Extracting MIP Gap of my Hotstart Solution.
回答済みHi,
I use .start to use a hotstart solution in my MIP model. With the command model.MIPGap after model.optimize() I extract the best solutions's gap, but how do I get the initial solution's gap in python?
Below you can find a selection of my log file.
...
User MIP start produced solution with objective -132615 (0.16s)
Loaded user MIP start with objective -132615
Presolve removed 3244 rows and 4849 columns
Presolve time: 0.56s
Presolved: 10409 rows, 141941 columns, 93631 nonzeros
Variable types: 132391 continuous, 9550 integer (9550 binary)
Root simplex log...
Iteration Objective Primal Inf. Dual Inf. Time
18575 -1.2725123e+05 6.760905e+03 0.000000e+00 5s
22127 -1.2727473e+05 0.000000e+00 0.000000e+00 8s
Root relaxation: objective -1.272747e+05, 22127 iterations, 6.75 seconds (6.95 work units)
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 -127274.73 0 373 -132614.68 -127274.73 4.03% - 8s
0 0 -127280.13 0 459 -132614.68 -127280.13 4.02% - 11s
0 0 -127280.16 0 462 -132614.68 -127280.16 4.02% - 11s
0 0 -127280.16 0 418 -132614.68 -127280.16 4.02% - 12s
0 0 -127303.34 0 451 -132614.68 -127303.34 4.01% - 15s
H 0 0 -132614.6840 -127303.34 4.01% - 16s
0 0 -127307.21 0 451 -132614.68 -127307.21 4.00% - 17s
0 0 -127307.27 0 445 -132614.68 -127307.27 4.00% - 17s
0 0 -127336.88 0 445 -132614.68 -127336.88 3.98% - 20s
0 0 -127337.59 0 441 -132614.68 -127337.59 3.98% - 21s
0 0 -127337.60 0 433 -132614.68 -127337.60 3.98% - 21s
0 0 -127339.96 0 492 -132614.68 -127339.96 3.98% - 23s
0 0 -127339.97 0 493 -132614.68 -127339.97 3.98% - 24s
...
-
Hi,
The MIPGap attribute is available when the optimization is terminated because of hitting a termination criterion or proving the optimality. This attribute reports the relative gap between the current best bound and the incumbent.
If you are interested in finding the gap between the initial start solution and the current best bound, you would need to calculate it yourself using the gap formula shared on the page linked above.
- The current best bound can be queried using the ObjBound attribute.
- The objective value of the initial start solution can be found by parsing the log file.
Best regards,
Maliheh
1
サインインしてコメントを残してください。
コメント
1件のコメント