Schedule optimization means searching through possible schedules for the one that breaks no hard rule and has the lowest total penalty for the soft rules it bends. A solver is the program that does the searching. It has no judgment about medicine, fairness or your group. It does arithmetic on the rules and weights you give it, very quickly, over more candidates than a person could look at in a lifetime.
You don’t need the mathematics to use one well. You do need the vocabulary, a feel for what the search is doing, and a few ways to check the result.
A seven-day example you can do by hand
Three physicians, A, B and C. One shift a day for one week, Monday to Sunday. Seven slots to fill.
The rules:
- Hard: nobody works more than three shifts in the week.
- Soft, weight 5: C asked for Wednesday off.
- Soft, weight 3: nobody works three days in a row. Each run of three costs 3.
- Soft, weight 2: nobody works both Saturday and Sunday.
Here are three candidate schedules, listed Monday through Sunday.
Candidate one: A, A, A, B, B, C, C. A works three in a row, which costs 3. C works both weekend days, which costs 2. Total penalty: 5.
Candidate two: A, B, C, A, B, C, A. C is working on the Wednesday she asked off, which costs 5. No runs of three, and the weekend is split. Total penalty: 5.
Candidate three: A, B, A, C, B, C, A. A works Monday, Wednesday and Sunday. B works Tuesday and Friday. C works Thursday and Saturday. Nobody exceeds three shifts, C has Wednesday off, nobody works three in a row, and Saturday and Sunday go to different people. Total penalty: 0.
There’s also A, A, A, A, B, C, B, which looks tidy and is thrown out immediately, because A has four shifts and that breaks the hard rule. It never gets a score.
That’s the whole idea. A solver generates candidates, discards any that break a hard rule, adds up the penalties on the rest, and keeps the lowest.
Why you can’t do this by hand for a real quarter
In the toy, each of seven slots can go to any of three people. That’s 3 multiplied by itself seven times, or 2,187 possible schedules.
A real group of 14 physicians filling five shifts a day for a 90-day quarter has 450 slots. If any of the 14 could take any slot, the number of possible schedules is 14 multiplied by itself 450 times. Written out, that number has more than 500 digits.
Nearly all of those are useless: one physician working every shift, or someone working two shifts at once. But there’s no shortcut that lists only the sensible ones. The solver’s real work is avoiding the useless regions without visiting them, by using the rules themselves to rule out huge groups of candidates at a stroke. If Dr. A is on Tuesday night, every schedule that also has her on Wednesday morning can be dropped together, unseen.
A scheduler building by hand does the same thing by instinct, placing the hardest shifts first and never considering most combinations. The difference is that a person finds one acceptable schedule and stops. A solver keeps going after it has found a legal schedule, looking for a cheaper one.

Schedule optimization vocabulary
Variable. One decision the solver has to make. In scheduling, that’s usually “does this physician work this shift on this date, yes or no.”
Hard constraint. A rule that can’t be broken. A schedule that breaks one is discarded, however good it is otherwise.
Soft constraint. A rule that can be broken at a price. The price is its penalty weight.
Objective. The number the solver is trying to make as small as possible: the sum of all penalties incurred. This is the schedule’s score. If you’re setting weights, the post on hard rules, soft rules and penalty weights covers how.
Feasible. A schedule that satisfies every hard constraint. Candidates one, two and three above are all feasible. The fourth isn’t.
Infeasible. Used of a problem, it means no schedule exists that satisfies all the hard rules at once. If coverage requires 450 shifts and the contracts add up to a maximum of 430, the problem is infeasible and no amount of searching will help.
Optimal. The feasible schedule with the lowest possible score. Proving a schedule is optimal means showing nothing better exists, which can take far longer than finding it.
Time limit. How long the solver is allowed to search. Most improvement tends to come early, and later gains get smaller and slower.
What a solver can’t do for you
It can’t choose the weights. If a denied day-off request costs 5 and a third weekend costs 4, the solver will happily give someone a third weekend to grant someone else’s day off. Whether that’s right is a decision about your group, and the solver has no opinion.
It can’t follow rules that aren’t in the rulebook. If you never told it that Dr. H.R. shouldn’t work nights before her clinic day, it will schedule her for exactly that, and the schedule will still score perfectly.
It can’t fix an infeasible rulebook. If the hard rules contradict each other, the answer is “no schedule exists.” The useful response is to find which rules collide and relax one, usually by turning a hard rule into a heavily weighted soft one.
And it can’t see fairness you haven’t measured. A solver minimizing total penalty will accept one physician absorbing 30 points of bad luck if that saves 31 points spread across everyone else. If you care about the worst-off individual, that has to be a rule too, such as a penalty that grows faster the further any one person drifts from target.

Four ways to check the output
You shouldn’t have to trust a solver. Each of these tests is quick, and together they fit in an afternoon.
- Count the hard rules yourself. Pick three physicians and verify their shift totals, night caps and rest intervals by hand. A solver with correct rules won’t break them, so if you find a break, a rule was entered wrong.
- Find the worst-off person. Look at the score broken down by physician and read the schedule of whoever carries the most penalty. If their quarter looks unreasonable to you, the weights need work, even if the total is low.
- Move one weight and re-run. Double the weight on weekend equity and build again. Weekend counts should tighten and something else should get slightly worse. If nothing changes, that rule wasn’t limiting anything. If the schedule changes wildly, two rules are fighting and you should find out which.
- Score a hand-built schedule under the same rules. Take last quarter’s schedule, the one a person made, and price it with the same weights. Then put the two side by side. Where the hand-built one scores better on some rule, ask why. Often the scheduler was honoring something the rulebook doesn’t contain yet.
The third test is the reason run time matters in practice. Tuning weights is a loop: change a number, build, look, change it again. With generator runs that take most of an hour, you get a handful of tries in a working day and tend to settle for the first schedule nobody objects to. When a build is quick, the same day holds dozens of what-ifs.
Where the judgment stays
Everything a solver produces follows from the rulebook. A fair schedule comes from fair rules with sensible weights, and an odd schedule nearly always traces back to a rule that’s missing, misweighted or entered wrong.
So the scheduler’s work moves from placing shifts to writing rules, choosing weights and reading results. ShiftAccord splits that work in two: a solver that builds the schedule, and a separate exact scorer that prices any schedule rule by rule, whether the solver made it or you did.



