0

I've two variables: C which is binary, and X which is non-negative

If C = 0 then X = 0; If C = 1 then X = X (meaning there's no constraint on X)

How should I format this conditional constraint into a linear constraint for LP?

1 Answer 1

3

Note that strictly speaking LP models only contain continuous variables. So we assume this is a MIP model to be solved with a MIP solver.

Here are three ways to attack this, depending on the capabilities of the solver.

(1) If you use a solver that supports indicator constraints, you can simply use:

 c=0 ==> x=0

(2) For other solvers you can use:

 x <= M*c

where M is a (tight as possible) upper bound on x.

(3) Finally, if your solver supports SOS1 (Special Ordered Sets of type 1) sets, you can use:

 d = 1-c
 {d,x} ∈ SOS1
 d >= 0

(1) and (3) have the advantage that no bound is needed. If you have a good, tight bound on x, (2) is a good option.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.