min=16+x21*16+x22*6+x31*17+x21*x32*6+x22*x32*8+x41*17+x31*x42*6+x21*x32*x42*8
+x22*x32*x42*11+x51*18+x41*x52*6+x31*x42*x52*8+x21*x32*x42*x52*11+x22*x32*x42*x52*18;
x21+x22=1;
x31+x32=1;
x41+x42=1;
x51+x52=1;
end
@bin(8)
这程序运行后 得到Objective value: 59.00000
Variable Value Reduced Cost
X21 0.000000 5.000000
X22 1.000000 0.000000
X31 0.000000 4.000000
X32 1.000000 0.000000
X41 0.000000 6.000000
X42 1.000000 0.000000
X51 1.000000 0.000000
X52 0.000000 0.000000
然而明显的有当:
X21=0;
X22=1;
X31=1;
X32 =0;
X41 =0 ;
X42 = 1 ;
X51 = 0 ;
X52 = 1 ;
最小值为53
我用的是LINGO8.0版本的 不知道出了什么问题?
采用lingo10计算的结果是你所需要的!但是系统明显提示所求得的是局部最优解,所以能否求得全局最优解要看程序使用的算法,并不是lingo系统的问题!
Local optimal solution found.
Objective value: 53.00000
Total solver iterations: 11
Variable Value Reduced Cost
X21 0.000000 8.000000
X22 1.000000 0.000000
X31 0.000000 9.000000
X32 1.000000 0.000000
X41 1.000000 0.000000
X42 0.000000 6.000000
X51 0.000000 12.00000
X52 1.000000 0.000000
Row Slack or Surplus Dual Price
1 53.00000 -1.000000
2 0.000000 -14.00000
3 0.000000 -8.000000
4 0.000000 -23.00000
5 0.000000 -6.000000
我也有同样的疑惑,为什么有时求得的解反代回去,目标值明显不一样?
另楼上的可否提供10.0的注册码?
以下是用LINGO 9求得的解。
1)让系统自动选择优化;
Local optimal solution found.
Objective value: 57.00000
Total solver iterations: 5
Variable Value Reduced Cost
X21 1.000000 0.000000
X22 0.000000 2.000000
X31 0.000000 6.000000
X32 1.000000 0.000000
X41 0.000000 4.000000
X42 1.000000 0.000000
X51 0.000000 7.000000
X52 1.000000 0.000000
Row Slack or Surplus Dual Price
1 57.00000 -1.000000
2 0.000000 -41.00000
3 0.000000 -25.00000
4 0.000000 -19.00000
5 0.000000 -11.00000
2)采用全局最优解方法求得的:
Global optimal solution found.
Objective value: 53.00000
Extended solver steps: 17
Total solver iterations: 3040
Variable Value Reduced Cost
X21 0.000000 8.000000
X22 1.000000 0.000000
X31 0.000000 9.000000
X32 1.000000 0.000000
X41 1.000000 0.000000
X42 0.000000 6.000000
X51 0.000000 12.00000
X52 1.000000 0.000000
Row Slack or Surplus Dual Price
1 53.00000 -1.000000
2 0.000000 -14.00000
3 0.000000 -8.000000
4 0.000000 -23.00000
5 0.000000 -6.000000
欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |