This site helps schedule a roster of employees for a one-per-day shift in an optimal way.
Specifically, the schedule minimizes the difference between the person with the highest number of (weighted) shifts and the person with the lowest number of (weighted) shifts, subject to the following constraints
- One employee per day
- Enforce all exemptions
- Weight certain days higher (e.g. weekends)
- No more than one shift in a K-day window
- Include the previous month in the tally of shifts and K-day windows
In technical terms, define $x_{ij}$ as a binary variable indicating whether employee $i$ pulls duty on day $j$. Then,
$$
\begin{align*}
\text{min}_x \ \ \ &s_{max} - s_{min} \\
\text{s.t.} \ \ \ &\sum_i x_{ij} = 1 \ \forall j \\
&\sum_j x_{ij} \leq s_{max} \ \forall i \\
&\sum_j x_{ij} \geq s_{min} \ \forall i
\end{align*}
$$