Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 CSE 331 Sep 10, 2010.

Similar presentations


Presentation on theme: "Lecture 5 CSE 331 Sep 10, 2010."— Presentation transcript:

1 Lecture 5 CSE 331 Sep 10, 2010

2 HW 1 Posted on course webpage READ THE INSTRUCTIONS CAREFULLY

3 New tougher deadline If you do not form a group by Sep 14
You will get a ZERO on group leader scribe

4 Only 71 signed forms I’ll need confirmation in writing. No graded material will be handed back till I get this signed form from you!

5 One new blog post slot open
Sep 15 has one free slot now

6 On matchings Mal Wash Simon Inara Zoe Kaylee

7 A valid matching

8 Not a matching

9 Perfect Matching

10 Preferences

11 Instability

12 Questions/Comments?

13 Stable Marriage problem
Input: M and W with preferences Output: Stable Matching Set of men M and women W Preferences (ranking of potential spouses) Matching (no polygamy in M X W) Perfect Matching (everyone gets married) m w m’ w’ Instablity Stable matching = perfect matching+ no instablity

14 First algorithm? Try to match up one man and women who prefer each other most n! perfect matchings Go through all perfect matchings S If S is stable then stop else move to the next matching

15 Verify if perfect matching is stable
Go through all pairs (m,w) n^2 pairs Check if m and w *both* prefer each other to their current matchings O(n) time If so matching is unstable O(n^3) time

16 Today’s lecture Couple of examples
Gale-Shapley algorithm for Stable Marriage problem

17 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


Download ppt "Lecture 5 CSE 331 Sep 10, 2010."

Similar presentations


Ads by Google