Page 1 of 1

Linearizing and minimizing an absolute term

Posted: Mon Jun 17, 2019 5:00 pm
by Monsef
Hi,

If we want to linearize and minimize an absolute term like |A-B|, where A and B are free integer variables. How do I do it?

Also, if the term changed to |A-1| what is the linear model for that?

I have solved the second part:
A-1<= x
1-A>=x
X>=0,
Min x

Is this correct?.

Re: Linearizing and minimizing an absolute term

Posted: Wed Jun 19, 2019 8:56 pm
by bussieck
Your expression is correct but it involves to minimize x which is hard when you try to just substitute |.| in a model. The absmip model (https://www.gams.com/latest/gamslib_ml/ ... bsmip.html) shows how to reformulate |.| with the help of a binary variable. You will need to have the some bounds on the variables involved or need indicators or a very complex SOS1 reformulation.

-Michael