Unformatted text preview:

1Chapter 1Introduction:Some RepresentativeProblemsSlides by Kevin Wayne.Copyright © 2005 Pearson-Addison Wesley.All rights reserved.1.1 A First Problem: Stable Matching3Matching Residents to HospitalsGoal. Given a set of preferences among hospitals and medical schoolstudents, design a self-reinforcing admissions process.Unstable pair: applicant x and hospital y are unstable if:! x prefers y to its assigned hospital.! y prefers x to one of its admitted students.Stable assignment. Assignment with no unstable pairs.! Natural and desirable condition.! Individual self-interest will prevent any applicant/hospital dealfrom being made.4Stable Matching ProblemGoal. Given n men and n women, find a "suitable" matching.! Participants rate members of opposite sex.! Each man lists women in order of preference from best to worst.! Each woman lists men in order of preference from best to worst.Zeus Amy ClareBerthaYancey Bertha ClareAmyXavier Amy ClareBertha1st2nd3rdMen’s Preference Profilefavorite least favoriteClare Xavier ZeusYanceyBertha Xavier ZeusYanceyAmy Yancey ZeusXavier1st2nd3rdWomen’s Preference Profilefavorite least favorite5Stable Matching ProblemPerfect matching: everyone is matched monogamously.! Each man gets exactly one woman.! Each woman gets exactly one man.Stability: no incentive for some pair of participants to undermineassignment by joint action.! In matching M, an unmatched pair m-w is unstable if man m andwoman w prefer each other to current partners.! Unstable pair m-w could each improve by eloping.Stable matching: perfect matching with no unstable pairs.Stable matching problem. Given the preference lists of n men and nwomen, find a stable matching if one exists.6Stable Matching ProblemQ. Is assignment X-C, Y-B, Z-A stable?Zeus Amy ClareBerthaYancey Bertha ClareAmyXavier Amy ClareBertha1st2nd3rdMen’s Preference ProfileClare Xavier ZeusYanceyBertha Xavier ZeusYanceyAmy Yancey ZeusXavier1st2nd3rdWomen’s Preference Profilefavorite least favorite favoriteleast favorite7Stable Matching ProblemQ. Is assignment X-C, Y-B, Z-A stable?A. No. Bertha and Xavier will hook up.Zeus Amy ClareBerthaYancey Bertha ClareAmyXavier Amy ClareBerthaClare Xavier ZeusYanceyBertha Xavier ZeusYanceyAmy Yancey ZeusXavier1st2nd3rd1st2nd3rdfavorite least favorite favoriteleast favoriteMen’s Preference Profile Women’s Preference Profile8Stable Matching ProblemQ. Is assignment X-A, Y-B, Z-C stable?A. Yes.Zeus Amy ClareBerthaYancey Bertha ClareAmyXavier Amy ClareBerthaClare Xavier ZeusYanceyBertha Xavier ZeusYanceyAmy Yancey ZeusXavier1st2nd3rd1st2nd3rdfavorite least favorite favoriteleast favoriteMen’s Preference Profile Women’s Preference Profile9Stable Roommate ProblemQ. Do stable matchings always exist?A. Not obvious a priori.Stable roommate problem.! 2n people; each person ranks others from 1 to 2n-1.! Assign roommate pairs so that no unstable pairs.Observation. Stable matchings do not always exist for stableroommate problem.BBobChrisAdamCABDDDoofusA B CDCA1st2nd3rdA-B, C-D ! B-C unstableA-C, B-D ! A-B unstableA-D, B-C ! A-C unstableis core of market nonempty?10Propose-And-Reject AlgorithmPropose-and-reject algorithm. [Gale-Shapley 1962] Intuitive methodthat guarantees to find a stable matching.Initialize each person to be free.while (some man is free and hasn't proposed to every woman) { Choose such a man m w = 1st woman on m's list to whom m has not yet proposed if (w is free) assign m and w to be engaged else if (w prefers m to her fiancé m') assign m and w to be engaged, and m' to be free else w rejects m}11Proof of Correctness: TerminationObservation 1. Men propose to women in decreasing order of preference.Observation 2. Once a woman is matched, she never becomes unmatched;she only "trades up."Claim. Algorithm terminates after at most n2 iterations of while loop.Pf. Each time through the while loop a man proposes to a new woman.There are only n2 possible proposals. !WyattVi ctor1stAB2ndCD3rdCBAZeusYanceyXavier CDABBADC4thEE5thADEEDCBEBerthaAmy1stWX2ndYZ3rdYXVErikaDianeClare YZVWWVZX4thVW5thVZXYYXWZn(n-1) + 1 proposals required12Proof of Correctness: PerfectionClaim. All men and women get matched.Pf. (by contradiction)! Suppose, for sake of contradiction, that Zeus is not matched upontermination of algorithm.! Then some woman, say Amy, is not matched upon termination.! By Observation 2, Amy was never proposed to.! But, Zeus proposes to everyone, since he ends up unmatched. !13Proof of Correctness: StabilityClaim. No unstable pairs.Pf. (by contradiction)! Suppose A-Z is an unstable pair: each prefers each other topartner in Gale-Shapley matching S*.! Case 1: Z never proposed to A. ! Z prefers his GS partner to A. ! A-Z is stable.! Case 2: Z proposed to A. ! A rejected Z (right away or later) ! A prefers her GS partner to Z. ! A-Z is stable.! In either case A-Z is stable, a contradiction. !Bertha-ZeusAmy-YanceyS*. . .men propose in decreasingorder of preferencewomen only trade up14SummaryStable matching problem. Given n men and n women, and theirpreferences, find a stable matching if one exists.Gale-Shapley algorithm. Guarantees to find a stable matching for anyproblem instance.Q. How to implement GS algorithm efficiently?Q. If there are multiple stable matchings, which one does GS find?15Efficient ImplementationEfficient implementation. We describe O(n2) time implementation.Representing men and women.! Assume men are named 1, …, n.! Assume women are named 1', …, n'.Engagements.! Maintain a list of free men, e.g., in a queue.! Maintain two arrays wife[m], and husband[w].– set entry to 0 if unmatched– if m matched to w then wife[m]=w and husband[w]=mMen proposing.! For each man, maintain a list of women, ordered by preference.! Maintain an array count[m] that counts the number of proposalsmade by man m.16Efficient ImplementationWomen rejecting/accepting.! Does woman w prefer man m to man m'?! For each woman, create inverse of preference list of men.! Constant time access for each query after O(n) preprocessing.for i = 1 to n inverse[pref[i]] = iPref1st82nd73rd34th45th1 5 266th7th8thInverse 4th2nd8th6th5th7th1st3rd1 2 3 4 56 7 8AmyAmyAmy prefers man 3 to 6since inverse[3] < inverse[6]2717Understanding the SolutionQ. For a given problem instance, there may be several stablematchings. Do all executions of Gale-Shapley yield the same stablematching? If so, which one?An instance with two stable matchings.!


View Full Document

U of I CS 473 - Stable Matching

Download Stable Matching
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Stable Matching and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Stable Matching 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?