Search code examples
constraintslinear-programmingabsolute-value

Linear Programming - Absolute value greater than a constant


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.


Solution

  • 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.