I have this constraint which ensures that there are at least $$F$$ consecutive days off. F.e. for $$F=2$$, an 1-0-1 is prevented.

$$1+y_{it}\ge y_{i(t-1)}+y_{ik}~\forall i\in I, t\in\left\{ 2,\ldots,T- {F}+1 \right\}, k\in \left\{ t+1,\ldots,t+{F}-1 \right\}$$

I also have two constraints that ensures a minimum ($$W$$)/maximum ($$A$$) number of consecutive work days. Is it possible to change my first constraint to a work on, using a summation as in the second constraints?

$$\sum_{j=t}^{t+A}y_{ij}\le A~\forall i\in I,t\in \{1,\ldots,T - A\}$$ $$\sum_{j=t+1}^{t+W}y_{ij}\ge {W}\cdot(y_{i(t+1)}-y_{it}\forall i\in I, t\in \{1, \ldots, \mid T \mid - {W}\}$$

$$x_{ijt}$$ and $$y_{it}$$ are binary variables. $$x_{ijt}$$ indicates a shift assignment, $$y_{it}$$ whether a worker works on a day or not. For this $$\sum_{j\in J} x_{ijt}=y_{it}\forall i\in I, t\in T$$ holds. $$I$$ is the set of worker, $$J$$ of the shifts and $$T$$ the days.

• Did you mean to say that $A$ is the maximum number of consecutive work days?
– prubin
Commented Jun 10 at 15:27
• Your first constraint says that if worker $i$ works on day $t-1$ and also on any day from $t+1$ ot $t+F-1$ then they must also work on day $t.$ How does that ensure any days off?
– prubin
Commented Jun 10 at 15:30
• @prubin Sorry, I misstated the question. I just updated it. Commented Jun 10 at 16:14
• Your second constraint says that a worker cannot work $A+1$ consecutive days. How does that translate to ensuring a minimum number of consecutive work days?
– prubin
Commented Jun 10 at 17:35
• It does not. I just wanted to provide an example, on how the new constraint should kind of look like. I kind of want to utilize a sum--formulation, rather than using another index with another $\forall$ approach. Commented Jun 10 at 17:47

$$\sum_{j=t}^{t+F-1}(1-y_{ij})\geq F\cdot (y_{i(t-1)}-y_{it})\quad \forall i\in I, t\in \{2,\ldots,T-F+1\}$$.
• This does not prevent $y\equiv1$ (working every day). Commented Jun 10 at 21:39