'OR' in conditional constraint
回答済みI 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
-
正式なコメント
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
投稿コメントは受け付けていません。
コメント
2件のコメント