stable matchings a.k.a. the stable marriage problem

24
Stable Matchings a.k.a. the Stable Marriage Problem Samia Qader 252a-az CSC 254

Upload: miya

Post on 15-Jan-2016

112 views

Category:

Documents


3 download

DESCRIPTION

Stable Matchings a.k.a. the Stable Marriage Problem. Samia Qader 252a-az CSC 254. The Stable Marriage Problem. Overview Real - life application The stable marriage problem Theorems Termination Correctness of algorithm Open problems. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Stable Matchings a.k.a. the Stable Marriage Problem

Stable Matchingsa.k.a. the Stable Marriage Problem

Samia Qader

252a-az CSC 254

Page 2: Stable Matchings a.k.a. the Stable Marriage Problem

The Stable Marriage Problem

Overview

• Real - life application

• The stable marriage problem

• Theorems

• Termination

• Correctness of algorithm

• Open problems

Page 3: Stable Matchings a.k.a. the Stable Marriage Problem

Real-life application• Residency: after medical school

• “The Match” was developed to assign prospective students to residency programs

• The students submit a rank-order list (ROL) to the National Residency Match Program (NRMP)

• Hospitals rank-order their students

• NRMP finds a match.

Page 4: Stable Matchings a.k.a. the Stable Marriage Problem

Simple Problem• We’ve got n boys and n girls.

• Each boy submits an ROL of all n girls and the girls do the same

• A matching is unstable if a boy A and a girl a, not married to each other, mutually prefer each other to their spouses.

• A marriage is a bijection between the boys and girls

Page 5: Stable Matchings a.k.a. the Stable Marriage Problem

Example 1: 4 boys (A,B,C,D) married to 4 girls (a,b,c,d)

• Men Preference

A c b d a

B b a c d

C c a d b

D c a d b

• Women Preference

a A B D C

b C A D B

c C B D A

d B A C DMatching (Aa, Bb, Cc, Dd) Is it stable?

Look at Aa and Bb: A(4) + a(1) = 5

B(1) + b(4) = 5

total = 10

Page 6: Stable Matchings a.k.a. the Stable Marriage Problem

Ex 1: 4 boys (A,B,C,D) married to 4 girls (a,b,c,d)

• Men Preference

A c b d a

B b a c d

C c a d b

D c a d b

• Women Preference

a A B D C

b C A D B

c C B D A

d B A C DCheck Ab and Ba: A(2) + a(2) = 4

B(2) + b(2) = 4

total = 8

Page 7: Stable Matchings a.k.a. the Stable Marriage Problem

Marriage Algorithm – in words

• The boys are all single and free to propose

Page 8: Stable Matchings a.k.a. the Stable Marriage Problem

Marriage Algorithm – in words

• The girls are all engaged temporarily to (the ugly man)

Ugly man

Page 9: Stable Matchings a.k.a. the Stable Marriage Problem

Marriage Algorithm – in words• The boys propose to the best girl on their list (who

hasn’t rejected them yet). The girls accept - tentatively.

• If the girl gets a better offer from a boy that she prefers to her fiancé, she will break off the engagement.

• STOP when all the boys are engaged

Page 10: Stable Matchings a.k.a. the Stable Marriage Problem

ROL

Page 11: Stable Matchings a.k.a. the Stable Marriage Problem

Results3 happy couples:

Page 12: Stable Matchings a.k.a. the Stable Marriage Problem

ROL

Brown man wants blonde girl – But she doesn’t want him

Page 13: Stable Matchings a.k.a. the Stable Marriage Problem

ROL

Scratch off blonde from brown’s list

Page 14: Stable Matchings a.k.a. the Stable Marriage Problem

New Results3 different couples:

Page 15: Stable Matchings a.k.a. the Stable Marriage Problem

More detail….while (k<n) do

begin X = (k+1)st man;while (X ! = ) do { x= best remaining choice on X’s list if (x prefers X to her fiancé) { engage X and x X = former fiancé of } // end if}// end whileif (X != ) withdraw x from X’s listendk = k+1; } // end while

n= no.of men & women

k = no. of couples formed

X = man suitor

x = woman

= ugly man

Page 16: Stable Matchings a.k.a. the Stable Marriage Problem

Some Theorems

• The order in which the boys propose does not matter

• The final matching is stable

• The boys get to marry the best girl the could possibly get in a stable marriage

Page 17: Stable Matchings a.k.a. the Stable Marriage Problem

Termination: the algorithm has to end

• In what situation would the algorithm run forever - if a boy B keeps getting rejected by all girls

• This can never happen:

a boy in only rejected by all girls if all the girls are engaged to someone better

Impossible - since there are n girls and n-1 boys that are better than B

Page 18: Stable Matchings a.k.a. the Stable Marriage Problem

Correctness of the Algorithm

• Is the final marriage stable?• Proof by contradiction:• There exists some pair (b,g) that mutually

prefer each other to whomever they are matched to.

• Since b proposed in the order of his ROL, he must have proposed to g already

Page 19: Stable Matchings a.k.a. the Stable Marriage Problem

Correctness continued...

• But if g is not engaged to b, she must have rejected him

• g would only reject b if she is already engaged to someone she prefers

• Therefore, g’s fiancé must be ranked more highly than b

• CONTRADICTION

Page 20: Stable Matchings a.k.a. the Stable Marriage Problem

Boy Optimality

• The marriage returned by this algorithm assigns every boy to his favorite stable partner.

• Consider matching each girl to her least favorite choice. The matching produced is stable and is the same as the matching returned by the algorithm described.

Page 21: Stable Matchings a.k.a. the Stable Marriage Problem

Residency Problem

• Who gets to play the boy?

• Answer : the hospitals

Page 22: Stable Matchings a.k.a. the Stable Marriage Problem

Bipartite matching

• In a complete bipartite graph, each node would have an ROL of the nodes that it prefers.

1

2

3

4

1

2

3

4

a

b

c

d

Page 23: Stable Matchings a.k.a. the Stable Marriage Problem

Open Problems…

• Maximum number of stable matches grows exponentially with n. What is the instance of size n with the largest possible number of stable matchings?

• Sex-equal matching: where the sum of the male scores is equal to the sum of the female scores.

• Is it possible to test the stability of every matching in a set of matchings faster (significantly) than by checking each of the matchings from scratch?

Page 24: Stable Matchings a.k.a. the Stable Marriage Problem

References

• Asratian A.S, Denley T.M.J, Bipartite Graphs and their Applications,

Cambridge University Press, N.Y. (1998).

• Gusfield, D., Irving R.W., The Stable Marriage Problem :Structure and

Algorithms, The MIT Press, Cambridge (1989).

• Knuth D.E., Stable Marriage and its Relation to Other Combinatorial

Problems, American Mathematical Society, Providence (1997).

• Littman M.L., http://www.cs.duke.edu/education/courses/cps130/fall98

lectures/lect13/lect13.html, (1998).

• Lovasz L., Plummer M.D., Matching Theory, North-Holland, North-

Holland (1986).