0
$\begingroup$

There is an integer linear programming problem with this constraint:

$$\left|X1 - X2\right|= 5\text{ or }10\text{ or }20$$

How it can be solved with adding auxiliary variable $y$?

Main problem is that "or" between $5$ and $10$ and $20$.

$\endgroup$

1 Answer 1

0
$\begingroup$

Here is a tactic using 3 auxiliaries:

$$|X_1 - X_2| = 5y_1 + 10y_2 + 20y_3$$

$$y_1 + y_2 + y_3 = 1, all binary$$

Now you just need to model the left-hand-side, which isn't trivial.

$\endgroup$
1
  • 1
    $\begingroup$ You're quite close, actually. Just apply your approach to the constraint $$X_1-X_2 = -20~\text{or}~{-10}~\text{or}~{-5}~\text{or}~5~\text{or}~10~\text{or}~20$$ $\endgroup$ Commented Mar 23, 2015 at 16:34

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.