Lazy not fulfilled
AnsweredHello,
I'm using a MIPSOL callback to determine if any new incumbent solution is feasible or not with respect to some additional constraints (which are not included in the original model). If not, the code adds a lazy constraint to invalidate the incumbent solution. However, in the documentation concerning lazy constraints I read:
Your callback should be prepared to cut off solutions that violate any of your lazy constraints, including those that have already been added. Node solutions will usually respect previously added lazy constraints, but not always.
Why not always?
-
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?. -
The reason is parallel execution. It could be that two parallel threads find solutions at the same time. At the synchronization point, we collect these solutions and present them one by one to the user by calling the callback function. Then, the user may produce a lazy constraint that cuts off the first solution. But now, we wouldn't check the next solution against all newly generated lazy constraints, but instead just call the callback for this second solution as well. It could be that this second solution violates the very same lazy constraint that was already used to cut off the first solution, so you need to be prepared to add the very same lazy constraint again. But this does not harm - in the lazy constraint pool, we will identify it as a duplicate and ignore it. In this situation, it is only needed to trigger the rejection of the second solution.
1
Post is closed for comments.
Comments
2 comments