How to linearize an implication?

174 Views Asked by At

Could someone help me linearize this implication?

Being x and y integer variables, the implication is the following

x >= 1 --> y = 0
y >= 1 --> x = 0

I would really appreciate some help.

2

There are 2 best solutions below

0
Christopher Hamkins On

Would this work?

Introduce a parameter t.

y = Max(1 - t, 0)
x = Min(t, 0)

and then linearize the Max and Min as described in https://or.stackexchange.com/questions/711/how-to-formulate-linearize-a-maximum-function-in-a-constraint

0
pybegginer On

Is there a way that both are zero? Because this seems like the usual complementarity constraints used into Battery optimization or Power Systems optimization and usual approach for this, for x and y being binary Vars:

x + y <= 1

Or the equality constraining:

x + y == 1