Variable value is zero, but Solver reports 1e-17 for it.
AnsweredHello,
I have X and Z decision variables in my model. I defined a constant Z<=X. So, when X=0, Z need to be Zero. But Solver reports 1e-17 for Z. How can I solve this issue?
X: binary variable
Z: continuous variable (>=0)
Regards,
Bahar
-
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 -
Thank you so much for your help and guidance .
Regards,
Bahar
0
Please sign in to leave a comment.
Comments
2 comments