数学建模社区-数学中国

标题: [原创][求助]关于LINGO程序的一个问题 [打印本页]

作者: 见光分解    时间: 2007-7-21 20:36
标题: [原创][求助]关于LINGO程序的一个问题

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版本的  不知道出了什么问题?  

                           


作者: madio    时间: 2007-7-22 02:36

采用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


作者: davywu    时间: 2007-7-26 14:40

我也有同样的疑惑,为什么有时求得的解反代回去,目标值明显不一样?

另楼上的可否提供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

[此贴子已经被作者于2007-7-26 14:44:14编辑过]

作者: daihaifeng    时间: 2009-3-6 09:59
lingo10,.0的破解补丁下不到
作者: mathcd    时间: 2009-3-6 11:27
让我用11版帮你算吧。
  Global optimal solution found.
  Objective value:                              53.00000
  Objective bound:                              53.00000
  Infeasibilities:                              0.000000
  Extended solver steps:                              17
  Total solver iterations:                          2833


                       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
作者: crossrainbrow    时间: 2009-3-6 16:25
我用 lingo9.0求的解和3楼的一样 ,各个版本结果相差很大,那到底该用哪一版本的呢?疑惑
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
作者: mathcd    时间: 2009-3-6 22:20
当然是版本较高的比较好吧




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5