# Inputting logical constraints into a binary programming model in Gurobi

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.

Thanks!

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$$.