1. REPRESENTATIVE PROBLEMS ‣ Stable Matching ‣ Five

1. REPRESENTATIVE PROBLEMS ‣ Stable Matching ‣ Five

1. REPRESENTATIVE PROBLEMS 1. REPRESENTATIVE PROBLEMS ‣ stable matching ‣ stable matching ‣ five representative problems ‣ five representative problems SECTION 1.1 Lecture slides by Kevin Wayne Copyright © 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos Matching med-school students to hospitals Stable matching problem Goal. Given a set of preferences among hospitals and med-school students, Goal. Given a set of n men and a set of n women, find a "suitable" matching. design a self-reinforcing admissions process. ・Participants rank members of opposite sex. ・Each man lists women in order of preference from best to worst. Unstable pair: student x and hospital y are unstable if: ・Each woman lists men in order of preference from best to worst. ・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. favorite least favorite favorite least favorite ・Individual self-interest prevents any hospital–student side deal. 1st 2nd 3rd 1st 2nd 3rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus men's preference list women's preference list 3 4 Perfect matching Unstable pair Def. A matching S is a set of ordered pairs m–w with m ∈ M and w ∈ W s.t. Def. Given a perfect matching S, man m and woman w are unstable if: ・Each man m ∈ M appears in at most one pair of S. ・m prefers w to his current partner. ・Each woman w ∈ W appears in at most one pair of S. ・w prefers m to her current partner. Def. A matching S is perfect if | S | = | M | = | W | = n. Key point. An unstable pair m–w could each improve partner by joint action. 1st 2nd 3rd 1st 2nd 3rd 1st 2nd 3rd 1st 2nd 3rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus a perfect matching S = { X–C, Y–B, Z–A } Bertha and Xavier are an unstable pair 5 6 Stable matching problem Stable roommate problem Def. A stable matching is a perfect matching with no unstable pairs. Q. Do stable matchings always exist? A. Not obvious a priori. Stable matching problem. Given the preference lists of n men and n women, find a stable matching (if one exists). Stable roommate problem. ・Natural, desirable, and self-reinforcing condition. ・2 n people; each person ranks others from 1 to 2 n – 1. ・Individual self-interest prevents any man–woman pair from eloping. ・Assign roommate pairs so that no unstable pairs. 1st 2nd 3rd no perfect matching is stable Adam B C D A–B, C–D ⇒ B–C unstable Bob C A D A–C, B–D ⇒ A–B unstable 1st 2nd 3rd 1st 2nd 3rd Chris A B D A–D, B–C ⇒ A–C unstable Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Doofus A B C Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Observation. Stable matchings need not exist for stable roommate problem. a perfect matching S = { X–A, Y–B, Z–C } 7 8 Gale-Shapley deferred acceptance algorithm Proof of correctness: termination An intuitive method that guarantees to find a stable matching. Observation 1. Men propose to women in decreasing order of preference. GALE–SHAPLEY (preference lists for men and women) Observation 2. Once a woman is matched, she never becomes unmatched; ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ she only "trades up." INITIALIZE S to empty matching. WHILE (some man m is unmatched and hasn't proposed to every woman) Claim. Algorithm terminates after at most n 2 iterations of while loop. w ← first woman on m's list to whom m has not yet proposed. Pf. Each time through the while loop a man proposes to a new woman. IF (w is unmatched) There are only n 2 possible proposals. ▪ Add pair m–w to matching S. ELSE IF (w prefers m to her current partner m') Remove pair m'–w from matching S. 1st 2nd 3rd 4th 5th 1st 2nd 3rd 4th 5th Victor A B C D E Amy W X Y Z V Add pair m–w to matching S. Wyatt B C D A E Bertha X Y Z V W ELSE Xavier C D A B E Clare Y Z V W X w rejects m. Yancey D A B C E Diane Z V W X Y Zeus A B C D E Erika V W X Y Z RETURN stable matching S. n(n-1) + 1 proposals required ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ 9 10 Proof of correctness: perfection Proof of correctness: stability Claim. In Gale-Shapley matching, all men and women get matched. Claim. In Gale-Shapley matching, there are no unstable pairs. Pf. [by contradiction] Pf. Suppose the GS matching S* does not contain the pair A–Z. ・Suppose, for sake of contradiction, that Zeus is not matched upon ・Case 1: Z never proposed to A. men propose in termination of GS algorithm. ⇒ Z prefers his GS partner B to A. decreasing order of preference ・Then some woman, say Amy, is not matched upon termination. ⇒ A–Z is stable. ・By Observation 2, Amy was never proposed to. ・Case 2: Z proposed to A. A – Y ・But, Zeus proposes to everyone, since he ends up unmatched. ▪ ⇒ A rejected Z (right away or later) B – Z ⇒ A prefers her GS partner Y to Z. women only trade up ⋮ ⇒ A–Z is stable. ・In either case, the pair A–Z is stable. ▪ Gale-Shapley matching S* 11 12 Summary Efficient implementation Stable matching problem. Given n men and n women, and their preferences, Efficient implementation. We describe an O(n 2) time implementation. find a stable matching if one exists. Representing men and women. Theorem. [Gale-Shapley 1962] The Gale-Shapley algorithm guarantees ・Assume men are named 1, …, n. to find a stable matching for any problem instance. ・Assume women are named 1', …, n'. Q. How to implement GS algorithm efficiently? Representing the matching. Q. If there are multiple stable matchings, which one does GS find? ・Maintain a list of free men (in a stack or queue). ・Maintain two arrays wife[m] and husband[w]. - if m matched to w, then wife[m] = w and husband[w] = m set entry to 0 if unmatched Men proposing. ・For each man, maintain a list of women, ordered by preference. ・For each man, maintain a pointer to woman in list for next proposal. 13 14 Efficient implementation (continued) Understanding the solution Women rejecting/accepting. For a given problem instance, there may be several stable matchings. ・Does woman w prefer man m to man m' ? ・Do all executions of GS algorithm yield the same stable matching? ・For each woman, create inverse of preference list of men. ・If so, which one? ・Constant time access for each query after O(n) preprocessing. 1st 2nd 3rd 4th 5th 6th 7th 8th pref[] 8 3 7 1 4 5 6 2 woman prefers man 3 to 6 since inverse[3] < inverse[6] 1 2 3 4 5 6 7 8 inverse[] 4th 8th 2nd 5th 6th 7th 3rd 1st 1st 2nd 3rd 1st 2nd 3rd for i = 1 to n Xavier Amy Bertha

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us