以Lingo软件编写程序求解匹配问题:
答案:1 悬赏:0
解决时间 2021-01-22 23:04
- 提问者网友:凉末
- 2021-01-22 00:11
以Lingo软件编写程序求解匹配问题:
最佳答案
- 二级知识专家网友:怙棘
- 2021-01-22 01:47
这样写 其中x表示的是两个人是否配对
model:
sets:
student/1..8/;
match(student,student)|&1#lt#&2:cost,x;
endsets
data:
cost=
9342156
73521
44292
1552
876
23
4;
enddata
min=@sum(match:cost*x);
@for(student(i):@sum(student(j)|@in(match,i,j):x(i,j))+@sum(student(j)|@in(match,j,i):x(j,i))=1);
end
model:
sets:
student/1..8/;
match(student,student)|&1#lt#&2:cost,x;
endsets
data:
cost=
9342156
73521
44292
1552
876
23
4;
enddata
min=@sum(match:cost*x);
@for(student(i):@sum(student(j)|@in(match,i,j):x(i,j))+@sum(student(j)|@in(match,j,i):x(j,i))=1);
end
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯