How to adjust the parameters of Gurobi in the process of solving?

297 views
Skip to first unread message

Xinwei Shen

unread,
Jun 16, 2015, 10:21:07 AM6/16/15
to yal...@googlegroups.com
I am using YALMIP to formulate a MILP model, using Gurobi to solve the model. 
However, the convergence speed of the model is too slow. I have to find the way to adjust the parameters of the Gurobi while it is solving the problem 
(e.g. If the Gap (the relative gap between the best known solution and the best known bound) reach a certain value, stop solving, adjust the parameter, then go back and go on solving).
Is that possible with YALMIP? If the answer is YES, how?

Johan Löfberg

unread,
Jun 16, 2015, 10:25:34 AM6/16/15
to yal...@googlegroups.com
No, you cannot.

the only way I see this is that you code the model using c/++, and use callback functions, but I doubt you can change tolerance options on-the-fly.

Focus on creating better models and experiment with various cut/heuristic options instead. 

Xinwei Shen

unread,
Jun 16, 2015, 10:30:54 AM6/16/15
to yal...@googlegroups.com
I am not trying to change the tolerance. I was trying to change some heuristic parameters like Heuristics(the amount of time spent in MIP heuristics) and RINS(Frequency of the RINS heuristic).
Other parameters related with cut strategies is also considerable if it is effective.

Xinwei Shen

unread,
Jun 16, 2015, 10:34:23 AM6/16/15
to yal...@googlegroups.com
actually Gurobi itself offers a parameter named as ImproveStartTime and ImproveStartGap can do what I want to do. 
“These parameters allow you to give up on proving optimality at a certain point in the search, and instead focus all attention on finding better feasible solutions from that point onward.”

However, I want to set the realted parameters back to the way they should be after the GAP reach a certain value, i.e. the opposite way ImproveStartTime works. And Gurobi didn't have that kind of parameters.

Johan Löfberg

unread,
Jun 16, 2015, 2:19:27 PM6/16/15
to yal...@googlegroups.com
As I said, your only way to communicate with gurobi in matlab is through the options you send. There is no way to do anything during the solution process.
Reply all
Reply to author
Forward
0 new messages