Question for NP
AnsweredHello, when the relationship between decision variable and objective function exist bool mapping,as shown in the attachment with two pictures , then can gurobi sovle this problem? Thank you in advance!

0
-
Official comment
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 why not try our AI Gurobot?. -
Hi,
Variable objects don't have a value. This means that it is not possible to perform comparisons such as
if X[0] <= 0:
where \(\texttt{X}\) is an optimization variable. You have to model \(\texttt{if-else}\)-statements via introduction of auxiliary binary variables and constraints. A good example of how to model such relationships is discussed in the stackexchange post How to write if else statements in linear programming.
Best regards,
Jaromił0
Post is closed for comments.
Comments
2 comments