(rev. 02/15/2008)
Notes On The Stable Matching Problem
- 1. The stopping condition of the main loop is: Each man either is engaged or
has proposed to all the women
- 2. There are only N2 possible proposals. (N possible men proposing to N
possible women)
- 3. The loop stops after no more than N2 iterations. (Pf: 1+2
imply this.)
(This establishes that the loop is not infinite, and
moreover
it tells us something about how efficient the algorithm
may be. ( O(N2) )
- 4. Once a woman has become engaged, she remains engaged.
- 5. Once all women have received a proposal, all N women are engaged. (Pf: 4
implies this)
- 6. if all N women are engaged, then all N men are engaged. (Pf: The process
assures that each woman is matched to exactly one man and no two women are
matched to the same man. (There is a 1-1 mapping of women to men.) There are
N women, so there must be N men matched to women.)
- 7. if all N men are engaged, then all N women are engaged. (Pf: basically the
same as proof of 6.)
- 8. The loop stops, and when it does, all the men and women are engaged.
(1+5+6+7 imply this.)
So far we have done enough to verify that the algorithm performs what the book
calls a "perfect matching" - it creates N pairs, and each of the N men and N
women occur in exactly one of the N pairs.
The other thing we want to know is whether this matching is "stable". Here is
the idea: Suppose that
- 9. Alice is matched to Bill, and
- 10. Charlotte is matched to David.
Is it possible that *both* the following things are true?
- 11. Does Alice like David better than Bill?
- 12. Does David like Alice better than Charlotte?
If so then Alice and David both have an incentive to 'run off' with each
other. This would be an instability in the matching.
- 13. If 12 is true, then David proposed to Alice before he proposed to
Charlotte. (Pf: Men start at the top of their list and go down.)
- 14. If 12 is true, Alice rejected David ... either at the time David proposed,
or later. (Pf: Otherwise Alice would still be paired to David.)
- 15. If 12 is true, after Alice rejected David, every man to whom she was
engaged was someone she liked more than David. (Pf: Women reject a man only in
favor of a man they like more.)
- 16. If 12 is true then Alice likes Bill better than David. (Pf: 15 + the fact
that she was matched with Bill in the end.)
- We have shown that 9-12 can't all be true (We showed that if 9, 10, and 12 are
true, then 11 must be false). This proves that the algorithm creates a
matching with no instabilities.
- Our text goes on to define what it means for (m, w) to be valid
partners. It means there exists a stable matching in which m and w are
paired.
- Then the text proves that the Gale-Shapley algorithm always matches each man
with his "best valid partner" - the valid partner who is highest on his list.
This is a pretty amazing result. It means that the algorithm simultaneously
gives all the men the "best" match they could receive in any stable
matching. Also it means that the algorithm always results in the same
matching - even though, each time through the main loop, there is freedom to
choose which single man will make the next proposal.
The central idea of the proof is to demonstrate that when the algorithm runs
no man is rejected by a valid partner.
- The text also proves that the G-S algorithm pairs each woman with her
worst valid partner.