Some Representative Problems: 1.1 A First Problem: Stable Matching
Some Representative Problems: 1.1 A First Problem: Stable Matching
Introduction:
Some Representative
Problems
Goal. Given a set of preferences among hospitals and medical school Goal. Given n men and n women, find a "suitable" matching.
students, design a self-reinforcing admissions process. !Participants rate members of opposite sex.
!Each man lists women in order of preference from best to worst.
Unstable pair: applicant x and hospital y are unstable if: !Each woman lists men in order of preference from best to worst.
! x prefers y to its assigned hospital.
! y prefers x to one of its admitted students.
favorite least favorite favorite least favorite
Stable assignment. Assignment with no unstable pairs.
! Natural and desirable condition. 1st 2nd 3rd 1st 2nd 3rd
Individual self-interest will prevent any applicant/hospital deal
Xavier Amy Bertha Clare Amy Yancey Xavier Zeus
!
3 4
Stable Matching Problem Stable Matching Problem
Perfect matching: everyone is matched monogamously. Q. Is assignment X-C, Y-B, Z-A stable?
!Each man gets exactly one woman.
!Each woman gets exactly one man.
Stable matching problem. Given the preference lists of n men and n Zeus Amy Bertha Clare Clare Xavier Yancey Zeus
women, find a stable matching if one exists. Men’s Preference Profile Women’s Preference Profile
5 6
Q. Is assignment X-C, Y-B, Z-A stable? Q. Is assignment X-A, Y-B, Z-C stable?
A. No. Bertha and Xavier will hook up. A. Yes.
favorite least favorite favorite least favorite favorite least favorite favorite least favorite
1st 2nd 3rd 1st 2nd 3rd 1st 2nd 3rd 1st 2nd 3rd
Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Xavier Amy Bertha Clare Amy Yancey Xavier Zeus
Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus
Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus
Men’s Preference Profile Women’s Preference Profile Men’s Preference Profile Women’s Preference Profile
7 8
Stable Roommate Problem Propose-And-Reject Algorithm
Q. Do stable matchings always exist? Propose-and-reject algorithm. [Gale-Shapley 1962] Intuitive method
A. Not obvious a priori. that guarantees to find a stable matching.
is core of market nonempty?
9 10
Observation 1. Men propose to women in decreasing order of preference. Claim. All men and women get matched.
Pf. (by contradiction)
Observation 2. Once a woman is matched, she never becomes unmatched; ! Suppose, for sake of contradiction, that Zeus is not matched upon
she only "trades up." termination of algorithm.
! Then some woman, say Amy, is not matched upon termination.
Claim. Algorithm terminates after at most n2 iterations of while loop. ! By Observation 2, Amy was never proposed to.
Pf. Each time through the while loop a man proposes to a new woman. ! But, Zeus proposes to everyone, since he ends up unmatched. !
There are only n2 possible proposals. !
Vi ctor A B C D E Amy W X Y Z V
Wyatt B C D A E Bertha X Y Z V W
Xavi er C D A B E Clare Y Z V W X
Yancey D A B C E Di ane Z V W X Y
Zeus A B C D E Eri ka V W X Y Z
11 12
Proof of Correctness: Stability Summary
Claim. No unstable pairs. Stable matching problem. Given n men and n women, and their
Pf. (by contradiction) preferences, find a stable matching if one exists.
! Suppose A-Z is an unstable pair: each prefers each other to
partner in Gale-Shapley matching S*. Gale-Shapley algorithm. Guarantees to find a stable matching for any
men propose in decreasing
problem instance.
S*
! Case 1: Z never proposed to A. order of preference
! A-Z is stable.
13 14
Engagements. Amy 1st 2nd 3rd 4th 5th 6th 7th 8th
15 16
Understanding the Solution Understanding the Solution
Q. For a given problem instance, there may be several stable Q. For a given problem instance, there may be several stable
matchings. Do all executions of Gale-Shapley yield the same stable matchings. Do all executions of Gale-Shapley yield the same stable
matching? If so, which one? matching? If so, which one?
17 18
Claim. GS matching S* is man-optimal. Stable matching problem. Given preference profiles of n men and n
Pf. (by contradiction) women, find a stable matching.
! Suppose some man is paired with someone other than best partner.
no man and woman prefer to be with
Men propose in decreasing order of preference ! some man is each other than assigned partner
19 20
Woman Pessimality Extensions: Matching Residents to Hospitals
Woman-pessimal assignment. Each woman receives worst valid partner. Ex: Men " hospitals, Women " med school residents.
Claim. GS finds woman-pessimal stable matching S*. Variant 1. Some participants declare others as unacceptable.
resident A unwilling to
Pf. Variant 2. Unequal number of men and women. work in Cleveland
! Suppose A-Z matched in S*, but Z is not worst valid partner for A.
! There exists stable matching S in which A is paired with a man, say Variant 3. Limited polygamy.
Y, whom she likes less than Z.
S hospital X wants to hire 3 residents
! Let B be Z's partner in S.
! Z prefers A to B. man-optimality Amy-Yancey
! Thus, A-Z is an unstable in S. ! Bertha-Zeus Def. Matching S unstable if there is a hospital h and resident r such that:
...
!h and r are acceptable to each other; and
!either r is unmatched, or r prefers h to her assigned hospital; and
!either h does not have all its places filled, or h prefers r to at least one
of its assigned residents.
21 22
23 24
Interval Scheduling
1.2 Five Representative Problems Input. Set of jobs with start times and finish times.
Goal. Find maximum cardinality subset of mutually compatible jobs.
h Time
0 1 2 3 4 5 6 7 8 9 10 11
26
Input. Set of jobs with start times, finish times, and weights. Input. Bipartite graph.
Goal. Find maximum weight subset of mutually compatible jobs. Goal. Find maximum cardinality matching.
A 1
23
B 2
12
20
C 3
26
13 D 4
20
E 5
11
16 Time
0 1 2 3 4 5 6 7 8 9 10 11
27 28
Independent Set Competitive Facility Location
1 2
4 5 10 1 5 15 5 1 5 1 15 10
3
29 30
31