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

Implementing case specific constraints with hard less and greater operators

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three 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.
  • Maliheh Aramon
    • Gurobi Staff

    Hi Michael, 

    Since \(w_i\) is a natural number, the constraints \(w_i > w_j\) and \(w_i < w_j\) can be represented as \(w_i - w_j \geq 1\) and \(w_i - w_j \leq -1\), respectively. 

    Seconds, what would be the best way to implement such constraints? Using indicator constraints or should I model a mixed equation for the case and C?

    I am not sure what a mixed equation for the case and C means. You can use indicator constraints to represent the part involving \(w\) variables in all three constraints and use Gurobi general constraints helper functions and_() and or_() to model conjunction and disjunction operators.

    Best regards,

    Maliheh

    0

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