520 likes | 623 Views
Strong Stability in the Hospitals/Residents Problem. Rob Irving, David Manlove and Sandy Scott. University of Glasgow Department of Computing Science S upported by E PSR C grant GR/R84597/01, Nuffield Foundation award NUF-NAL-02, and RSE / SEETLLD Personal Research Fellowship.
E N D
Strong Stability in the Hospitals/Residents Problem Rob Irving,David Manloveand Sandy Scott University of Glasgow Department of Computing Science Supported by EPSRC grant GR/R84597/01, Nuffield Foundation award NUF-NAL-02, and RSE / SEETLLD Personal Research Fellowship
Hospitals/Residentsproblem (HR): Motivation • Graduating medical students or residents seek hospital appointments • Free-for-all markets are chaotic • Centralised matching schemes are in operation • Schemes produce stable matchingsof residents to hospitals • National Resident Matching Program (US) • other large-scale matching schemes, both educational and vocational
Hospitals/Residentsproblem (HR): Definition • A set H of hospitals,a setRofresidents • Each resident r ranks asubset of H in strict order of preference • r finds hacceptableif h appears on r’s preference list • Each hospital h has ph posts, and ranks in strict order those residents who find h acceptable • A matching M is a subset of R×H such that: • (r,h)Mimplies that r findshacceptable • Each resident ris assigned at most one hospital • Each hospital his assigned at most ph residents
r1: h2 h3 h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 h1 h3 r6: h3 h1:3: r2 r1 r3 r5 h2:2: r3 r2 r1 r4 r5 h3:1: r4 r5 r1 r3 r6 An instance of HR
r1: h2 h3 h1 r2: h2h1 r3: h3 h2h1 r4: h2 h3 r5: h2 h1 h3 r6: h3 h1:3: r2 r1r3 r5 h2:2: r3 r2r1 r4r5 h3:1: r4 r5 r1 r3r6 A matching in HR
Stable matchings in HR • Matching M is stable if M admits no blocking pair • (r,h) is a blocking pair of matching M if: • r finds h acceptable and • eitherr is unmatched in Morr prefers h to his assigned hospital in M and • eitherh is undersubscribed in Mor h prefers r to its worst resident assigned in M
r1: h2 h3 h1 r2: h2h1 r3: h3 h2h1 r4: h2 h3 r5: h2 h1 h3 r6: h3 h1:3: r2 r1r3 r5 h2:2: r3 r2r1 r4r5 h3:1: r4 r5 r1 r3r6 A blocking pair • (r4, h2) is a blocking pair of matching M since: • r4 finds h2 acceptable • r4 is unmatched in M • h2prefersr4to its worst resident assigned in M
r1: h2 h3h1 r2: h2 h1 r3: h3h2 h1 r4: h2h3 r5: h2h1 h3 r6: h3 h1:3: r2r1 r3r5 h2:2: r3 r2 r1 r4 r5 h3:1: r4 r5 r1 r3 r6 A stable matching • Example shows that, in a stable matching, • one or more residents may be unmatched • one or more hospitals may be undersubscribed
Algorithmic results for HR • Every instance of HR admits at least one stable matching • Such a matching can be found in linear time using the Gale / Shapley algorithm • Resident-oriented version finds the resident-optimal stable matching • Each resident obtains the best hospital that he could obtain in any stable matching • Hospital-orientedversion finds the hospital-optimal stable matching • Each hospital obtains the best set of residents that it could obtain in any stable matching
The Rural Hospitals Theorem • For a given instance of HR, there may be more than one stable matching, but: • All stable matchings have the same size • The same set of residents are matched in all stable matchings • Any hospital that is undersubscribed in one stable matching has exactly same residents in all stable matchings • This is the Rural Hospitals Theorem
Ties in the preference lists • Participants may wish to express ties in their preferences lists: h1 : r7 (r1 r3) r5 • version of HR with ties is HRT • more general form of indifference involves partial orders • version of HR with partial orders is HRP • Three stability definitions are possible: • Weak stability • Strong stability • Super-stability
r1:(h2 h3) h1 r2: h2 h1 r3: h3 (h1 h2) r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2 (r1 r4 r5) h3:1:(r4 r5) (r1 r3 r6) An instance of HRT
Weak stability • Matching M is weakly stable if M admits no blocking pair • (r,h) is a blocking pair of matching M if: • r finds h acceptable • eitherr is unmatched in Morrstrictly prefers h to his assigned hospital in M • eitherh is undersubscribed in Mor hstrictly prefers r to its worst resident assigned in M • That is, if (r,h)joined together, both would be better off
r1:(h2h3) h1 r2: h2 h1 r3: h3 (h1 h2) r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1r3) r5 h2:2: r3r2 (r1r4 r5) h3:1:(r4 r5) (r1 r3 r6) A weakly stable matching in HRT Weakly stable matching has size 5
r1:(h2 h3) h1 r2: h2 h1 r3: h3 (h1 h2) r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2 (r1r4 r5) h3:1:(r4 r5) (r1r3r6) A second weakly stable matching in HRT Weakly stable matching has size 6
Weak stability in HRT: algorithmic results • Weakly stable matching always exists and can be found in linear time • Gusfield and Irving, 1989 • Weakly stable matchings can have different sizes • Problem of finding a maximum cardinality weakly stable matching is NP-hard, even if each hospital has 1 post(i.e. instance of stable marriage problem with ties and incomplete lists) • Iwama, Manlove, Miyazaki and Morita, ICALP ’99 • Result holds even if the ties occur on one side only, at most one tie per list, and each tie is of length 2 • Manlove, Irving, Iwama, Miyazaki, Morita, TCS 2002 • Result also holds for minimum weakly stable matchings
Weak stability: lower bounds • Problem of finding a maximum cardinality weakly stable matching in HRT is APX-complete, even if each hospital has 1 post • Halldórsson, Iwama, Miyazaki, Morita, LATIN 2002 • Ties on both sides, ties of length 2 • Ties on one side only, ties of length ≤3 • Halldórsson, Iwama, Miyazaki, Yanagisawa, ESA 2003 • Ties on one side only, ties of length 2 • NP-hard to approximate maximum within21/19 • Halldórsson, Irving, Iwama, Manlove, Miyazaki, Morita, Scott, TCS 2003 • Ties on one side only, preference lists of constant length • Result also holds for minimum weakly stable matchings
Weak stability: upper bounds • Problem of finding a maximum or minimum cardinality weakly stable matching is approximable within 2 • Manlove, Irving, Iwama, Miyazaki, Morita, TCS 2002 • If each hospital has 1 post, problem of finding a maximum cardinality weakly stable matching is approximable within: • 2/(1+L-2) – ties on one side only, ties of length ≤L • 13/7– ties on both sides, ties of length 2 • Halldórsson, Iwama, Miyazaki, Yanagisawa, ESA 2003 • 10/7 (expected) – ties on one side only, ≤1tie per list, ties of length 2 • 7/4 (expected) – ties on both sides, ≤nties, ties of length 2 • Halldórsson, Iwama, Miyazaki, Yanagisawa, COCOON 2003 • Let s+ and s- denote the sizes of a maximum and minimum cardinality weakly stable matching, and let t be the number of lists with ties. If each hospital has 1 post, any weakly stable matching M satisfies: • s+ - t ≤ |M| ≤ s- + t • Halldórsson, Irving, Iwama, Manlove, Miyazaki, Morita, Scott, TCS 2003
Super-stability • Matching M is super-stable if M admits no blocking pair • (r,h) is a blocking pair of matching M if: • r finds h acceptable • eitherr is unmatched in Morr strictly prefers h to his assigned hospital in M or r is indifferent between them • eitherh is undersubscribed in Mor h strictly prefers r to its worst resident assigned in M orh is indifferent between them • That is, if (r,h)joined together, neither would be worse off
Super-stable matchings in HRT • A matching is super-stable in an instance of HRT if it is stable in every instance of HR obtained by breaking the ties • A super-stable matching is weakly stable • “Rural Hospitals Theorem” also holds for HRT under super-stability • Irving, Manlove, Scott, SWAT 2000 • A super-stable matching may not exist: r1:(h1 h2) h1:1:(r1 r2) r2:(h1 h2) h2:1:(r1 r2)
Finding a super-stable matching • Stable marriage problem with ties (i.e. HRT with |R|=|H|=n and each hospital has 1 post): • O(n2) algorithm • Irving, Discrete Applied Mathematics, 1994 • General HRT case • O(L) algorithm, where L is total length of preference lists • Algorithm can be extended to HRP case • Irving, Manlove, Scott, SWAT 2000
Strong stability in HRT • A matching M is strongly stableunless there is an acceptable pair (r,h)M such that, if they joined together, one would be better off and the other no worse off • Such a pair constitutes a blocking pair • A super-stable matching is strongly stable, and a strongly stable matching is weakly stable • Ties on one side only super-stability = strong stability • An instance of HRT may admit no strongly stable matching: r1: h1 h2 h1:1:(r1 r2) r2: h1 h2 h2:1: r1 r2
r1: (h2 h3) h1 r2: h2h1 r3: h3 h2h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1r3) r5 h2:2: r3 r2 (r1r4r5) h3:1: (r4 r5) (r1 r3) r6 A blocking pair r4 and h2 form a blocking pair
r1: (h2 h3) h1 r2: h2h1 r3: h3 h2h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1r3) r5 h2:2: r3 r2 (r1r4r5) h3:1: (r4 r5) (r1 r3) r6 Another blocking pair r1 and h3 form a blocking pair
Finding a strongly stable matching • Stable marriage problem with ties (i.e. HRT with |R|=|H|=n and each hospital has 1 post): • O(n4) algorithm • Irving, Discrete Applied Mathematics, 1994 • General HRT case • O(L2) algorithm, where L is total length of preference lists • HRP case • Deciding whether a strongly stable matching exists is NP-complete • Irving, Manlove, Scott, STACS 2003
The algorithm in brief repeat provisionally assign all free residents to hospitals at head of list form reduced provisional assignment graph find critical set of residents and make corresponding deletions until critical set is empty form a feasible matching check if feasible matching is strongly stable
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 An instance of HRT
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 A provisional assignmentand a dominated resident
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 A deletion
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2(r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 Another provisional assignment
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 Several provisional assignments
Provisional assignment graph with one bound resident r1 h1:(3) r2 h2:(2) r3 r4 h3:(1) r5
Removing a bound resident r1 h1:(3) r2 h2:(1) r3 r4 h3:(1) r5
Reduced provisional assignment graph r1 h2:(1) r3 r4 h3:(1) r5
Critical set r1 h2:(1) r3 r4 h3:(1) r5
r1: (h2 h3) h1 r2: h2 h1 r3: h3 h2 h1 r4: h2h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 Critical set
r1: (h2 h3) h1 r2: h2 h1 r3: h3h2 h1 r4: h2h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2(r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 Deletions from the critical set, end of loop iteration
r1: (h2 h3)h1 r2: h2 h1 r3: h3 h2 h1 r4: h2 h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3r2(r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 Second loop iteration, starting with a provisional assignment
r1: (h2 h3)h1 r2: h2 h1 r3: h3h2 h1 r4: h2h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2(r1 r4 r5) h3:1: (r4r5) (r1 r3) r6 Several provisional assignments
Final provisional assignment graph with 4 bound residents r1 h1:(3) r2 h2:(2) r3 r4 h3:(1) r5
Removing a bound resident r1 h1:(2) r2 h2:(2) r3 r4 h3:(1) r5
Removing a second bound resident r1 h1:(2) r2 h2:(1) r3 r4 h3:(1) r5
Removing a third bound resident r1 h1:(2) r2 h2:(0) r3 r4 h3:(1) r5
Removing a bound resident with an additional provisional assignment r1 h1:(1) r2 h2:(0) r3 r4 h3:(1) r5
This consists of: the bound (resident,hospital) pairs (r1,h1), (r2,h2), (r3,h2), (r5,h1) unioned together with: perfect matching in the final reduced provisional assignment graph (r4,h3) A feasible matching
r1: (h2 h3) h1 r2: h2 h1 r3: h3h2 h1 r4: h2h3 r5: h2 (h1 h3) r6: h3 h1:3: r2 (r1 r3) r5 h2:2: r3 r2 (r1 r4 r5) h3:1: (r4 r5) (r1 r3) r6 A strongly stable matching (r1,h1), (r2,h2), (r3,h2), (r4,h3), (r5,h1)
The algorithm in full (1) repeat { while some resident r is free and has a non-empty list for each hospital h at the head of r’s list { provisionally assign r to h; ifh is fully-subscribed or over-subscribed { for each resident r' dominated on h’s list delete the pair (r',h); } } form the reduced provisional assignment graph; find the critical set Z of residents; for each hospital hN(Z) for each resident r in the tail of h’s list delete the pair (r,h); } untilZ = ;
The algorithm in full (2) let G be the final provisional assignment graph; let M be a feasible matching in G; if M is strongly stable output M; else no strongly stable matching exists;
Theoretical results • Algorithm has complexity O(L2), where L is total length of preference lists • Bounded below by complexity of finding a perfect matching in a bipartite graph • Matching produced by the algorithm is resident-optimal • “Rural Hospitals Theorem” holds for HRT under strong stability