Slide - Department of Computer Science

Popularity in the Capacitated
House Allocation Problem
David Manlove
Department of Computing Science
University of Glasgow
Colin Sng
Department of Computing Science
University of Glasgow
BCTCS - 5th April 2006
Capacitated House Allocation
Problem (CHA)





Set of agents A = {a1, a2,…, ar}
Set of houses H = {h1,h2,…,hs}
Each agent ai has a strictly ranked preference list of acceptable houses; houses
have no preference over agents.
Each house hj has a capacity cj which indicates the maximum number of agents who
may be matched to it
A matching is a partial function from A to H such that
 Each agent ai is only matched to acceptable houses Example
 Each agent ai is matched to at most one house hj
a1: h1 h2
h1:c1=2
a2: h1 h4 h2
h2:c2=1
 Each house hj is matched at most to cj agents
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1
a6: h2 h1 h4
a7: h4
BCTCS - 5th April 2006
h3:c3=2
h4:c4=1
Popular Matchings






Let M be a matching in a given instance I of CHA.
Define M(ai) to be the house matched to a matched agent ai in M
Define M(hj) to be the set of agents matched to a house hj in M
Given two matchings M and M', agent ai prefers M to M' if either
 ai is matched in M but unmatched in M', or
 ai is matched in both M and M', but prefers M(ai) to M'(ai)
We say that M is more popular than M' if there are more agents who prefer M to M'
than prefer M' to M
A matching M is popular if there is no other matching M' that is more popular than
M.
BCTCS - 5th April 2006
Popular matchings may not
exist

Consider the following example instance I1 of CHA
( c1=c2=c3=1)
a1: h1 h2 h3
a2: h1 h2 h3
a3: h1 h2 h3

M1= {(a1,h1), (a2,h2),(a3,h3)} and M2 = {(a1,h3),(a2,h1),(a3,h2)} are two
possible matchings.
a1 prefers M1 to M2 (1 agent) but a2 and a3 prefers M2 to M1 (2 agents)
So M2 is more popular than M1
In fact, there is no popular matching
Problem: given any CHA instance, find a popular matching if one
exists




BCTCS - 5th April 2006
Background




Known results
 Problem was first considered by Gardenfors (1975) in context
of Stable Marriage problem (SM)
 D.J. Abraham, R.W. Irving, T. Kavitha, K. Melhorn (2005)
considered the problem in special setting of CHA, where each
house has capacity 1 (otherwise known as House Allocation
problems).
Falls in category of matching problems with one-sided preference
lists.
Examples:- Scottish Executive Teaching Induction Scheme,
allocation of campus housing in American universities
CHA follows as natural extension of problem setting.
BCTCS - 5th April 2006
Characterisation of popular
matchings in CHA (i)



For each agent ai,
 f(ai) denotes the first-ranked house on ai’s preference list, we call f(ai) an
f-house
For each house hj, let f(hj) = aiA: f(ai) =hj and fj =|f(hj)|
Lemma 1.
 Let M be any popular matching for a given CHA instance I. Then, for every
f-house hj, |M(hj)∩f(hj)| = min {cj,fj}
BCTCS - 5th April 2006
Execution (i)

Example
a1: h1 h2
a2: h1 h4 h2
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1
a6: h2 h1 h4
a7: h4
h1:c1=2, f1 c1
h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
a1
h1
a2
a3
a4
a5
h2
h3
h4
a6
a7
Lemma 1. Let M be any popular matching for a given CHA instance I. Then, for every
f-house hj, |M(hj)∩f(hj)| = min {cj,fj}
BCTCS - 5th April 2006
Execution (ii)
Example
a1: h1 h2
a2: h1 h4 h2
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1
a6: h2 h1 h4
a7: h4

h1:c1=2, f1 c1
h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
a1
h1
a2
a3
a4
a5
h2
h3
h4
a6
a7
Lemma 1. Let M be any popular matching for a given CHA instance I. Then, for every
f-house hj, |M(hj)∩f(hj)| = min {cj,fj}
BCTCS - 5th April 2006
Execution (iii)
Example
a1: h1 h2
a2: h1 h4 h2
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1
a6: h2 h1 h4
a7: h4

Match a1 & a2 to h1
a1
h1
a2
a3
a4
a5
h2
h3
h4
a6
a7
Lemma 1. Let M be any popular matching for a given CHA instance I. Then, for every
f-house hj, |M(hj)∩f(hj)| = min {cj,fj}
BCTCS - 5th April 2006
Execution (iv)
Example
a1: h1 h2
a2: h1 h4 h2
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1
a6: h2 h1 h4
a7: h4

a1
h1
a2
a3
a4
a5
h2
h3
h4
a6
a7
Lemma 1. Let M be any popular matching for a given CHA instance I. Then, for every
f-house hj, |M(hj)∩f(hj)| = min {cj,fj}
BCTCS - 5th April 2006
Characterisation of popular
matchings in CHA (ii)

For each agent ai,

s(ai) denotes the most-preferred house hj on ai’s preference list such that either




(i) hj is a non f-house, or
(ii) hj is an f-house such that hjf(ai) and fj < cj
we call s(ai) an s-house
create a last resort house l(ai) and append l(ai) to ai’s preference list
BCTCS - 5th April 2006
Execution (v)

Example
a1
h1
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)
h1:c1=0
h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
(f-house,s-house)
BCTCS - 5th April 2006
h2
h3
h4
Characterisation of popular
matchings in CHA (iii)

Lemma 2.
 Let M be any popular matching in a CHA instance. Then no agent ai can
be matched in M to a house between f(ai) and s(ai) on ai’s preference
list.
ai: f(ai) … M(ai) …s(ai)

Lemma 3.
 Let M be any popular matching in a CHA instance. Then no agent can
be matched in M to a house worse than s(ai) on ai’s preference list.
ai: f(ai) … s(ai) M(ai)
BCTCS - 5th April 2006
Characterisation of popular
matchings in CHA (iv)


By Lemmas 2 and 3, for every agent ai, M(ai)  {f(ai), s(ai)}, so only need a
subgraph G' of G to find popular matching
For each agent ai in the graph G, delete all edges except those belonging to
f(ai) and s(ai)
Theorem 1. A matching M is popular if and only if

For every f-house hj,
1.
a)
b)
2.
If fjcj, then f(hj) M(hj), else
If fj>cj, then |M(hj)|=cj and M(hj) f(hj)
M is an agent-complete matching of the subgraph G'
BCTCS - 5th April 2006
Execution (vi)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h1:c1=0
h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
(f-house,s-house)
BCTCS - 5th April 2006
h2
h3
h4
Execution (vii)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
h2
h3
h4
a6
a7
NB: Condition 1(a) of Theorem 1 already satisfied, i.e. for every f-house hj,
if fjcj, then f(hj) M(hj),
BCTCS - 5th April 2006
Execution (viii)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Find an agent-complete matching to satisfy Condition 2 of Theorem 1
BCTCS - 5th April 2006
h2
h3
h4
Execution (ix)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Find an agent-complete matching to satisfy Condition 2 of Theorem 1
BCTCS - 5th April 2006
h2
h3
h4
Execution (x)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Ensure Condition 1(b) of Theorem 1
i.e. for every f-house hj, if fj>cj, then |M(hj)|=cj and M(hj) f(hj)
BCTCS - 5th April 2006
h2
h3
h4
Execution (x)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Ensure Condition 1(b) of Theorem 1
i.e. for every f-house hj, if fj>cj, then |M(hj)|=cj and M(hj) f(hj)
BCTCS - 5th April 2006
h2
h3
h4
Execution (xi)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
Promote a6 to h2
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Ensure Condition 1(b) of Theorem 1
i.e. for every f-house hj, if fj>cj, then |M(hj)|=cj and M(hj) f(hj)
BCTCS - 5th April 2006
h2
h3
h4
Execution (xii)
Example
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

h2:c2=1,f2>c2
h3:c3=2
h4:c4=1,f4>c4
(f-house,s-house)
Nothing to do for a5 & a7
a1
h1
a2
a3
a4
l(a5)
l(a6)
l(a7)
a5
a6
a7
Ensure Condition 1(b) of Theorem 1
i.e. for every f-house hj, if fj>cj, then |M(hj)|=cj and M(hj) f(hj)
BCTCS - 5th April 2006
h2
h3
h4
Execution (xiii)
Example
a1: h1 h2 l(a1)
a2: h1 h4 h2 l(a2)
a3: h2 h1 h4 h3
a3: h2 h1 h4 h3
a4: h4 h2 h3
a5: h4 h1 l(a5)
a6: h2 h1 h4 l(a6)
a7: h4 l(a7)

a1
h1
a2
a3
a4
a5
(f-house,s-house)
a6
Matching satisfies Theorem 1
a7
Popular matching =
{(a1,h1), (a2, h1),(a3,h3),(a4,h4), (a6, h2)}
BCTCS - 5th April 2006
h2
h3
h4
Summary





Time complexity of algorithm is O(r3/2s1/2)
Algorithm can be extended to find maximum cardinality popular
matching also in O(r3/2s1/2) time
Have also extended findings to the case where preference list may
contain ties, i.e. Capacitated House Allocation problem with ties
(CHAT)
O((r+s)L) algorithm for finding a maximum cardinality popular
matching in an instance of CHAT, if one exists
Open problem: Extend setting to include the case where houses
also have preferences over agents. What is the complexity of
finding a maximum cardinality popular matching if one
exists?
BCTCS - 5th April 2006