如何解决如何缩小CPLEX MIP的差距?
我不确定这是不是我的问题最好的SE,还是OR SE?
我正在IBM ILOG CPLEX Optimization Studio中通过Fix&Optimize启发式解决MIP(MLCLSP),并将结果导出到CSV。这适用于大多数数据,例如我的变量的求解值,目标值,求解时间等。我只在访问 MIP相对差距时遇到问题。
var mipgap = cplex.getMIPRelativeGap();
此行的结果为CPLEX Error 1217: No solution exists.
,但是,引擎日志中没有指示符将导致该错误。另外,在注释该行时,其他所有内容都可以正常工作。
不幸的是,Reference Manual中的相关条目不是很有帮助(至少对我而言)。
任何想法为什么会这样以及如何解决?
引擎日志如下:
CPXParaM_DetTimeLimit 15000 Found incumbent of value 53030,000000 after 0,00 sec. (0,09 ticks) Tried aggregator 2 times. MIP Presolve eliminated 740 rows and 180 columns. Aggregator did 8 substitutions. Reduced MIP has 362 rows,552 columns,and 1733 nonzeros. Reduced MIP has 0 binaries,552 generals,0 SOSs,and 0 indicators. Presolve time = 0,00 sec. (1,07 ticks) Tried aggregator 1 time. Reduced MIP has 362 rows,82 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,using up to 4 threads. Root relaxation solution time = 0,93 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 53030,0000 43750,0000 17,50%
* 0 0 integral 0 43750,0000 38 0,00% Elapsed time = 0,02 sec. (3,59 ticks,tree = 0,00 MB,solutions
= 2)
Root node processing (before b&c): Real time = 0,62 ticks) Parallel b&c,4 threads: Real time = 0,00 ticks) Sync time (average) = 0,00 sec. Wait time (average) = 0,00 sec.
------------ Total (root+branch&cut) = 0,62 ticks) CPXParaM_DetTimeLimit 15000 2 of 2 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 43750,0000. Tried aggregator 2 times. MIP Presolve eliminated 715 rows and 155 columns. Aggregator did 8 substitutions. Reduced MIP has 387 rows,577 columns,and 1808 nonzeros. Reduced MIP has 25 binaries,28 ticks) Probing time = 0,02 ticks) Tried aggregator 1 time. Reduced MIP has 387 rows,02 sec. (0,91 ticks) Probing time = 0,02 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,using up to 4 threads.
Root node processing (before b&c): Real time = 0,86 ticks) Parallel b&c,86 ticks) CPXParaM_DetTimeLimit 15000 1 of 3 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 37500,0000. Tried aggregator 2 times. MIP Presolve eliminated 768 rows and 236 columns. MIP Presolve added 6 rows and 0 columns. Aggregator did 6 substitutions. Reduced MIP has 342 rows,498 columns,and 1562 nonzeros. Reduced MIP has 25 binaries,473 generals,41 ticks) Probing fixed 0 vars,tightened 3 bounds. Probing time = 0,21 ticks) Tried aggregator 1 time. MIP Presolve eliminated 1 rows and 1 columns. MIP Presolve modified 4 coefficients. Reduced MIP has 341 rows,497 columns,and 1559 nonzeros. Reduced MIP has 25 binaries,472 generals,and 0 indicators. Presolve time
= 0,85 ticks) Probing time = 0,19 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,97 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 37500,0000 31250,0000 16,67%
* 0+ 0 35000,0000 10,71%
0 0 31314,2064 15 35000,0000 31314,2064 41 10,53%
0 0 32074,4750 34 35000,0000 Cuts: 54 62 8,36%
0 0 32584,6404 20 35000,0000 Cuts: 25 91 6,90%
0 0 32644,0817 30 35000,0000 Cuts: 29 105 6,73%
0 0 32782,8515 24 35000,0000 Cuts: 14 115 6,33%
0 0 32833,6352 17 35000,0000 Cuts: 22 120 6,19%
* 0+ 0 34315,0000 32833,6352 4,32%
0 0 32833,6352 23 34315,0000 Cuts: 10 125 4,32%
0 0 32834,1709 20 34315,0000 Cuts: 3 130 4,32%
* 0+ 0 34314,0000 32834,1709 4,31%
* 0+ 0 34201,00%
* 0+ 0 34032,1709 3,52%
* 0+ 0 33782,1709 2,81%
0 2 32834,1709 20 33782,6982 130 2,80% Elapsed time = 0,20 sec. (31,17 ticks,02 MB,solutions
= 7)
Implied bound cuts applied: 29 Flow cuts applied: 17 Mixed integer rounding cuts applied: 10 Flow path cuts applied: 11 Zero-half cuts applied: 2 Gomory fractional cuts applied: 10
Root node processing (before b&c): Real time = 0,19 sec. (30,99 ticks) Parallel b&c,4 threads: Real time = 0,17 sec. (31,03 ticks) Sync time (average) = 0,06 sec. Wait time (average) = 0,36 sec. (62,01 ticks) CPXParaM_DetTimeLimit 15000 1 of 7 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 33782,0000. Tried aggregator 2 times. MIP Presolve eliminated 827 rows and 321 columns. MIP Presolve added 4 rows and 0 columns. Aggregator did 9 substitutions. Reduced MIP has 278 rows,410 columns,and 1282 nonzeros. Reduced MIP has 20 binaries,390 generals,43 ticks) Probing fixed 0 vars,tightened 2 bounds. Probing time = 0,13 ticks) Tried aggregator 1 time. MIP Presolve modified 4 coefficients. Reduced MIP has 278 rows,70 ticks) Probing time = 0,13 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,72 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 33782,0000 28782,0000 14,80%
0 0 28870,7089 20 33782,0000 28870,7089 40 14,54%
0 0 29921,5804 37 33782,0000 Cuts: 73 63 11,43%
0 0 30297,2961 16 33782,0000 Cuts: 18 84 10,32%
* 0+ 0 31893,0000 30297,2961 5,00%
0 0 30338,7836 37 31893,0000 Cuts: 17 95 4,87%
0 0 30436,2248 30 31893,0000 Cuts: 13 107 4,57%
0 0 30456,4637 13 31893,0000 Cuts: 11 113 4,50%
0 0 30477,0706 56 31893,0000 Cuts: 13 120 4,44%
0 0 30498,5940 36 31893,0000 Cuts: 20 125 4,37%
0 0 30533,7835 37 31893,0000 Cuts: 6 128 4,26%
* 0+ 0 31662,0000 30533,7835 3,56%
* 0+ 0 31654,0000 30568,6604 3,43%
* 0+ 0 31382,6604 2,59%
0 2 30533,7835 37 31382,6604 128 2,59% Elapsed time = 0,16 sec. (30,64 ticks,solutions
= 5)
Implied bound cuts applied: 21 Flow cuts applied: 13 Mixed integer rounding cuts applied: 3 Flow path cuts applied: 20 Zero-half cuts applied: 1 Gomory fractional cuts applied: 11
Root node processing (before b&c): Real time = 0,14 sec. (30,48 ticks) Parallel b&c,25 sec. (59,67 ticks) Sync time (average) = 0,04 sec. Wait time (average) = 0,39 sec. (90,15 ticks) CPXParaM_DetTimeLimit 15000 1 of 5 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 31382,0000. Tried aggregator 2 times. MIP Presolve eliminated 845 rows and 360 columns. Aggregator did 13 substitutions. Reduced MIP has 252 rows,367 columns,and 1144 nonzeros. Reduced MIP has 25 binaries,342 generals,32 ticks) Probing time = 0,14 ticks) Tried aggregator 1 time. Reduced MIP has 252 rows,63 ticks) Probing time = 0,64 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 31382,0000 25132,0000 19,92%
0 0 25244,8113 25 31382,0000 25244,8113 40 19,56%
0 0 27533,0641 41 31382,0000 Cuts: 84 74 12,26%
* 0+ 0 30999,0000 27533,0641 11,18%
0 0 27920,4415 20 30999,0000 Cuts: 18 95 9,93%
* 0+ 0 29564,0000 27920,4415 5,56%
0 0 27953,8964 41 29564,0000 Cuts: 16 106 5,45%
0 0 28070,3282 42 29564,0000 Cuts: 14 120 5,05%
0 0 28098,0339 21 29564,0000 Cuts: 13 124 4,96%
0 0 28114,2658 38 29564,0000 Cuts: 9 130 4,90%
0 0 28124,0308 52 29564,0000 Flowpaths: 4 137 4,87%
0 0 28126,2949 38 29564,0000 Cuts: 8 140 4,86%
* 0+ 0 29427,0000 28178,7129 4,24%
* 0+ 0 29343,7129 3,97%
* 0+ 0 29324,91%
* 0+ 0 29305,84%
0 2 28126,2949 38 29305,0000 28190,9836 140 3,51 ticks,solutions
= 7)
* 14 10 integral 0 29272,9836 193 3,69%
* 315 93 integral 0 29212,0000 28421,3841 1104 2,71%
* 453+ 121 29067,0000 28619,5918 1,54%
* 604 56 integral 0 29041,0000 28910,0060 3006 0,45%
Implied bound cuts applied: 24 Flow cuts applied: 10 Mixed integer rounding cuts applied: 3 Flow path cuts applied: 19 Zero-half cuts applied: 1 Gomory fractional cuts applied: 15
Root node processing (before b&c): Real time = 0,40 ticks) Parallel b&c,22 sec. (40,83 ticks) Sync time (average) = 0,10 sec. Wait time (average) = 0,38 sec. (71,23 ticks) CPXParaM_DetTimeLimit 15000 1 of 12 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 29041,0000. Tried aggregator 2 times. MIP Presolve eliminated 900 rows and 440 columns. Aggregator did 13 substitutions. Reduced MIP has 197 rows,287 columns,and 884 nonzeros. Reduced MIP has 25 binaries,262 generals,21 ticks) Probing time = 0,11 ticks) Tried aggregator 1 time. Reduced MIP has 197 rows,49 ticks) Probing time = 0,10 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,50 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 29041,0000 22791,0000 21,52%
0 0 22903,2112 25 29041,0000 22903,2112 34 21,13%
0 0 25185,8934 41 29041,0000 Cuts: 85 68 13,27%
0 0 25572,1352 35 29041,0000 Cuts: 18 90 11,94%
* 0+ 0 27162,0000 25572,1352 5,85%
0 0 25617,2128 26 27162,0000 Cuts: 14 98 5,69%
0 0 25669,8899 14 27162,0000 Cuts: 19 108 5,49%
0 0 25712,5560 38 27162,0000 Cuts: 9 115 5,34%
0 0 25743,1148 54 27162,0000 Cuts: 7 125 5,22%
0 0 25814,7675 52 27162,0000 Cuts: 20 137 4,96%
0 0 25819,4636 38 27162,0000 Cuts: 21 141 4,94%
0 0 25819,5024 38 27162,0000 Cuts: 9 143 4,8040 39 27162,0000 Flowcuts: 1 144 4,94%
* 0+ 0 27070,0000 25819,8040 4,62%
* 0+ 0 26991,34%
* 0+ 0 26960,23%
* 0+ 0 26847,8040 3,83%
0 2 25819,8040 39 26847,8040 144 3,83% Elapsed time = 0,solutions
= 6)
* 112 27 integral 0 26828,0000 25881,4576 374 3,53%
* 138 37 integral 0 26687,0000 25890,1618 467 2,99%
Implied bound cuts applied: 18 Flow cuts applied: 9 Mixed integer rounding cuts applied: 8 Flow path cuts applied: 21 Gomory fractional cuts applied: 14
Root node processing (before b&c): Real time = 0,54 ticks) Parallel b&c,11 sec. (21,68 ticks) Sync time (average) = 0,28 sec. (53,22 ticks) CPXParaM_DetTimeLimit 15000 1 of 8 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 26687,0000. Tried aggregator 2 times. MIP Presolve eliminated 955 rows and 520 columns. Aggregator did 13 substitutions. Reduced MIP has 142 rows,207 columns,and 624 nonzeros. Reduced MIP has 25 binaries,182 generals,02 sec. (1,10 ticks) Probing time = 0,08 ticks) Tried aggregator 1 time. Reduced MIP has 142 rows,36 ticks) Probing time = 0,07 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,38 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 26687,0000 20437,0000 23,42%
0 0 20546,7110 25 26687,0000 20546,7110 29 23,01%
0 0 22823,4321 41 26687,0000 Cuts: 84 63 14,48%
0 0 23203,9052 20 26687,0000 Cuts: 18 84 13,05%
* 0+ 0 24798,0000 23203,9052 6,43%
0 0 23233,0297 41 24798,0000 Cuts: 15 92 6,31%
0 0 23370,5859 47 24798,0000 Cuts: 17 107 5,76%
0 0 23380,8335 66 24798,0000 Cuts: 7 118 5,71%
0 0 23396,3490 38 24798,0000 Cuts: 18 134 5,65%
0 0 23401,6885 48 24798,0000 Cuts: 11 144 5,63%
0 0 23406,5270 39 24798,0000 Cuts: 9 151 5,61%
* 0+ 0 24543,0000 23406,5270 4,63%
* 0+ 0 24293,0000 23536,4099 3,11%
0 2 23406,5270 39 24293,0000 23555,5098 151 3,04% Elapsed time = 0,14 sec. (18,87 ticks,solutions
= 4)
Implied bound cuts applied: 26 Flow cuts applied: 15 Mixed integer rounding cuts applied: 9 Flow path cuts applied: 18 Gomory fractional cuts applied: 14
Root node processing (before b&c): Real time = 0,16 sec. (18,79 ticks) Parallel b&c,09 sec. (22,60 ticks) Sync time (average) = 0,02 sec. Wait time (average) = 0,25 sec. (41,39 ticks) CPXParaM_DetTimeLimit 15000 1 of 4 MIP starts provided solutions. MIP start 'm1' defined initial solution with objective 24293,0000. Tried aggregator 2 times. MIP Presolve eliminated 1015 rows and 605 columns. MIP Presolve added 5 rows and 5 columns. Aggregator did 13 substitutions. Reduced MIP has 87 rows,127 columns,and 364 nonzeros. Reduced MIP has 25 binaries,102 generals,04 ticks) Probing time = 0,04 ticks) Tried aggregator 1 time. Reduced MIP has 87 rows,22 ticks) Probing time = 0,04 ticks) MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic,22 ticks)
Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 24293,0000 18043,0000 25,73%
0 0 18153,5111 25 24293,0000 18153,5111 25 25,27%
0 0 20418,7107 41 24293,0000 Cuts: 89 59 15,95%
* 0+ 0 23893,0000 20418,7107 14,54%
0 0 20865,3751 41 23893,0000 Cuts: 30 82 12,67%
* 0+ 0 23841,0000 20865,3751 12,48%
0 0 21002,1722 36 23841,0000 Cuts: 17 95 11,91%
0 0 21051,8993 38 23841,0000 Cuts: 10 102 11,70%
0 0 21075,6472 36 23841,0000 Cuts: 10 104 11,60%
0 0 21083,0413 38 23841,0000 Cuts: 7 109 11,57%
* 0+ 0 22452,0000 21083,0413 6,10%
* 0+ 0 21902,0413 3,74%
0 2 21083,0413 38 21902,0000 21156,8012 109 3,40% Elapsed time = 0,09 sec. (10,49 ticks,solutions
= 5)
Implied bound cuts applied: 19 Flow cuts applied: 11 Mixed integer rounding cuts applied: 9 Flow path cuts applied: 15 Zero-half cuts applied: 1 Gomory fractional cuts applied: 15
Root node processing (before b&c): Real time = 0,08 sec. (10,44 ticks) Parallel b&c,13 sec. (18,70 ticks) Sync time (average) = 0,20 sec. (29,14 ticks)
在这里,F&O算法在8次迭代中逐块求解,我可以在脚本日志中提取并显示几个cplex参数。只有这个MIP差距会产生错误...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。