π§© Constraint Solving POTD:Nurse Rostering β Scheduling Under Hard Constraints #23705
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Constraint Solving β Problem of the Day. A newer discussion is available at Discussion #23894. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Daily problem from the constraint solving world β 2026-03-31 Β· Category: Scheduling
Problem Statement
A hospital must assign nurses to shifts over a planning horizon (typically one to four weeks). Each shift is one of Day (D), Evening (E), or Night (N), and there is also an Off (O) option. Nurses have different skill levels, contracts, and personal preferences. The scheduler must respect hard rules (safety, labor law) and optimize soft objectives (fairness, preference satisfaction).
Concrete Instance (5 nurses, 7 days)
Objective: minimise
Ξ£ penalty_k * violation_k(LP relaxation provides a lower bound).Trade-offs: MIP solvers (Gurobi, HiGHS, CPLEX) provide proven optimality gaps and excellent LP relaxation bounds. However, modeling complex sequential patterns requires many auxiliary binary variables, which can slow root-node LP solve. MIP typically outperforms CP on large, loosely-constrained instances.
Approach 3 β Local Search / Metaheuristics
Start from any feasible (or near-feasible) assignment and iteratively improve by applying moves:
Used in practice (e.g., simulated annealing, tabu search) for very large instances where exact methods time out. Trade-off: no optimality guarantee, but can find good solutions quickly for 500+ nurses.
Example Model β MiniZinc (CP)
Key Techniques
1. Global Constraints for Sequences
The
regular(orautomaton) global constraint in CP can encode any forbidden shift pattern expressible as a DFA. For nurse rostering, this is used to enforce rules like "no more than 3 consecutive nights" or "at least 2 days off after a night block" in a single, efficiently propagated constraint β far more scalable than individual binary constraints.2. Column Generation (MIP)
For large instances, a DantzigβWolfe decomposition treats each nurse's complete weekly pattern as a column. The master problem selects a set of patterns (one per nurse) satisfying coverage. The pricing subproblem (a shortest-path or CP sub-problem per nurse) generates improving patterns. This dramatically reduces the MIP size and often finds high-quality solutions quickly.
3. Symmetry Breaking
Nurses with identical skill profiles and contracts are interchangeable. Adding lexicographic ordering constraints (e.g.,
roster[1] β€_lex roster[2]for equivalent nurses) eliminates symmetric solutions and can reduce search by orders of magnitude.Challenge Corner
References
Beta Was this translation helpful? Give feedback.
All reactions