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

Confusing results of MIP solving with `FeasibilityTol=1e-9`

回答済み

コメント

2件のコメント

  • Riley Clement
    • Gurobi Staff

    Hi Xintong,

    Tolerances are important since our machines use floating point arithmetic.  Their calculations are not 100% accurate which is why 0.1 + 0.2 = 0.30000000000000004  (see https://0.30000000000000004.com/).

    If I set Presolve=0 then we still get 161.28 with FeasibilityTol=1e-9.

    If I look at the presolve model I can see the constraint x0 + x1 >= 133, which of course is not compatible with a solution of x0 = 56, x1=76.

    I suspect that during presolve we deduce that

    x0 + x1 >= 132 + epsilon

    for some tiny value of epsilon with 1e-8 ≥ epsilon ≥ 1e-9.  The epsilon arises as a tiny error in calculations.

    We know that since x0 and x1 are integer we can round the RHS up.  If FeasibilityTol=1e-8 then the RHS is considered close enough to 132, but with FeasibilityTol=1e-9 we determine the RHS to be bigger than 132 and so round up to 133.

    In summary, we need tolerances to accommodate the weaknesses in floating point arithmetic.  If tolerances are too tight we may lose some feasible solutions.

    - Riley

     

     

     

    0
  • Xintong Zhou
    • Gurobi-versary
    • Curious
    • Conversationalist

    Hi Riley,

    Thanks for your explanation! 

    Taking the presolved model into consideration makes more sense for this case. I see what's happening now. Thanks.

    0

サインインしてコメントを残してください。