Gale–Shapley algorithm
Algorithm for stable matching, used in medical residency matching.
The Gale–Shapley algorithm, also known as the deferred acceptance algorithm, propose-and-reject algorithm, or Boston Pool algorithm, is a method for solving the stable matching problem. The algorithm pairs equal numbers of participants of two types based on preferences, ensuring no pair mutually prefers each other over their assigned match.
- field
- Mathematics, economics, computer science
- known_for
- Stable matching problem and the Gale–Shapley algorithm
- publication_venue
- The American Mathematical Monthly
Lore & Background
The algorithm involves rounds where unmatched participants of one type propose to the next on their preference list; each proposal is accepted if the recipient prefers it to their current match. The procedure is a truthful mechanism for proposers, giving them their most-preferred stable pairing, while recipients receive their least-preferred stable pairing. The algorithm runs in time quadratic in the number of participants, or linear in input size.
Reader's Guide
The Gale–Shapley algorithm is significant for providing a theoretical foundation to the stable matching problem, which had been used in practice for years, notably by the National Resident Matching Program. Alvin E. The algorithm has widespread real-world applications, including matching American medical students to residencies and French university applicants to schools. It guarantees a stable matching that is optimal for the proposing side and worst for the receiving side, and a reversed form produces the opposite optimality. Its efficiency and correctness have made it a cornerstone of matching theory and practical resource allocation.
Did You Know?
- The algorithm is a truthful mechanism for the proposing participants, who receive their most-preferred stable pairing.
- It can be implemented to run in time quadratic in the number of participants, or linear in input size.
Origins, Recognition, and a Posthumous Honor
The procedure is also known by several other names—deferred acceptance, propose-and-reject, and the Boston Pool algorithm—reflecting its diverse intellectual and practical lineage. Gale, who had passed away before the award was announced, was widely acknowledged as the person who would have shared the honor as a third co-recipient had he still been living. The episode underscores how a practical tool can outpace its own mathematical justification by a full decade.
The Round-by-Round Dance and Its Built-in Asymmetry
At its heart, the algorithm proceeds in successive rounds. In each round, every participant on the proposing side who is still unmatched extends an offer to the next name on their personal preference list. The recipient then compares the incoming offer against whoever they are currently paired with; if the new proposal is more appealing, they switch, and the previously matched participant becomes unmatched again. This cycle repeats until every position is filled or every preference list is exhausted. A striking feature of the design is its inherent asymmetry. For the proposing side, the mechanism is truthful: each proposer ends up with the best possible partner that any stable matching could deliver. The receiving side, by contrast, is guaranteed the worst stable outcome available to them. Despite this asymmetry, the procedure is computationally efficient—its running time scales quadratically with the number of participants and linearly with the total size of the preference data, making it practical even for large-scale matching markets.
From Hospitals to Universities: A Global Workhorse
The algorithm's influence extends far beyond the mathematics classroom. Its most celebrated application is the matching of American medical students to hospital residencies, a process that has relied on the procedure since the early 1950s under the name "Boston Pool algorithm" within the National Resident Matching Program. The fact that this critical healthcare infrastructure was operating on the algorithm a full ten years before Gale and Shapley provided the formal proof of correctness highlights how deeply embedded the method is in practical systems. Beyond medicine, the same logic governs the assignment of French university applicants to their preferred schools, illustrating that the technique generalizes across countries and sectors wherever two-sided preferences must be reconciled. Alvin E.
Defining Stability and the Troubling Marriage Metaphor
The problem the algorithm solves is deceptively simple to state: given equal numbers of two groups of participants, each holding a ranked list of the other group, find a pairing in which no two individuals would both prefer to be matched with each other rather than with their assigned partners. The problem is often called the "stable marriage problem," a framing that casts the two groups as men and women exchanging proposals. However, this metaphor has drawn sustained criticism. Scholars have pointed out that it is not only sexist in its gendered language but also misleading in substance: the mechanical steps of the algorithm—blind sequential proposals, immediate acceptance or rejection—do not correspond to how people actually negotiate partnerships, whether in marriage or otherwise. The metaphor obscures more than it illuminates about the algorithm's true structure.
Frequently Asked Questions
What is the Gale–Shapley algorithm?
It is a matching procedure that pairs two equal-sized groups so that no two participants would both prefer each other over their assigned partners. It is also widely called the deferred acceptance algorithm or the propose-and-reject algorithm.
How does the Gale–Shapley algorithm actually work?
One side repeatedly proposes to its most-preferred still-available partner, and each recipient tentatively holds the best offer while rejecting the rest. The propose-and-reject loop continues until every participant on both sides is locked into a stable pair.
More in Algorithms And Data Structures 25-38
Elsewhere in the Algorithms And Data Structures universe
Spotted an error? Know more?
This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record
