Skip to main content

Formulation help

Answered

Comments

1 comment

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Nick,

    Using a quadratic expression is likely a step in the wrong direction.  You could use Gurobi's "MIN" function - in gurobipy this is addGenConstrMin, or you could introduce a binary variable y and use the following set of constraints

    x <= l
    x <= d # better as an upper bound, rather than constraint
    x >= d*y
    x >= l - y*l.ub

    where l.ub is an upper bound on l.

    Note that if your objective function naturally causes the x variable to want to be as large as possible then you will only need the first two of these constraints.

    - Riley

    0

Please sign in to leave a comment.