Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linear Programming - Absolute value greater than a constant [closed]

How would you convert the constraint |x| >= 2 so that it would work in a Linear Program (in particular, solving using Simplex).

I understand how to convert |x| <= 2 as that would become x <= 2 and -x <= 2

However the same logic does not work when you have a minimum constant.

like image 852
llll0 Avatar asked Dec 05 '25 14:12

llll0


1 Answers

There is just no way to shoehorn an equation like |x|>=2 into a pure (continuous) LP. You need to formulate x <= -2 OR x >= 2 which is non-convex. This will require a binary variable making the problem a MIP.

One formulation can be:

x >= 2 - delta*M
x <= -2 + (1-delta)*M
delta in {0,1}

where M is judiciously chosen large number. E.g. if -100<=x<=100 then you can choose M=102.

like image 91
Erwin Kalvelagen Avatar answered Dec 09 '25 00:12

Erwin Kalvelagen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!