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

Slides:



Advertisements
Similar presentations
1 Stable Matching A Special Case of Stable Marriage.
Advertisements

Strong Stability in the Hospitals/Residents Problem Robert W. Irving, David F. Manlove and Sandy Scott University of Glasgow Department of Computing Science.
1 Almost stable matchings in the Roommates problem David Abraham Computer Science Department Carnegie-Mellon University Péter Biró Department of Computer.
Modelling and Solving the Stable Marriage problem using Constraint Programming David Manlove and Gregg OMalley University Of Glasgow Department of Computing.
Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science.
1 Student-Project Allocation with Preferences over Projects David Manlove Gregg OMalley University of Glasgow Department of Computing Science Supported.
1 Student-Project Allocation with Preferences over Projects David Manlove University of Glasgow Department of Computing Science Joint work with Gregg OMalley.
Strong Stability in the Hospitals/Residents Problem
Blah blah blah. Zoes shark Thanks to the conference artist Phoebe.
The Stable Marriage Problem and Constraint Programming.
LAW February A 5/3 approximation algorithm for a hard case of stable marriage Rob Irving Computing Science Department University of Glasgow (joint.
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 2.
Naveen Garg, CSE, IIT Delhi
Matching Theory.
Men Cheating in the Gale-Shapley Stable Matching Algorithm Chien-Chung Huang Dartmouth College.
Matching problems Toby Walsh NICTA and UNSW. Motivation Agents may express preferences for issues other than a collective decision  Preferences for a.
Joint work with Rob Irving
1 Stable Marriage Problem. 2 Consider a society with n men (denoted by capital letters) and n women (denoted by lower case letters). A marriage M is a.
Stabile Marriage Thanks to Mohammad Mahdian Lab for Computer Science, MIT.
Chapter 26 of CLSR Bipartite Matching By Dr. M. Sakalli, Sources: Levitin and many other CSE, Marmara Univ. May/2009.
Lecture 4 CSE 331 Sep 9, Blog posts for lectures Starts from today See Sep 8 post on the blog.
A Longer Example: Stable Matching UNC Chapel HillZ. Guo.
Strong Stability in the Hospitals/Residents Problem Robert W. Irving, David F. Manlove and Sandy Scott University of Glasgow Department of Computing Science.
The Stable Marriage Problem
1 Stable Matching Problem Goal. Given n men and n women, find a "suitable" matching. n Participants rate members of opposite sex. n Each man lists women.
Pareto Optimality in House Allocation Problems David Manlove Department of Computing Science University of Glasgow David Abraham Computer Science Department.
Pareto Optimality in House Allocation Problems David Manlove Department of Computing Science University of Glasgow David Abraham Computer Science Department.
Lecture 2 CSE 331. Day 1 Survey On UBlearns Day 1 Survey (talking points) Security MS PhD for research Building PC’s for 442 It’s ok to play games –
Stable Matchings a.k.a. the Stable Marriage Problem
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Lecture 23: Stable Marriage ( Based on Lectures of Steven Rudich of CMU and Amit Sahai of Princeton) Shang-Hua Teng.
Stable Matching Lecture 7: Oct 3. Matching A B C DE Boys Girls Today’s goal: to “match” the boys and the girls in a “good” way.
1 Chapter 1 Introduction: Some Representative Problems Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
A Constraint Programming Approach to the Hospitals / Residents Problem By David Manlove, Gregg O’Malley, Patrick Prosser and Chris Unsworth.
Algorithms for Student-Project Allocation
Design & Co-design of Embedded Systems Final Project: “The Match Maker” Second Phase Oral Presentation Safa S. Mahmoodian.
The Stable Marriage Problem
Incentive compatibility in 2-sided matching markets
Matching Lecture 19: Nov 23.
Sep 29, 2014 Lirong Xia Matching. Report your preferences over papers soon! –deadline this Thursday before the class Drop deadline Oct 17 Catalan independence.
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
1 “Almost stable” matchings in the Roommates problem David Abraham Computer Science Department Carnegie-Mellon University, USA Péter Biró Department of.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Market Design and Analysis Lecture 2 Lecturer: Ning Chen ( 陈宁 )
Market Design and Analysis Lecture 1 Lecturer: Ning Chen ( 陈宁 )
Pareto Optimality in House Allocation Problems David Manlove Department of Computing Science University of Glasgow David Abraham Computer Science Department.
Centralised matching schemes
Matching Boys Girls A B C D E
Cybernetica AS & Tartu University
Stable Matching.
Chapter 1 Introduction: Some Representative Problems
Stable Marriage Problem
Introduction to the Design and Analysis of Algorithms
Chapter 10 Iterative Improvement
CSE 421: Introduction to Algorithms
Lecture 6 CSE 331 Sep 11, 2017.
“Almost stable” matchings in the Roommates problem
Matching Lirong Xia March 8, Matching Lirong Xia March 8, 2016.
CSE 421: Introduction to Algorithms
1.1 A First Problem: Stable Matching
Blah blah blah.
Chapter 1 Introduction: Some Representative Problems
Popularity in the Capacitated House Allocation Problem
Lecture 6 CSE 331 Sep 12, 2016.
Lecture 7 CSE 331 Sep 10, 2014.
Piyush Kumar (Lecture 3: Stable Marriage)
A Grand Tour of Stable Matching Problems
Lecture 7 CSE 331 Sep 11, 2013.
Presentation transcript:

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

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

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

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

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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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!

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

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

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

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

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

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

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

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

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

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

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

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

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

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 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

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!

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: 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

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: 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

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: 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

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: 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

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

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) : , 2002

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

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

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 ;

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

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

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

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

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

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

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

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

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

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

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

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

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: 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

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

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

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

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

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?

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!

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

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

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

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

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

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

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