'OR' in conditional constraint
AnsweredI was trying to define a variable x using gurobi julia.
x could either equal to 0 or greater equal to 10.
I tried to use the big-M formulation in this article but seems doesn't work: https://support.gurobi.com/hc/en-us/articles/4414392016529-How-do-I-model-conditional-statements-in-Gurobi-
@variable(model, x >= 0)
@variable(model, delta, Bin)
@constraint(model, x >= 10-M*(1-delta))
0
-
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. -
You need an upper bound on your variable (which can be seen as the big-M). Then you can define \(x\) as a semi-continuous variable in julia, see Constraints · JuMP.
Or you add the constraints \(x\geq 10\delta\) and \(x\leq M\delta\).0
Post is closed for comments.
Comments
2 comments