Presentation is loading. Please wait.

Presentation is loading. Please wait.

L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant.

Similar presentations


Presentation on theme: "L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant."— Presentation transcript:

1 L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant GR/M13329 and Nuffield Foundation award NUF-NAL-02

2 L3 #2 Medical matching: general situation Graduating medical students (US: residents; formerly interns; UK: PRHOs) seek hospital appointments Free-for-all markets are chaotic – Danger of residents or hospitals trying to improve their allocation – Hospitals imposing unrealistic deadlines on residents to decide on offers Centralised matching schemes are in operation: – Residents form preferences over hospitals – Hospitals form preferences over residents – No resident receives more than one hospital appointment – No hospital exceeds its capacity – Residents and hospitals agree to be bound by the outcome of the matching algorithm Schemes not based on stability have failed

3 L3 #3 Hospitals/Residents problem (HR): definitions n residents r 1, r 2, …, r n m hospitals h 1, h 2, …, h m Hospital h i has capacity c i Each resident ranks a subset of the hospitals in strict order of preference Each hospital ranks its applicants in strict order of preference r finds h acceptable if h is on r’s preference list; r finds h unacceptable otherwise (and vice versa) A matching M in an instance of HR is an allocation of residents to hospitals such that: 1) (r,h)  M  r,h find each other acceptable 2) No resident receives more than one post 3) No hospital exceeds its capacity

4 L3 #4 Hospitals/Residents problem: example r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

5 L3 #5 Hospitals/Residents problem: matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences M = {(r 1, h 1 ), (r 2, h 2 ), (r 3, h 3 ), (r 5, h 2 ), (r 6, h 1 )} (size 5)

6 L3 #6 Hospitals/Residents problem: matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Matching M is stable if M admits no blocking pair – (r,h) is a blocking pair of matching M if: 1) r, h find each other acceptable and 2) either r is unmatched in M or r prefers h to his/her assigned hospital in M and 3) either h is undersubscribed in M or h prefers r to its worst resident assigned in M

7 L3 #7 HR: unstable matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Matching M is stable if M admits no blocking pair – (r,h) is a blocking pair of matching M if: 1) r, h find each other acceptable and 2) either r is unmatched in M or r prefers h to his/her allocated hospital in M and 3) either h is undersubscribed in M or h prefers r to its worst resident assigned in M Matching above is unstable as e.g. (r 2,h 1 ), (r 4,h 2 ) and (r 4,h 3 ) are blocking pairs

8 L3 #8 HR: unstable matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Matching M is stable if M admits no blocking pair – (r,h) is a blocking pair of matching M if: 1) r, h find each other acceptable and 2) either r is unmatched in M or r prefers h to his/her allocated hospital in M and 3) either h is undersubscribed in M or h prefers r to its worst resident assigned in M Matching above is unstable as e.g. (r 2,h 1 ), (r 4,h 2 ) and (r 4,h 3 ) are blocking pairs

9 L3 #9 HR: unstable matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Matching M is stable if M admits no blocking pair – (r,h) is a blocking pair of matching M if: 1) r, h find each other acceptable and 2) either r is unmatched in M or r prefers h to his/her allocated hospital in M and 3) either h is undersubscribed in M or h prefers r to its worst resident assigned in M Matching above is unstable as e.g. (r 2,h 1 ), (r 4,h 2 ) and (r 4,h 3 ) are blocking pairs

10 L3 #10 HR: stable matching r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Matching M is stable if M admits no blocking pair –(r,h) is a blocking pair of matching M if 1) r, h find each other acceptable and 2) either r is unmatched in M or r prefers h to his/her allocated hospital in M and 3) either h is undersubscribed in M or h prefers r to its worst resident assigned in M Example shows that, in a given stable matching, one or more residents may be unmatched one or more hospitals may be undersubscribed

11 L3 #11 A special case of HR Suppose that all hospitals have capacity 1 – This is the stable marriage problem with unacceptable partners Residents are referred to as men, hospitals are referred to as women Input to the problem consists of: – a set of n men {m 1,m 2,…,m n } – a set of m women {w 1,w 2,…,w m } – for each person q, a preference list in which q ranks a subset of the members of the opposite sex in strict order A matching M is a set of disjoint (man,woman) pairs such that (m,w)  M only if: – m finds w acceptable – w finds m acceptable

12 L3 #12 Unacceptable partners: example instance m 1 : w 4 w 1 w 3 w 1 : m 4 m 1 m 2 m 2 : w 2 w 1 w 4 w 2 : m 3 m 2 m 4 m 3 : w 2 w 4 w 3 w 3 : m 1 m 3 m 4 : w 1 w 4 w 2 w 4 : m 4 m 1 m 3 m 2 Men’s preferences Women’s preferences A blocking pair of matching M is a (man,woman) pair (m,w)  M such that: 1. m and w find each other acceptable 2. m is unmatched in M or prefers w to his partner in M 3. w is unmatched in M or prefers m to her partner in M Matching M is stable if M admits no blocking pair

13 L3 #13 Unacceptable partners: example instance m 1 : w 4 w 1 w 3 w 1 : m 4 m 1 m 2 m 2 : w 2 w 1 w 4 w 2 : m 3 m 2 m 4 m 3 : w 2 w 4 w 3 w 3 : m 1 m 3 m 4 : w 1 w 4 w 2 w 4 : m 4 m 1 m 3 m 2 Men's preferences Women's preferences A blocking pair of matching M is a (man,woman) pair (m,w)  M such that: 1. m and w find each other acceptable 2. m is unmatched in M or prefers w to his partner in M 3. w is unmatched in M or prefers m to her partner in M Matching M is stable if M admits no blocking pair

14 L3 #14 Unacceptable partners: example instance m 1 : w 4 w 1 w 3 w 1 : m 4 m 1 m 2 m 2 : w 2 w 1 w 4 w 2 : m 3 m 2 m 4 m 3 : w 2 w 4 w 3 w 3 : m 1 m 3 m 4 : w 1 w 4 w 2 w 4 : m 4 m 1 m 3 m 2 Men's preferences Women's preferences A blocking pair of matching M is a (man,woman) pair (m,w)  M such that: 1. m and w find each other acceptable 2. m is unmatched in M or prefers w to his partner in M 3. w is unmatched in M or prefers m to her partner in M Matching M is stable if M admits no blocking pair The matching above is not stable as (m 3,w 2 ) and (m 3,w 3 ) are blocking pairs

15 L3 #15 Unacceptable partners: example instance m 1 : w 4 w 1 w 3 w 1 : m 4 m 1 m 2 m 2 : w 2 w 1 w 4 w 2 : m 3 m 2 m 4 m 3 : w 2 w 4 w 3 w 3 : m 1 m 3 m 4 : w 1 w 4 w 2 w 4 : m 4 m 1 m 3 m 2 Men's preferences Women's preferences A blocking pair of matching M is a (man,woman) pair (m,w)  M such that: 1. m and w find each other acceptable 2. m is unmatched in M or prefers w to his partner in M 3. w is unmatched in M or prefers m to her partner in M Matching M is stable if M admits no blocking pair The matching above is not stable as (m 3,w 2 ) and (m 3,w 3 ) are blocking pairs

16 L3 #16 Unacceptable partners: example instance m 1 : w 4 w 1 w 3 w 1 : m 4 m 1 m 2 m 2 : w 2 w 1 w 4 w 2 : m 3 m 2 m 4 m 3 : w 2 w 4 w 3 w 3 : m 1 m 3 m 4 : w 1 w 4 w 2 w 4 : m 4 m 1 m 3 m 2 Men's preferences Women's preferences A blocking pair of matching M is a (man,woman) pair (m,w)  M such that: 1. m and w find each other acceptable 2. m is unmatched in M or prefers w to his partner in M 3. w is unmatched in M or prefers m to her partner in M Matching M is stable if M admits no blocking pair The matching above is stable

17 L3 #17 Revised Gale/Shapley (GS) algorithm A stable matching always exists for a stable marriage instance with unacceptable partners A stable matching M may be found efficiently using the revised Gale/Shapley algorithm – the algorithm takes  cmn steps, for some constant c Some people may be unmatched in M, but – the same people are unmatched in all stable matchings – hence all stable matchings have the same size Each man matched in M has the best partner he could obtain in any stable matching Each woman matched in M has the worst partner she could obtain in any stable matching The revised Gale / Shapley algorithm can be extended to HR

18 L3 #18 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } Hospital-oriented GS algorithm: – Gusfield and Irving (1989), Section 1.6.2

19 L3 #19 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

20 L3 #20 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

21 L3 #21 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

22 L3 #22 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

23 L3 #23 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

24 L3 #24 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

25 L3 #25 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

26 L3 #26 Hospital-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some hospital h is undersubscribed) and (h’s list contains a resident r not provisionally assigned to h)) { r := first such resident on h’s list; /* h proposes to r */ if (r is already assigned to some hospital h’) break the provisional assignment of r to h’; provisionally assign r to h ; for (each successor h’ of h on r’s list) delete the pair (r,h’) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

27 L3 #27 Hospital-optimal stable matching Theorem: Given an arbitrary instance of HR: – the hospital-oriented GS algorithm always terminates with a stable matching M – the algorithm takes  cmn steps, for some constant c – each hospital that is full in M is assigned the best set of residents that it could obtain in any stable matching – each resident assigned in M is assigned to the worst hospital that he could obtain in any stable matching The matching output by the hospital-oriented GS algorithm is called the hospital-optimal stable matching Hospital-oriented GS algorithm used National Resident Matching Program (US) since 1952 Pressure from student bodies associated with the NRMP led to the incorporation of the resident-oriented GS algorithm!

28 L3 #28 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } Resident-oriented GS algorithm: –Gusfield and Irving (1989), Section 1.6.3

29 L3 #29 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

30 L3 #30 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

31 L3 #31 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

32 L3 #32 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

33 L3 #33 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

34 L3 #34 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

35 L3 #35 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

36 L3 #36 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

37 L3 #37 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

38 L3 #38 Resident-oriented GS algorithm for HR assign each resident to be free ; assign each hospital to be totally unsubscribed ; while ((some resident r is free) and (r has a nonempty list)) { h := first hospital on r’s list; /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) { s’ := worst resident provisionally assigned to h ; assign s’ to be free ; delete the pair (s’,h) ; } if (h is full) { s := worst resident provisionally assigned to h ; for (each successor s’ of s on h’s list) delete the pair (s’,h) ; } r 1 : h 2 h 1 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

39 L3 #39 Resident-optimal stable matching Theorem: Given an arbitrary instance of HR: – the resident-oriented GS algorithm always terminates with a stable matching M – the algorithm takes  cmn steps, for some constant c – each resident assigned in M is assigned to the best hospital that he could be assigned to in any stable matching The matching output by the resident-oriented GS algorithm is called the resident-optimal stable matching r 1 : h 2 h 1 resident-optimal r 2 : h 1 h 2 r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

40 L3 #40 Resident-optimal stable matching Theorem: Given an arbitrary instance of HR: – the resident-oriented GS algorithm always terminates with a stable matching M – the algorithm takes  cmn steps, for some constant c – each resident assigned in M is assigned to the best hospital that he could be assigned to in any stable matching The matching output by the resident-oriented GS algorithm is called the resident-optimal stable matching r 1 : h 2 h 1 resident-optimal r 2 : h 1 h 2 hospital-optimal r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

41 L3 #41 The “Rural Hospitals Theorem” There may be more than one stable matching, but: – All stable matchings have the same size – The same residents are assigned in all stable matchings – Any hospital that is undersubscribed in one stable matching is assigned exactly the same residents in all stable matchings This is called the “Rural Hospitals Theorem” – Gusfield and Irving (1989), Section 1.6.4 r 1 : h 2 h 1 resident-optimal r 2 : h 1 h 2 hospital-optimal r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 3 r 2 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 6 r 1 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences

42 L3 #42 Summary Hospitals / Residents problem: Hospital-oriented GS algorithm Resident-oriented GS algorithm give hospital-optimal and resident-optimal stable matchings, respectively Centralised Matching Schemes National Resident Matching Program (US) Canadian Resident Matching Service Scottish PRHO Allocations scheme (SPA) all generate resident-optimal stable matchings Seminal paper: Gale and Shapley (1962): “College admissions and the stability of marriage”, American Mathematical Monthly, 69:9-15 But the NRMP’s hospital-oriented GS algorithm predated Gale and Shapley’s work by 10 years!

43 L3 #43 Hospitals/Residents problem with Ties (HRT) Participants may wish to express ties in their preference lists – Irving (1994): “Stable marriage and indifference”, Discrete Applied Mathematics, 48:261-272 r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences A matching is weakly stable if it is stable for some instance of HR obtained by breaking the ties There is always a weakly stable matching in an instance of HRT A weakly stable matching can be found using the resident-oriented GS algorithm

44 L3 #44 Hospitals/Residents problem with Ties (HRT) Participants may wish to express ties in their preference lists – Irving (1994): “Stable marriage and indifference”, Discrete Applied Mathematics, 48:261-272 r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences A matching is weakly stable if it is stable for some instance of HR obtained by breaking the ties There is always a weakly stable matching in an instance of HRT A weakly stable matching can be found using the resident-oriented GS algorithm

45 L3 #45 Hospitals/Residents problem with Ties (HRT) Participants may wish to express ties in their preference lists – Irving (1994): “Stable marriage and indifference”, Discrete Applied Mathematics, 48:261-272 r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences A matching is weakly stable if it is stable for some instance of HR obtained by breaking the ties There is always a weakly stable matching in an instance of HRT A weakly stable matching can be found using the resident-oriented GS algorithm

46 L3 #46 Hospitals/Residents problem with Ties (HRT) Participants may wish to express ties in their preference lists – Irving (1994): “Stable marriage and indifference”, Discrete Applied Mathematics, 48:261-272 r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences A matching is weakly stable if it is stable for some instance of HR obtained by breaking the ties There is always a weakly stable matching in an instance of HRT A weakly stable matching can be found using the resident-oriented GS algorithm

47 L3 #47 Weakly stable matchings in HRT r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 r 4 r 5 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 r 5 r 4 r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences The weakly stable matchings may be of different cardinalities

48 L3 #48 Maximum / minimum weakly stable matchings Do efficient algorithms exist for finding maximum or minimum cardinality weakly stable matchings, given an instance of HRT? Unfortunately, this is unlikely Each of the problems of finding a maximum or minimum weakly stable matching is “NP-hard” and the result is true even if: 1. each hospital has capacity 1 2. the ties occur in the preference lists on one side only 3. there is at most one tie per preference list, and 4. any tie is of length 2 Iwama, Manlove, Miyazaki & Morita (1999): “Stable marriage with incomplete lists and ties”, Proc. ICALP ’99 Manlove, Irving, Iwama, Miyazaki & Morita (2002): “Hard Variants of Stable Marriage”, Theoretical Computer Science, 276 (1-2) : 261-279, 2002

49 L3 #49 Summary: weakly stable matchings Weakly stable matchings can be of different sizes, and it is hard to find a maximum-sized weakly stable matching Weakly stable matchings could be undermined by a “bribery” situation r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences r 1 : h 1 h 2 r 2 : h 1 h 2 Each hospital has 2 posts r 3 : h 1 h 3 r 4 : h 2 h 3 h 1 : r 1 r 2 r 3 r 5 r 6 r 5 : h 2 h 1 h 2 : r 2 r 1 r 6 (r 5 r 4 ) r 6 : h 1 h 2 h 3 : r 4 r 3 Resident preferences Hospital preferences Define a stronger form of stability in HRT

50 L3 #50 Super-stable matchings in HRT A matching is super-stable if it is stable in every instance of HR obtained by breaking the ties A super-stable matching is weakly stable Proposition: Let I be an instance of HRT. If I admits a super-stable matching then all weakly stable matchings have the same size Therefore a super-stable matching cannot match fewer people than would be matched by a weakly stable matching A super-stable matching also guards against “bribery” But, a super-stable matching may not exist! Efficient algorithm to find a super-stable matching, if one exists, given an HRT instance – Irving, Manlove and Scott (2000): “The Hospitals / Residents Problem with Ties”, Proc. SWAT 2000

51 L3 #51 Algorithm for HRT under super-stability assign each resident to be free ; assign each hospital to be totally unsubscribed ; for (each hospital h) full(h) := false ; while ((some resident r is free) and (r has a nonempty list)) { for (each hospital h at the head of r’s list) { /* r proposes to h */ provisionally assign r to h ; if (h is oversubscribed) for (each resident s’ at the tail of h’s list) { if (s’ is provisionally assigned to h) break the assignment ; delete the pair (s’,h ) ; } if (h is full) { full(h) := true ; s := worst resident provisionally assigned to h ; for (each strict successor s’ of s on h’s list) delete the pair (s’,h ) ; } } } if ((some resident is multiply assigned) or (some hospital h is undersubscribed and full(h) ) no super-stable matching exists ; else the assignment relation is a super-stable matching ;

52 L3 #52 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

53 L3 #53 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

54 L3 #54 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

55 L3 #55 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

56 L3 #56 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

57 L3 #57 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

58 L3 #58 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

59 L3 #59 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

60 L3 #60 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

61 L3 #61 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 full r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

62 L3 #62 Example execution of the algorithm r 1 : h 2 h 1 Each hospital has 2 posts r 2 : h 1 h 2 r 3 : h 1 h 3 r 4 :(h 2 h 3 ) h 1 : r 3 r 1 r 2 r 5 r 6 r 5 : h 1 h 2 h 2 : r 2 r 1 r 6 (r 4 r 5 ) r 6 : h 2 h 1 h 3 : r 4 r 3 Resident preferences Hospital preferences During the proposal sequence, for any hospital h, – If h is oversubscribed then all residents tied in h’s last place are rejected – If h is full then all residents strictly poorer than h’s worst provisional assignee are prevented from proposing to h At termination – if some hospital is undersubscribed and was previously full or – some resident is multiply assigned then no super-stable matching exists, otherwise the assignment relation is a super-stable matching

63 L3 #63 Super-stable matchings in HRT Theorem: Given an arbitrary instance of HRT: – the algorithm either finds a super-stable matching M, or reports that none exists – the algorithm takes  cmn steps, for some constant c – each resident assigned in M is assigned to the best hospital that he could obtain in any super-stable matching We can also formulate a hospital-oriented algorithm Theorem: There may be more than one super-stable matching, but: – All super-stable matchings have the same size – The same residents are assigned in all super-stable matchings – Any hospital that is undersubscribed in one super-stable matching is assigned exactly the same residents in all super-stable matchings

64 L3 #64 Super-stable vs. weakly stable matchings If a super-stable matching exists, it should be chosen in favour of a weakly stable matching Existence of a super-stable matching Structure of super-stable matchings in HRT Website for Stable Matching Algorithms project: http://www.dcs.gla.ac.uk/research/algorithms/stable start Let I be an HRT instance Does I admit a super-stable matching? Find a super-stable matching Find a weakly stable matching No Yes stop

65 L3 #65 Strategic Issues Suppose that I is an instance of HR What if a set S of residents were to falsify their true preferences in I, in the hope of achieving a better hospital? Example (each hospital has 1 post): r 1 : h 1 h 2 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 1 h 2 h 3 h 4 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences

66 L3 #66 Strategic Issues Suppose that I is an instance of HR What if a set S of residents were to falsify their true preferences in I, in the hope of achieving a better hospital? Example (each hospital has 1 post): r 1 : h 1 h 2 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 1 h 2 h 3 h 4 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences

67 L3 #67 Strategic Issues Suppose that I is an instance of HR What if a set S of residents were to falsify their true preferences in I, in the hope of achieving a better hospital? Example (each hospital has 1 post): r 1 : h 1 h 2 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 1 h 2 h 3 h 4 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences Suppose now that residents 1 and 2 falsify their preference lists r 1 : h 2 h 1 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 2 h 4 h 1 h 3 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences

68 L3 #68 Strategic Issues Suppose that I is an instance of HR What if a set S of residents were to falsify their true preferences in I, in the hope of achieving a better hospital? Example (each hospital has 1 post): r 1 : h 1 h 2 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 1 h 2 h 3 h 4 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences Suppose now that residents 1 and 2 falsify their preference lists r 1 : h 2 h 4 h 1 h 3 h 1 : r 4 r 1 r 2 r 3 r 2 : h 2 h 4 h 1 h 3 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences

69 L3 #69 Strategic Issues Suppose that I is an instance of HR What if a set S of residents were to falsify their true preferences in I, in the hope of achieving a better hospital? Example (each hospital has 1 post): r 1 : h 1 h 2 h 3 h 4 h 1 : r 4 r 1 r 2 r 3 r 2 : h 1 h 2 h 3 h 4 h 2 : r 3 r 1 r 2 r 4 r 3 : h 1 h 2 h 3 h 4 h 3 : r 1 r 2 r 4 r 3 r 4 : h 3 h 1 h 2 h 4 h 4 : r 1 r 2 r 3 r 4 Resident preferences Hospital preferences Residents r 1, r 3 and r 4 have improved their assigned hospitals But, S={r 1,r 2 } was the set of liars Is it possible for all members of the set S to obtain a better hospital?

70 L3 #70 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals!

71 L3 #71 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 1 r 2 r 3 r 4 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences

72 L3 #72 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 1 r 2 r 3 r 4 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences

73 L3 #73 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 1 r 2 r 3 r 4 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences Now suppose that hospital h 1 distorts its true preferences in the hope of obtaining a better set of residents

74 L3 #74 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 2 r 4 r 1 r 3 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences Now suppose that hospital h 1 distorts its true preferences in the hope of obtaining a better set of residents

75 L3 #75 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 2 r 4 r 1 r 3 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences Now suppose that hospital h 1 distorts its true preferences in the hope of obtaining a better set of residents

76 L3 #76 Strategic Issues Let P denote the true preferences in I, and let P’ denote the falsified preferences in I Theorem: There is no stable matching in P’ such that every resident in S obtains a better partner than he obtains in the resident-optimal stable matching in P However the same need not be true of hospitals! Example (h 1 has 2 posts; h 2, h 3 have 1 post each) r 1 : h 3 h 1 h 2 h 1 : r 1 r 2 r 3 r 4 r 2 : h 2 h 1 h 3 h 2 : r 1 r 2 r 3 r 4 r 3 : h 1 h 3 h 2 h 3 : r 3 r 1 r 2 r 4 r 4 : h 1 h 2 h 3 Resident preferences Hospital preferences Hospital h 1 has gained a better set of residents Roth and Sotomayor (1990), “Two-Sided Matching: A Study in Game-Theoretic Modeling and Analysis”, Econometric Society Monographs, Cambridge Univ. Press

77 L3 #77 Summary Hospital / Residents problem (HR) – All hospitals have capacity 1: stable marriage problem with unacceptable partners – Resident-oriented GS algorithm for HR – Hospital-oriented GS algorithm for HR Hospitals / Residents problem with Ties (HRT) – Weakly stable matchings – Super-stable matchings Strategic issues in HR Open questions: – Existence of super-stable matchings – Structure of super-stable matchings – Heuristics for finding large weakly stable matchings – Strategic issues for HRT


Download ppt "L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant."

Similar presentations


Ads by Google