I am working on an optimization problem which has the following constraint:
Let $x_{j}, y_{j}$, $j=1, \ldots, J$ be a set of binary variables, it holds that, for $j', j'' \in J$ fixed, if $$\sum_{j' < j < j''}x_{j} = 0$$ then either $y_{j'} = 0$ or $y_{j''} = 0$.
I know that the implication can be modelled introducing a binary variable $z_{j',j''}$ such that $y_{j} - z_{j',j''} \leq 0$ and $y_{j} + z_{j', j''} \leq 1$, but I do not know how to model the entire constraint formally with the introduction of big-M.
Any help will be appreaciated.