Algorithm Search⌘K

Problemadvanced

Stable matching with couples

Also called hospitals-residents with couples.

Stable matching of doctors to hospitals in which couples rank pairs of positions. A stable matching may not exist and the problem is NP-complete.

Stable matching with couples is the hospitals-residents problem in which some residents apply as couples and rank pairs of positions, one for each partner, so that they can live in the same area. This one change destroys the good properties of the problem without couples: a stable matching may not exist, deciding whether one exists is NP-complete, and the rural hospitals theorem and the lattice of stable matchings no longer apply. The problem is close to the stable roommates problem, which also may have no stable matching, but there the cause is one set of agents on both sides, while here it is the joint preference of two residents. The American medical match has let couples apply together for decades, with heuristic algorithms that work well in practice.

In plain words

Doctors look for training positions and hospitals pick doctors. When two doctors are a couple, they want positions that fit together, for example two jobs in the same city. They give one joint list of pairs of jobs. A couple may accept a pair of jobs only together, and it may prefer to stay together without jobs over taking two jobs far apart. This joint wish acts like a need for two goods at once. Because of it, every way to assign the doctors can be unstable: someone always wants to move, and the move makes someone else want to move. Also, checking if a stable way exists is a very hard computational problem. In real markets with few couples, a stable way is usually found.

Definition

An instance has a set of hospitals, each with a capacity qhq_h and a strict order over the residents it finds acceptable, and a set of residents. Some residents are single, with a strict order over acceptable hospitals. The others are grouped into couples (c,c′)(c, c'). A couple has a strict order over the pairs (h,h′)(h, h') in which hh is a hospital or "unmatched" for cc and h′h' is a hospital or "unmatched" for c′c'; the pair (unmatched, unmatched) is the outside option, and pairs below it are unacceptable.

A matching assigns residents to hospitals within capacities, with each single resident at an acceptable hospital or unmatched and each couple at an acceptable pair or unmatched. Say that hospital hh would admit resident rr if hh finds rr acceptable and either has a free position or prefers rr to one of its residents. A matching is stable (in the sense of Roth 1984) when no one blocks it:

  • no single resident rr and hospital hh such that rr prefers hh to her assignment and hh would admit rr;
  • no couple (c,c′)(c, c') and pair (h,h′)(h, h') that the couple prefers to its assignment such that each named hospital would admit its member, keeping the partner's current position if only one member moves, and admitting both if h=h′h = h';
  • no hospital that is assigned an unacceptable resident, and no couple at an unacceptable pair.

The decision problem asks whether a stable matching exists; the search problem asks for one. Other papers use slightly different definitions of stability, which differ in how a couple that moves frees its old positions.

Variants

  • Responsive couples. If the couple's joint order agrees with two separate individual orders (a pair improves when one member's hospital improves and the other's stays), stable matchings exist (Klaus and Klijn 2005); in effect the couple behaves like two singles.
  • Couples who must be at the same hospital. Each couple ranks hospitals for both members together.
  • Short lists and bounded capacities. McDermid and Manlove (2010) showed that the problem stays NP-complete under strong restrictions on the lengths of the lists, and gave polynomial algorithms for some special cases.

Examples

All capacities are 1. The couple (c1,c2)(c_1, c_2) accepts only the pair (h1,h2)(h_1, h_2): c1c_1 at h1h_1 and c2c_2 at h2h_2. The single resident ss ranks h1h_1 above h2h_2. Hospital h1h_1 ranks c1c_1 above ss, and hospital h2h_2 ranks ss above c2c_2.

matching blocked by
couple at (h1,h2)(h_1, h_2), ss unmatched ss and h2h_2: ss wants h2h_2, and h2h_2 prefers ss to c2c_2
ss at h1h_1, couple unmatched the couple and (h1,h2)(h_1, h_2): h1h_1 prefers c1c_1 to ss, and h2h_2 is free
ss at h2h_2, couple unmatched ss and h1h_1: ss prefers h1h_1, and h1h_1 is free
everyone unmatched ss and h1h_1

These are all the matchings, so no stable matching exists. Each step of a deferred acceptance run moves to the next row of a cycle: the couple displaces ss at h1h_1, ss displaces c2c_2 at h2h_2, the couple then gives up both positions, and ss goes back to h1h_1.

Known algorithms

  • Roth-Peranson algorithm. The medical match since 1998 uses an applicant-proposing deferred acceptance algorithm that processes couples by withdrawing and re-entering applicants as needed. It may cycle in principle, so it has no guarantee, but in the computations of Roth and Peranson (1999) on the match data it found stable matchings.
  • Exact search. Integer programming, constraint programming and SAT models solve small and medium instances exactly or prove that no stable matching exists. Their running time is exponential in the worst case.
  • Brute force. Trying all matchings decides existence in exponential time; the problem is in NP because stability of a given matching is checked in polynomial time.

Bounds

  • Deciding whether a stable matching exists is NP-complete (Ronn 1990). It is in NP because checking every possible blocking resident or couple with every hospital or pair of hospitals takes polynomial time.
  • The problem stays NP-complete with severe restrictions on the lists (McDermid and Manlove 2010).
  • In large random markets, stable matchings exist with high probability when there are few couples. Kojima, Pathak and Roth (2013) proved this when the number of couples grows slowly relative to the market, and Ashlagi, Braverman and Hassidim (2014) sharpened the condition on the number of couples.

Reductions

Applications

The American National Resident Matching Program lets couples rank pairs of positions, because couples who could not do so tended to find jobs outside the match. Roth (1984) pointed out that stable matchings may not exist with couples. The redesign by Roth and Peranson (1999), adopted in 1998, handles couples explicitly, and similar algorithms run in other medical matches and in the market for clinical psychologists, whose data Kojima, Pathak and Roth (2013) used to support their large-market results.

References

  1. Alvin E. Roth, The evolution of the labor market for medical interns and residents, a case study in game theory, Journal of Political Economy 92(6), 991 to 1016 (1984), the whole paper (couples in the medical match, and an instance with no stable matching)
  2. Eytan Ronn, NP-complete stable matching problems, Journal of Algorithms 11(2), 285 to 304 (1990), the whole paper (NP-completeness of deciding whether a stable matching with couples exists)
  3. Eric McDermid and David F. Manlove, Keeping partners together, algorithmic results for the hospitals/residents problem with couples, Journal of Combinatorial Optimization 19(3), 279 to 303 (2010), the whole paper (hardness under restricted lists, and polynomial special cases)
  4. Alvin E. Roth and Elliott Peranson, The redesign of the matching market for American physicians, some engineering aspects of economic design, American Economic Review 89(4), 748 to 780 (1999), the whole paper (the applicant-proposing algorithm with couples used by the medical match)
  5. Fuhito Kojima, Parag A. Pathak and Alvin E. Roth, Matching with couples, stability and incentives in large markets, Quarterly Journal of Economics 128(4), 1585 to 1632 (2013), the whole paper (existence of stable matchings with high probability in large markets with few couples)
  6. Itai Ashlagi, Mark Braverman and Avinatan Hassidim, Stability in large matching markets with complementarities, Operations Research 62(4), 713 to 732 (2014), the whole paper (sharper conditions on the number of couples)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a known algorithm
  • a contract.yaml