同LS指定每人翻译且只翻译一种语言
model:
sets:
r/1..4/:;
c/1..4/:;
link(r,c):time,x;
endsets
data:
time=215134
1041415
9141613
78119;
enddata
min=@sum(link:x*time);
@for(link:@bin(x));
@for(r(i):@sum(c(j):x(i,j))=1);
@for(c(j):@sum(r(i):x(i,j))=1);
end
Globaloptimalsolutionfound.
Objectivevalue:28.00000
Extendedsolversteps:0
Totalsolveriterations:0
VariableValueReducedCost
X(1,4)1.0000004.000000
X(2,2)1.0000004.000000
X(3,1)1.0000009.000000
X(4,3)1.00000011.00000
LS仁兄
@for(person(i):@sum(language(j):x)=1);
@for(language(j):@sum(person(i):x)=1);
没有写成x(i,j)结果得不到正确答案
Globaloptimalsolutionfound.
Objectivevalue:22.00000
Extendedsolversteps:0
Totalsolveriterations:0
VariableValueReducedCost
X(1,1)1.0000002.000000
X(2,2)1.0000004.000000
X(3,1)1.0000009.000000
X(4,1)1.0000007.000000
不满足每列和为1