Matchings with One-Sided Preferences

Matchings with One-Sided Preferences
Dimitrios Michail
Department of Informatics and Telematics
Harokopio University of Athens
May 2010
Overview
• Matchings with one-sided preferences
• Possible objectives
• Rank-Maximal and Popular matchings
• Algorithm for popular matchings
• Unpopularity factor
• Algorithms for bounded unpopularity factor
• Experiments
Harokopio University of Athens
2/27
Matchings with Preferences
Input
We are given a set of applicants A with an interest in obtaining a set of posts
P and each member of A has a preference list (possible including ties)
comprising a subset of elements of P.
Goal
Compute a matching of A to P, that is, an allocation of each applicant to at
most one post so that each post is filled by at most one applicant.
Harokopio University of Athens
3/27
Matchings with Preferences
• each applicant ranks a subset of
1st
the posts
1st
2nd
• the ranking might include ties
• only the applicant side has
preferences
1st
2nd
When both sides express preferences,
we are in the stable matchings region.
1st
In this talk one-sided preferences.
Harokopio University of Athens
4/27
Practicality
The problem can model many real-life situations.
We are not restricted to applicants-posts, it can be any assignment
• students-universities
• products-shelfs
• query-database tuple
• etc.
Harokopio University of Athens
5/27
Abstracting to a Graph
1
1
Abstracting to a graph we are given a bipartite
graph G(A ∪ P, E) where E consists of all
pairs (a, p) where p belongs in the preference
list of a.
2
1
2
1
Harokopio University of Athens
6/27
Abstracting to a Graph
1
1
Abstracting to a graph we are given a bipartite
graph G(A ∪ P, E) where E consists of all
pairs (a, p) where p belongs in the preference
list of a.
2
1
2
We are also given an edge function
r : E 7→ {1, 2, . . .} which denotes the
preference of each edge e = (a, p) in the
preference list of applicant a ∈ A. We call r(e)
the rank of edge e.
1
Harokopio University of Athens
6/27
Abstracting to a Graph
1
1
Abstracting to a graph we are given a bipartite
graph G(A ∪ P, E) where E consists of all
pairs (a, p) where p belongs in the preference
list of a.
2
1
2
1
Harokopio University of Athens
We are also given an edge function
r : E 7→ {1, 2, . . .} which denotes the
preference of each edge e = (a, p) in the
preference list of applicant a ∈ A. We call r(e)
the rank of edge e.
Preference lists may include ties.
6/27
Optimization?
What are the possible optimization criteria that we wish to set?
It really depends on the problem-domain and our goal/view of the specific
problem and/or the world.
In this talk we will see 2 such criteria, namely
.1.
rank-maximal matchings, and
.2.
popular matchings.
Harokopio University of Athens
7/27
Rank-Maximal Matchings
Goal
Compute a matching M which maximizes the edges of rank 1, and given that
it maximizes the edges of rank 2, and so on.
Harokopio University of Athens
8/27
Rank-Maximal Matchings
Goal
Compute a matching M which maximizes the edges of rank 1, and given that
it maximizes the edges of rank 2, and so on.
2
1
2
1
2
1
1
2
Harokopio University of Athens
8/27
Rank-Maximal Matchings
Goal
Compute a matching M which maximizes the edges of rank 1, and given that
it maximizes the edges of rank 2, and so on.
2
2
1
1
2
2
1
1
2
2
1
1
1
2
Harokopio University of Athens
1
2
8/27
Rank-Maximal Matchings Algorithm
The algorithm [IKMMP 06] operates in phases:
• in phase 1 a maximum matching M1 of rank 1 edges is computed
• in phase 2 a maximum matching M2 of rank ≤ 2 edges, which does not
affect the maximality of the rank 1 edges
..
.
• in phase i a maximum matching Mi of rank ≤ i edges, which does not
affect the maximality of the previous rank edges
..
.
Harokopio University of Athens
9/27
Gallai-Edmonds Decomposition
1
1
1
1
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
2
can be deleted
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
2
can be deleted
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
2
cannot be deleted
1
1
1
1
1
1
Harokopio University of Athens
10/27
Gallai-Edmonds Decomposition
1
1
1
1
2
can be used
1
1
1
1
1
1
Harokopio University of Athens
10/27
Popular Matchings
A matching M is more popular than a matching M0 if the number of applicants
that prefer M to M0 is larger than the number of applicants that prefer M0 to M.
1
3 2
1
3 2
1
3 2
1
1
1
2
3
1
2
3
2
3
1
2
3
2
3
1
2
3
The matching at the right is more popular than the matching at the middle.
Harokopio University of Athens
11/27
Popular Matchings
A matching M is popular if and only if there is no matching M0 that is more
popular than M.
Harokopio University of Athens
12/27
Popular Matchings
• The problem has also been studied under the name of majority
assignments [Gärderfors 1975].
• Assignments where there exists no majority of applicants who all want to
change their posts.
• A great deal of research is beeing conducted trying to find assignments
which exhibit some sort of stability (economics community).
Harokopio University of Athens
13/27
Bad News
Unfortunately popular matchings do not always exist.
1
1
1
3 2
3 2
3 2
1
1
1
2
3
1
2
3
2
3
1
2
3
2
3
1
2
3
The reason is that the popular relationship is not acyclic.
Harokopio University of Athens
14/27
Some Good News
[Mahdian 06] showed that in a probabilistic setting where preference lists are
drawn at random and the number of posts is more than the number of
applicants by a small multiplicative factor ≈ 1.42, popular matchings almost
surely exist.
Harokopio University of Athens
15/27
Some Good News
[Mahdian 06] showed that in a probabilistic setting where preference lists are
drawn at random and the number of posts is more than the number of
applicants by a small multiplicative factor ≈ 1.42, popular matchings almost
surely exist.
[KMN 09] showed that every instance admits a probability distribution over
matchings, called a mixed matching, that is popular.
Harokopio University of Athens
15/27
Popular Matchings
Computing Popular Matchings
• Computing popular matchings can be done in polynomial time [AIKM 07]
• Very simple algorithm linear time algorithm if no ties in preference lists
No Ties Algorithm
• Add for each applicant a last resort post to denote not matched.
• Every applicant must be matched with one of two choices:
.1. either the first choice,
.2. or the best choice which is not the first choice of anyone else.
• Every applicant must be matched (possibly with their last resort).
• Find maximum matching in reduced graph. If someone remains free,
there is no popular matching.
Harokopio University of Athens
16/27
Measuring Unpopularity
Given any two matchings X and Y in G, define φ(X, Y) = the number of
applicants that prefer X to Y.
Let us define the following function to compare two matchings X and Y:
{
φ(Y,X)
if φ(X, Y) > 0
∆(X, Y) = φ(X,Y)
∞
otherwise.
Unpopularity Factor of Matching M
• let M denote the set of all matchings in G and
• let Z denote the set of matchings M̃ such that φ(M, M̃) = φ(M̃, M) = 0.
u(M) =
Harokopio University of Athens
max
M0 :M0 ∈M and M0 ∈Z
/
∆(M, M0 ).
17/27
Complexity
Unfortunately [McCutchen 08] showed that computing a matching with
minimum unpopularity factor is NP-Complete.
Finding an approximation algorithm is an open problem.
Harokopio University of Athens
18/27
An Algorithm
The Bounded Unpopular algorithm [HKMN 08] resembles the algorithm for
rank-maximal matchings.
It operates in phases:
• in phase 1 a maximum matching M1 of rank 1 edges is computed
• in phase 2 the next best choice edges are added, which do not affect the
maximality of M1 and a new maximum matching M2 is computed
..
.
• in phase i the next best choice edges are added, which do no affect the
maximality of Mi−1 and a new maximum matchings Mi is computed
..
.
If all applicants matched by phase i, then u(Mi ) ≤ i − 1.
Harokopio University of Athens
19/27
Implementation
Library at
• http://www.dit.hua.gr/~michail/subpages/libmosp/
doxygen/index.html
contains
• 3 different rank-maximal matchings algorithm [IKMMP 06, M 07]
• algorithm for popular matchings [AIKM 07]
• the bounded-unpopular algorithm of [HKMN 08]
Harokopio University of Athens
20/27
Experimental Setup
[UMM09] consider the problem of matching points to preference functions in
the context of databases:
• posts are points in d-dimensional space
• applicants are linear functions with weights for each dimension (weights
are normalized to sum up to 1)
• The value of each function at each data point is the preference.
• We use the same setup to evaluate the various algorithms.
Harokopio University of Athens
21/27
Experimental Setup
[UMM09] consider the problem of matching points to preference functions in
the context of databases:
• posts are points in d-dimensional space
• applicants are linear functions with weights for each dimension (weights
are normalized to sum up to 1)
attribute-2
f1 (·)
f2 (·)
attribute-1
Harokopio University of Athens
21/27
Datasets
We used two datasets
• household1 collection with attributes: (a) living area, (b) number of
bedrooms, and (c) number of bathrooms
• collection of NBA players2 with 3 offensive attributes: (a) points, (b)
offensive rebounds, and (c) assists
Preference functions were created uniformly at random.
1
2
http://www.zillow.com
www.databasebasketball.com/stats_download.htm
Harokopio University of Athens
22/27
Experiments
Household dataset
Unpopularity factor
300
RMM
BND
• # of applicants, na
• # of posts, np = 500
250
• RMM: rank-maximal
200
• BND:
bounded-unpopular
150
100
50
0
00
=5
na
50
=2
na
25
=1
na
0
=5
na
Harokopio University of Athens
23/27
Experiments
NBA dataset
Unpopularity factor
70
RMM
BND
• # of applicants, na
• # of posts, np = 500
60
• RMM: rank-maximal
50
• BND:
40
bounded-unpopular
30
20
10
0
00
=5
na
50
=2
na
25
=1
na
00
=1
na
0
=5
na
Harokopio University of Athens
24/27
Work in Progress
• Motivated by the database assignment application
• Computing popular matchings I/O efficiently
• Use the well known External Memory Model of computation
External Memory Model [AV 89]
• assume two level memory (main memory of size M and disk)
• data is transferred in blocks of size B between disk and memory
• assume N is problem size and B M N
• complexity of algorithm is number of I/Os from the disk
• memory computation is for free
Harokopio University of Athens
25/27
Future Work on This Subject
Possible directions are:
• approximation algorithm for unpopularity
• branch-and-bound exact algorithm
• external memory version of Gale/Shapley algorithm
Harokopio University of Athens
26/27
The End
Thank you!
Harokopio University of Athens
27/27