780 likes | 807 Views
The Hospitals / Residents Problem and Some E xtensions D avid Manlove University of Glasgow D epartment of C omputing Science. Supported by E PSR C grant GR/M13329 and Nuffield Foundation award NUF-NAL-02. Medical matching: general situation
E N D
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
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
Hospitals/Residents problem (HR): definitions • n residents r1,r2,…,rn • m hospitals h1,h2,…,hm • Hospital hihas capacityci • Each resident ranks a subset of the hospitals in • strict order of preference • Each hospital ranks its applicants in strict • orderof preference • rfinds hacceptable if h is on r’s preference list;rfinds hunacceptable 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
Hospitals/Residents problem: example r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
Hospitals/Residents problem: matching r1:h2h1 r2:h1h2 Each hospital has 2 posts r3:h1h3 r4:h2 h3h1:r1r3r2r5 r6 r5:h2 h1h2:r2r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences M = {(r1, h1), (r2, h2), (r3, h3), (r5, h2), (r6, h1)} (size 5)
Hospitals/Residents problem: matching • r1:h2h1 • r2:h1h2 Each hospital has 2 posts • r3:h1h3 • r4:h2 h3h1:r1 r3r2r5 r6 • r5:h2 h1h2:r2r6r1r4 r5 • r6:h1 h2h3:r4 r3 • 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) eitherr is unmatched in M • orr prefers h to his/her assigned hospital in M • and • 3) eitherh is undersubscribed in M • or h prefers r to its worst resident assigned in M
HR: unstable matching • r1:h2h1 • r2:h1h2 Each hospital has 2 posts • r3:h1h3 • r4:h2 h3h1:r1r3r2r5 r6 • r5:h2 h1h2:r2r6r1r4 r5 • r6:h1 h2h3:r4 r3 • 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) eitherr is unmatched in M • orr prefers h to his/her allocated hospital in M • and • 3) eitherh is undersubscribed in M • or h prefers r to its worst resident assigned in M • Matching above is unstable as e.g. (r2,h1), (r4,h2) and (r4,h3) are blocking pairs
HR: unstable matching • r1:h2h1 • r2:h1h2 Each hospital has 2 posts • r3:h1h3 • r4:h2 h3h1:r1r3r2r5 r6 • r5:h2 h1h2:r2r6r1r4 r5 • r6:h1 h2h3:r4 r3 • 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) eitherr is unmatched in M • orr prefers h to his/her allocated hospital in M • and • 3) eitherh is undersubscribed in M • or h prefers r to its worst resident assigned in M • Matching above is unstable as e.g. (r2,h1), (r4,h2) and (r4,h3) are blocking pairs
HR: unstable matching • r1:h2h1 • r2:h1h2 Each hospital has 2 posts • r3:h1h3 • r4:h2 h3h1:r1r3r2r5 r6 • r5:h2 h1h2:r2r6r1r4 r5 • r6:h1 h2h3:r4 r3 • 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) eitherr is unmatched in M • orr prefers h to his/her allocated hospital in M • and • 3) eitherh is undersubscribed in M • or h prefers r to its worst resident assigned in M • Matching above is unstable as e.g. (r2,h1), (r4,h2) and (r4,h3) are blocking pairs
HR: stable matching • r1:h2 h1 • r2:h1 h2 Each hospital has 2 posts • r3:h1 h3 • r4:h2h3h1:r1 r3r2r5 r6 • r5:h2 h1h2:r2 r6r1r4 r5 • r6:h1h2h3:r4r3 • Resident preferences Hospital preferences • Matching M is stable if M admits no blocking pair • (r,h) is a blocking pair of matching Mif • 1)r, h find each other acceptable • and • 2) eitherr is unmatched in M • orr prefers h to his/her allocated hospital in M • and • 3) eitherh 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
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 {m1,m2,…,mn} • a set of m women {w1,w2,…,wm} • for each person q, a preference list in • which q ranks a subset of the members • of the opposite sex in strict order • AmatchingMis a set of disjoint (man,woman) • pairs such that (m,w)Monly if: • m finds w acceptable • wfinds m acceptable
Unacceptable partners: example instance • m1: w4 w1 w3w1: m4 m1 m2 • m2: w2 w1 w4w2: m3 m2 m4 • m3: w2 w4 w3w3: m1 m3 • m4: w1 w4 w2w4: m4 m1 m3 m2 • 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. mis unmatched in M or prefers w to his partner in M 3. wis unmatched in M or prefers m to her partner in M • Matching M is stable if M admits no blocking • pair
Unacceptable partners: example instance • m1: w4 w1 w3w1: m4 m1 m2 • m2: w2 w1 w4w2: m3m2 m4 • m3: w2 w4 w3w3: m1 m3 • m4: w1 w4 w2w4: m4m1 m3 m2 • 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. mis unmatched in M or prefers w to his partner in M 3. wis unmatched in M or prefers m to her partner in M • Matching M is stable if M admits no blocking • pair
Unacceptable partners: example instance • m1: w4 w1 w3w1: m4 m1 m2 • m2: w2 w1 w4w2: m3m2 m4 • m3: w2 w4 w3w3: m1 m3 • m4: w1 w4 w2w4: m4m1 m3 m2 • 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. mis unmatched in M or prefers w to his partner in M 3. wis 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 (m3,w2)and • (m3,w3)are blocking pairs
Unacceptable partners: example instance • m1: w4 w1 w3w1: m4 m1 m2 • m2: w2 w1 w4w2: m3m2 m4 • m3: w2 w4 w3w3: m1 m3 • m4: w1 w4 w2w4: m4m1 m3 m2 • 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. mis unmatched in M or prefers w to his partner in M 3. wis 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 (m3,w2)and • (m3,w3)are blocking pairs
Unacceptable partners: example instance • m1: w4 w1 w3w1: m4 m1 m2 • m2: w2 w1 w4w2: m3 m2 m4 • m3: w2 w4 w3w3: m1 m3 • m4: w1 w4 w2w4: m4m1 m3 m2 • 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. mis unmatched in M or prefers w to his partner in M 3. wis 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
Revised Gale/Shapley (GS) algorithm • A stable matching always exists for a stable • marriage instancewith unacceptable partners • Astable matchingMmay be found efficiently • using the revisedGale/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
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
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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’) ; } r1:h2h1 r2:h1h2 Each hospital has 2 posts r3:h1 h3 r4:h2h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1h2h3:r4r3 Resident preferences Hospital preferences
Hospital-optimal stable matching • Theorem: Given an arbitrary instance of HR: • the hospital-oriented GS algorithm always • terminates with a stable matchingM • 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!
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
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2 h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1 h2h3:r4 r3 Resident preferences Hospital preferences
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) ; } } r1:h2 h1 r2:h1 h2 Each hospital has 2 posts r3:h1 h3 r4:h2h3h1:r1 r3r2r5 r6 r5:h2 h1h2:r2 r6r1r4 r5 r6:h1h2h3:r4r3 Resident preferences Hospital preferences
Resident-optimal stable matching • Theorem: Given an arbitrary instance of HR: • the resident-oriented GS algorithm always • terminates with a stable matchingM • 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 • r1:h2 h1 resident-optimal • r2:h1 h2 • r3:h1 h3 • r4:h2 h3h1:r1 r3r2r5 r6 • r5:h2 h1h2:r2 r6r1r4 r5 • r6:h1 h2h3:r4 r3 • Resident preferences Hospital preferences
Resident-optimal stable matching • Theorem: Given an arbitrary instance of HR: • the resident-oriented GS algorithm always • terminates with a stable matchingM • 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 • r1:h2 h1 resident-optimal • r2:h1 h2 hospital-optimal • r3:h1 h3 • r4:h2 h3h1:r1 r3r2r5 r6 • r5:h2 h1h2:r2 r6r1r4 r5 • r6:h1 h2h3:r4 r3 • Resident preferences Hospital preferences
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 • r1:h2 h1 resident-optimal • r2:h1 h2 hospital-optimal • r3:h1 h3 • r4:h2 h3h1:r1 r3r2r5 r6 • r5:h2 h1h2:r2 r6r1r4 r5 • r6:h1 h2h3:r4 r3 • Resident preferences Hospital preferences
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!
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 • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6(r4 r5) • r6:h1h2 h3:r4r3 • 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
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 • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6 r4 r5 • r6:h1h2 h3:r4r3 • 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
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 • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6 r4 r5 • r6:h1h2 h3:r4r3 • 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
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 • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6 (r4 r5) • r6:h1h2 h3:r4r3 • 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
Weakly stable matchings in HRT • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3 h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6 r4 r5 • r6:h1h2 h3:r4r3 • Resident preferences Hospital preferences • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3 h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6 r5 r4 • r6:h1h2 h3:r4r3 • Resident preferences Hospital preferences • The weakly stable matchings may be of • differentcardinalities
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 • marriagewith 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
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 • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6(r4 r5) • r6:h1h2 h3:r4r3 • Resident preferences Hospital preferences • r1:h1h2 • r2:h1h2Each hospital has 2 posts • r3:h1h3 • r4:h2h3 h1:r1r2r3r5r6 • r5:h2h1 h2:r2r1r6(r5 r4) • r6:h1h2 h3:r4r3 • Resident preferences Hospital preferences • Define a stronger form of stability in HRT
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 weaklystable 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