We can use binary variables to solve the problem.
We already have a lower bound for u.
u >= 0
Providing an upper bound in terms of the binary variables x and y, we get
u <= M*(1 - xy)
u <= M*(1-z), where z = xy
where M is some arbitrarily large number(Can set M as sum of absolute values of a and b in certain situations)
xy = 1
corresponds to u =0 and thus a=b.
So, x = 1 should also correspond to a>=0,
and y = 1 should correspond to b>=0
for which we can use:
x >= 0
x <= Upper bound of a
y >= 0
y <= Upper bound of b
Now, xy =1 to corresponds to ab>=0
Now we use the McCormick Envelope, to convert xy>0 to linear constraints, which is given as
Let Upper bound of x be XU, Upper bound of y be YU.
Lower bound of x be XL, Lower bound of y be YL.
We get,
z <= XU*y + YL*x - XU*YL
z <= YU*x + XL*y - YU*XL
z >= XL*y + YL*x - XL*YL
z >= XU*y + YU*x - XU*YU
Lower bounds for x and y is 0, upper bound is 1, this simplifies to
z <= y
z <= x
z >= 0
z >= x + y - 1
If anyone has another answer please do post, I would be happy to know!.
>
-operator is not valid in terms of LPs, it's always>=
) – sascha