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:
Is this correct?.
Problems with modeling
2 posts • Page 1 of 1
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.