Consider the following binary variable $x \in \{0,1\}$ and two continuous real variables $y,p \in \mathbb{R}$.
I am trying to model the following conditional equations as constraints:
\begin{cases} -y \le p \le y ,& \text{if } y \ge 0 \\ y \le p \le -y ,& \text{if } y \le 0 \\ p = 0 ,& \text{if } x = 0 \\ \end{cases}
Whats the best way to do so while maintaining a MILP formulation?
The above is a restatement of the problem I attempted to explain below:
If the following two binary variables $x,z \in \{0,1\}$ and continuous real variable $y \in \mathbb{R}$. Whats the best way to linearize the product of the three (i.e. $xyz$) if I am using them in a constraint?
$ xyz \le p \le xyz$
Where $p \in \mathbb{R} $ is another continuous variable. The actual constraint in mind is supposed to maintain the variable $p$ within the same range when the continuous variable $y$ switches signs. For more details, here is the actual expression:
$x((1-z)y + 2yz)) \le p \le x(2(1-z)y + yz)$
$(1-z)y \le zy$
So the idea is that $z$ is 0 when $y$ is positive, and $z$ is 1 when $y$ is negative. $x$ is a switching binary that is turned to $0$ to limit the value of $p$ to 0. Is there a way to linearize this expression?