90 likes | 444 Views
Overview of Graph Theory Addendum “The Stable Marriage Problem”. Instructor: Carlos Pomalaza-Ráez Fall 2003 University of Oulu, Finland. The Stable Marriage Problem. Problem : Given N men and N women, find a "suitable" matching between men and women
E N D
Overview of Graph TheoryAddendum“The Stable Marriage Problem” Instructor: Carlos Pomalaza-RáezFall 2003University of Oulu, Finland
The Stable Marriage Problem Problem: Given N men and N women, find a "suitable" matching between men and women The problem and the solution can be represented as a bipartite graph Edges represent all possible matching. Matching (M) means to select some of the edges according to some criteria. Perfect Matching: each man gets exactly one woman; each woman gets exactly one man A matchingis unstable if there is a pair, e.g. (Raimo, Anne), who like each other more than their spouses; they can improve their situation by dumping spouses and eloping Gale-Shapley Theorem: A stable marriage always possible, and found in O(n2) time. Men Women Raimo Eeva Saku Anne Tarmo Miina Inka Urho Vesa Katri
worst worst best best Matchmaker, Matchmaker, Make Me A Match! The Gale-Shapley Algorithm • Each man lists women in order of preference from best to worst • Each woman lists men in order of preference Men’s Preference List Women’s Preference List • All people begin unengaged • While there are unengaged men, each proposes until a woman accept • Unengaged women accept 1st proposal they get • If an engaged woman receives a proposal she likes better, she breaks old engagement and accepts new proposal; dumped man begins proposing where he left off
Gale-Shapley Algorithm • Results of G-S algorithm are always stable • It requires two people of opposite sex in different couples to break up a marriage • If a man wants to leave for some woman, then he already proposed to her and she rejected him, so she won’t leave her husband for him is a perfect matching but unstable because (Anne, Tarmo) prefer each other to current partners • is a perfect stable matching • When men propose we call it M0 • When woman propose we call it M1
Gale-Shapley Algorithm is a also perfect stable matching but now Eeva and Anne are better of than on the previous matching What happens when men do the proposing? • Each man has the best partner he can have in any stable marriage • Each woman has the worst partner she can have in any stable marriage • G-S always produces same stable marriage - order of proposals is irrelevant Final observations • Historically, men propose to women. Why it has to be that way? • Men: propose early and often • Women: ask out the guys Reference: The Stable Marriage Problem: Structure and Algorithms (Foundations of Computing) by Dan Gusfield and Robert Irving, MIT Press, 1989.