solver takes ages to close GAP
AnsweredHello,
I am trying to solve a fairly large MILP model, however, the solver is taking ages to reduce the GAP. I am aiming to get a GAP ideally under 1% and do so in under 6hrs as I need to run the same model with different values around at least 50 times.
I have already tried many different options such as MIPFocus=1, 2, 3 which lead to 0 solutions. Heuristic=0, 0.5 with the same result, 0 solutions. Method=3 which gave me a solution with 1.80% in 6hrs. ConcurrentMIP=2, 4, 6 using a combination of Threads=4, 6, 12, 18, 24 with the same result of ~1.80% in 6hrs.
Can you please advice on what can I do to reduce the solving times and achieve a GAP under 1%?
here is the full log of one of the test I ran with MIPGap =0.01 and Threads =18:
https://www.dropbox.com/sh/e0f2ab4j07agp6z/AABQ5lFZFF-ftUcT7GB6bvfMa?dl=0
Thanks
-
Hi Donovan,
to my judgment, you used many of the available parameters which could improve the performance. You could also play with the Cuts parameter to let Gurobi add them more aggressively (e.g. setting it to 2 or 3).
You can also try using Gurobi's parameter tuning tool - perhaps the automated search will yield better parameter choices.
I noticed that presolve process reduces your problem drastically (80% of constraints and 90% of variables are removed). Additionally, the cuts that Gurobi adds are quite numerous. Perhaps you could find a way to strengthen the model formulation? This will almost certainly help in finding high-quality solutions. Perhaps the information about the types of cuts that Gurobi added will be beneficial to guide your search for a stronger formulation.
Additionally, you can look up some other threats that consider similar questions (such as this, this, and this). Maybe these will give you further ideas.
Best regards
Jonasz0 -
Thanks for answering Jonasz. My model has a very high number of parameters with values = 0 that later are part of constraints and variables, perhaps that is the reason why the pre-solver removes a high percentage of constraints and variables. I will try the CUTS parameter and see what happens with that, later if I do not see any improvement I will try the tuning tool.
Thanks again,
Donovan
0 -
Looking at the log file you provided, Gurobi spends over an hour during the root node cut loop, yet the progress in the best bound is pretty modest. And all the added cuts may add run time to the node LPs in the tree search as well. So you might try setting the Cuts parameter to 0 and see if the gain you get from improved node throughput exceeds any loss in progress in the best bound. Also, you could try setting the presolve parameter to 2, which may further reduce the problem size and tighten the formulation.
Ed
0 -
Thanks for your answer Ed. I tried the parameters that you and Jonasz suggested and the solver took around 2.5 times longer than before.
So I decided to reformulate some bits on my model and now it takes around 7-8 hours to solve with a Gap <0.40% (below 0.40%) which is enough for my purposes.
Thank you both for you answers,
Donovan
1
Please sign in to leave a comment.
Comments
4 comments