How I can express this mathematically?

265 Views Asked by At

I'm working on a OR project. I have a code which fixes my problem which uses the constraint

((a =< b) or (c =< d) or (e =< f)) = True

I need to rewrite this condition as mathematical expression(s)

I tried

(a-b) * (c-d) * (e-f) =< 0

Which seems to work for most cases but fails when two of them are positive and one of them are negative.

Any help is greatly appreciated.

2

There are 2 best solutions below

0
On

$\max(b-a,d-c,f-e)\ge 0$.

But really, it already was mathematical.

1
On

Another way: $$ (|a - b| + a - b)(|c - d| + c - d)(|e - f| + e - f) \le 0 $$