Inspiration

Nurse rosters are still often built by hand. First-come-first-served filling produces night-to-day turnarounds, six-day streaks, ignored day-off requests and uneven workloads, all linked to fatigue and burnout. When someone calls in sick, the planner has to reshuffle the week by hand. We wanted a tool that gives a fair, safe roster instantly and can repair it with minimal disruption.

What it does

RosterRx builds a Day / Evening / Night roster for 6-24 nurses over 7-28 days. It enforces coverage, rest rules (no Night to Day/Evening or Evening to Day turnaround) and a 5-day streak limit, grants day-off requests, and splits shifts, nights and weekends evenly. A live dashboard compares the result with a naive first-come roster. On the demo ward (12 nurses, 14 days) rule violations drop from 23 to 0, day-off requests granted go from 21% to 100%, and every nurse works 9-10 shifts with 2-3 nights. Click any worked shift to mark a nurse as called in sick: the roster repairs itself and changes only a few cells (3.5 on average in our stress test; 12 of 12 repairs were rule-compliant).

How we built it

Plain HTML, CSS and JavaScript in a single file, with no dependencies. The roster is a nurses x days grid optimised with simulated annealing: propose a cell change or a same-day swap, always accept improvements, and accept a worse roster with probability exp(-delta/T) while the temperature cools from 40 to 0.05. The energy function is 100 x rule violations + unfairness (variance of shifts, nights, weekends) + ignored requests + over-staffing. Repair warm-starts from the published roster with a penalty per changed cell and reheats automatically if it gets stuck. The annealer is a resumable object so the UI can animate it live, with the energy chart drawn on a canvas. We tested it in headless Chrome across ward sizes and random call-outs.

Challenges we ran into

Our first "naive" baseline was accidentally a legal rotation, which made the comparison meaningless, so we replaced it with a realistic first-come fill. Repair sometimes got stuck with one uncovered slot at low temperature; we added automatic reheating, after which all 12 test repairs succeeded. Truly understaffed wards cannot satisfy the rules, so the app says so honestly instead of pretending.

Accomplishments that we're proud of

Zero rule violations on every feasible case we tested, including a 24-nurse x 28-day ward in about 3 seconds, and a repair feature that keeps disruption to a handful of shifts.

What we learned

Simulated annealing is a great fit for scheduling, because accepting temporarily worse rosters lets the search untangle coverage and rest rules together. Stability penalties matter as much as quality when repairing a roster people already know.

What's next

Skill mix and certifications, contracted hours and leave balances, shift-swap requests between nurses, importing a real ward's rules, and calendar export.

Notes

Track: Healthcare & Environmental. Synthetic data only; this is a prototype, not a certified clinical scheduling product. AI tools disclosure: this project was designed and written with the help of an AI coding assistant (Claude by Anthropic). No third-party libraries or assets are used.

Built With

Share this project:

Updates

Submission history