500 likes | 512 Views
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. Can’t we just guess?. #1. #2. #3. #4. #1. #2. #3. #4.
E N D
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
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb Cc
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb Cc Dd
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb Cc Dd is not stable Do you see why?
Can’t we just guess? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb Cc Dd is not stable Ab elope
Let infidelity derive a solution? #1 #2 #3 #4 #1 #2 #3 #4 Aa Bb Cc Dd is not stable Ab elope
Let infidelity derive a solution? Let Ab elope and….. #1 #2 #3 #4 #1 #2 #3 #4 Ab Ba Cc Dd is not stable Cb elope
Let infidelity derive a solution? Let Cb elope and….. #1 #2 #3 #4 #1 #2 #3 #4 Ac Ba Cb Dd is not stable Dc elope
Let infidelity derive a solution? Let Cb elope and….. #1 #2 #3 #4 #1 #2 #3 #4 Ad Ba Cb Dc is stable! How can we show this?
Proof of no infidelity #1 #2 #3 #4 #1 #2 #3 #4 Ad Ba Cb Dc is stable!
Proof of no infidelity #1 #2 #3 #4 #1 #2 #3 #4 Ad Ba Cb Dc is stable!
Proof of no infidelity #1 #2 #3 #4 #1 #2 #3 #4 Ad Ba Cb Dc is stable! Algorithm?
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
Iterate until stable? Ab elope
Iterate until stable? Ab elope Cb elope
Iterate until stable? Ab elope Cb elope Ca elope
Iterate until stable? Ab elope Cb elope Ca elope Aa elope – back to start
Try everything? • How many possibilities are there?
How many possible stable matchings? Left group can decide to approach distinct people from the right group
How many possible stable matchings? Each adjacent pair will decide between their first and second choices. For example, 1 and 2 ….
How many possible stable matchings? Go with their first choices 1 and 2 are stable from the left Or…….
How many possible stable matchings? Go with their second choices 1 and 2 are stable from the right
How many possible stable matchings? n/2 groups can go 1 of 2 ways here Exponential number of possibilties: 2 n/2
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #1 #2 #3 #4
Algorithm applied to first example #1 #2 #3 #4 #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!
Desirable properties • Termination • Correctness • Everybody paired up • Stable arrangement • Fairness • Is it fair? • If not, who suffers?
Fairness #1 #2 #3 #4 #1 #2 #3 #4
Fairness #1 #2 #3 #4 #1 #2 #3 #4 Big letters have the advantage. Hospitals hosting residents.
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
Roommates #1 #2 #3 We can cover all possibilities by trying A with C, then B, then D Let’s see what happens
Roommates #1 #2 #3 Try A with C
Roommates #1 #2 #3 Try A with C BC bail
Roommates #1 #2 #3 Try A with B
Roommates #1 #2 #3 Try A with B AC bail
Roommates #1 #2 #3 Try A with D
Roommates #1 #2 #3 No stable matching exists Try A with D AB bail