Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stable Matching Examples Ron K. Cytron Examples drawn from Knuths’ lecture in French: Marriages stables et leurs relations.

Similar presentations


Presentation on theme: "Stable Matching Examples Ron K. Cytron Examples drawn from Knuths’ lecture in French: Marriages stables et leurs relations."— Presentation transcript:

1 Stable Matching Examples Ron K. Cytron http://www.cs.wustl.edu/~cytron/ Examples drawn from Knuths’ lecture in French: Marriages stables et leurs relations avec d’autres problemes combinatoires 24 November 2008

2 Stable Matching Problem CSE 131 Can’t we just guess? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

3 Stable Matching Problem CSE 131 Can’t we just guess? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa

4 Stable Matching Problem CSE 131 Can’t we just guess? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb

5 Stable Matching Problem CSE 131 Can’t we just guess? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb Cc

6 Stable Matching Problem CSE 131 Can’t we just guess? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb Cc Dd

7 Stable Matching Problem CSE 131 Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb Cc Dd is not stable Do you see why? Can’t we just guess?

8 Stable Matching Problem CSE 131 Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb Cc Dd is not stable Ab elope Can’t we just guess?

9 Stable Matching Problem CSE 131 Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Aa Bb Cc Dd is not stable Ab elope Let infidelity derive a solution?

10 Stable Matching Problem CSE 131 Let infidelity derive a solution? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ab Ba Cc Dd is not stable Cb elope Let Ab elope and…..

11 Stable Matching Problem CSE 131 Let infidelity derive a solution? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ac Ba Cb Dd is not stable Dc elope Let Cb elope and…..

12 Stable Matching Problem CSE 131 Let infidelity derive a solution? Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ad Ba Cb Dc is stable! How can we show this? Let Cb elope and…..

13 Stable Matching Problem CSE 131 Proof of no infidelity Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ad Ba Cb Dc is stable!

14 Stable Matching Problem CSE 131 Proof of no infidelity Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ad Ba Cb Dc is stable!

15 Stable Matching Problem CSE 131 Proof of no infidelity Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 Ad Ba Cb Dc is stable! Algorithm?

16 Stable Matching Problem CSE 131 Your ideas? Let infidelity rule and see what happens Put top choices together and see Compute average of X y y X and do something with that score Favor one side with its preference, ignore the other side Make smaller instances and try that Start with worst matches and try to improve

17 Stable Matching Problem CSE 131 Iterate until stable?

18 Stable Matching Problem CSE 131 Iterate until stable? Abac B-- Cabc aACB bCAB c Ab elope

19 Stable Matching Problem CSE 131 Iterate until stable? Abac B-- Cabc aACB bCAB c Ab elope Cb elope

20 Stable Matching Problem CSE 131 Iterate until stable? Abac B-- Cabc aACB bCAB c Ab elope Cb elope Ca elope

21 Stable Matching Problem CSE 131 Iterate until stable? Abac B-- Cabc aACB bCAB c Ab elope Cb elope Ca elope Aa elope – back to start

22 Stable Matching Problem CSE 131 Try everything? How many possibilities are there?

23 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n

24 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n Left group can decide to approach distinct people from the right group

25 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n Each adjacent pair will decide between their first and second choices. For example, 1 and 2 ….

26 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n Go with their first choices 1 and 2 are stable from the left Or…….

27 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n Go with their second choices 1 and 2 are stable from the right

28 Stable Matching Problem CSE 131 How many possible stable matchings? 112… 221… 334… 443… …… n-1 n… nn … 1…1 2…2 3…3 4…4 ……… … n…n n/2 groups can go 1 of 2 ways here Exponential number of possibilties: 2 n/2

29 Stable Matching Problem CSE 131 The algorithm

30 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

31 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

32 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

33 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

34 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

35 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

36 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

37 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

38 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4

39 Stable Matching Problem CSE 131 Algorithm applied to first example Acbda Bbacd Cbdac Dcadb #1#2#3#4 aABDC bCADB cCBDA dBACD #1#2#3#4 C and D are unbreakable Little a could try for big A, but big A won’t go for it Little d could try for big B, but big B won’t go for it Stable!

40 Stable Matching Problem CSE 131 Desirable properties Termination Correctness –Everybody paired up –Stable arrangement Fairness –Is it fair? –If not, who suffers?

41 Stable Matching Problem CSE 131 Fairness Aabcd Bbcda Ccdab Ddabc #1#2#3#4 aBCDA bCDAB cDABC dABCD #1#2#3#4

42 Stable Matching Problem CSE 131 Fairness Aabcd Bbcda Ccdab Ddabc #1#2#3#4 aBCDA bCDAB cDABC dABCD #1#2#3#4 Big letters have the advantage. Hospitals hosting residents.

43 Stable Matching Problem CSE 131 How about picking roommates? Like stable matching, but instead of two populations –A B C … –a b c … We have just one population: –A, B, C, … Example: –A, B, C, D –Make any one pairing (such as AB) and the other paring (CD) is determined

44 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 We can cover all possibilities by trying A with C, then B, then D Let’s see what happens

45 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with C

46 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with C BC bail

47 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with B

48 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with B AC bail

49 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with D

50 Stable Matching Problem CSE 131 Roommates ACBD BACD CBAD DABC #1#2#3 Try A with D AB bail No stable matching exists


Download ppt "Stable Matching Examples Ron K. Cytron Examples drawn from Knuths’ lecture in French: Marriages stables et leurs relations."

Similar presentations


Ads by Google