Constraints in Gurobi
回答済みI have the following constraint:
model.addConstr(aux1["O+", "1", m, t] == demand - sum(i1["O+", "1", m, t] for m in range(1, m)))
model.addConstr(aux2["O+", "1", m, t] == gp.max_(0, aux1["O+", "1", m, t]))
model.addConstr(aux3["O+", "1", m, t] == i1["O+", "1", m, t] - aux2["O+", "1", m, t])
model.addConstr(I1["O+", "1", m, t] == gp.max_(0, aux3["O+", "1", m, t]))
which is representative of:is there anything wrong with using auxiliary variables?
0
-
Hi Shahrzad,
It looks correct. You would not be able to formulate this using the current Gurobi API without using auxiliary variables.
- Riley
0 -
Thank you Riley for your prompt response.
0
サインインしてコメントを残してください。
コメント
2件のコメント