0
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ This is very similar to your last post. Can you work it out with the answer provided there ? $\endgroup$
    – Kuifje
    Nov 24, 2022 at 19:20

1 Answer 1

3
$\begingroup$

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.$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.