How to transform absolute values in the objective function of a linear program?

129 Views Asked by At

Referring to this, in the Numerical Example, clearly $x_3$ is useless (looks like the page is not well maintained). I find the explanation confusing though. If I simply have an objective function
min | t - 23 |
then 23 is the optimal solution

when I use U = | t - 23|
s.t. - t + 23 $\leq$ U $\leq$ t -23

then it seems like 22 is illegal, which is not the point, and, what is U? is it | t - 23 | or t -23 because this is not given in the last line of the numerical example in the link.

Actually, I have,
min p = 2 * | $t_{1} - q_{1}$ | + 3 * | $t_{1} - q_{1}$ | + 2 * | $t_{2} - q_{2}$ |
s.t. $t_{1} + t_{2}$ = 10

The $q_i$ are given. How do I linearize such a problem?

1

There are 1 best solutions below

10
On BEST ANSWER

Let $U = t_{14} - q_{14}$ and $V = t_{13} - q_{13}$ and solve the four systems

min p = 2 U + 3 U + 2 V
s.t. U>= 0, V>=0, 
    U = t_{14} - q_{14}, 
    V = t_{13} - q_{13}, and
    t_{13} - t_{14} = 10

min p = -2U - 3U + 2V
s.t. U< 0, V>=0, 
    U = t_{14} - q_{14}, 
    V = t_{13} - q_{13}, and
    t_{13} - t_{14} = 10

min p = 2 U + 3 U - 2 V
s.t. U>= 0, V<0, 
    U = t_{14} - q_{14}, 
    V = t_{13} - q_{13}, and
    t_{13} - t_{14} = 10

min p = -2U - 3U - 2V
s.t. U< 0, V<0, 
    U = t_{14} - q_{14}, 
    V = t_{13} - q_{13}, and
    t_{13} - t_{14} = 10

This splits into cases along the piecewise definition of the absolute value and uses that, for instance, $2|V| = 2V$ when $V \geq 0$ and $2|V| = -2V$ when $V < 0$ (and similarly for $U$).