# multivariate piecewise-linear equality constraint in optimization problem

I have an optimization problem of the type:

$\min f(x) \\ s.t. Ax \le b \\ g(x)=0$

where $g(x)$ is a piecewise-linear function defined as:

$g(x) = \begin{cases} c_1^Tx & \text{if$x_1+x_2-x_3 \ge 0$} \\ c_2^Tx & \text{otherwise} \end{cases}$

I would like to know how to express this problem into a MIP and solve it.

Introduce binaries $\delta_1$and $\delta_2$ satisfying $\delta_1+\delta_2=1$. Now you have two cases, $\delta_1=1$, $c_1^Tx=0$, $x_1+x_2-x_3\geq 0$ and $\delta_2=1$, $c_2^Tx=0$, $x_1+x_2-x_3\leq -\epsilon$. Standard big-M modelling and you have something like
$$-M(1-\delta_1) \leq c_1^Tx \leq M(1-\delta_1)\\ -M(1-\delta_2) \leq c_2^Tx \leq M(1-\delta_2)\\ x_1+x_2-x_3 \geq -M(1-\delta_1)\\ x_1+x_2-x_3 \leq -\epsilon + M(1-\delta_2)$$
$\delta_1+\delta_2 =1$ is redundant as the two sets are disjoint, but it never hurts to add simple constraints on binaries.
• Since I only have two cases, would it be correct to just use one binary variable $\delta$ and its complement $(1-\delta)$? Or could this cause errors? – giulatona Sep 29 '14 at 14:09