Title: Stable Matching Problems with Constant Length Preference Lists
1Stable Matching Problems with Constant Length
Preference Lists
- Rob Irving, David Manlove, Gregg OMalley
- University Of Glasgow
- Department of Computing Science
2SMI Formulation
- Set n1 men SM m1 , m2 , ., mn1
- Set n2 women SW w1 , w2 , ., wn2
- Each man ranks a subset of SW in strict order of
preference. - Each woman ranks a subset of SM in strict order
of preference. - A matching M is a bijection between the men and
women. - We say a (man, woman) pair (m,w) blocks M if
- m prefers w to his partner in M, and
- w prefers m to her partner in M.
- A matching that admits no blocking pair is said
to be stable - Cant improve by making an arrangement outside
the matching. - We can always find a stable matching for an
instance of SMI by an adaptation of an algorithm
known as the Gale/Shapley algorithm (1962). - Gale and Sotomayor also proved in 1985 that for
an instance of SMI all stable matchings have the
same size.
3SMTI Formalisation
- Set of n1 men SM m1 , m2 , ., mn1
- Set of n2 women SW w1 , w2 , ., wn2
- Each man mi ranks a subset of SW in preference
order, and mis list may contain ties. - Each woman wj ranks a subset of SM in preference
order, and wjs list may contain ties. - A matching M is a set of (man , woman) pairs
(m,w) such that each of m and w appear in at most
one pair, and m and w are on each others list. - We say a (man, woman) pair (m , w) blocks M if
- Either m is unmatched or m strictly prefers w to
his partner in M, and - Either w is unmatched or w strictly prefers m to
her partner in M. - A matching that admits no blocking pair is said
to be stable - Cant improve by making an arrangement outside
the matching.
4Properties
- When no ties are allowed in a participants list
- A stable matching for an instance of SMI can
always be found using a slightly modified version
of an algorithm known as the Gale/Shapley
algorithm (1962). - Gale and Sotomayor also proved in 1985 that for
an instance of SMI all stable matchings have the
same size. - When ties are allowed in a participants list
- Again we can always find a stable matching for an
instance of SMTI by breaking the ties arbitrarily
and running the Gale/Shapley algorithm. - However stable matchings may have different sizes
in this case.
5SMTI Example
m1 w1 w2 w1 (m1 m2) m2 w1
w2 m1 Mens preferences Womens
preferences
- Two possible stable matchings are
- M (m1 , w1)
- M ( m1 , w2) , (m2 , w1)
6The History
- A natural problem to consider is finding a stable
matching that matches the largest number of men
and women. We denote this problem by MAX-SMTI. - MAX-SMTI was shown to be NP-hard by Iwama et al.
in 1999. - A further natural restriction of MAX-SMTI is
finding a maximum stable matching when the
preference lists are of a constant length. - This has applications for the matching of
graduating medical students to hospitals posts in
many countries as typically students lists are
small and of fixed length. - The above problem is the one-to-many
generalisation of SMTI called the
Hospitals/Residents problem with Ties (HRT).
7The History cont..
- The following table shows a list of the known
results for the case of constant length
preference lists. The numbers indicate the upper
bounds on the length of the preference lists.
Mens list size Womens list size P or NP-hard Cite
7 4 NP-hard Halldórsson et al. 03
5 5 NP-hard Halldórsson et al. 03
3 4 NP-hard DFM GOM 06
8Our Contribution.
- We show MAX-SMTI is polynomial-time solvable
where mens lists are of size 2 and contain no
ties, and the womens lists are of unbounded
length and may contain ties.
9(2,n)-MAX-SMTI
- The algorithm is presented in 3 phases.
- Phase 1 adapted Gale/Shapley algorithm.
- Phase 2 network flow stage.
- Phase 3 continuation of phase 1.
- An allocation (similar to matching only women can
be multiply assigned) is produced by phase 1. - Phase 2 attempts to move men from multiply
assigned women to unassigned women. - Phase 3 may or may not be need, it reallocates
men still assigned to multiply assigned women.
10Phase 1
- men propose to the women
- women hold proposals
- if some woman wj receives a proposal from man mi,
then she deletes all strict successors of mi from
her list - Terminates with an allocation A1
11Phase 1 Example
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 Mens preferences Womens
preferences
12Phase 1 Example
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 Mens
preferences Womens preferences
- Allocation A1 output by phase 1
- A1 ( m1 , w1 ) , ( m2 , w1 ) , ( m3 , w1 ) ,
( m4 , w2 )
- We note here that w1 is multiply assigned.
13Phase 2 Network Construction
- Add source node s and sink node t.
- For each multiply assigned woman wj, edge (s ,
wj) with capacity 1 less than the number of
assignees to wj. - For each unassigned woman wj, edge (wj , t) of
capacity 1. - Let mi be a man with 2 women left on his list.
Let wj be mis first-choice and wk be mis
second-choice. Add the edges (wj , mi) and (mi ,
wk) with capacity 1. - Women with only 1 partner may be represented by a
vertex as a result of this step.
14Phase 2 Network
w2
w3
m1
m4
1
1
1
1
1
w1
2
s
t
1
1
w4
m2
1
15Phase 2 Lists
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 Mens
preferences Womens preferences
16Phase 2 Max Flow
w2
w3
m1
m4
1
1
1
1
1
w1
2
s
t
1
1
w4
m2
1
- The maximum (saturating) flow gives rise to the
following - m1 being moved from w1 to w2
- m4 being moved from w2 to w3
- m2 being moved from w1 to w4.
17Phase 2 Allocation
m1 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 Mens
preferences Womens preferences
- In this case we have found the maximum stable
matching, namely - M ( m1 , w2 ) , ( m2 ,w4 ) , ( m3 ,w1 ) , ( m4
,w3 )
18Phase 3
- In general there may still be women who are
multiply assigned after phase 2. - It can proven, however, that if the remaining
ties are broken arbitrarily and we continue with
phase 1, a stable matching of maximum size is
obtained.
19Open Problems
- Is (2,n)-MAX-HRT polynomial-time solvable?
- Is the generalisation of (2,n)-MAX-SMTI and
(2,n)-MAX-HRT in which both sides preference
lists contain ties polynomial-time solvable? - Finding the exact boundary between P and NP-hard
cases, i.e. when both men and women have
preference lists of size at most 3 and their
lists contain ties.