Stable Marriage Problem - Florida Institute of Technologypkc/cs4hs/million/stableMarriage.pdf · 1/...

Preview:

Citation preview

1/ 58

Stable Marriage ProblemA Million Dollar Problem

Ryan Stansifer

Department of Computer SciencesFlorida Institute of TechnologyMelbourne, Florida USA 32901

http://www.cs.fit.edu/~ryan/

25 March 2017

2/ 58

A matching algorithm

A ranking algorithm

A ???? problem

3/ 58

Problem 1:known as the

stable marriage problem

Solution: known as thedeferred acceptance algorithm

4/ 58

Shapely and Roth won the 2012 Nobel Prize in Economics

5/ 58

10 million SEKUS$ 1.4 millione 950,000

6/ 58

The problem is to find mutually acceptable matching of n things ofone kind to n things of another. For example:

donors to receipients,

residents to hospital opportunities,

students to available spots in schools, and

men to women

7/ 58

Let us meet the men and the women.

Let us make a matching.

8/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK

YORK

XAVIER

WALTER

VICTOR

ULRIC

9/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK

XAVIER

WALTER

VICTOR

ULRIC

10/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK YORK ELLA

XAVIER

WALTER

VICTOR

ULRIC

11/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK YORK ELLA

XAVIER XAVIERBETH

WALTER

VICTOR

ULRIC

12/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK YORK ELLA

XAVIER XAVIERBETH

WALTER

VICTOR VICTOR DOT

ULRIC

13/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK YORK ELLA

XAVIER XAVIERBETH

WALTER WALTERAMY

VICTOR VICTOR DOT

ULRIC

14/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK CLARE

YORK YORK ELLA

XAVIER XAVIERBETH

WALTER WALTERAMY

VICTOR VICTOR DOT

ULRIC ULRIC FRAN

15/ 58

There are many possible matching.

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK DOT

YORK YORK BETH

XAVIER XAVIER ELLA

WALTER WALTERFRAN

VICTOR VICTORCLARE

ULRIC ULRIC AMY

Several example matchings example 1: WXZVYU men emoji 16

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK BETH

YORK YORK ELLA

XAVIER XAVIERCLARE

WALTER WALTERFRAN

VICTOR VICTOR DOT

ULRIC ULRIC AMY

Several example matchings example 2: UZXVYW men emoji 17

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK ELLA

YORK YORKCLARE

XAVIER XAVIER AMY

WALTER WALTERFRAN

VICTOR VICTOR DOT

ULRIC ULRIC BETH

Several example matchings example 3: XUYVZW men emoji 18

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK AMY

YORK YORK BETH

XAVIER XAVIERCLARE

WALTER WALTERDOT

VICTOR VICTORELLA

ULRIC ULRIC FRAN

Several example matchings example 4: ZYXWVU men emoji 19

20/ 58

There is always a matching of all.

Is there a best one?

For that we need to consider the preferences of the all the men andwomen.

21/ 58

Men’s Preferences

1 2 3 4 5 6

ZACK CLARE AMY BETH ELLA FRAN DOT

YORK ELLA CLARE BETH AMY FRAN DOT

XAVIER BETH CLARE AMY ELLA FRAN DOT

WALTER AMY CLARE BETH ELLA FRAN DOT

VICTOR CLARE DOT FRAN BETH AMY ELLA

ULRIC AMY FRAN DOT CLARE BETH ELLA

22/ 58

Women’s Preferences

1 2 3 4 5 6

AMY ULRIC WALTER XAVIER YORK ZACK VICTOR

BETH ULRIC VICTOR XAVIER YORK ZACK WALTER

CLARE ZACK XAVIER YORK VICTOR ULRIC WALTER

DOT YORK XAVIER ZACK VICTOR ULRIC WALTER

ELLA VICTOR XAVIER YORK ZACK WALTER ULRIC

FRAN ZACK XAVIER YORK VICTOR ULRIC WALTER

23/ 58

We can look at a matchingas a table for the men or for the women.

24/ 58

AMY BETH CLARE DOT ELLA FRAN

ZACK ZACK BETH

YORK YORK ELLA

XAVIER XAVIERCLARE

WALTER WALTERFRAN

VICTOR VICTOR DOT

ULRIC ULRIC AMY

25/ 58

ZACK YORK XAVIER WALTER VICTOR ULRIC

AMY ULRIC AMY

BETH ZACK BETH

CLARE XAVIERCLARE

DOT VICTOR DOT

ELLA YORK ELLA

FRAN WALTERFRAN

26/ 58

Recall:We are looking for a good matching.

It not possible for everyone to get their first choice. But it wouldbe nice to eliminate dissatification leading to instability.

What do we mean? Consider the following example . . .

27/ 58

A B C D E F

CABEFD Zack BethECBAFD York EllaBCAEFD Xavier ClareACBEFD Walter FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth ZackZXYVUW Clare XavierYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran Walter

28/ 58

A B C D E F

CABEFD Zack BethECBAFD York EllaBCAEFD Xavier ♥ ClareACBEFD Walter FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth Zack ♥ZXYVUW Clare XavierYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran Walter

29/ 58

A B C D E F

CABEFD Zack Beth ♥ECBAFD York EllaBCAEFD Xavier ClareACBEFD Walter FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth ZackZXYVUW Clare ♥ XavierYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran Walter

30/ 58

Deferred Acceptance Algorithm

Is there an algorithm that will matchall the men and women efficiently with no unhappy couples?

31/ 58

Deferred Acceptance Algorithm

Repeat the following steps until all are matched.

An unmatched man proposes to the more preferred womanwho has not previously rejected his proposal.

Then, a woman (tentatively) accepts the proposal breaking anexisting engagement when the new suitor is preferred (if any).

A B C D E F

CABEFD ZackECBAFD YorkBCAEFD XavierACBEFD WalterCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV AmyUVXYZW BethZXYVUW ClareYXZVUW DotVXYZWU EllaZXYVUW Fran

Deferred acceptance algorithm step 0: no matches 32

A B C D E F

CABEFD Zack ClareECBAFD YorkBCAEFD XavierACBEFD WalterCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV AmyUVXYZW BethZXYVUW Clare ZackYXZVUW DotVXYZWU EllaZXYVUW Fran

Deferred acceptance algorithm step 1: Zack proposes to Clare 33

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD XavierACBEFD WalterCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV AmyUVXYZW BethZXYVUW Clare ZackYXZVUW DotVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 2: York proposes to Ella 34

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD WalterCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV AmyUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW DotVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 3: Xavior proposes to Beth 35

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD Walter AmyCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV Amy WalterUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW DotVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 4: Walter proposes to Amy 36

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD Walter AmyCDFBAE VictorAFDCBE Ulric

Z Y X W V U

UWXYZV Amy WalterUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW DotVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 5: Clare rejects Victor’s proposal 37

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD Walter AmyCDFBAE Victor DotAFDCBE Ulric

Z Y X W V U

UWXYZV Amy WalterUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 6: Victor proposes to Dot 38

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD WalterCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 7: Ulric proposes to Amy 39

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD WalterCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 8: Clare rejects Walter’s proposal 40

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD WalterCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 9: Beth rejects Walter’s proposal 41

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD WalterCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran

Deferred acceptance algorithm step 10: Ella rejects Walter’s proposal 42

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD Walter FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran Walter

Deferred acceptance algorithm step 11: Walter proposes to Fran 43

All are matched.No blocking pairs.

There might be many stable matchings(but in this particular case there are not)

A B C D E F

CABEFD Zack Clare •ECBAFD York EllaBCAEFD Xavier BethACBEFD Walter FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot • VictorVXYZWU Ella YorkZXYVUW Fran Walter

Blocking Pair? No. Dot-Zack 45

A B C D E F

CABEFD Zack ClareECBAFD York EllaBCAEFD Xavier BethACBEFD Walter • FranCDFBAE Victor DotAFDCBE Ulric Amy

Z Y X W V U

UWXYZV Amy • UlricUVXYZW Beth XavierZXYVUW Clare ZackYXZVUW Dot VictorVXYZWU Ella YorkZXYVUW Fran Walter

Blocking Pair? No. Amy-Walter 46

47/ 58

Definition

A pair (m,w) is blocking for a matching if m prefers w to hismatch and also w prefers m to her match.

A blocking pair destablizes a matching as the pair have incentiveto abandoned their partners.

48/ 58

Definition

A matching is perfect if all are paired up.

Definition

A matching is stable if there are no blocking pairs.

It is not obvious, but there is always a stable matching no matterwhat the preferences are.

Theorem

There is always a perfect, stable matching.

49/ 58

Definition

A man and a woman are possible for each other if some stablematching marries them.

Theorem (Gale-Shapley)

Every man gets his best possible match.

Theorem (Gale-Shapley)

Every woman gets her worse possible match.

50/ 58

Theorem (Dubins-Freedman)

No man or consortium of men can improve their results in themale-proposing algorithm by submitting false preferences.

51/ 58

Efficient Implmetnation

Does woman w prefer man m to man m′?Create inverse of preference list of men.

Amy 1 2 3 4 5 6

pref 6(U) 4(W) 3(X) 2(Y) 1(Z) 5(V)

Amy 1 2 3 4 5 6

inv 5 4 3 2 1 1

for i=1 to n

inv [pref[i]] = i

Amy prefers man 6 to man 3 since inv[6]=1 ¡ inv[3]=3

52/ 58

Social Utility

There are many ways to do matching. But the remarkable thingabout the deferred acceptance algorithm is that:

1 there is no advantage to lie or cheat about the preference, and

2 no swap will improve all the parties involved

This means making matchings this way can reduce strife and otherproblems.

53/ 58

National Resident Matching Program (NRMP)www.nrmp.org

NRMP places applicants for postgraduate medical trainingpositions into residency programs at teaching hospitals throughoutthe United States.

54/ 58

Historical Context

Hospitals made offers earlier and earlier and residents waitedlonger and longer to accept.

In 1952 a centralized clearing house (NRMP) was formed.

Originally used the “Boston Pool” algorithm. Mostlyequivalent to the deferred acceptance algorithm whichhospital optimality.

Algorithm overhauled and new algorithm adopted May 1997.

Resident optimalSide constraints (couples, unacceptability, unequal numbers)

Today over 42,000 residents for over 30,000 positions.

55/ 58

56/ 58

In New York City in the late 1990s tens of thousands of childrenwere placed in badly matched schools.

The process was so byzantine it appeared nothingshort of a Nobel Prize-worthy algorithm could fix it.Three economists Atila Abdulkadiroglu (Duke), ParagPathak (M.I.T.) and Alvin E. Roth (Stanford), all expertsin game theory and market design were invited to attackthe sorting problem together. Their solution was a modelof mathematical efficiency and elegance.

In 2014 75,000 eight grade students applied for a spot at one of426 public high schools, in a few hours the Class of 2019 wasarranged.

57/ 58

College Admissions

58/ 58

Kidney

59/ 58

National Kidney RegistryFacilitating Living Donor Transplantshttp://www.kidneyregistry.org/

The National Kidney Registry uses the power oftechnology and large pools of donor/recipient pairs tofind better matches through paired exchange.

60/ 58

The top trading cycle algorithm may produce long chains (SeeNYT) and the maximal matching algorithm can be distorted by ahospital’s goal of minimizing its costs over the greater social good.In general, the goal is to incentive hospitals to report all of theirpatient-donor pairs, to save as many lives as possible.

References I

D. Gale and Lloyd S. Shapley. “College Admissions and theStability of Marriage”. In: American Mathematical Monthly120.5 (May 2013), pp. 386–391. doi: http://dx.doi.org/10.4169/amer.math.monthly.120.05.386. url:http://www.jstor.org/stable/pdfplus/10.4169/amer.

math.monthly.120.05.386.pdf.

D. Gusfield and R. W. Irving. The Stable Marriage Problems:Structure and Algorithms. Cambridge, Massachusetts: MITPress, 1989.

Grace Lyo. The Stable Marriage Problem. Girls’ AngleWomen in Mathematics Video Series. Presented by EmilyRhiel. 2012. url: http://www.girlsangle.org/page/filmpage.php?num=16.

Numberphile. The Stable Marriage Problem. YouTube.Presented by Emily Rhiel. 2014. url:https://www.youtube.com/watch?v=Qcv1IqHWAzg.

61/ 58

References II

Alvin E. Roth. “The Economics of Matching: Stability andIncentives”. In: Mathematics of Operation Research 7.4(2009), pp. 79–112.

Alvin E. Roth. “The Evolution and the Labor Market forMedical Interns and Residents: A Case Study in GameTheory”. In: Political Economy Y2.6 (1984).

Alvin E. Roth. “The Evolution of the Labor Market forMedical Interns and Residents: A Case Study in GameTheory”. In: Journal of Polical Enconomy 92 (1984),pp. 991–1016. url: http://www.economics.harvard.edu/~aroth/papers/evolut.pdf.

Alvin E. Roth and Elliot Peranson. “The Redesign of theMatching Market for American Physicians: Some EngineeringAspects of Ecnomic Design”. In: The American EconomicReview 89.4 (1999).

62/ 58

References III

Alvin E. Roth, T. Sonmez, and M. U. Unver. “KidneyExchange”. In: Quaterly Journal of Economics 119 (2004),pp. 457–488.

Alvin E. Roth, T. Sonmez, and M. U. Unver. “PairwiseKidney Exchange”. In: Journal of Economic Theory 125(2005), pp. 151–1888.

Kevin Sack. “60 lives, 30 kidneys, all linked”. In: New YorkTimes (February 2012). url:http://www.nytimes.com/2012/02/19/health/lives-

forever-linked-through-kidney-transplant-chain-

124.html.

63/ 58

References IV

Tracey Tullis. “How Game Thoery Helped Improve New YorkCity’s High School Application Process”. In: New YorkTimes (December 2014). url:https://www.nytimes.com/2014/12/07/nyregion/how-

game-theory-helped-improve-new-york-city-high-

school-application-process.html.

64/ 58

Recommended