Will Gurobi retain lazy cuts after changing the objective coefficients?
AnsweredConsider the following scenario.
- I build a MIP model.
- I create a callback for adding lazy cuts.
- I solve the MIP, adding many lazy cuts in the callbacks.
- I change the objective coefficients on some of the variables.
- I resolve the MIP with the new objective coefficients.
When the coefficients are changed in step 4, will the lazy cuts that were added in step 3 be removed from the model? My guess is that they will be removed since the model has changed. I want to confirm that the particular lazy cuts added in step 3 will not be automatically included in the step 5 model.
Thanks.
-
Hi Austin,
I'll assume you're asking about "lazy constraints" as opposed to "user cuts." For more information on the difference between these two, see this article.
Lazy constraints are required for the underlying application; they cut off integer feasible solutions that would otherwise be feasible to the original model. All of these constraints are valid for the application, but are left out of the model formulation, usually because there are too many to enumerate (e.g., subtour elimination constraints in the traveling salesman problem). Changing the objective coefficients and re-solving the model will (almost certainly) result in a very different branch-and-bound tree that generates different lazy constraints. As such, Gurobi will discard any lazy constraints generated in an earlier solve of the model.
I hope this helps!
1 -
Hi Eli,
I meet a similar problem. Before re-solving, I need to change some constraints instead of the objective. I guess the Gurobi will also discard all of lazy constraints generated in an earlier solve. It this right?
Many thanks.
0 -
Yes, that's correct.
0 -
Dear Eli,
Thanks for your reply! :)
0
Please sign in to leave a comment.
Comments
4 comments