Reformulate Absolute values in linear programming

131 Views Asked by At

I did not find answer to similar question anywhere so I asking here. I have a constraint in linear programming model:


$|a-b|=d+g+i~$ where $~a, b, d, g, i$ are binary.


How should I reformulate this to make it linear for my model? Thanks in advance for any help!

1

There are 1 best solutions below

2
On BEST ANSWER

If all variables are binary then you can write it for instance as

$$ \begin{array}{l} d+g+i+a-b=2z \\ d+g+i\leq 1 \end{array} $$

where $z$ is another binary variable.