Linearisation of absolute values in the objective function with sign change

132 Views Asked by At

I hope you can help me. Basically, I am aware of how I can implement, for example, $Min |X -1|$ as an absolute value in the objective function of an LP.

However, I have the following problem: I have a variable $X$ , which can take positive and negative values and a parameter $p$ which can also take positive and negative values.

The goal is now $Min |X - p|$.

By linearization I normally decompose X into two positive variables. But this is only "useful" if $p >0$, if $p$ takes on both positive and negative values, this way does not work.

Can someone please help me here...

1

There are 1 best solutions below

0
On

Two standard approaches:

  1. Minimize $z$ subject to $z \ge X-p$ and $z \ge p-X$.
  2. Minimize $z^+ + z^-$ subject to $X - p = z^+ - z^-$, $z^+ \ge 0$, and $z^- \ge 0$.