Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Longer Example: Stable Matching UNC Chapel HillZ. Guo.

Similar presentations


Presentation on theme: "A Longer Example: Stable Matching UNC Chapel HillZ. Guo."— Presentation transcript:

1 A Longer Example: Stable Matching UNC Chapel HillZ. Guo

2 Matching Residents to Hospitals Goal. Given a set of preferences among n hospitals and n medical school students, design a self-reinforcing admissions process. Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

3 Matching Residents to Hospitals Goal. Given a set of preferences among n hospitals and n medical school students, design a self- reinforcing admissions process. Unstable pair: doctor x and hospital A are unstable if: – x prefers A to its assigned hospital, and – A prefers x to its admitted student. Stable assignment. Assignment with no unstable pairs. – Natural and desirable condition. – Individual self-interest will prevent any applicant/hospital deal from being made. UNC Chapel HillZ. Guo

4 Example Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: (A, s), (B, t), (C, q), (D, r) (stable) (A, t), (B, q), (C, s), (D, r) (un-stable pair: (B, t)) UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

5 A Simple Approach Function Simple-Proposal-But-Invalid – Start with some assignment between doctors and hospitals – While unstable pair exists “swap” to satisfy the pair – end while UNC Chapel HillZ. Guo

6 Example Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: (A, t), (B, q), (C, s), (D, r) (un-stable pair: (B, t)) -> (A, q), (B, t), (C, s), (D, r) UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

7 A Simple Approach Function Simple-Proposal-But-Invalid – Start with some assignment between doctors and hospitals – While unstable pair exists “swap” to satisfy the pair – end while UNC Chapel HillZ. Guo This will NOT work since a loop can occur. Swaps might continually result in new “dissatisfied” pairs.

8 The Boston Pool Algorithm So named because it was previously used by a regional clearinghouse in the Boston area. The algorithm is often misattributed to David Gale and Lloyd Shapley, who formally analyzed the algorithm and first proved that it computes a stable matching in 1962. Shapley was awarded the 2012 Nobel Prize in Economics for his research on stable matching and… UNC Chapel HillZ. Guo

9 The Boston Pool algorithm proceeds in rounds until every position has been filled. Each round has two stages: 1. An arbitrary unassigned hospital A offers its position to the best doctor x (according to the hospital’s preference list) who has not already rejected it. 2. Each doctor ultimately accepts the best offer that she receives, according to her preference list. Thus, if x is currently unassigned, she (tentatively) accepts the offer from A. If x already has an assignment but prefers A, she rejects her existing assignment and (tentatively) accepts the new offer from A. Otherwise, x rejects the new offer. UNC Chapel HillZ. Guo The Boston Pool Algorithm

10 Example Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

11 Example Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: (A, s), (B, t), (C, q), (D, r) UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

12 Example Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: (A, s), (B, t), (C, q), (D, r) The matching (A, r), (B, s), (C, q), (D, t) is also stable UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt

13 Correctness - Termination Observation 1. Hospitals propose to doctors in decreasing order of preference. Observation 2. Once a doctor accepts an offer he/she never becomes unmatched, he/she only "trades up“. Claim. Algorithm terminates after at most n 2 rounds. – Pf. Each hospital makes an offer to each doctor at most once (only make offer to “new” doctor), so the algorithm requires at most n 2 rounds. – The average (expected) case is O(n lg n). UNC Chapel HillZ. Guo

14 Correctness Claim. The algorithm always computes a matching (to all hospitals and doctors) – Pf. It’s obvious that throughout the process, no doctor can accept more than one position, and no hospital can hire more than one doctor. – Pf. (by contradiction) Suppose that Hospital A is not matched upon termination of algorithm. Then some doctor x is not matched upon termination. By Observation 2, x never received an offer. But, A made offers to everyone, since A ends up unmatched. UNC Chapel HillZ. Guo

15 Correctness Claim. No unstable pair. – Pf. Suppose doctor x is assigned to hospital A in the final matching, but prefers B. Because every doctor accepts the best offer she receives, x received no offer she liked more than A. In particular, B never made an offer to x. On the other hand, B made offers to every doctor they like more than y. Thus, B prefers y to x, and so there is no instability. UNC Chapel HillZ. Guo

16 More properties Def. x is a feasible doctor for A if there exists a stable matching that assigns doctor x to hospital A. Claim. Each hospital A is rejected only by doctors that are infeasible for A. (Hospital-Optimal) Pf. (by induction) Consider an arbitrary round of the algorithm, in which doctor x rejects A for B (B is offering x, x prefers B to A). Every doctor that appears higher than x in B’s preference list has already rejected B and therefore is infeasible for B (why?). Now consider an arbitrary matching that assigns x to A: B prefers x to its partner => unstable. B prefers its partner to x => its partner is infeasible (why?), and again the matching is unstable. UNC Chapel HillZ. Guo

17 More properties Def. x is a feasible doctor for A if there exists a stable matching that assigns doctor x to hospital A. Claim. Each hospital A is rejected only by doctors that are infeasible for A. (Hospital-Optimal) Claim. Each doctor x prefers every other feasible match to its final assignment A. (Doctor-Pessimal) Pf. Consider an arbitrary stable matching where A is not matched with x but with another doctor y.The previous Claim implies that A prefers x to y (why?). Because the matching is stable, x must therefore prefer her assigned hospital to A. UNC Chapel HillZ. Guo

18 More properties No matter which unassigned hospital makes an offer in each round, the algorithm always computes the same matching (why?) A doctor can potentially improve her assignment by lying about her preferences NRMP reversed its matching algorithm in 1998 – So that potential residents offer to work for hospitals in preference order, and each hospital accepts its best offer. – The precise effect of this change on the patients is an open problem. UNC Chapel HillZ. Guo

19 About its history Until 1950’s – Competition among hospitals for the best doctors led to earlier and earlier offers of internships, along with tighter deadlines for acceptance. – In the 1940s, medical schools agreed not to release information until a common date during their students’ fourth year. In response, hospitals began demanding faster decisions. – Interns were forced to gamble if their third-choice hospital called first. UNC Chapel HillZ. Guo

20 In Academia For graduate school admission, we have the “April 15 Resolution”. However, the academic job market involves similar gambles, at least in computer science. – Some departments start making offers in February with two-week decision deadlines; others don’t even start interviewing until late March; – MIT notoriously waits until May, when all its interviews are over, before making any faculty offer. UNC Chapel HillZ. Guo

21 About its history In the early 1950’s – A central clearinghouse for internship assignments, now called the National Resident Matching Program (NRMP), was established – Each year, doctors submit a ranked list of all hospitals where they would accept an internship, and each hospital submits a ranked list of doctors they would accept as interns. – The NRMP then computes a stable assignment of interns to hospitals. UNC Chapel HillZ. Guo

22 It’s not the end of the story In reality, most hospitals offer multiple internships, each doctor ranks only a subset of the hospitals and vice versa, and There are typically more internships than interested doctors. And then it starts getting complicated, moreover, e.g., – There are couples that willing to stay in the same city/hospital whenever possible… UNC Chapel HillZ. Guo

23 This course This class is ultimately about learning two skills that are crucial for all computer scientists: – Intuition: How to think about abstract computation. UNC Chapel HillZ. Guo

24 This course This class is ultimately about learning two skills that are crucial for all computer scientists: – Intuition: How to think about abstract computation. – Language: How to talk about abstract computation. UNC Chapel HillZ. Guo

25 This course This class is ultimately about learning two skills that are crucial for all computer scientists: – Intuition: How to think about abstract computation. – Language: How to talk about abstract computation. You can only develop good problem solving skills by solving problems. You can only develop good communication skills by communicating. UNC Chapel HillZ. Guo

26 Example - Process Suppose four doctors q,r,s,t, and four hospitals A,B,C,D rank each other as follows: (A,t); (A,t)(B,r); (C,t)(B,r); (C,t)(B,r)(D,s); (A,s)(C,t)(B,r); (A,s)(C,t)(D,r); (A,s)(B,t)(D,r); +(C,r?);+(C,s?); (A,s)(B,t)(D,r)(C,q); UNC Chapel HillZ. Guo qrst AABD BDAB CCCC DBDA ABCD trts strr rqsq qsqt


Download ppt "A Longer Example: Stable Matching UNC Chapel HillZ. Guo."

Similar presentations


Ads by Google