This is a reference page. If you’re new to PlanMyRounds, start with How rosters work and Creating a roster first.
At a glance
Two-phase solver
A fast greedy pass seeds the schedule, then an OR-Tools constraint-programming solver refines it against a weighted objective.
Hard vs. soft constraints
Hard constraints are never violated. Soft constraints are optimised — the engine bends them only when there’s no valid alternative.
Fresh data every run
Doctor profiles, approved leave, and shift definitions are re-read on every generation so the output reflects the latest state.
Full violation report
Every run produces a structured report — hard violations block publishing; soft violations surface as warnings.
Roster inputs
The top-level fields required to start a roster run.Doctor parameters
Every doctor in the roster pool carries the following fields. The engine reads them on every run — keeping doctor profiles up to date is the single biggest lever for better rosters.Identity and eligibility
Leave and availability constraints
The engine pulls a fresh snapshot of leave data on every run.Only leaves with Approved status create hard blocks. Pending or rejected leaves are ignored by the engine — always clear the pending queue before generating.
Shift configuration
Every shift type used in the roster is defined by these fields.Weekly shift configuration
When using the weekly engine, shifts can be configured per day of week:- Monday through Sunday can each carry a different shift list.
- A separate Holiday Shifts set overrides the day-of-week config on public holidays.
- The engine pre-computes metadata: total weekdays, total weekends, coverage percentage, overlaps, and gaps.
Scheduling rules (hard constraints)
Hard constraints are non-negotiable. The engine will not produce an assignment that violates them — if it can’t, generation fails.Soft constraints and fairness optimisation
Soft constraints are optimised, not guaranteed. The engine assigns scores and penalties to guide the solver toward the best achievable outcome.Fairness weights
The engine uses a weighted objective function. Higher weight means higher priority for the solver.Hours balancing
Other soft rules
Violation reporting
After every run, the engine produces a structured violation report. Each violation contains:Hard violations block publishing. Soft violations surface as warnings and do not prevent publishing — you can review and accept them.
Constraint priority order
When the engine encounters conflicts, it resolves them in this exact order.Hard (non-negotiable)
1
No overlapping shifts
A doctor cannot be assigned two shifts on the same day.
2
Approved leave blocks respected
The doctor is fully blocked on approved leave dates.
3
Minimum shift staffing met
Every shift instance reaches
required_doctors.4
Minimum senior staffing met
Every shift instance reaches
min_seniors_required.5
Max consecutive work days respected
No doctor exceeds the configured cap.
6
Min rest days per week respected
Each doctor gets the configured rest days per Monday–Sunday week.
7
Back-to-back duty rules respected
Global setting and shift-pair exceptions are both honoured.
Soft (optimised)
- Total workload fairness (weight 10)
- Shift type balance (weight 3)
- Excluded shift / shift type / weekday preferences (weight 1)
- New doctor grace period
- Min / max hours per month
- Proportional and outlier-based fairness
Solver behaviour
The engine runs in two phases.1
Greedy phase
Assigns senior doctors first, then fills remaining slots using fairness-based ranking. This produces a valid starting solution quickly.
2
OR-Tools optimisation phase
A constraint-programming solver (Google’s OR-Tools) refines the greedy result against the weighted objective function until the time budget is reached or the solver proves optimality.
Solver timeouts
Timeouts scale with the size of the problem.Related reading
How rosters work
The end-user view of the roster lifecycle.
Roster constraints
A friendlier walkthrough of the work, rest, and fairness rules.
Creating a roster
The four-step wizard that feeds these parameters in.
Leave management
How approved leave is treated as a hard constraint.