Remove cbCut
AnsweredI tried to implement some user cut by callback function to solve a MIP problem. I'm wondering if it is possible to remove some of the cuts during the callback? Btw, I'm using python to write the program.
Thanks a lot
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
No, there isn't a way to remove constraints/cuts in a callback. To "remove" a user cut, you would have to store the cut, restart the optimization, then make sure you don't add the cut (or a sufficiently similar cut) in the next optimization run. But this requires restarting the entire optimization process.
0 -
Thank you, I noticed that we can remove constraint by model.remove(), So is it possible to use model.addConstr() rather than model.cbCut in the callback function? Are there any differences between these two methods?
0 -
Hi Tang,
You cannot remove constraints during the optimization. This would result in a relaxation of the problem and invalidate the previously made progress in finding the optimum. The whole idea of the branch-and-bound-and-cut process relies on further and further restricting the feasible domain until optimality can be proven.
Cheers,
Matthias0 -
Thanks a lot.
0
Post is closed for comments.
Comments
5 comments