Employee scheduling
Automated staff scheduling with CP-SAT solver
The employee scheduling problem
Employee scheduling consists of assigning resources to time slots over a given period, while respecting a set of constraints and optimising multiple objectives simultaneously.
This is a classic combinatorial optimisation problem. As the number of resources, time slots, and constraints grows, the number of possible combinations exceeds manual calculation capacity. Conventional tools cannot explore this solution space. The CP-SAT solver does so in minutes.
Google documents this use case with an official employee scheduling example in the OR-Tools documentation.
Modelling
Planopti translates the client's operational data into a mathematical model that CP-SAT can process. The model rests on three components:
- Decision variables
assign[r, d, s]: a boolean variable for each resource/day/slot triplet. If the variable equals 1, the resource is assigned to that slot on that day - Rest variables
is_off[r, d]: a boolean variable indicating whether the resource is off - Counting variables:
total_minutes[r],total_off_days[r],shifts_per_type[r, t]for volume tracking and balancing - Objective function: a weighted sum of penalties that the solver seeks to minimise
For a real-world problem, this can represent more than 100,000 boolean variables and several thousand constraints. The solver also manages gap variables (min/max per group) and penalty variables for soft objectives.
Constraints
The solver manages two types of constraints:
Hard constraints (inviolable): rules that can never be broken. If no solution satisfies all of them, the solver returns an INFEASIBLE status.
Soft constraints (penalised): objectives the solver seeks to satisfy as best it can. Each violation generates a penalty in the objective function. The higher the penalty, the higher the objective's priority.
Constraints are configurable. The client defines their own business rules, thresholds, and priorities. The solver encodes them automatically into the model.
Fairness
Fairness is a central objective in employee scheduling. The solver minimises workload gaps between resources within the same group:
- Fair distribution of workload within each group
- Fair distribution of shift types among qualified resources
- Grouping rest periods to avoid fragmentation
Fairness is measured and optimised by the solver, not approximated. The result is a minimal gap, mathematically proven.
Interface
Planopti provides a web interface allowing the scheduling manager to handle the entire process: data entry, launching optimisation, viewing results, and manual adjustments.
The result generated by the solver is not fixed. The manager can modify assignments, relaunch the solver with new constraints, and export the final result. All operations are traced.
Deployment
Planopti is deployed on-premise on the client's infrastructure. No data leaves the network. See our technology page for deployment details.
Ready to optimise your scheduling?
Tell us about your operation. We will show you how constraint programming can solve your specific challenges.