π§© Constraint Solving POTD:Problem of the Day: Nurse Rostering β Staff Scheduling Under Constraints #50541
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 #50836. |
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.
Problem Statement
Nurse Rostering is the problem of assigning nurses to shifts over a planning horizon while satisfying complex constraints on coverage, fairness, and regulations.
Concrete Instance
Consider a small hospital unit with:
Constraints:
Goal: Find a feasible assignment, or if multiple solutions exist, optimize for fairness (equal shift distribution).
Why It Matters
Healthcare scheduling: Hospitals must staff emergency departments, ICUs, and wards 24/7 while respecting union contracts and nurse preferences.
Retail and service industries: Large retailers use rostering to manage customer-facing staff across multiple locations, times, and skill levels.
Emergency services: Fire, police, and paramedic units must maintain coverage while adapting to variable demand and complex rest rules.
Call centers: Large operations schedule agents across shifts, languages, and skill specializations to meet service-level agreements.
Modeling Approaches
Approach 1: Constraint Programming (CP)
Decision variables:
assignment[n, d, s] β {0, 1}for each nursen, dayd, shifts1if nursenworks shiftson dayd, else0Key constraints:
β_n assignment[n, d, s] β₯ 2(at least 2 nurses per shift)β_{d,s} assignment[n, d, s] β€ 5(max 5 shifts per nurse per week)assignment[n, d, Night] = 1for more than 2 consecutive daysassignment[N1, 3, *] = 0andassignment[N1, 4, *] = 0Objective: Minimize max deviation in shift counts per nurse
Strengths: Native support for global constraints (e.g.,
cumulative,automatonfor consecutive patterns), automatic propagation.Trade-offs: Less flexible for dynamic pricing or objective refinement; typically slower on very large instances without good search heuristics.
Approach 2: Mixed-Integer Programming (MIP)
Decision variables:
x[n, d, s] β {0, 1}for each nursen, dayd, shifts(same as above)y[n] β₯ 0for fairness slack (deviation from average shifts per nurse)Key constraints:
β_n x[n, d, s] β₯ 2β_{d,s} x[n, d, s] β€ 5z[n, d]and enforceβ_d x[n, d, *] β€ avg_shifts + y[n]andβ_d x[n, d, *] β₯ avg_shifts - y[n]Objective: Minimize
β_n y[n](total slack) ormax_n y[n](largest deviation)Strengths: Efficient solvers (CPLEX, Gurobi) can handle large instances; easy to add cost-based objectives.
Trade-offs: Linearizing complex constraints (consecutive patterns, disjunctive scheduling) requires auxiliary variables and big-M bounds, which can weaken LP relaxations.
Example Model (Pseudo-code: CP-based)
Key Techniques
1. Global Constraints for Temporal Patterns
Nurse rostering involves forbidden patterns (e.g., 3+ consecutive nights). The
automatonconstraint encodes these patterns as a finite state machine, enabling efficient propagation. Alternatively,cumulativeconstraints enforce capacity limits across overlapping time windows.2. Symmetry Breaking and Heuristics
Nurse identities are often interchangeable (symmetry). Heuristics like least-flexible-first (assign nurses with fewer available slots first) and largest-weighted-degree reduce the search space by identifying critical decisions early. Breaking symmetry with constraints like "N1 always works at least as many shifts as N2" prunes equivalent branches.
3. Column Generation and Relaxation
Large rostering instances use set-covering formulations: each column represents a feasible individual nurse schedule, and the master problem selects a subset to cover all shifts. The subproblem (pricing problem) identifies new columns via dynamic programming or CP.
Challenge Corner
Question for you: In the basic model above, fairness is measured by deviation in total shifts. But in practice, nurses prefer specific shifts (some prefer nights, others prefer mornings). How would you modify the model to encode individual preferences? Can you introduce soft constraints that reduce preference violations without making the problem infeasible?
References
Rossi, F., van Beek, P., Walsh, T. (2006). Handbook of Constraint Programming, Ch. 22 (Scheduling). Elsevier. A comprehensive reference for CSP modeling of scheduling problems.
Gendreau, M., Potvin, J.-Y. (2010). "Handbook of Metaheuristics", Ch. Nurse Scheduling. Springer. Covers local search and tabu/genetic approaches to rostering.
Cheang, B., Lim, A., Rodrigues, B. (2003). "Nurse Rostering Problems β Complexity and Potential Solutions in the Era of the Internet." Journal of Scheduling, 6(4), 327β337. A definitive problem characterization.
Gurobi.com/rostering: (www.gurobi.com/redacted) β Practical solver documentation and benchmarks for MIP formulations.
All reactions