Why is Gurobi taking so much time after finding the optimal solution?
AnsweredHi,
I am trying to solve a large MILP problem in 2 steps. In the first step I have some additional constrains which eliminate some variables and make the problem easier to solve and in the second step I remove the constraints and solve the whole problem.
The problem is, the solution of the first step takes a short time but afterwards Gurobi does some iterations which takes much longer. What is the purpose of those iterations? Is there any option to skip them?
Below you can see the output message of Gurobi. I use v 8.0.0 with ampl.
Gurobi 8.0.0: outlev = 1
mipgap = 0.2
Optimize a model with 302900 rows, 387417 columns and 1711779 nonzeros
Variable types: 360565 continuous, 26852 integer (26852 binary)
Coefficient statistics:
Matrix range [1e-03, 7e+10]
Objective range [2e-01, 9e-01]
Bounds range [5e-01, 7e+07]
RHS range [4e-03, 1e+09]
Warning: Model contains large matrix coefficient range
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 194894 rows and 291204 columns (presolve time = 5s) ...
Presolve removed 195829 rows and 292538 columns
Presolve time: 6.36s
Presolved: 107071 rows, 94879 columns, 458639 nonzeros
Variable types: 83116 continuous, 11763 integer (11750 binary)
Deterministic concurrent LP optimizer: primal and dual simplex
Showing first log only...
Presolve removed 7466 rows and 2064 columns
Presolved: 99605 rows, 92815 columns, 441133 nonzeros
Root simplex log...
Iteration Objective Primal Inf. Dual Inf. Time
0 2.1294076e+06 1.347814e+06 9.965733e+10 8s
31000 -1.7966603e+09 1.167516e+01 5.237360e+09 10s
43338 -1.7423616e+09 0.000000e+00 1.716589e+11 15s
Concurrent spin time: 0.00s
Solved with dual simplex
Root relaxation: objective -1.682044e+09, 61745 iterations, 10.75 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 -1.682e+09 0 3064 - -1.682e+09 - - 19s
0 0 -1.683e+09 0 3122 - -1.683e+09 - - 30s
0 0 -1.683e+09 0 2927 - -1.683e+09 - - 32s
0 0 -1.683e+09 0 2947 - -1.683e+09 - - 32s
0 0 -1.683e+09 0 2944 - -1.683e+09 - - 33s
0 0 -1.683e+09 0 3243 - -1.683e+09 - - 37s
0 0 -1.683e+09 0 3279 - -1.683e+09 - - 38s
0 0 -1.683e+09 0 3279 - -1.683e+09 - - 38s
0 0 -1.683e+09 0 3279 - -1.683e+09 - - 39s
0 0 -1.683e+09 0 3544 - -1.683e+09 - - 42s
0 0 -1.683e+09 0 3556 - -1.683e+09 - - 45s
0 0 -1.683e+09 0 3618 - -1.683e+09 - - 46s
0 0 -1.683e+09 0 3679 - -1.683e+09 - - 46s
0 0 -1.683e+09 0 3567 - -1.683e+09 - - 49s
H 0 0 -1.72371e+09 -1.683e+09 2.33% - 54s
Cutting planes:
Gomory: 72
Cover: 197
Implied bound: 405
Clique: 606
MIR: 236
StrongCG: 1
Flow cover: 1260
Zero half: 1
Mod-K: 1
Network: 9
Explored 1 nodes (89087 simplex iterations) in 54.13 seconds
Thread count was 8 (of 8 available processors)
Solution count 1: -1.72371e+09
Optimal solution found (tolerance 2.00e-01)
Best objective -1.723705955990e+09, best bound -1.683463420917e+09, gap 2.3347%
Optimize a model with 302900 rows, 387417 columns and 1711779 nonzeros
Coefficient statistics:
Matrix range [1e-03, 7e+10]
Objective range [2e-01, 9e-01]
Bounds range [2e-16, 7e+07]
RHS range [4e-03, 1e+09]
Warning: Model contains large matrix coefficient range
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Iteration Objective Primal Inf. Dual Inf. Time
0 handle free variables 0s
31572 -1.8561310e+02 2.287383e+09 0.000000e+00 5s
37220 -2.2426664e+02 4.406643e+09 0.000000e+00 10s
39401 -2.4037817e+02 4.720930e+09 0.000000e+00 15s
42618 -2.7931715e+02 3.055355e+09 0.000000e+00 20s
44722 -3.0855981e+02 1.647134e+09 0.000000e+00 25s
45780 -3.5220783e+02 2.828419e+09 0.000000e+00 30s
46293 -3.9315744e+02 1.240447e+10 0.000000e+00 36s
46701 -4.7694468e+02 1.019694e+09 0.000000e+00 41s
47005 -5.2521096e+02 1.536292e+09 0.000000e+00 46s
47410 -5.7179088e+02 1.541685e+09 0.000000e+00 51s
48104 -6.2090334e+02 4.272539e+09 0.000000e+00 55s
48769 -6.7007875e+02 1.270966e+09 0.000000e+00 60s
49819 -7.2309354e+02 8.921288e+08 0.000000e+00 65s
50665 -7.5584803e+02 1.693751e+10 0.000000e+00 70s
51302 -8.3019271e+02 1.469611e+09 0.000000e+00 75s
51706 -1.1850318e+03 8.529402e+09 0.000000e+00 81s
52220 -1.5375468e+03 1.106627e+11 0.000000e+00 86s
52630 -2.0626853e+03 4.930438e+10 0.000000e+00 91s
52933 -2.2655273e+03 1.230573e+09 0.000000e+00 95s
53346 -2.8964221e+03 1.657397e+09 0.000000e+00 101s
53754 -3.3126854e+03 1.837539e+09 0.000000e+00 106s
54434 -3.8636273e+03 2.888508e+09 0.000000e+00 111s
54637 -4.3825301e+03 3.123007e+09 0.000000e+00 115s
55060 -6.9146655e+03 5.969435e+08 0.000000e+00 120s
55359 -1.2613434e+04 3.123074e+09 0.000000e+00 128s
55459 -1.4078814e+04 1.701700e+10 0.000000e+00 131s
55656 -1.7157864e+04 3.945146e+09 0.000000e+00 137s
55756 -1.9317333e+04 4.500264e+09 0.000000e+00 141s
55955 -2.2522585e+04 3.122705e+09 0.000000e+00 149s
56054 -2.4189350e+04 5.026979e+08 0.000000e+00 153s
56154 -2.6162403e+04 4.165341e+09 0.000000e+00 158s
56255 -2.8115172e+04 7.683779e+08 0.000000e+00 163s
56356 -2.9409356e+04 3.649139e+09 0.000000e+00 167s
56456 -3.0609056e+04 1.606122e+10 0.000000e+00 171s
56556 -3.7268636e+04 7.538295e+09 0.000000e+00 175s
56757 -5.4097843e+04 1.052211e+10 0.000000e+00 181s
56857 -6.4701069e+04 1.590336e+10 0.000000e+00 186s
56956 -7.3656204e+04 5.915608e+08 0.000000e+00 191s
57054 -8.2972493e+04 5.676295e+08 0.000000e+00 197s
57154 -9.0637503e+04 7.540524e+09 0.000000e+00 202s
57253 -1.0020252e+05 7.728648e+09 0.000000e+00 207s
57352 -1.0952737e+05 3.386470e+09 0.000000e+00 213s
57452 -1.1788348e+05 5.239693e+08 0.000000e+00 219s
57552 -1.2437621e+05 8.204472e+08 0.000000e+00 224s
57652 -1.3134143e+05 7.543124e+09 0.000000e+00 229s
57751 -1.3460201e+05 3.122705e+09 0.000000e+00 233s
57851 -1.4225017e+05 1.271586e+10 0.000000e+00 238s
57951 -1.5060545e+05 5.467829e+09 0.000000e+00 243s
58050 -1.5699953e+05 9.637608e+09 0.000000e+00 248s
58149 -1.6499148e+05 9.017171e+09 0.000000e+00 253s
58249 -1.7292083e+05 6.132103e+09 0.000000e+00 259s
58347 -1.7856792e+05 5.906334e+08 0.000000e+00 263s
58447 -1.8656894e+05 6.385623e+09 0.000000e+00 269s
58547 -1.9579582e+05 6.130101e+09 0.000000e+00 275s
58647 -2.0401017e+05 5.252313e+09 0.000000e+00 282s
58748 -2.1235131e+05 3.464810e+09 0.000000e+00 288s
58846 -2.2095733e+05 6.517605e+09 0.000000e+00 294s
58946 -2.2793379e+05 9.018643e+09 0.000000e+00 299s
59046 -2.3706423e+05 9.106532e+08 0.000000e+00 305s
59146 -2.4882729e+05 6.953939e+08 0.000000e+00 312s
59245 -2.5793069e+05 6.146622e+08 0.000000e+00 317s
59346 -2.6918790e+05 2.198499e+10 0.000000e+00 324s
59446 -2.8356601e+05 6.953553e+08 0.000000e+00 330s
59545 -2.9455786e+05 9.018643e+09 0.000000e+00 337s
59644 -3.0573550e+05 8.361457e+09 0.000000e+00 342s
59744 -3.1751080e+05 6.900108e+09 0.000000e+00 348s
59843 -3.2979136e+05 9.018643e+09 0.000000e+00 353s
59942 -3.4592300e+05 2.249540e+10 0.000000e+00 359s
60043 -3.6161794e+05 6.687710e+10 0.000000e+00 365s
60143 -3.7769950e+05 7.207824e+08 0.000000e+00 371s
60243 -3.9036701e+05 6.899026e+09 0.000000e+00 376s
60343 -4.0495805e+05 1.287762e+10 0.000000e+00 382s
60442 -4.2461659e+05 5.254317e+09 0.000000e+00 388s
60542 -4.4414222e+05 8.415259e+08 0.000000e+00 394s
60641 -4.6583930e+05 8.440481e+08 0.000000e+00 400s
60740 -4.8788317e+05 7.777666e+08 0.000000e+00 405s
60841 -5.1754860e+05 9.825951e+09 0.000000e+00 411s
60936 -5.3971703e+05 9.637608e+09 0.000000e+00 415s
61035 -5.6854029e+05 2.135529e+10 0.000000e+00 421s
61135 -5.9868393e+05 2.154621e+10 0.000000e+00 426s
61233 -6.2288007e+05 8.440481e+08 0.000000e+00 431s
61333 -6.6098634e+05 9.106532e+08 0.000000e+00 437s
61431 -6.9779152e+05 9.825978e+09 0.000000e+00 442s
61531 -7.4387270e+05 1.930400e+10 0.000000e+00 448s
61631 -7.9680884e+05 5.709168e+09 0.000000e+00 452s
61731 -8.5235127e+05 4.254981e+11 0.000000e+00 457s
61831 -9.3262581e+05 6.198747e+09 0.000000e+00 462s
61930 -9.8989612e+05 1.445015e+10 0.000000e+00 466s
62129 -1.1801503e+06 7.178836e+09 0.000000e+00 475s
62229 -1.3885237e+06 7.819152e+09 0.000000e+00 480s
62329 -1.7429819e+06 7.846536e+09 0.000000e+00 485s
62530 -2.6903025e+06 1.208956e+10 0.000000e+00 493s
62631 -3.0408114e+06 1.361459e+10 0.000000e+00 496s
62830 -4.6645893e+06 2.085749e+10 0.000000e+00 503s
62931 -6.4508966e+06 2.192035e+10 0.000000e+00 506s
63666 -1.7236712e+09 6.488597e+06 0.000000e+00 511s
-
Official comment
By default, after solving a MIP, AMPL fixes the integer variables and solves the LP relaxation. This is known as the fixed LP. To prevent this, set the AMPL parameter basis=1.
-
Thank you for your reply! Sorry I didn't know that it was related to AMPL rather than Gurobi. Adding basis=0 in AMPL's gurobi_options does the trick.
0
Please sign in to leave a comment.
Comments
2 comments