If-Then Constraint: If $F(X) > 3$, then $Y = 1$

611 Views Asked by At

$F(x) = x_1+x_2+x_3+x_4$

Scenario: Amongst binary variables $X_1$, $X_2$, $X_3$, $X_4$, if more than $3$ are chosen, then another binary variable $Y = 1$. Otherwise, $y = 0$. How can I formulate constraints based on this for a linear programming model?

Thanks!

1

There are 1 best solutions below

10
On BEST ANSWER

Something like this : $$ \mbox{Max } \sum_{i=1}^9 C_iX_i - pY $$ subject to $$ X_1+X_2+X_3+X_4 \le 3 + Y $$ Variable $Y$ takes value $1$ only if all $4$ $X$ variables take value $1$. You probably also have the following constraint to ensure exactly $5$ $X$ variables are chosen : $$ \sum_{i=1}^9 X_i = 5 $$