Skip to main content

Technical questions regarding binary variables



1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Lorenz,

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

    x = 1 &\rightarrow\, y = 1\\
    x = 0 &\rightarrow\, y \leq 1 - \epsilon

    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, 



Please sign in to leave a comment.