stable matching problems with constant length preference lists rob irving, david manlove, gregg...

18
Stable Matching Stable Matching Problems with Problems with Constant Length Constant Length Preference Lists Preference Lists Rob Irving, David Manlove, Rob Irving, David Manlove, Gregg O’Malley Gregg O’Malley University Of Glasgow University Of Glasgow Department of Computing Department of Computing Science Science

Upload: joshua-jones

Post on 28-Mar-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Stable Matching Stable Matching Problems with Problems with

Constant Length Constant Length Preference ListsPreference ListsRob Irving, David Manlove,Rob Irving, David Manlove, Gregg Gregg

O’MalleyO’Malley

University Of GlasgowUniversity Of Glasgow

Department of Computing Department of Computing ScienceScience

Page 2: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

SMTI FormalisationSMTI Formalisation SetSet ofof nn11 men men SSMM = {m = {m1 1 , m, m2 2 , …., m, …., mnn11

}} SetSet ofof nn22 women women SSW W = {w= {w1 1 , w, w2 2 , …., w, …., wnn22

}}

Each man Each man mmii ranks a subset of ranks a subset of SSWW in preference order, in preference order, and and mmii’s list may contain ties.’s list may contain ties.

Each woman Each woman wwjj ranks a subset of ranks a subset of SSMM in preference order, in preference order, and and wwjj’s list may contain ties.’s list may contain ties.

A matching A matching MM is a set of (man , woman) pairs is a set of (man , woman) pairs (m,w)(m,w) such such that each of that each of mm and and ww appear in at most one pair, and appear in at most one pair, and mm and and ww are on each other’s list. are on each other’s list.

We say a (man, woman) pair We say a (man, woman) pair (m , w)(m , w) blocksblocks MM if: if: Either Either mm is unmatched is unmatched oror mm strictly prefers strictly prefers ww to his partner to his partner

in in MM,, andand Either Either ww is unmatched is unmatched oror ww strictly prefers strictly prefers mm to her partner to her partner

in in MM.. A matching that admits no blocking pair is said to be A matching that admits no blocking pair is said to be

stablestable Can’t improve by making an arrangement outside Can’t improve by making an arrangement outside

the matchingthe matching..

Page 3: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

PropertiesProperties When When no tiesno ties are allowed in a participant’s list: are allowed in a participant’s list:

A stable matching for an instance of SMI can always be A stable matching for an instance of SMI can always be found using a slightly modified version of an algorithm found using a slightly modified version of an algorithm known as the Gale/Shapley algorithm (1962).known as the Gale/Shapley algorithm (1962).

Gale and Sotomayor also proved in 1985 that for an Gale and Sotomayor also proved in 1985 that for an instance of SMI all stable matchings have the same size.instance of SMI all stable matchings have the same size.

When When tiesties are allowed in a participant’s list: are allowed in a participant’s list: Again we can always find a stable matching for an Again we can always find a stable matching for an

instance of SMTI by breaking the ties arbitrarily and instance of SMTI by breaking the ties arbitrarily and running the Gale/Shapley algorithm.running the Gale/Shapley algorithm.

However stable matchings may have However stable matchings may have different sizesdifferent sizes in in this case.this case.

Page 4: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

SMTI ExampleSMTI Example

m1: w1 w2 w1: (m1 m2)m2: w1 w2: m1

Men’s preferences Women’s preferences

Two possible stable matchings are:Two possible stable matchings are:MM = = {(m{(m11 , , ww11)})}

M’M’ = = {( m{( m11 , w , w22) , (m) , (m22 , w , w11)})}

Page 5: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

The HistoryThe History A natural problem to consider is finding a stable A natural problem to consider is finding a stable

matching that matches the largest number of men matching that matches the largest number of men and women. We denote this problem by MAX-SMTI.and women. We denote this problem by MAX-SMTI.

MAX-SMTI was shown to be NP-hard by IwamaMAX-SMTI was shown to be NP-hard by Iwama et et al. in 1999.al. in 1999.

A further natural restriction of MAX-SMTI is finding A further natural restriction of MAX-SMTI is finding a maximum stable matching when the preference a maximum stable matching when the preference lists are of a constant length.lists are of a constant length. This has applications for the matching of graduating This has applications for the matching of graduating

medical students to hospitals posts in many countries – as medical students to hospitals posts in many countries – as typically student’s lists are small and of fixed length.typically student’s lists are small and of fixed length.

The above problem is the one-to-many generalisation of The above problem is the one-to-many generalisation of SMTI called the Hospitals/Residents problem with Ties SMTI called the Hospitals/Residents problem with Ties (HRT).(HRT).

Page 6: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

The History cont..The History cont..

Men’s Men’s list sizelist size

Women’s Women’s list sizelist size

P or P or

NP-hardNP-hardCiteCite

77 44 NP-hardNP-hard Halldórsson et al. Halldórsson et al. ‘03‘03

55 55 NP-hardNP-hard Halldórsson et al. Halldórsson et al. ‘03‘03

33 44 NP-hardNP-hard DFM & GOM ‘06DFM & GOM ‘06

The following table shows a list of the known results for the The following table shows a list of the known results for the case of constant length preference lists. The numbers indicate case of constant length preference lists. The numbers indicate the upper bounds on the length of the preference lists.the upper bounds on the length of the preference lists.

Page 7: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Our Contribution.Our Contribution.

We show MAX-SMTI is We show MAX-SMTI is polynomial-time solvable where polynomial-time solvable where men’s lists are of size 2 and men’s lists are of size 2 and contain no ties, and the women’s contain no ties, and the women’s lists are of unbounded length lists are of unbounded length and may contain ties.and may contain ties.

Page 8: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

(2,n)-MAX-SMTI(2,n)-MAX-SMTI The algorithm is presented in 3 phases.The algorithm is presented in 3 phases.

Phase 1 : adapted Gale/Shapley algorithm.Phase 1 : adapted Gale/Shapley algorithm. Phase 2 : network flow stage.Phase 2 : network flow stage. Phase 3 : continuation of phase 1.Phase 3 : continuation of phase 1.

An An allocationallocation (similar to matching only (similar to matching only women can be multiply assigned) is produced women can be multiply assigned) is produced by phase 1. by phase 1.

Phase 2 attempts to move men from multiply Phase 2 attempts to move men from multiply assigned women to unassigned women. assigned women to unassigned women.

Phase 3 may or may not be need, it Phase 3 may or may not be need, it reallocates men still assigned to multiply reallocates men still assigned to multiply assigned women.assigned women.

Page 9: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 1Phase 1

men “propose” to the women;men “propose” to the women; women “hold” proposals;women “hold” proposals; if some woman if some woman wwjj receives a receives a

proposal from man proposal from man mmii, then she , then she deletes all strict successors of deletes all strict successors of mmii from her list;from her list;

Terminates with an allocation Terminates with an allocation AA11

Page 10: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 1 ExamplePhase 1 Examplem1: w1 w2 w1: (m1 m2

m3) m5

m2: w1 w4 w2: (m1 m4) (m3 m5)

m3: w1 w2 w3: m4

m4: w2 w3 w4: m2

m5: w1 w2

Men’s preferences Women’s preferences

Page 11: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

m1: w1 w2 w1: ( m1 m2 m3 ) m5

m2: w1 w4 w2: ( m1 m4 ) ( m3 m5 )

m3: w1 w2 w3: m4

m4: w2 w3 w4: m2

m5: w1 w2

Men’s preferences Women’s preferences

Phase 1 ExamplePhase 1 Example

Allocation Allocation AA11 output by phase 1: output by phase 1:

AA11 = { ( m = { ( m11 , w , w11 ) , ( m ) , ( m22 , w , w11 ) , ( m ) , ( m33 , , ww11 ) , ( m ) , ( m44 , w , w22 ) } ) }

We note here that We note here that ww11 is multiply is multiply assigned.assigned.

Page 12: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 2 : Network Phase 2 : Network ConstructionConstruction

Add source node Add source node ss and sink node and sink node tt.. For each multiply assigned woman For each multiply assigned woman wwjj, , edge edge

(s , w(s , wjj)) with capacity with capacity 11 less than the number of less than the number of assignees to assignees to wwjj..

For each unassigned woman For each unassigned woman wwjj, , edge edge (w(wj j , t), t) of of capacity capacity 11..

Let Let mmii be a man with 2 women left on his list. Let be a man with 2 women left on his list. Let wwjj be be mmii’s first-choice and ’s first-choice and wwkk be be mmii’s second-’s second-choice. Add the edges choice. Add the edges (w(wj j , m, mii)) and and (m(mi i , w, wkk)) with with capacity capacity 11. . Women with only 1 partner may be represented by a Women with only 1 partner may be represented by a

vertex as a result of this step.vertex as a result of this step.

Page 13: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 2 : NetworkPhase 2 : Network

s tw1

w2

w3

w4

m2

m1

m4

21

1 1 1

1

1

1

1

Page 14: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 2 : ListsPhase 2 : Listsm1: w1 w2 w1: ( m1 m2 m3 )

m5

m2: w1 w4 w2: ( m1 m4 ) ( m3 m5 )

m3: w1 w2 w3: m4

m4: w2 w3 w4: m2

m5: w1 w2

Men’s preferences Women’s preferences

Page 15: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 2 : Max FlowPhase 2 : Max Flow

s tw1

w2

w3

w4

m2

m1

m4

21

1 1 1

1

1

1

1

The maximum (saturating) flow gives rise to The maximum (saturating) flow gives rise to the following:the following:

mm11 being moved from being moved from ww11 to to ww22;;

mm44 being moved from being moved from ww22 to to ww33;;

mm22 being moved from being moved from ww11 to to ww44..

Page 16: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 2 : AllocationPhase 2 : Allocationm1: w1 w2 w1: ( m1 m2 m3 )

m5

m2: w1 w4 w2: ( m1 m4 ) ( m3 m5 )

m3: w1 w2 w3: m3

m4: w2 w3 w4: m4

m5: w1 w2

Men’s preferences Women’s preferences

In this case we have found the maximum stable In this case we have found the maximum stable matching, namely:matching, namely:

M = {( mM = {( m11 , w , w2 2 ) , ( m) , ( m2 2 ,w,w4 4 ) , ( m) , ( m3 3 ,w,w1 1 ) , ) , ( m( m4 4 ,w,w3 3 )})}

Page 17: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Phase 3Phase 3

In general there may still be women In general there may still be women who are multiply assigned after who are multiply assigned after phase 2.phase 2.

It can proven, however, that if the It can proven, however, that if the remaining ties are broken arbitrarily remaining ties are broken arbitrarily and we continue with phase 1, a and we continue with phase 1, a stable matching of maximum size is stable matching of maximum size is obtained.obtained.

Page 18: Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science

Open ProblemsOpen Problems

Is (2,n)-MAX-HRT polynomial-time Is (2,n)-MAX-HRT polynomial-time solvable?solvable?

Is the generalisation of (2,n)-MAX-SMTI Is the generalisation of (2,n)-MAX-SMTI and (2,n)-MAX-HRT in which both sides and (2,n)-MAX-HRT in which both sides preference lists contain ties polynomial-preference lists contain ties polynomial-time solvable?time solvable?

Finding the exact boundary between P Finding the exact boundary between P and NP-hard cases, i.e. when both men and NP-hard cases, i.e. when both men and women have preference lists of size and women have preference lists of size at most 3 and their lists contain ties.at most 3 and their lists contain ties.