0

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

grg
  • 1,017

1 Answers1

0

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.

  • 1
    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$$ – Michael Grant Mar 23 '15 at 16:34