# Integer linear programming problem

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

$$|X_1 - X_2| = 5y_1 + 10y_2 + 20y_3$$
$$y_1 + y_2 + y_3 = 1, all binary$$
• 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