Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 CSE 331 Sep 5, 2014.

Similar presentations


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

1 Lecture 5 CSE 331 Sep 5, 2014

2 Submit the form I’ll need confirmation in writing. No graded material will be handed back till I get this signed form from you!

3 Schedules and Deadlines

4

5 Schedules and Deadlines

6

7 Sign-up for mini projects
me your group (=6) composition + your chosen algorithm

8 Homeworks HW 1 posted online: see piazza
Pickup graded HW 0 starting Monday

9 Remember to read HW policies

10 Separate Proof idea/proof details
Proof details with no proof idea will get you a zero for the entire problem

11 On matchings Mal Wash Simon Inara Zoe Kaylee

12 A valid matching Mal Wash Simon Inara Zoe Kaylee

13 Not a matching Mal Wash Simon Inara Zoe Kaylee

14 Perfect Matching Mal Wash Simon Inara Zoe Kaylee

15 Preferences Mal Wash Simon Inara Zoe Kaylee

16 Instability Mal Wash Simon Inara Zoe Kaylee

17 Even though BBT and JA are not very happy
A stable marriage Even though BBT and JA are not very happy

18 Two stable marriages

19 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 polyandry/gamy in M X W) Perfect Matching (everyone gets married) m w m’ w’ Instablity Stable matching = perfect matching+ no instablity

20 Questions/Comments?

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

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

23 Discuss: Naïve algorithm!

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

25 Gale-Shapley Algorithm
David Gale Lloyd Shapley O(n3) algorithm

26 Moral of the story… >

27 Questions/Comments?

28 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

29 Preferences Mal Wash Simon Inara Zoe Kaylee

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


Download ppt "Lecture 5 CSE 331 Sep 5, 2014."

Similar presentations


Ads by Google