LINGO线性规划 怎么编写?急!!!
min=10*(x1-155)+10*(x2-258)+30*(98-x3)+30*(106-x4)+30*(123-x5)+30*(x6-135)+30*(138-x7...
min=10*(x1-155)+10*(x2-258)+30*(98-x3)+30*(106-x4)+30*(123-x5)+30*(x6-135)+30*(138-x7)+30*(140-x8)+30*(x9-150)+30*(x10-180)
约束
1 2 3 4 5 6 7 8
9 10
1 - 3 15 15 15 15 15 15 15 15
2 3 - 15 15 15 15 15 15 15 15
3 15 15 - 8 8 8 8 8 8 8
4 15 15 8 - 8 8 8 8 8 8
5 15 15 8 8 - 8 8 8 8 8
6 15 15 8 8 8 - 8 8 8 8
7 15 15 8 8 8 8 - 8 8 8
8 15 15 8 8 8 8 8 - 8 8
9 15 15 8 8 8 8 8 8 - 8
10 15 15 8 8 8 8 8 8 8 -
|xi-xj|>=xij(i不等于j)
x1<=599;
x1>=155;
x2<=744;
x2>=258;
x3<=98;
x3>=89;
x4<=106;
x4>=96;
x5<=124;
x5>=110;
x6<=576;
x6>=135;
x7<=138;
x7>=124;
x8<=140;
x8>=126;
x9<=591;
x9>=150;
x10<=657;
x10>=180; 展开
约束
1 2 3 4 5 6 7 8
9 10
1 - 3 15 15 15 15 15 15 15 15
2 3 - 15 15 15 15 15 15 15 15
3 15 15 - 8 8 8 8 8 8 8
4 15 15 8 - 8 8 8 8 8 8
5 15 15 8 8 - 8 8 8 8 8
6 15 15 8 8 8 - 8 8 8 8
7 15 15 8 8 8 8 - 8 8 8
8 15 15 8 8 8 8 8 - 8 8
9 15 15 8 8 8 8 8 8 - 8
10 15 15 8 8 8 8 8 8 8 -
|xi-xj|>=xij(i不等于j)
x1<=599;
x1>=155;
x2<=744;
x2>=258;
x3<=98;
x3>=89;
x4<=106;
x4>=96;
x5<=124;
x5>=110;
x6<=576;
x6>=135;
x7<=138;
x7>=124;
x8<=140;
x8>=126;
x9<=591;
x9>=150;
x10<=657;
x10>=180; 展开
展开全部
model:
sets:
point/1..10/:x;
road(point,point)|&1#gt#&2:a;
endsets
data:
a=
3
15 15
15 15 8
15 15 8 8
15 15 8 8 8
15 15 8 8 8 8
15 15 8 8 8 8 8
15 15 8 8 8 8 8 8
15 15 8 8 8 8 8 8 8;
enddata
min=10*(x(1)-155)+10*(x(2)-258)+30*(98-x(3))+30*(106-x(4))+30*(123-x(5))+30*(x(6)-135)+30*(138-x(7))+30*(140-x(8))+30*(x(9)-150)+30*(x(10)-180);
@for(road(i,j):@abs(x(i)-x(j))>=a(i,j));
x(1)<=599;
x(1)>=155;
x(2)<=744;
x(2)>=258;
x(3)<=98;
x(3)>=89;
x(4)<=106;
x(4)>=96;
x(5)<=124;
x(5)>=110;
x(6)<=576;
x(6)>=135;
x(7)<=138;
x(7)>=124;
x(8)<=140;
x(8)>=126;
x(9)<=591;
x(9)>=150;
x(10)<=657;
x(10)>=180;
end
sets:
point/1..10/:x;
road(point,point)|&1#gt#&2:a;
endsets
data:
a=
3
15 15
15 15 8
15 15 8 8
15 15 8 8 8
15 15 8 8 8 8
15 15 8 8 8 8 8
15 15 8 8 8 8 8 8
15 15 8 8 8 8 8 8 8;
enddata
min=10*(x(1)-155)+10*(x(2)-258)+30*(98-x(3))+30*(106-x(4))+30*(123-x(5))+30*(x(6)-135)+30*(138-x(7))+30*(140-x(8))+30*(x(9)-150)+30*(x(10)-180);
@for(road(i,j):@abs(x(i)-x(j))>=a(i,j));
x(1)<=599;
x(1)>=155;
x(2)<=744;
x(2)>=258;
x(3)<=98;
x(3)>=89;
x(4)<=106;
x(4)>=96;
x(5)<=124;
x(5)>=110;
x(6)<=576;
x(6)>=135;
x(7)<=138;
x(7)>=124;
x(8)<=140;
x(8)>=126;
x(9)<=591;
x(9)>=150;
x(10)<=657;
x(10)>=180;
end
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询