Skip to main content

lazy lower bound and upper bound for Vars

Answered

Comments

3 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    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 re-presolve 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
  • Thomas Leveringhaus
    Gurobi-versary
    Collaborator
    Investigator

    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 islanding-constraints are only relevant/active in rare cases. Setting their lazy-attribute to 1 speeded up the model, but I will not try it with further constraints.

    Thanks!

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    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 islanding-constraints are only relevant/active in rare cases. Setting their lazy-attribute to 1 speeded up the model, but I will not try it with further constraints.

    I think it makes some sense that adding the islanding-constraints as lazy constraint gives a speed-up. I would guess that the islanding-constraints 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 islanding-constraints. Anyway, I'm glad that you are doing good progress.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.