how to formulate a "if- then" with Non-binary variable as condition
Answeredsince addGenConstrIndicator works if its condition is a binary variable. how can we formulate "if x1+2*x2-x3>=2 then z=1" in this case?
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
You can define an auxiliary variable \(x = x_1 + 2 x_2 + x_3\) and then follow the instructions in How do I model conditional statements in Gurobi? to model if \(x\geq 2\) then \(z=1\).
1 -
thank you
0
Post is closed for comments.
Comments
3 comments