[Math] Handling $\max(x,0)$ in the objective function

linear programmingoptimization

I have the following optimization problem in $x$

$$\begin{array}{ll} \text{minimize} & \max (K_1+x,0)+ K_2 x\\ \text{subject to} & \quad x \in \mathcal{P}\end{array}$$

Is there any trick to handle $\max(\cdot,0)$ and convert this optimization problem into a linear program?

Best Answer

This can be easily achieved by adding one dummy variable. \begin{align} \min_P \quad &(\max (K_1+P,0)+ K_2 P)\\ P &\in \mathcal{P}\\& \Updownarrow\\ \min_P\quad &t+K_2P\\P&\in \mathcal{P}\\t&\geq K_1+P\\t&\geq0 \end{align}

Related Question