0

I have this constraint in my model:

(X - Y) @ B >= 0

where B is a boolean vector variable, X and Y are variables vector that represent quantities

I'm working with CVXPY, so I have to keep linear expressions

How could I translate this constraint in a way that is linear?

Could someone help me please ?

1 Answers1

1

I am assuming that X>=0 and Y>=0. In that case, we can somewhat easily linearize XB=X*B and YB=Y*B.

   XB <= X
   XB <= B*999
   XB >= X-999*(1-B)
   0 <= XB <= 999

Here 999 is an upper bound on X. Similar for YB. Now just add:

   XB >= YB
Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39