Gurobi / modeling-examples

Gurobi modeling examples
https://gurobi.github.io/modeling-examples/
Apache License 2.0
653 stars 291 forks source link

How Indicator constraint can be triggered with multiple variables in Gurobi? #8

Closed ptkphung99 closed 3 years ago

ptkphung99 commented 3 years ago

Dear Sir/Madam,

I am trying to write the constraint related to multiple variables. However, it shows error "Indicator constraints can only be triggered by a single binary variable at a given value". Can you help me fix this error? Thank you very much! The code is following: mdl.addConstrs((x[i,j,k] - t[i,j,k] == 1) >> (d2[j,k] == d2[i,k] - d[i,j]) for i, j, k in arcos2 if i != 0 and j != 0)

Where:

gglockner commented 3 years ago

This doesn't look like an issue with the modeling code in this Github repository. For assistance, please go to https://support.gurobi.com and post your question to the community forum; if you are a commercial customer, you can also go there to open a support ticket.