To the author: what is the algorithmic approach to determine a schedule?<p>Once you add a couple of constraints or complications (e.g. can't be on-call two nights in a row, or on-call weekends count 1.5x because they are more "painful"), it quickly becomes a fairly general constraint satisfaction problem. This is a field with deep mathematics involved and decades of academic literature. As far as I know, reaching the state-of-the-art is extremely hard, and it is usually advised to use an off-the-shelf solver (a SAT [1] solver, or a constraint-programming solver like Gecode [2], or something more specific like OptaPlanner/TimeFold [3]).<p>If in addition you introduce happiness and/or fairness maximization, then you may want optimality guarantees, and then you need a full-blown MIP solver (which means slower solves, and the faster MIP solvers are expensive).<p>That said, the model used here seems to have a special structure, so a custom (greedy?) algorithm may make sense. Any pointer for more details on the model?<p>[1] <a href="http://www.satcompetition.org" rel="nofollow">http://www.satcompetition.org</a><p>[2] <a href="https://www.gecode.org" rel="nofollow">https://www.gecode.org</a><p>[3] <a href="https://timefold.ai/" rel="nofollow">https://timefold.ai/</a>