Posted by: atri | September 19, 2010

## Lecture 09/17/10 GS algorithm always outputs a stable matching

(Guest post by Daniel Knopp)

In Last Fridays Lecture (09/17/`10) we handed in homework 1, many of us being reminded that we all need to hand in each problem on a separate sheet. Then we worked through the proof of the proposition that the GS algorithm always outputs a stable matching.

The proof:

First we need to make a few observations about the nature of the GS algorithm.

Observation 1: Once a man gets engaged he remains engaged to increasingly better women, if better women exist.

Observation 2: If w proposes to m after m’ then m’ > m in Lm.

Definition 1: A matching is some arrangement of pairings such that each m and w in a pair is only paired with one w or one m respectively.

Proposition (Proof to be posted on blog by Atri): The output of the GS algorithm is at least a matching.

Proof Ideas:

We will prove the proposition by contradiction. We will also use 2 lemmas: the first that the GS algorithm outputs a perfect matching(s) S, the second that S has no instability.

Proof:

At any point in the algorithm either w is free or engaged to just one man, where w is any arbitrary w in W. Similarly, at any point in the algorithm either m is free or engaged to just one w, where m is any arbitrary m in M.

Theorem: for any input, the GS algorithm outputs a stable matching.

Lemma 1- For every input the GS algorithm outputs a stable matching S.

Lemma 2- S has no instability.

Proof idea for lemma 1.

Assume the GS algorithm outputs a matching that is not perfect.

Fact 1: n men engaged => n women engaged.

Fact 1 and Observation 1 => contradiction, if fact 1 and observation 1 then there is a perfect matching which contradicts our assumption.

Proof of Lemma 1.

Assume there exist a w in W such that w is free and w has proposed to every m in M.

Consider and arbitrary m in M. Consider the time w proposed to m.

Case 1: m was free => m gets engaged. Recall by observation 1 => m is engaged at the end of the algorithm.

Case 2: m was engaged => (observation 1) m is still engaged at the end of the algorithm.

Therefore all men are engaged at the end of the algorithm=> all women are engaged at the end of the algorithm by fact 1. => w is engaged. This is a contradiction thus we have shown there is a perfect matching at the end of the algorithm.

—–This is as far as we got Friday. Lemma 2 was not proven.