Solvicus
All posts

Blog

Staff Scheduling Optimization: A Worked Example

Staff scheduling looks simple until you write down every rule it actually has to satisfy. Take a mid-sized medical practice: 15 physicians, a handful of exam rooms, a few pieces of specialized equipment, and a week of patient demand to cover. Ask anyone who has built that roster by hand or in a spreadsheet, and they'll tell you it takes hours — and the result is still full of avoidable idle time, last-minute swaps, or accidental labor-law violations.

The problem, precisely stated

A scheduling problem like this has three layers of input:

The objective is straightforward to state and hard to hand-solve: minimize patient wait time and physician idle time, while never violating a hard constraint — a rest period, a room's equipment requirement, a qualification mismatch.

Why this is a mixed-integer program

Every assignment here is a yes/no decision — physician X is or isn't in room Y during time slot Z — which puts this squarely in mixed-integer programming territory. A typical formulation uses a binary variable for every (physician, room, time slot) combination, hard constraints that forbid double-booking a physician or a room, that require an ultrasound-certified technician whenever the ultrasound room is booked, and that enforce minimum rest between shifts — with an objective that penalizes idle gaps and patient wait time.

Why spreadsheets and heuristics break down

A spreadsheet or a simple greedy heuristic (“assign the next available physician”) can produce a valid roster, but it has no way to prove there isn't a materially better one — and at 15 physicians across a week, the number of valid combinations is far too large to check by hand or improve by intuition. A solver searches that entire space and returns the schedule that is provably as good as the constraints allow.

Try it yourself

This is one of the illustrative use cases we build dedicated solvers for — see the full write-up, required inputs, and an example agent prompt on the Multi-Resource Shift & Scheduling Optimization page. If you have a similar resource-allocation problem today, our general-purpose Linear & Integer Programming solver is available now — create a free account to try it.