Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cybernetica AS & Tartu University

Similar presentations


Presentation on theme: "Cybernetica AS & Tartu University"— Presentation transcript:

1 Cybernetica AS & Tartu University
How to choose and not regret later (the stable matching problem) Peeter Laud Cybernetica AS & Tartu University EXCS kickoff

2 Bipartite graphs Hall's (marriage) theorem: If each subset of ●-s has
at least as many ○-s for neighbours, then one can find partners for all ●-s Say we have two kinds of objects and there is a relationship between them. Objects --- men or women, students and study programs, working groups and postdocs, etc. Relationship --- compatibility. Can we pair up the objects, such that objects in the same pair are compatible? We may have a surplus of white dots...

3 Preferences For simplicity assume that:
There is the same number of both kinds of objects Call them “men” and “women” Every man is compatible with every woman Each man has a preference list of women Each woman has a preference list of men (Generalizations: capacities, incompatibilities, indifferences, surplus of men or women)

4 Example A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y D A B C D

5 Is this a good matching? A Y V Z X V C A B D B Y Z X V X A C B D C Z V

6 A blocking pair ... A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X

7 ... will find each other A Y V Z X V C A B D B Y Z X V X A C B D C Z V
? ? V X Y Z

8 Stable matchings A matching is stable if there are no blocking pairs
Do stable matchings always exist? How to find them? Idea: start with any matching and let the things sort themselves out: Pick a blocking pair Swap the partners Repeat

9 Let the lone people be a pair, too
Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z

10 Pick a blocking pair A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X

11 Swap the partners A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y

12 Pick a blocking pair A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X

13 Swap the partners A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y

14 Pick a blocking pair A Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X

15 Swap the partners A Y V Z X V C A B D We have already
had this matching B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z

16 Existence of stable matchings
The presented simple algorithm does not always give us a stable matching Still, a stable matching always exists In 1962, a constructive proof was offered by Gale and Shapley

17 Gale-Shapley algorithm
V Z X V C A B D Each unengaged man proposes to his first choice Each woman picks the most likable courter B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z

18 Gale-Shapley algorithm
V Z X V C A B D The rejected men cross out the women that turned them down Each unengaged man proposes to his first choice Each woman picks the most likable courter B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z

19 Gale-Shapley algorithm
V Z X V C A B D The rejected men cross out the women that turned them down Each unengaged man proposes to his first choice Each woman picks the most likable courter B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z

20 Gale-Shapley algorithm
V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D V X Y Z Happiness ensues

21 Everybody gets married
If there's a free woman W in the end, there must be a free man M, too But A woman that gets engaged, stays engaged A free man proposes, to everyone if necessary Sometime, M must have proposed to W W was free at the time A free woman always accepts a proposal W accepted M's proposal Hence W is not free in the end

22 The match is stable M W X W M N M N X W M goes through his list
from top until X Well, assume the opposite... Consider M's perspective on the work of the algorithm M W X W M N M N X W time

23 The match is stable M W X W M N M N X W Consider W's perspective
on the work of the algorithm M W X W M N M N X W time

24 caused by our assumption
The match is stable According to M's perspective, he proposed to everyone until X, including W According to W's perspective, only N and less desirable men (not M) proposed to her Contradiction, caused by our assumption M W X W M N M N X W

25 The algorithm is efficient
The size of the input is O(n2), where n is the number of men or women At each proposal one of the following happens: A free woman becomes engaged Happens at most n times A man crosses of a woman in his list Happens at most n(n-1) times The total number of proposals is at most n2 The size of the input is also O(n2) The amount of work done at each proposal is bounded by a constant

26 Dealing with capacities
If a man M can “marry” cM women, then propose as long as engaged to less than cW women If a woman W can “marry” cW men, then accept propositions as long as engaged to less than cW men

27 Several stable matchings
Y V Z X V C A B D A pair (M,W) is feasible if it occurs in some stable matching B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D A B C D A B C D A B C D V X Y Z V X Y Z V X Y Z Feasible pairs: (B,X), (A,{V,Y,Z}),(C,{V,Z}),(D,{V,Y})

28 Who prefers which matching?
Y V Z X V C A B D Gale-Shapley: man-optimal woman-pessimal B Y Z X V man-pessimal woman-optimal X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D G G G G B B B B A B C D A B C D A B C D V X Y Z V X Y Z V X Y Z B B B G B G G G

29 Gale-Shapley is man-optimal
Men make proposals in their order of preference First to the women they cannot have Then to the optimal feasible partner and other feasible partners Then to the women the don't want to have Claim: the process stops here A man's optimal feasible partner does not reject him Assume the contrary Consider the first time a man is rejected by his optimal feasible partner

30 Gale-Shapley is man-optimal
infeasible feasible M W Infeasible or optimal N W W N M M N Algorithm continues until its end W No rejection by optimal feasible partners time

31 Gale-Shapley is man-optimal
infeasible feasible M W Infeasible or optimal N W W N M M N Blocking pair W Z Z Feasible for N There is a stable matching where M and W are matched

32 Gale-Shapley is woman-pessimal
infeasible feasible Consider the male-optimal stable matching any stable matching M W W M male-optimal any M M N N W W Z Z NOT a blocking pair

33 Strategic misreporting of pref.s
Y V Z X V C A B D B Y Z X V X A C B D C Z V Y X Y D A B C D Z V Y X Z A C B D G G G G B B B B A B C D A B C D A B C D V X Y Z V X Y Z V X Y Z B B B G B G G G

34 Strategic misreporting of pref.s
Can one get a better deal by not telling the truth about one's preferences? If Gale-Shapley is employed, then Men — no Women — possibly Are there matching procedures where telling one's real preferences is the dominant strategy for everybody?

35 I/O of a matching procedure
Input: Number of men and women Preferences of each man and woman Output A stable matching

36 Set of preferences P1 A Y X Z X A C B B X Y Z Y C A B C X Y Z Z A B C
A prefers M1 C X Y Z Z A B C C prefers M1 X prefers M2 Two stable matchings: Y prefers M2 A B C A B C M2 M1 Y Z X Y Z X A matching procedure F, applied to these preferences, returns either M1 or M2

37 Set of preferences P2 A Y X Z X A C B B X Y Z Y C A B C X Y Z Z A B C
If F(P1)=M1 then X has incentive to misreport preferences B X Y Z Y C A B C X Y Z Z A B C One stable matching: A B C A B C M2 M1 Y Z X Y Z X A matching procedure F, applied to these preferences, returns M2

38 Set of preferences P3 A Y X Z X A C B B X Y Z Y C A B C X Y Z Z A B C
If F(P1)=M2 then A has incentive to misreport preferences B X Y Z Y C A B C X Y Z Z A B C One stable matching: A B C A B C M2 M1 Y Z X Y Z X A matching procedure F, applied to these preferences, returns M1

39 Handling misreporting
In Gale-Shapley algorithm one side has incentive to misreport preferences In applications, this side should be the one that has more difficulties in hiding one's true preferences


Download ppt "Cybernetica AS & Tartu University"

Similar presentations


Ads by Google