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