当MILP明显可解决时,为什么不提供解决方案?

时间:2018-07-14 14:10:05

标签: python gurobi pulp

我正在使用PuLP和Gurobi求解器以及各种参数在Python脚本中求解MILP。

使用“ for”循环进行灵敏度分析,每次运行时都要更改参数。首先运行的是“最坏情况”参数(效率很低的发电机和非常差的绝缘材料),逐渐遍历MILP时,这些参数会逐渐得到改善。在某些时候,以一种可以很快找到解决方案的方式设置参数时,Gurobipy似乎没有找到解决方案。这是日志:

Changed value of parameter TimeLimit to 300.0
Prev: 1e+100  Min: 0.0  Max: 1e+100  Default: 1e+100
Optimize a model with 8640 rows, 10080 columns and 20158 nonzeros
Variable types: 8640 continuous, 1440 integer (0 binary)
Coefficient statistics:

Matrix range     [2e-05, 4e+04]
Objective range  [1e+03, 1e+03]
Bounds range     [7e-01, 4e+04]
RHS range        [1e-02, 3e+04]

Presolve removed 7319 rows and 7331 columns
Presolve time: 0.03s
Presolved: 1321 rows, 2749 columns, 4069 nonzeros
Variable types: 1320 continuous, 1429 integer (1429 binary)

Root relaxation: objective 4.910087e+05, 679 iterations, 0.01 seconds

Nodes    |    Current Node    |     Objective Bounds      |     Work
Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

 0     0 491008.698    0   11          - 491008.698      -     -    0s
0     0 491008.698    0   11          - 491008.698      -     -    0s
0     2 491008.698    0   11          - 491008.698      -     -    0s
30429 24907 491680.652  942    3          - 491011.160      -   1.0    5s
73520 66861 491679.428  958    3          - 491011.996      -   1.0   10s
123770 116802 491762.182 1241    2          - 491012.439      -   1.0   15s
174010 165706 491896.963 1266    2          - 491012.636      -   1.0   20s
221580 212357 491234.860 1144    5          - 491012.931      -   1.0   25s
270004 259925 491187.818  904    5          - 491013.203      -   1.0   30s
322655 311334 491807.797 1254    2          - 491013.349      -   1.0   35s
379633 367554 491194.198  941    5          - 491013.571      -   1.0   40s
434035 420930 494029.008 1375    1          - 491013.695      -   1.0   45s
490442 476293 494016.622 1354    1          - 491013.851      -   1.0   50s
544923 529662 491203.097  990    5          - 491013.947      -   1.0   55s
597268 581228 492312.463 1253    2          - 491014.018      -   1.0   60s
650478 633331 491093.453  383    5          - 491014.133      -   1.0   65s
703246 685374 491755.974 1241    2          - 491014.188      -   1.0   70s
756675 737356 491069.420  272    6          - 491014.250      -   1.0   75s
811974 791502 491560.902 1235    3          - 491014.308      -   1.0   80s
866893 845452 491112.986  497    5          - 491014.345      -   1.0   85s
923793 901357 494014.134 1348    1          - 491014.390      -   1.0   90s
981961 958448 492971.305 1266    2          - 491014.435      -   1.0   95s
1039971 1015276 491545.502 1216    4          - 491014.502      -   1.0  100s
1097780 1071899 491171.468  818    5          - 491014.527      -   1.0  105s
1154447 1127328 491108.438  461    5          - 491014.591      -   1.0  110s
1212776 1184651 491024.147   57    6          - 491014.622      -   1.0  115s
1272535 1243171 495190.479 1266    2          - 491014.643      -   1.0  120s
1332126 1301674 491549.733 1228    3          - 491014.668      -   1.0  125s
1392772 1361287 491549.544 1219    3          - 491014.694      -   1.0  130s
1452380 1419870 491754.309 1237    2          - 491014.717      -   1.0  135s
1511070 1477572 491229.746 1131    5          - 491014.735      -   1.0  140s
1569783 1535126 491130.785  587    5          - 491014.764      -   1.0  145s
1628729 1593010 494026.669 1368    1          - 491014.775      -   1.0  150s
1687841 1651373 493189.023 1264    2          - 491014.810      -   1.0  155s
1747707 1709984 491548.263 1223    3          - 491014.841      -   1.0  160s
1807627 1768777 491160.795  755    5          - 491014.876      -   1.0  165s
1865730 1825486 494030.045 1379    1          - 491014.899      -   1.0  170s
1925615 1884356 494028.562 1374    1          - 491014.923      -   1.0  175s
1984204 1941827 491847.402 1115    2          - 491014.933      -   1.0  180s
2044016 2000572 491244.304 1210    5          - 491014.970      -   1.0  185s
2102125 2057622 491174.413  828    5          - 491014.989      -   1.0  190s
2161393 2115829 491115.089  532    5          - 491015.017      -   1.0  195s
2220721 2174168 491086.511  348    6          - 491015.041      -   1.0  200s
2281194 2233610 infeasible 1433               - 491015.048      -   1.0  205s
2341496 2292542 492824.696 1262    2          - 491015.069      -   1.0  210s
2399836 2349837 491548.142 1224    3          - 491015.084      -   1.0  215s
2459295 2408276 491178.869  853    5          - 491015.088      -   1.0  220s
2519203 2467098 491112.995  488    5          - 491015.106      -   1.0     225s
2578654 2525514 491069.711  270    6          - 491015.123      -   1.0  230s
2636111 2582093 491762.206 1250    2          - 491015.139      -   1.0  235s
2695962 2640805 491237.559 1152    5          - 491015.146      -   1.0  240s
2755319 2699171 491156.897  797    6          - 491015.161      -   1.0  245s
2813620 2756371 491024.109   43    7          - 491015.182      -   1.0  250s
2872810 2814527 492309.743 1255    2          - 491015.185      -   1.0  255s
2932550 2873227 492180.501 1255    2          - 491015.202      -   1.0  260s
2991586 2931246 491244.162 1207    5          - 491015.217      -   1.0  265s
3050385 2988872 491196.181  952    5          - 491015.228      -   1.0  270s
3110478 3047787 491127.746  560    5          - 491015.247      -   1.0  275s
3169730 3105844 491109.579  525    6          - 491015.266      -   1.0  280s
3229972 3165019 494029.916 1376    1          - 491015.276      -   1.0  285s
3289639 3223661 491861.516 1173    2          - 491015.293      -   1.0  290s
3349653 3282631 491862.419 1185    2          - 491015.305      -   1.0  295s

Explored 3409667 nodes (3506772 simplex iterations) in 300.02 seconds
Thread count was 8 (of 8 available processors)

Solution count 0

Time limit reached
Best objective -, best bound 4.910153206264e+05, gap -
('Gurobi status=', 9)

我已经将最大求解时间增加到300s(更多的时间占用了更多的RAM,并且程序在某个时候终止了),并使用参数(更糟糕的参数设置找到了解决方案!),但是似乎没有任何效果。可能是什么问题?

1 个答案:

答案 0 :(得分:0)

我可以通过插入“ None”(最长)来解决问题,并插入一个最大的空白来解决此问题。