Combination of AND OR in Linear Programming

57 Views Asked by At

I have three binary variables: $x,y,z$.

I want to define $U$ as follows: $$U = x \wedge (y \vee z)$$

Following this, I have already tried defining

$$yz = y \vee z$$

and then, doing

$$U = x \wedge yz$$

But this adds too many variables and constraints to my problem (since $yz$ has $810000$ variables). Is there any simpler approach for linearizing this?

If it helps, in my problem, when $x = 0$, $y,z=1$.

1

There are 1 best solutions below

3
On BEST ANSWER

Rewrite in conjunctive normal form: \begin{equation} u \iff (x \land (y \lor z)) \\ [u \implies (x \land (y \lor z))] \land [\neg u \implies \neg (x \land (y \lor z)) \\ [\neg u \lor (x \land (y \lor z))] \land [u \lor \neg (x \land (y \lor z)) \\ [(\neg u \lor x) \land (\neg u \lor y \lor z)] \land [u \lor (\neg x \lor \neg (y \lor z)) \\ [(\neg u \lor x) \land (\neg u \lor y \lor z))] \land [u \lor (\neg x \lor (\neg y \land \neg z)) \\ [(\neg u \lor x) \land (\neg u \lor y \lor z))] \land [(u \lor \neg x \lor \neg y) \land (u \lor \neg x \lor \neg z)) \\ (1-u +x\ge 1) \land (1-u +y +z\ge 1)\land (u+1-x +1-y\ge 1) \land (u +1-x +1- z\ge 1) \\ (u \le x) \land (u \le y +z)\land (u\ge x+y-1) \land (u\ge x+z-1), \end{equation} which is a stronger formulation than @LinAlg.

Similarly, $$(u \iff (x \land (y \lor z))) \land (\neg x \implies (y \land z))$$ leads to \begin{equation} (¬u ∨ x) ∧ (¬u ∨ y ∨ z) ∧ (u ∨ ¬x ∨ ¬z) ∧ (u ∨ ¬y ∨ z) ∧ (x ∨ y)\\ (1-u + x \ge 1) ∧ (1-u + y + z \ge 1) ∧ (u +1-x +1-z \ge 1) ∧ (u +1-y + z\ge 1) ∧ (x + y \ge 1)\\ (u \le x) ∧ (u \le y + z) ∧ (u \ge x + z - 1) ∧ (u + z\ge y) ∧ (x + y \ge 1) \end{equation}