0

I would appreciate any help to solve the following task:

If $y=1$ then $x_i=1$ for at least $k$ of the possible indices $i\in\{1,\cdots,n\}$ where $k$ and $n$ are parameters, $x$ is a binary variable vector with $n$ elements, and $y$ is a binary variable.

Kuifje
  • 13,324
  • 1
  • 23
  • 56

1 Answers1

3

You want to enforce $y=1 \implies \sum_i x_i \ge k$. You can do so by imposing linear big-M constraint $$k - \sum_i x_i \le (k - 0) (1 - y),$$ which simplifies to $$\sum_i x_i \ge k y.$$

RobPratt
  • 32,006
  • 1
  • 44
  • 84