Employee scheduling
Automated staff scheduling with the CP-SAT solver. In plain terms: every rule is checked for every person, every day of the month, and the roster is ready in minutes.
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.
The data required
A roster calculation rests on four sets of data, which every operation already holds, most often in Excel files.
- People: name, contract type, qualifications held, contractual hours, and optionally the group or team they belong to.
- Positions: start and end times, breaks, required qualification, and paid duration.
- Demand: how many people on each position, each day of the month.
- Unavailability: approved leave, training, fixed rest days, ongoing sick leave.
None of this data is new. The difference is that it stops being spread across several files kept by several people, and becomes a single coherent calculation input.
When the problem has no solution
Sometimes no roster satisfies every rule. The solver then returns an infeasible status and produces nothing, rather than returning a roster that would break a rule.
That case is more useful than it sounds. It means your rules and your headcount contradict each other that month: too many positions to cover for too few available people, or a rest constraint incompatible with the shift structure.
It is information manual building never gives. By hand, a roster always comes out in the end: gaps get filled by accepting a breach, often without formalising it. The calculation asks the question openly before publication, which leaves time to decide: reinforcement, accepted overtime, or a revised requirement.
The planner's role after the calculation
The roster produced is not frozen, and is not meant to be. It covers the rules we managed to write down, not the ones nobody ever formulated.
The planner reviews it, then adjusts what only they know: a personal situation, a preference never put in writing, an arrangement between two colleagues. Every manual change is re-checked by the engine, which immediately flags it if it breaks a hard rule.
That is the part of the trade that does not automate, and precisely the part with the most value. The calculation handles the combinatorics; the planner keeps the knowledge of people and the responsibility for the published roster.
Deployment
Planopti is employee scheduling software, on-premise or hosted, your choice. In local mode, no data leaves your 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.