Add semi-continious constraint
進行中Hi all,
I have the following contstraint (thereby Transportflow is a decision variable):
for c in CrossDock:
for k in Customer:
for t in Period:
model.addConstr(quicksum(Transportflow[c,k,p,t] for p in Produkt) >= 21)
But I want the quicksum to be either zero or greater than 21. So it should have a semicont structure.
How can I achieve this?
0
-
正式なコメント
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. -
Hi Shahrzad,
The typical approach is to define binary decision variables \(y_{ckt}\) being equal to 1 if cross dock \(c\) is chosen to ship products to customer \(k\) at time period \(t\).
- If \(y_{ckt}\) equals 1, the constraint ensures that the sum over product flows transported from cross dock \(c\) to customer \(k\) at time period \(t\) is at least 21.
- If \(y_{ckt}\) equals 0, the constraint ensures that the sum over product flows transported from cross dock \(c\) to customer \(k\) at time period \(t\) equals 0.
You can use the Gurobi API for indicator constraints to implement the above constraints.
Best regards,
Maliheh
0 -
Hi Maliheh,
Thanks for the answer! Is it possible to implement this without creating new variables?
0
投稿コメントは受け付けていません。
コメント
3件のコメント