Why are binary Variables getting float results. Is there any command to prevent it?
AnsweredHello.
I have defined two types of variables in my model running in different iterations. To restrict the variable values, I have considered both ways like binary and Integer variables with lb=0 and ub=1.

However, for some iterations, the variables are taking float values. Is there any way to prevent it? Please Suggest.
-
Official comment
This post is more than two 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. -
Hi Biswajit,
It is possible, that due to machine precision and numerical inaccuracies caused by, e.g., so-called trickle-flows, that discrete variables take float values in an optimal solution. To avoid this you could either decrease the IntFeasTol parameter value or use the IntegralityFocus parameter.
I recommend using (and reading the description of) the IntegralityFocus parameter even tho it might have a visible impact on performance
Best regards,
Jaromił0 -
In addition to Jaromil's reply, please refer to Why does Gurobi sometimes return non-integral values for integer variables?
0
Post is closed for comments.
Comments
3 comments