In an MIP, how can I formulate a constraint such that a decision variable is only greater (or equal to) zero if (and only if) the sum of different decision variables is equal to something.
I'm working with a path flow formulation model and I want to have a constraint that forces flow q on path p to be zero if not all routes in path p are flown.
Example: flow q on path p, which contains flight A to B ($f_{AB}$) and flight B to C ($f_{BC}$), can be greater than zero if and only if one aircraft flies from A to B and (the same or another aircraft) flies from B to C.
I) q = 0 if $\sum$($f_{AB}$ + $f_{BC}$) $\le$ 1
II) q $\ge$ 0 if $\sum$($f_{AB}$ + $f_{BC}$) = 2
In case there are three flights in one path, constraint I becomes $\le$ 2, and constraint II becomes = 3, etc.
(I know exactly which flow can go over which paths, and I know how many flights are contained in all of the available paths. Moreover, all $f_{ij}$ are binary)
Help with this would be highly appreciated! (I'm writing my problem in python, in case that matters for anything)