メインコンテンツへスキップ

Formulation help

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Riley Clement
    • 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

投稿コメントは受け付けていません。