I am fairly new to linear programming since I came across this topic at university this semester. We mainly focus on nurse rostering. In the lecture, we created a very basic rostering model with an objective function and two constraints. Nr. 1 is the demand constraint and nr.2 is the individual working constraint. I now want to build upon this model and add a few constraints.
In our model, we have two binary variables: $a_{its}$ indicates if nurse $i$ works the shift $s$ on day $t$. $b_{it}$ indicates if nurse $i$ works on day $t$. The index goes from $i;t;s \in \{1,\dots,I;T;S\}$. I now want to model the following:
- A nurse must work at least $E_\min$ days at a stretch. To avoid off-on-off patterns so to speak.
- A nurse may work a maximum of $E_\max$ days at a stretch. My suggestion would be: $\sum_{j=t}^{j+E_\max}b_{ij}\le E_\max~\forall i\in I, t\in \{1,\dots,|T| -E_\max\}$
- A break between work sequences must always be exactly 2 days.
How do I model those linear constraints?