...too many inequality or equality relations
发布网友
发布时间:2024-10-05 14:06
我来回答
共1个回答
热心网友
时间:2024-10-05 14:44
minB=800+x1+d1+g1/2-y1+a2/2+a3/2+25+x2+d2+g2/2-y2+y1+a3/2-a2/2-50+x3+d3+g3/2-y3+y2-a3/2;
简化为:
min=800+25-50+x1+x2+x3-y3+d1+d2+d3+a3/2+g1/2+g2/2+g3/2;
可见,这里的y3没有约束,即使其他各个变量取0,也不能得到最小值,除非给出y3<10这样的约束条件,才可能有解。
修改后的代码:
model:
min=800+x1+d1+g1/2-y1+a2/2+a3/2+25+x2+d2+g2/2-y2+y1+a3/2-a2/2-50+x3+d3+g3/2-y3+y2-a3/2;
x1<=500;
x2<=800;
x3<=500;
y1<=200;
y2<=950/4;
y3<10;!添加y3的约束条件;
d1+d2+d3<=150;
g1+g2+g3<=50;
End
运行结果:
Global optimal solution found at iteration: 0
Objective value: 765.0000
Variable Value Reduced Cost
X1 0.000000 1.000000
D1 0.000000 1.000000
G1 0.000000 0.5000000
Y1 0.000000 0.000000
A2 0.000000 0.000000
A3 0.000000 0.5000000
X2 0.000000 1.000000
D2 0.000000 1.000000
G2 0.000000 0.5000000
Y2 0.000000 0.000000
X3 0.000000 1.000000
D3 0.000000 1.000000
G3 0.000000 0.5000000
Y3 10.00000 0.000000
Row Slack or Surplus Dual Price
1 765.0000 -1.000000
2 500.0000 0.000000
3 800.0000 0.000000
4 500.0000 0.000000
5 200.0000 0.000000
6 237.5000 0.000000
7 0.000000 1.000000
8 150.0000 0.000000
9 50.00000 0.000000