I am very new to Gurobi and OR in general (I'm in my first class for it now), so apologies if this is a very obvious answer. For a project in that class, I am generating a flight schedule for a theoretical airline. I am attempting to add a logical constraint relating to flow balance across cities for crew members, which basically says if expression A is true, then expression B must be true. I was attempting to use the model.addGenConstrIndicator function, but it will not allow me to input an expression for the "if" part of the function, only a single binary variable.

Any help on this would be greatly appreciated.



1 Answer 1


You could introduce two binary variables, say $x_A$ and $x_B$, two indicator constraints $x_A \iff A$ and $x_B \iff B$, and linear constraint $x_A \le x_B$. The latter enforces the implication $x_A \implies x_B$, which is equivalent to $A \implies B$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.