# IF constraint

 1 $$x \in \{0,1\}\\ y_1, y_2, y_3 \in \{0,1\}$$ How do you model: if x > 0: then y_1 + y_2 + y_3 = 1 It would be also sufficient to force y_1 + y_2 + y_3 >= 1 if x > 0 asked 19 May '15, 07:05 opt3 61●5 accept rate: 0% fbahr ♦ 4.6k●7●16

 1 Note that the unconstrained situation can be written as: $$0\leq y_1+y_2+y_3\leq 3$$ However, we can easily adjust this to accommodate your requirement: $$x\leq y_1+y_2+y_3 \leq 3-2x$$ if $$x\in [0,1]$$ then you need to define a new variable $$z\in \{0,1\}$$ and add constraints $$z-x\geq0$$ and \(z
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags: