I would like to express if then else statement in a set of constraints using Gurobi via Python API where B and A are binary decision variables.
Here is the statement I am stuck on :
If (B[r,u,v,x,y]) then A[r,u,x] or A[r,v,y]
Else set the value of B[r,u,v,x,y] == 0 when A[r,u,x] =1 and A[r,v,x]
I know how to express the first part of if then as :
B[r,u,v,x,y] >= A[r,u,x]
B[r,u,v,x,y] >= A[r,v,u]
But not sure how to formulate into constraints : when B[r,u,v,x,y] to be 0 if A[r,u,x] and A[r,v,y] are set to 1 in the else part.
Thanks
(a_0 & a_1) -> B < DeMorgan-> (not a_0 or not a_1) or B. If needed you can create some auxiliary-variable for the first subexpression (not a_0 or not a_1 == new_var) (where not is for binaries a(1-var)and an equality are two implications.(1-A0) + (1-A1) + (1-B) >= 1