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

Technical questions regarding binary variables

回答済み

コメント

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.
  • Jaromił Najman
    • Gurobi Staff

    Hi Lorenz,

    You could use a small tolerance \(\epsilon = 1e-4\) and model your condition using indicator constraints.

    \[\begin{align*}
    x = 1 &\rightarrow\, y = 1\\
    x = 0 &\rightarrow\, y \leq 1 - \epsilon
    \end{align*}\]

    The above states that if \(x=1\) then also \(y=1\) and if \(x=0\) then \(y<1\).

    Please note that the usage of a small tolerance is required, because you are trying to model a strict inequality, but Gurobi does not support these. It is very important to not choose the tolerance \(\epsilon > 0\) too small. In particular it should always be at least one order of magnitude larger than the FeasibilityTol.

    Best regards, 
    Jaromił

     

    0

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