0

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.

  • 1
    Welcome to the site. This appears to be a pure math or cs question, both of which have their respective StackExchange sites. You might find better help there. StackOverflow is for programming questions. – General Grievance Nov 09 '21 at 22:26
  • @Calculuswhiz Modeling a problem to solve it with a MIP solver would seem to be a legitimate SO topic, wouldn't it? – Christopher Hamkins Nov 11 '21 at 14:14
  • There is also a dedicated operations research SE at https://or.stackexchange.com/ which would be a good match for this question. – Christopher Hamkins Nov 11 '21 at 14:33
  • @ChristopherHamkins If it's programming and code, absolutely. But those details would have to be edited in by the OP. Until then, I think it would be better to post this question on those other SE sites. – General Grievance Nov 12 '21 at 13:12

2 Answers2

0

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

Christopher Hamkins
  • 1,442
  • 9
  • 18
0

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
pybegginer
  • 490
  • 1
  • 4
  • 12