Every year, thousands of medical students in the United States submit a ranked list of hospital residency programs, and each hospital ranks the applicants it would like to hire. A computer then finds the best possible assignment. The algorithm behind it — Gale-Shapley stable matching — runs in linear time and always finds a perfect stable matching when everyone is single.
A stable matching is one where no doctor and hospital both prefer each other to their current assignment. If such a blocking pair existed, they would defect, so stability is the natural fairness criterion.
But many medical students are couples — two doctors who want to train in the same city. They submit a joint ranked list of pairs of programs: "we would both go to Hospital A and Hospital B, or both to Hospital C and Hospital D, …". One partner cannot accept a position unless the other also has one nearby.
That single, reasonable constraint changes everything. Eitan Ronn proved in 1990 that deciding whether a stable matching even exists — let alone finding one — becomes NP-complete the moment couples enter the picture. The elegant linear-time algorithm breaks, and in the worst case no stable assignment exists at all.
This is not a theoretical curiosity. It is the real thorn inside the National Resident Matching Program (NRMP), the system that places 40,000+ doctors annually. Related work on stable matching and NP-completeness illuminates why this matters.
Comments
Loading comments...