I have the following constraint in my model:
$$x = 0 \lor \sum_{i=1}^n y_i = 3$$ where $x$ and $y_i$ are all binary variables.
How this can be linearized by means of big-M notation?
Should I include additional slack variables, or?
Operations Research Stack Exchange is a question and answer site for operations research and analytics professionals, educators, and students. It only takes a minute to sign up.
Sign up to join this communityI have the following constraint in my model:
$$x = 0 \lor \sum_{i=1}^n y_i = 3$$ where $x$ and $y_i$ are all binary variables.
How this can be linearized by means of big-M notation?
Should I include additional slack variables, or?
You do not need another variable. Your disjunction is equivalent to $$x=1 \implies \sum_{i=1}^n y_i = 3,$$ which you can enforce via big-M constraints $$M_1(1-x) \le \sum_{i=1}^n y_i - 3 \le M_2(1-x).$$ I leave to you the determination of good (small) choices of $M_1$ and $M_2$.
Some solvers also support such indicator constraints directly, without requiring you to explicitly impose big-M constraints.