1 / 32

Stable Marriage Problem and Gale-Shapley Algorithm

Learn about Stable Marriage Problem, perfect matching, and Gale-Shapley Algorithm in today's lecture. Sign up for mini projects and seek help if needed. Deadline for sign-up is Sep 23, 11:00 am.

michellet
Download Presentation

Stable Marriage Problem and Gale-Shapley Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 6 CSE 331 Sep 9, 2019

  2. We’re not mind readers

  3. If you need it, ask for help

  4. Sign-up for mini projects Only one signup so far! Deadline: Monday, Sep 23, 11:00am

  5. Peer notetaker request

  6. New Office Hour policy

  7. An extra office hour

  8. Feedback on your solutions

  9. Advice from TAs

  10. Watch walkthrough videos

  11. Read recitation notes

  12. Scientista meeting tomorrow!

  13. Questions/Comments?

  14. Reading Assignment - I

  15. Reading Assignment - II

  16. Stable Marriage problem Set of men M and women W Preferences (ranking of potential spouses) Matching (no polyandry/gamy in M X W) Perfect Matching (everyone gets married) m w Instablity m’ w’ Stable matching = perfect matching+ no instablity

  17. Two Questions Does a stable marriage always exist? If one exists, how quickly can we compute one?

  18. Today’s lecture Naïve algorithm Gale-Shapley algorithm for Stable Marriage problem

  19. Discuss: Naïve algorithm!

  20. The naïve algorithm Incremental algorithm to produce all n! prefect matchings? Go through all possible perfect matchings S If S is a stable matching then Stop n! matchings Else move to the next perfect matching

  21. Gale-Shapley Algorithm David Gale Lloyd Shapley O(n3) algorithm

  22. Moral of the story… >

  23. Questions/Comments?

  24. Rest of today’s agenda GS algorithm Run of GS algorithm on an instance Prove correctness of the GS algorithm

  25. 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

  26. Preferences Mal Inara Wash Zoe Simon Kaylee

  27. GS algorithm: Firefly Edition Inara Mal Zoe Wash 4 5 6 1 2 3 Kaylee Simon 4 5 6 1 2 3

  28. Observation 1 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 Once a man gets engaged, he remains engaged (to “better” women) 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

  29. Observation 2 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 If w proposes to m after m’, then she prefers m’ to m (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 set S of engaged pairs as the final output

  30. Questions/Comments?

  31. Why bother proving correctness? Consider a variant where any free man or free woman can propose Is this variant any different? Can you prove it?

  32. GS’ does not output a stable marriage

More Related