0
$\begingroup$

I would like to ask about the constraints representing the following implications, where each $x_i$ is a binary variable, or can be replaced by a set of $x_i$'s where at most one is 1 and $y$ is either a non-negative continuous or integer variable:

i) $x_i=1 \implies y>0 \textrm{ and } x_i=0 \implies y=0$

ii) $y>0 \implies x_i=1 \textrm{ and } y=0 \implies x_i=0$

iii) $y=0 \iff x_i=0 \textrm{ and } y>0 \iff x_i=1$

$\endgroup$
1
  • $\begingroup$ Thank you for pointing it. I have omitted the extra constraints. $\endgroup$ Commented Aug 6, 2024 at 23:23

1 Answer 1

1
$\begingroup$

For all parts, assume that $y \le U$ for some constant $U$.

i) For $x_i=1 \implies y>0$, introduce a small positive constant tolerance $\epsilon$ and enforce $x_i=1 \implies y\ge \epsilon$, either as an indicator constraint or via linear big-M constraint $\epsilon - y \le M(1-x_i)$, where $M$ is a constant upper bound on the LHS when $x_i=0$. Because you also have $x_i=0 \implies y_i=0$, you can take $M=\epsilon-0=\epsilon$, yielding $\epsilon - y \le \epsilon(1-x_i)$, which simplifies to $$\epsilon x_i \le y. \tag1\label1$$ To enforce $x_i=0 \implies y=0$, the nonnegativity of $y$ means that it suffices to enforce $x_i=0 \implies y \le 0$ either as an indicator constraint or via linear big-M constraint $$y \le U x_i.\tag2\label2$$

ii) For $y>0 \implies x_i=1$, rewrite as its equivalent contrapositive $x_i=0 \implies y \le 0$ and either use an indicator constraint or impose linear big-M constraint \eqref{2}. For $y=0 \implies x_i=0$, rewrite as its equivalent contrapositive $x_i=1 \implies y > 0$ and either use an indicator constraint or impose linear big-M constraint \eqref{1}.

iii) Notice that the first $\iff$ is equivalent to the second $\iff$. Furthermore, each $\iff$ is equivalent to i) and equivalent to ii).

If $y$ is an integer variable, you can take $\epsilon=1$ throughout.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.