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
-
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
サインインしてコメントを残してください。
コメント
2件のコメント