STABLE MATCHING

Gale-Shapley algorithm — no blocking pairs

7
2x
The Gale-Shapley algorithm (1962) solves the stable matching problem: given n men and n women each with preference lists, find a matching with no blocking pair — a man and woman who both prefer each other to their current partners. The algorithm is proposer-optimal: men propose in order of preference, women tentatively accept better offers. It always terminates in O(n²) rounds and produces a unique stable matching optimal for the proposing side. The 2012 Nobel Prize in Economics was awarded partly for this result and its applications to medical residency matching and school assignment.