下面这个程序lingo中出现问题63 望哪位高手帮忙知道下 急

2025-01-25 04:01:20
推荐回答(1个)
回答1:

设置为全局求最优解模式,否则找不到可行解。
设置如下:菜单栏LINGO->Options->Global Solver(选项卡)->Usr Global Solver(复选框打钩)->应用->ok
model:
sets:
var/1..16/:t,x;
col/1..3/:;
matr(col,var):y;
endsets
data:
t=7,9,13,15,22,14,11,8,38,21,16,30,14,17,26,25;
enddata
min=@sum(matr(m,n):@abs(y(m,n)*t(n)-286/3));
x(1)+t(1)<=x(2);x(1)+t(1)<=x(3);x(1)+t(1)<=x(4);
x(2)+t(2)<=x(5);
x(3)+t(3)<=x(6);
x(5)+t(5)<=x(7);x(5)+t(5)<=x(8);
x(6)+t(6)<=x(8);
x(7)+t(7)<=x(9);
x(8)+t(8)<=X(10);x(8)+t(8)<=x(11);
x(9)+t(9)<=x(12);x(9)+t(9)<=x(13);
x(10)+t(10)<=x(14);
x(11)+t(11)<=x(14);
x(12)+t(12)<=x(16);
x(13)+t(13)<=x(15);
x(14)+t(14)<=x(15);
x(15)+t(12)<=x(16);
x(1)=0;
x(16)+t(16)=286;
@for(var(i):@for(var(j)|j#ne#i: @abs(x(j)-x(i))>=0.01));
@for(var:@gin(x));
@for(col(m):@sum(var(n):y(m,n))>=3);
@for(var(n):@sum(col(m):y(m,n))=1);
@for(col(m):@sum(var(n):y(m,n)*t(n))<=100);
@for(col(m):@sum(var(n):y(m,n)*t(n))>=80);
@for(matr:@bin(y));
end