How do I transform the following set of conditions into inequalities?

84 Views Asked by At

I've been working on a mixed integer linear program for quite a while now and I need to set up constraints involving binary variables. I just can't find the correct answer to the following problem. Consider this:

We have three binary variables $x$, $y$ and $z$. If $x=0$, then $y=1$ and $z=1$. How do we express this statement using inequalities involving the three binary variables?

I'm sorry if the question is trivial, I guess the answer is probably really easy and obvious, but somehow my brain just seems to overcomplicate things here. I would really appreciate some help. Thanks!

2

There are 2 best solutions below

1
On

I guess: $2x+y+z\geq 2$.

For $x=0$ you need to have $y=z=1$ to satisfy this. If $x=1$ then it is true independently of what $y,z\in\{0,1\}$ are.

1
On

You can derive the desired constraints somewhat automatically via conjunctive normal form as follows: $$ \lnot x \implies (y \land z) \\ \lnot(\lnot x) \lor (y \land z) \\ x \lor (y \land z) \\ (x \lor y) \land (x \lor z) \\ x + y \ge 1 \land x + z \ge 1 $$ That is, \begin{align} x + y &\ge 1 \tag1\label1\\ x + z &\ge 1 \tag2\label2 \end{align} Note that \eqref{1} and \eqref{2} yield a stronger formulation than their aggregation $$2x+y+z \ge 2. \tag3\label3$$ For example, $(x,y,z)=(1/2,1,0)$ satisfies \eqref{3} but not \eqref{2}.