Place constraints back in the lazy constraint pool
AnsweredDear Gurobi team,
I would like to ask if it makes sense (or is even possible) to place constraints back in the lazy constraint pool.
I understand how they are placed in the lazy constraint pool initially and pulled into the active model depending on the parameter https://www.gurobi.com/documentation/current/refman/lazy.html#attr:Lazy.
But could it not make sense - e.g. after finding another new solution - to place constraints back in the lazy constraint pool, if they have become inactive in the current solution?
Couldn't this help to keep the problem size small? Or are there obvious reasons against such a strategy?
Best regards and thank you in advance
Thomas
-
Hi Thomas,
But could it not make sense - e.g. after finding another new solution - to place constraints back in the lazy constraint pool, if they have become inactive in the current solution?
Couldn't this help to keep the problem size small? Or are there obvious reasons against such a strategy?Lazy constraints that have been once added during the solution process don't have to be re-added because they remain as part of the lazy constraint pool. This means that if a lazy constraint becomes inactive after some iterations of the B&B algorithm and becomes active later, it will be recognized by Gurobi.
Does this answer your questions?
Best regards,
Jaromił0 -
Hi Jaromil,
thanks for your answer. Maybe that already answers my question, but I am not totally sure.
I think of three statuses, a constraint can have: active, inactive & lazy. If a constraint starts as lazy (attribute set to 1, 2 or 3) it can become active, depending on the rules described in https://www.gurobi.com/documentation/current/refman/lazy.html. Any constraint can become inactive during B&B. But I couldn't find any rules describing when a constraint becomes lazy. Do all constraints, that become inactive, become lazy? Or does the behaviour depend on the aforementioned lazy-attribute? Or can I control the behaviour by other parameters?
Thanks
Thomas
0 -
HI Thomas,
Do all constraints, that become inactive, become lazy? Or does the behaviour depend on the aforementioned lazy-attribute? Or can I control the behaviour by other parameters?
A constraint only has 2 statuses active and inactive. Lazy is a constraint attribute that lets Gurobi know that this constraint has to be handled differently, e.g., Gurobi cannot use lazy constraint in presolve if these come through a callback or Gurobi has to check each new incumbent against all lazy constraints to make sure that it is not cut off.
The only option you could set for lazy constraints is specified by the Lazy attribute, which controls how many lazy constraints are used if multiple are active at a single feasible point. Usually, this attribute does not make much of a difference but of course there are expections.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
3 comments