3

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.

1
  • 6
    I'm voting to close this question as off-topic because it's a purely mathematical question, not one about computer programming. ("Linear programming" is a bit of a misleading term; it has no relation with computer programming.) Commented Apr 5, 2016 at 6:34

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

1 Comment

How can we write a constraint like |x1- a1| +|x2-a2| + .... + |xn - an| >= K ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.