add constraints in callback
AnsweredHi,
I want to add some constraints in callback. When a better incumbent is found, that means some variable can be excluded(set to 0) because they can not be included in a better solution. How can i do?
Looking forward to any advices.
Thanks
-
Official comment
This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Peilin,
You can add some lazy cuts to achieve this.
See our TSP example:Cheers,
David0 -
Hi David,
Thanks for your advices.
Does lazy cuts be considered in the following solve? The cuts I want to add is to exclude some unpromising feasible solutions, which is different from that in TSP model to exclude infeasible solutions.
Best regards,
Peilin
0 -
Hi Peilin,
In that case you can use user cuts (instead of lazy cuts), however these will not remain for the next solve.
One way to keep these would be to save them in a separate container and add them all after the solve.Cheers,
David0 -
Get it. Thank you David
0
Post is closed for comments.
Comments
5 comments