(rev. 2022/02/07)

Notes On The Stable Matching Problem


Discussion of the Problem and the Gale-Shapley Algorithm

As our text says: "The Stable Matching problem originated, in part, in 1962 when David Gale and Lloyd Shapley, two mathematical economists, asked the question: Could one design a college admissions process, or a job-recruiting process, that was self-enforcing? ... Gale and Shapley proceeded to develop a striking algorithmic solution to this problem ... . ... this is not the only origin of the Stable Matching Problem. It turns out that for a decade before the work of Gale and Shapley, unbeknownst to them, the National Resident Matching Program had been using a very similar procedure, with the same underlying motivation, to match residents to hospitals. Indeed, this system, with relatively little change, is still in use today."

Looking at the Gale-Shapley algorithm, we can see that it seems to "try" to help members of both groups get desirable matches. A "man" proposes first to his most-preferred "woman" and he continues to propose to "women" in order of decreasing preference, until he becomes engaged to his final match. Also, a "woman" may be able to "trade up," by exchanging one match for a different, more preferred, match.

It is important, however, to understand that there is no guarantee that all the participants will be "equally satisfied" with the matching that the Gale-Shapley algorithm creates, and people who study the Stable Matching Problem say that matchings produced by the Gale-Shapley algorithm can be "unfair."

What is guaranteed about the Gale-Shapley algorithm is that it creates a stable matching of all the "men" and "women." That means it matches up all the "men" and "women" monogamously in such a way that there are no unstable pairs. The definition of an unstable pair is that it is a pair (m, w) consisting of a "man" m and a "woman" w who are NOT matched to each other, but who prefer each other to their matches. We can picture an unstable pair (m,w) as looking like this:

      w'
     /
    /
   m <--♥-->w
           /
          /
         m'
The meaning of the diagram is that m and w mutually "love" each other more than their current matches. In other words, m prefers w more than his match, w', AND w prefers m more than her match, m'.

Now that we've had this discussion of the Stable Matching Problem, in the rest of this document, we're going to prove that the Gale-Shapley algorithm works. In other words, given a set of N women, N men, and their preference lists, the Gale-Shapley algorithm will find, without fail, a stable matching of the women and men.

Proof That The Gale-Shapley Algorithm Works