Skip to main content

Variable value is zero, but Solver reports 1e-17 for it.

Answered

Comments

3 comments

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

    Hi Bahar,

    Mathematical operations in numerical algorithms are limited by machine precision. Thus, it is normal to see that continuous and even integer variables don't attain their true optimal values. In you case, the 1e-17 for Z can be safely seen as 0. For an example, see Real numbers are not real.

    Please note that numerical algorithms often work with internal computation tolerances. In Gurobi, such tolerances are, e.g., FeasibilityTol, IntFeasTol, OptimalityTol. These tolerances allow for small numerical offsets when declaring a point as feasible, optimal, and/or integer.

    You can find more information in our Guidelines for Numerical Issues. I also recommend reading a book on numerical algorithms such as, e.g., "Accuracy and Stability of Numerical Algorithmy" by Nicholas J. Higham.

    Best regards, 
    Jaromił

    0
  • Bahar Nasirian
    • Gurobi-versary
    • Conversationalist
    • Curious

    Thank you so much for your help and guidance .

     

    Regards,

    Bahar

    0

Post is closed for comments.