Processing math: 100%

Monday, January 29, 2018

Linearizing nested absolute values

In [1] an interesting question is posted: How to model a nested absolute value: min|(|x1a1|)(|x2a2|)| A standard way to model absolute values in the objective function in a linear minimization model min|x| is: minyyxy It would be tempting to apply this here: minzzy1y2zyixiaiyi The easiest way to illustrate this formulation is wrong, is showing a counter example. For this I added a few extra conditions to the model:minzzy1y2zyixiaiyix1=x2x1,x2[2,5] When using a1=1, a2=2, I see as solution:

----     37 PARAMETER a  

i1 -1.000,    i2  2.000


----     37 VARIABLE x.L  

i1 2.000,    i2 2.000


----     37 VARIABLE y.L  

i1 3.000,    i2 3.000


----     37 VARIABLE z.L                   =        0.000  

We can see the value  y2=3 is incorrect: |x2a2|=|22|=0. The underlying reason is of course: we are not minimizing the second term |y2a2|.

A correct formulation will need extra binary variables (or something related such as a SOS1 construct):minzzy1y2zyixiaiyi(xiai)yixiai+Mδiyi(xiai)+M(1δi)δi{0,1}

Background


The function z=max(x,y) can be linearized as: zxzyzx+Mδzy+M(1δ)δ{0,1} The function z=|x| can be interpreted as z=max(x,x).

Results


The example model now will show:


----     68 VARIABLE x.L  

i1 2.000,    i2 2.000


----     68 VARIABLE y.L  

i1 3.000


----     68 VARIABLE z.L                   =        3.000  

----     68 VARIABLE d.L  

                      ( ALL       0.000 )


I think we need binary variables for for both terms yi although for this numerical example it seems that we could only do it for the second term y2, and handle y1 as before, I believe that is just luck. A correct formulation will use binary variables for both inner absolute values.

Linearizing absolute values is not always that easy.

References


No comments:

Post a Comment