Stable Matching
Get to know the stable matching problem and its solution using greedy algorithms.
We'll cover the following...
Every year, thousands of new doctors must obtain internships at hospitals around the United States. During the first half of the 20th century, competition among hospitals for the best doctors led to earlier and earlier offers of internships, sometimes as early as the second year of medical school, along with tighter deadlines for acceptance. In the 1940s, medical schools agreed not to release information until a common date during their students’ fourth year. In response, hospitals began demanding faster decisions. By 1950, hospitals would regularly call doctors, offer them internships, and demand immediate responses. Interns were forced to gamble if their third-choice hospital called first—accept and risk losing a better opportunity later, or reject and risk having no position at all.
Finally, a central clearing house for internship assignments, now called the National Resident Matching Program (NRMP), was established in the early 1950s. Each year, doctors submit a ranked list of all hospitals where they would accept an internship, and each hospital submits a ranked list of doctors they would accept as interns. The NRMP then computes a matching between doctors and hospitals that satisfies the following stability requirement. A matching is unstable if there is a doctor α and hospital B that would be both happier with each other than with their current match; that is,
- is matched with some other hospital , even though she prefers .
- B is matched with some other doctor , even though they prefer .
In this case, we call an unstable pair for the matching. The goal of the Resident Match is a stable matching, which matches with no unstable pairs.
For simplicity, let’s assume from now on that there is exactly the same number of doctors and hospitals; each hospital offers exactly one internship; each doctor ranks all hospitals and vice versa; and finally, there are no ties in the doctors’ or hospitals’ rankings.
Some bad ideas
At first glance, it is not even clear that stable matching always exists! Certainly, not every matching of doctors and hospitals is stable. Suppose there are three doctors (Dr. Quincy, Dr. Rotwang, Dr. Shephard, represented by lower-case letters) and three hospitals (Arkham Asylum, Bethlem Royal Hospital, and County General Hospital, represented by upper-case letters) who rank each other as follows:
The matching is unstable because Arkham would rather hire Dr. Rotwang than Dr. Quincy, and Dr. Rotwang would rather work at Arkham than at Bedlam. ...
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy