lazy lower bound and upper bound for Vars
AnsweredDear Gurobi Team,
I am trying to speed up the solution of an optimization problem and reduce the size of the problem. I am already using the "lazy" option for some inequality constraints of which I know that they are very rarely active in solutions.
Now I had the idea to also set as lazy the lower bound and upper bound of some variables of which I know that they only very rarely come to their bounds, but have not found a corresponding option to do so.
Is this for some reason not a good idea after all, which is why this feature does not exist? Then I could save the effort of implementing a workaround via infinite lower and upper bounds and separate linear inequality constraints for each variable.
Best regards
Thomas

Hi Thomas,
Now I had the idea to also set as lazy the lower bound and upper bound of some variables of which I know that they only very rarely come to their bounds, but have not found a corresponding option to do so. Is this for some reason not a good idea after all, which is why this feature does not exist?
The feature exists. You could add the lazy constraint \(x \leq UB\) or \(x \geq LB\) as a lazy constraint. However, it is better to add variable bounds directly to the model instead of adding them "on the fly" as lazy constraints. The reason is that heuristics and presolve reductions can directly make use of the bound information. If variable bound information if provided as a lazy constraint then heuristic effort has been wasted and we cannot represolve the model with new bounds later on.
The same argument applies to all lazy constraints. For that reason it is often good to add all constraints to the model if they are not too many such that Gurobi's presolve can use these.
Best regards,
Jaromił0 
Hi Jaromił,
I see the obvious tradeoff between reducing the model size and not getting information from lazy bounds or constraints.
FYI:
I have huge sets of constraints to prevent islanding in an Optimal Transmission Switching Problem.
Typically the objective function and other constraints prevent islanding by themselves, so the islandingconstraints are only relevant/active in rare cases. Setting their lazyattribute to 1 speeded up the model, but I will not try it with further constraints.Thanks!
0 
Hi Thomas,
I have huge sets of constraints to prevent islanding in an Optimal Transmission Switching Problem.
Typically the objective function and other constraints prevent islanding by themselves, so the islandingconstraints are only relevant/active in rare cases. Setting their lazyattribute to 1 speeded up the model, but I will not try it with further constraints.I think it makes some sense that adding the islandingconstraints as lazy constraint gives a speedup. I would guess that the islandingconstraints contribute very little to the presolve step because they are there just to guarantee a very specific property, so adding them during the optimization as lazy constraints can be profitable. You could try finding out whether this hypothesis is true by looking at the presolve statistics with and without the islandingconstraints. Anyway, I'm glad that you are doing good progress.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
3 comments