COMS 482: unofficial class blog

Lecture 1: Stable Matching

Posted in Class Notes by Elliott Back on January 24th, 2005.

Instructor: Paul Chew
Course page: cs.cornell.edu/courses/cs482/
For Wednesday: Read chapter 1, preview 2 & 3.

Stability in Matching:

The set of couples:

(Alice, Bob)
(Carol, Dave)

  • unstable, if A prefers D and D prefers A, or B prefers C and C prefers B.
  • stable, if A prefers B and B prefers A, or A prefers D and D prefers C.

Opening questions:

Is it always possible, given a set of preferences, to find stable marriages? Look at the following preference lists:

A: B, D
B: C, A
C: B, D
D: A, C

Then, the matching {(A, B) (C,D)} is unstable, because C prefers B and B prefers C to its mate, so they will eagerly switch mates and disrupt the marriage. However, {(A,D) (C,B)} is stable, because C and B prefer each other and will not switch, even though A prefers B to D. Yes–there is always a stable solution.

Can we construct preferences so that there is no stable solution? Let’s try for the following exhaustive matchings:

{(A,B) (C,D)} 1 and {(A,D) (C,B)} 2

Now, pair one 1 has the following set of unstable preferences:

A: D, B
D: A, C

and

C: B, D
B: C, A

Pair two 2 has the following set of unstable preferences:

A: B, D
B: A, C

and

C: D, B
D: C, A

But, there is a contradiction between the two sets 1, 2. If you select a preference pair from matching one 1, you have already defined the rest of the preferences so that there is no instability in the second set of matchings.

Stable Matching Algorithm (Also called “Gale-Shapley” and misspelled “Gale-Shapely”):

Given n men m and women w, as well as a preference list L for each man or woman ranking all members of the opposite sex, each person is either free or engaged. All start free.

While( there exists a free man m ) {
    w = first woman on m’s list whom he has not proposed to
    if ( w is free ){
        (m, w) -> engaged
    } else if ( w is engaged to m’ && w prefers m to m’ ) {
        (m, w) -> engaged
        m’ -> free
    }
}

Convert all engagements to marriages.

Proofs:

“Each man can find a woman to propose to.”

If there is a free man, then there is also a free woman, because they engage in pairs. If a woman is free, she has never been proposed to, which means she must still be on the man’s list.

“The algorithm terminates.”

From the woman’s perspective, every new engagement is an improvement. Every guy gets worse. Every proposal is new. Since every time through the loop, a new proposal happens, and there are a finite number of proposals (n2), the algorithm terminates within n-squared time.

“The algorithm results in stable marriages.”

Assume that there is an instability such that there is (m,w) and (m’, w’) where m prefers w’ and w’ prefers m. So, m’ is the best that w’ has seen. But, m would have proposed to w’ before w because he ranks w’ higher. Yet, since he’s married to w, he must have proposed to w’ already. But she cannot reject him because w’ prefers m… contradiction.

This entry was posted on Monday, January 24th, 2005 at 12:13 pm and is tagged with nbsp nbsp nbsp nbsp nbsp, stable solution, stable marriages, edu courses, shapley, first woman, free man, misspelled, contradiction, gale, mates, cornell, algorithm, preference, alice, couples, mate, marriage. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

One Response to “Lecture 1: Stable Matching”

  1. [...] vious. Show there are no instabilities by simple contradition. See Lecture 1 for more on Stable Matching / Marriage. Bre [...]

Leave a Reply

Powered by WP Hashcash