Lecture 4 CSE 331 Sep 6, 2011
TA change Swapnoneel will leave us for 531 Jiun-Jie Wang will join us
Office Hours Jesse: R 1-1:50pm Jiun-Jie: T 1-1:50pm; W 2-2:50pm; Atri: M, F 2-2:50pm Bell 232
Not all signed forms turned in I’ll need confirmation in writing. No graded material will be handed back till I get this signed form from you!
subscription is now enabled
On matchings Mal Wash Simon Inara Zoe Kaylee
A valid matching Mal Wash Simon Inara Zoe Kaylee
Not a matching Mal Wash Simon Inara Zoe Kaylee
Perfect Matching Mal Wash Simon Inara Zoe Kaylee
Preferences Mal Wash Simon Inara Zoe Kaylee
Instability Mal Wash Simon Inara Zoe Kaylee
A stable marriage Even though BBT and JA are not very happy
Stable Marriage problem Set of men M and women W Matching (no polygamy in M X W) Perfect Matching (everyone gets married) Instablity m m w w m’w’ Preferences (ranking of potential spouses) Stable matching = perfect matching+ no instablity
A puzzle (if you’re bored) For any n, what is the maximum number of stable matchings (for the same problem instance)? Prove as tight upper and lower bounds as you can.
If you’re still bored Come talk to me if you’re interested in a research problem If there is enough interest, I’ll work with up to two of you Use the last lecture for your research presentations (Make some solid progress on the puzzle without google first though)
If you’re free this weekend
Questions/Comments?
Two Questions Does a stable marriage always exist? If one exists, how quickly can we compute one?
Today’s lecture Naïve algorithm Gale-Shapley algorithm for Stable Marriage problem
Discuss: Naïve algorithm!
The naïve algorithm Go through all possible perfect matchings S If S is a stable matching then Stop Else move to the next perfect matching n! matchings
Gale-Shapley Algorithm David Gale Lloyd Shapley O(n 3 ) algorithm
Moral of the story… >
Gale-Shapley Algorithm Intially all men and women are free While there exists a free woman who can propose Let w be such a woman and m be the best man she has not proposed to w proposes to m If m is free (m,w) get engaged Else (m,w’) are engaged If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
Preferences Mal Wash Simon Inara Zoe Kaylee
GS algorithm: Firefly Edition Mal Wash Simon Inara Zoe Kaylee