'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
-
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
Please sign in to leave a comment.
Comments
1 comment