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
-
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
Please sign in to leave a comment.
Comments
4 comments