MOHITH GAJJELA
FIELD / 05
CONSTRAINED MATCHING · LICENSED SUPPLY

Matching patients to providers
who can actually see them.

A provider can only see you with a licence in your state, your insurance, your language and an open slot in time. The solver below books a thousand people in your browser and fits in more of them than taking the first open slot.

CERTIFIED OPTIMAL MIN-COST FLOW  ·  DUAL CERTIFICATE ON EVERY RESIDUAL ARC  ·  FAIRNESS FRONTIER VIA CONVEX CAPACITY TIERS  ·  ONLINE PRIMAL-DUAL BID PRICES  ·  SHADOW PRICES FOR LICENCE PLANNING  ·  NO SOLVER LIBRARY  ·  CERTIFIED OPTIMAL MIN-COST FLOW  ·  DUAL CERTIFICATE ON EVERY RESIDUAL ARC  ·  FAIRNESS FRONTIER VIA CONVEX CAPACITY TIERS  ·  ONLINE PRIMAL-DUAL BID PRICES  ·  SHADOW PRICES FOR LICENCE PLANNING  ·  NO SOLVER LIBRARY  · 
01THE BOARD

Watch it seat
a thousand people.

People on top, open slots below. Press run and the solver books them. Orange threads are moves that bump an existing booking to free a contested slot.

SLOTLINE · LIVE SOLVE
loading…
100%
100%
400
5x
RESULT · 0 / 0 STEPS · 0 SEATED
DUAL CERTIFICATE
acute elevated routine open slot nobody could see them orange thread = a booking was moved to make room

Hover any square in the demand band to see who that person is, what plan they carry, how long they will keep looking, and who ended up seeing them.

02WHAT OPTIMALITY BUYS

Four policies,
one calendar.

Every curve below is computed in this page, on the instance currently loaded above. Move the supply dial and they all move with it. The gap between first-available and optimal is not a rounding error: it is dozens of people who never get an appointment, out of exactly the same set of openings.

WAIT-TIME DISTRIBUTIONLIVE

How quickly each policy gets people in the door. Higher and further left is better. The dashed line is 72 hours.

STABILITY VS THROUGHPUTLORENZ, LIVE

How evenly the work lands across providers. The dashed diagonal is perfect equality. Fairness tiers pull the curve toward it at a cost you can read off the next chart.

PRICE OF STABILITY
0
blocking pairs under deferred acceptance, which is stable by construction. The optimal matching has some, and seats more people.
SEATS GAINED
—
people the optimal matching seats that first-available does not, from identical supply.
COST OF GREEDY
—
how much worse the first-available objective is than the certified optimum.
SOLVE TIME
—
for the instance on screen, in your browser, single threaded.
03THE FAIRNESS FRONTIER

Spreading the work out
is nearly free.

Pure cost minimisation piles clients onto whichever providers happen to be cheapest to reach, and leaves others with an empty fortnight. Splitting each provider's capacity into tiers with rising marginal cost fixes that, and because the cost is convex the problem is still an exact min-cost flow, not an approximation. Every point on this curve is certified optimal for its own objective.

COST PAID VS INEQUALITY REMOVEDLIVE SWEEP

Each point is a full re-solve at a different fairness weight. The bend is the whole finding: most of the inequality disappears long before the cost does.

ONLINE, ONE ARRIVAL AT A TIMELIVE

Nobody gets to see next week's demand before answering today's. These policies decide on arrival. Bid prices come from the duals of a forecast instance: same providers, resampled demand, so nothing is learned from the run being graded.

04WHERE THE NEXT LICENCE GOES

The dual prices already
know where supply is short.

Solving the market once produces more than a matching. It produces a price on every dated opening, which is zero where capacity is slack and positive where it binds. Aggregating those prices by state and insurance plan ranks every possible expansion without re-solving anything. The bars below check that ranking by actually re-solving each candidate with new providers added.

EXPANSION PLANNER
rank correlation predicted vs re-solved: —  ·  best candidate sits at: —
8

In the offline harness the same ranking was graded against 60 candidate expansions, each re-solved three times with independently drawn new providers. The head of the ranking is what matters, and it holds: the single best expansion in the whole candidate set lands inside the dual ranking's top five, found for the price of one solve instead of one hundred and eighty.

One more wrinkle, and it is the kind that bites in practice. Scoring candidates against a single draw of demand picks a different winner than scoring them against several. The cell that looks best on one quarter's demand is not the cell that is best on average, so the harness re-scores the shortlist across independent demand scenarios and takes the one that wins on average instead.

05AT FULL SCALE

Same result,
four times the market.

The instance in your browser is deliberately small enough to re-solve on every slider drag. The offline harness runs a market four times the size, and the ordering does not change.

POLICYSEATEDWITHIN 72HGINIBLOCKING PAIRSGAP TO OPTIMAL

Optimality is not asserted, it is certified: . A feasible flow is optimal exactly when no residual arc has negative reduced cost under the node potentials, and that condition is checked arc by arc after every solve on this page.

06METHOD

How it is built,
and how I know it is right.

The market is a flow network, not a scoring problem

Source to person, person to a dated opening they are actually eligible for, opening to provider, provider to sink. Being unmatched is an explicit priced arc rather than an infeasibility, so the solver is always choosing who to leave out rather than failing. Licence, plan, language and modality are hard constraints that decide whether an arc exists at all; wait, clinical focus, identity request and time of day are priced into its cost.

Successive shortest paths with Johnson potentials

Hand written, no solver library, no matrix library. Potentials keep every reduced cost non-negative so Dijkstra stays valid across iterations, and the early exit on the sink is made safe by clamping the potential update at the sink distance. A single augmentation can cascade: the longest one on this instance reroutes nine existing bookings to free one contested slot.

Optimality is proved, not assumed

After every solve the engine walks every residual arc and checks complementary slackness. Zero negative reduced costs means no cheaper assignment exists, full stop. This runs on the instance in your browser too, which is why the certificate panel updates when you move the dials.

Two implementations, two languages, two algorithms

A Python reference re-implements the feasibility rules and the cost model from the written spec and solves the flow with a queue-based Bellman-Ford instead of Dijkstra with potentials. On the shipped instance both land on objective 860,015 and seat the same 869 people. For a bug to survive that it would have to exist identically in both.

The stability checker checks itself

Deferred acceptance is stable by construction, so a correct blocking-pair counter must report exactly zero for it. It does. That is what makes the count for the optimal matching meaningful: it is the real, measured price of optimising throughput rather than stability.

Nothing is tuned on the run it is graded on

The online policies' prices come from a forecast instance built on the same providers with resampled demand. The exponential penalty weight is chosen on that forecast too. The graded instance is only ever solved, never fitted to.

Everything here is synthetic and seeded. There are no real people in this data and nothing resembling a medical record: the instance generator draws states, plans, presenting needs and calendars from published population weights and writes the whole thing to a file you could regenerate yourself.

SLOTLINE · FIELD 05 · back to the instruments · MOHITH GAJJELA
Home