Skip to main content

Binary Variables were assigned a continous value

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Mathematical optimization solvers work with integrality tolerances. In Gurobi this tolerance is controled by the parameter IntFeasTol. This means that a binary variable with value \(\texttt{0.999999}\) is handled as \(\texttt{1}\). Usually, this is not an issue as you (the user) can round the non-integer values to their correct true integer values after an optimization run has been completed. However, there are cases where these tolerances can have significant impact on the solution and the behavior of the model. These cases are most often caused by so-called "trickle-flows", which occur when (badly scaled) big-M values are used in the model. Gurobi provides the parameter IntegralityFocus to tackle this issue. Altogether, you should try rounding binaries and integers after a successful optimization run and see whether all constraints are still satisfied (within tolerances FeasibilityTol). If this is not the case, then you should try reducing the IntFeasTol tolerance and experiment with the IntegralityFocus parameter. You could additionally try to improve the scaling of your model, cf. Guidelines for Numerical Issues.

    You can find additional information in the Knowledge Base article Why does Gurobi sometimes return non-integral values for integer variables?

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.