Skip to main content

Week 8: Stable Matching

Gale–Shapley, and why an algorithm that guarantees stability doesn't guarantee anything else

17 April 2028

Open the slides

The Gale–Shapley algorithm guarantees a stable matching always exists and can be found in finite steps: no two people would both rather be matched to each other than to their current match. It is one of the cleanest results in this entire course, and it is also, deliberately, the last unambiguously good news the semester delivers.

Stability is a narrow guarantee. It says nothing about happiness, fairness of who proposes versus who is proposed to, or what happens after the algorithm terminates. Congratulations — you found a stable match. Now decide who does the dishes.

Stability is also not unique. Run the same preferences with the two sides swapped — whoever was receiving now proposes — and the algorithm still terminates, still produces a stable matching, and very often produces a different one. The side doing the proposing ends up with the best stable outcome available to it, every member of that side, at the same time. That result has a name (proposer-optimality), and it’s the sharpest thing this week’s theorem says, sharper than “stability exists.”

This isn’t a toy result, either. The mechanism behind the U.S. medical residency match — where tens of thousands of doctors and hospitals are matched every year — is Gale–Shapley, adopted specifically because the market it replaced kept collapsing under exactly the “who moves first” pressure this week is about.

Outline

One thing this framework won’t explain

Gale–Shapley proves something sharper than “a stable match exists”: the side that proposes gets the best stable match available to it, every member of that side, simultaneously. Being the proposer isn’t a technical detail — it’s the single biggest determinant of who does better out of an otherwise-fair-sounding “stable” outcome.

The theorem has nothing to say about how a real matching market decides which side plays that role. That’s last week’s gap again, one level up: week 7 couldn’t say who breaks a standoff; this week, whoever a market labels the proposer wins the same way, and the model treats that label as given rather than fought over.

Further reading

Teaching team