1

How to write the following if-else condition in Linear Programming?

If YR1 == 1 , then 20 <= XR1 <= 80, else XR1 = 0

YR1 is a binary variable, XR1 is a continuous variable.

I tried

20 - XR1 <= 1000 * (1 - YR1)
80 - XR1 <= 1000 * (1 - YR1)

XR1 - 20 <= 1000 * YR1

Is it correct? If not, how can I convert the statement to linear programming conditions?

1 Answer 1

4

XR1 is called a semi-continuous variable. It can be modeled as:

 20*YR1 <= XR1 <= 80*YR1
 YR1 ∈ {0,1}
 

You need to split this into two inequalities.

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.