I have the following constraints. The first ensures that in my shift plan there are always exactly two days off between blocks of working days and only then does the next block begin.
It reads as follows.
$T$ is the day index and $y_{it}$ indicates whether a person $i$ works on day $t$ ($y_{it}=1$$y_{i,t}=1$) or not ($y_{it}=0$$y_{i,t}=0$).
\begin{align} 1 \le y_{i,t-1} + y_{i,t+1} \le 1 + y_{it}~~~~\forall i\in I,t\in \{2,\ldots,\mid T\mid -1\} \end{align}\begin{align} 1 \le y_{i,t-1} + y_{i,t+1} \le 1 + y_{i,t}~~~~\forall i\in I,t\in \{2,\ldots,\mid T\mid -1\} \end{align}
How can I generalise this constraint so that it not only applies to two days? For example, that must always be at least three free days in a row. It should be possible to control the number arbitrarily via the parameter $Sec$.
The second ones go as follows: \begin{align} \ &\sum_{t=1}^7y_{it} \geq 5 \forall i \in I\\ \ &\sum_{t=8}^{14}y_{it} \geq 5\forall i \in I \end{align}\begin{align} \ &\sum_{t=1}^7y_{i,t} \geq 5 \forall i \in I\\ \ &\sum_{t=8}^{14}y_{i,t} \geq 5\forall i \in I \end{align}
They are to ensure that in the period from $t=1-7$ and $t=8-14$ the sum of $y_{it}$$y_{i,t}$ is at least $5$. How can I combine these two constraints and also generalise them. So that it is not only for $T=14$, but also for all other multiples of $7$, for example?