500 likes | 1.16k Views
Stable Marriage Problem Introductory talk 2 . Yosuke KIKUCHI Dept Comp. and Info. Eng. Tsuyama College of Tech OKAYAMA, JAPAN. Contents. Original stable marriage problem (conntinued) Experimental study Scored stable marriage . Review of previous talk. Introduction of background
E N D
Stable Marriage Problem Introductory talk 2 Yosuke KIKUCHI Dept Comp. and Info. Eng. Tsuyama College of Tech OKAYAMA, JAPAN
Contents • Original stable marriage problem (conntinued) • Experimental study • Scored stable marriage
Review of previous talk • Introduction of background • Original stable marriage problem • Setting • Definition of stable • application • Gale-Shapley algorithm • Features of the algorithm • Proof of correctness of the algorithm • Number of proposals (worst case and mean value)
Stable marriage problem • There are N-women and N-men. Each parson has a preference list of opposite sex. Then decide N-matching between women and men.
A matching is stable A matching is unstable if a man A and a woman a, not married to each other , but they mutually prefer each other to their partners. These pair A and a is called blocking pair. A matching is stable if it does not contain a blocking pair.
Blocking pair • Men {A,B},Women {α,β} Man A Woman α Preference list Men’s Women’s Man B Woman β AαBβ
Blocking pair • Men {A,B},Women {α,β} Man A Woman α Preference list Men’s Women’s Man B Woman β AαBβ It is not a blocking pair.
Blocking pair • Men {A,B},Women {α,β} Man A Woman α Preference list Men’s Women’s Man B Woman β AαBβ
Example of stable and unstable Men’s preference list Women’s preference list (Aα, Bβ, Cγ, Dδ) A and β are a blocking pair. (Aδ, Bα, Cβ, Dγ) This is a stable matching.
Applications of stable matching • Distribution of students among laboratory • Distribution interns into hospitals[1] -reference- [1] 医師臨床研修マッチング協議会(JAPAN INTERNS MATCHING CONFERENCE(?)) URL)http://www.jrmp.jp/2008/3/26
Gale-Shapleyalgorithm • The algorithm contains following four steps. • 1. man proposes to his desirable woman one by one. • 2. woman decides whether accept or reject. • 3. If a man is refused, then he remove her name from his preference list. • 4. Repeat the steps above, until every man is accepted by a woman.
Pseudo code of Gale-Shapley algorithm Variables and constants n: number of women = number of men k: number of couples X: suitor χ: woman toward whom the suitor makes advances Ω: (undesirable) imaginary man k=0; all the women are engaged to Ω; while(k < n){ X=(k+1)-st man; while(X != Ω){ x=the best choice remaining on X’s list; if(χ prefers X to her current partner){ engage X and χ; X=preceding partner of χ;} if(X != Ω) withdraw χ from X’s list; } k = k+1; } Output matching ;
Gale-Shapley algorithm Ω α Ω β Ω γ Ω δ D γ A γ B α β C β δ Men’s list Women’s list
Gale-Shapleyalgorithm • Features ・The algorithm always finds a stable matching.・The matching is optimal solution for men (women).・The matching is independent from the order of proposals.
Number of proposals Worst case O(n2) times (The maximum number of rejection is (n-1)2. ) The complexity of the algorithm is O(n2). Best case n times (each man is not rejected . Thus each man’s partner is the really best partner for him. ) Then we estimate the mean number of proposals.
Number of rejects (Aα)→(Aα, Bβ)→(Aα, B β, C γ)→ (Aα, B β, C γ, Dα)→ (A β, B β, C γ, Dα) → (A β, Bγ, C γ, Dα) → (A β, Bγ, C α, Dα) → (A β, Bγ, C α, D β) → (Aγ, Bγ, C α, D β) → (Aγ, Bα, C α, D β) → (Aγ, Bα, Cβ, D β) →(Aγ, Bα, Cβ, Dγ) → (Aδ, Bα, Cβ, Dγ)The number of reject is 9.
When the algorithm is end? Ωα Ωβ Ωγ Ωδ D γ α A γ B β β C δ Men’s list Women’s list
When the algorithm ends? We address the order of proposals Woman’s list α δ, β, δ, β, γ, γ, β, δ, α, γ, δ δ β δ β γ γ β δ When all women appear in this sequence, we obtain a stable matching.
coupon collector’s problem • There are n distinct coupons and that each time one buys a box of detergent one obtains a coupon at random. How many boxes must be bought, on average, to obtain all n coupons? Case n=4 {A,B,C,D} C B C A C B D D →we stop to buy boxes, when we obtain 4 kinds of coupon.
mean value qk : the probability that at least k boxes are necessary m: number of coupons that we have. n : number of kinds of coupons Mean number of boxes one must buy to obtain new coupons when he already have m coupons. q1=1, q2=m/n, q3=(m/n)2,… q1+q2+q3+...=1+(m/n)+(m/n)2+... The mean value of boxes one must buy to obtain all n coupons.
mean value where Hn is the sum of the first n terms of the harmonic series 1+1/2+1/3+・・・. Hn=ln n+γ+1/(2n)-1/(12n2)+ε where 0 < ε < 1/(120n4), γ is Euler’s constant. An upper bound for the mean number E(N) of proposals to obtain a stable matching by Gale-Shapley algorithm is nHn=nln n+O(n).
mean value An upper bound for the mean number E(N) of proposals to obtain a stable matching by Gale-Shapley algorithm is nHn=nln n+O(n). More good upper bound is (n-1) Hn+1. Man can marry with a woman who is ranked ln n in his list on the average.
Experimental study (1/2) • Implementing the Gale-Shapley algorithm window.exe
Experimental study(2/2) • Measurement of the mean of solution of the Gale-Shapley algorithm ・Pentium D:2.66GHz ・Memory:1Gbyte ・OS:WindowsXP Random number generator : Random Streamer RPG102 1000times measurements for n=5,50,75,100 • result
Structure of stable matchings Men’s list Women’s list All stable matchings : (A α, B β, C γ, D δ), (A α, B β, C δ, C γ), (A β, B α, C γ, D δ), (A β, B α, C δ, C γ), (A β, B δ, C α, D γ), (A γ, B α, C δ, D β), (A γ, B δ, C α, D β)
Structure of stable matchings Men’s list Women’s list All stable matchings : (A α, B β, C γ, D δ), (A α, B β, C δ, C γ), (A β, B α, C γ, D δ), (A β, B α, C δ, C γ), (A β, B δ, C α, D γ), (A γ, B α, C δ, D β), (A γ, B δ, C α, D β) All stable matchings : (α, β, γ, δ), (α, β, δ, γ), (β, α, γ, δ), (β, α, δ, γ), (β, δ, α, γ), (γ, α, δ, β), (γ, δ, α, β)
Structure of stable matchings Men’s list Women’s list All stable matchings : (α, β, γ, δ), (α, β, δ, γ), (β, α, γ, δ), (β, α, δ, γ), (β, δ, α, γ), (γ, α, δ, β), (γ, δ, α, β) 1 1 1 1 (α, β, γ, δ) 1 1 2 2 (α, β, δ, γ) 2 2 1 1 (β, α, γ, δ) 2 2 2 2 (β, α, δ, γ) 3 2 2 3 (γ, α, δ, β) 2 3 3 2 (β, δ, α, γ) 3 3 3 3 (γ, δ, α, β)
Structure of stable matchings 1 1 1 1 (α, β, γ, δ) • Distributive lattice 1 1 2 2 (α, β, δ, γ) 2 2 1 1 (β, α, γ, δ) 2 2 2 2 (β, α, δ, γ) 2 3 3 2 (β, δ, α, γ) 3 2 2 3 (γ, α, δ, β) 3 3 3 3 (γ, δ, α, β)
Scored stable marriage problem Men’s preference list Woman’s preference list How to calculate score of matching How to calculate score Aγ: 40 + 5 = 45 Aδ,Bα,Cβ,Dγ: 65 + 40 + 90 + 45 = 240
Find optimal matching Men’s preference list Maximum score Assignment problemusing Hungarian method Woman’s preference list 30 + 20
What is Hungarian method? • This method can find n matching such that total amount is minimum in n×n matrix. Maximum score 200-score in matrix
Finding optimal matching The matching that be found by Hungarian method AδBβCγDα 65 + 95 + 60 + 50 = 270
Case: score is inclined. Men’s preference list Woman’s preference list More than one solution by using Hungarian method Aα,Bδ,Cβ,Dγ : 200 Aβ,Bα,Cδ,Dγ: 200Aγ,Bδ,Cα,Dβ: 200 ・ ・ ・ Use Gale-Shapley algorithm Aα,Bβ,Cδ,Dγ: 200
Scored stable marriage problem Apply Hungarian method Apply Gale-Shapley algorithmfind stable matching compare the score of Gale-Shapley and the core of Hungarian method. If the score of Gale-Shapley = the core of Hungarian method, then we choose the score of Gale-Shapley
Further work • If the preference list is incomplete and includes tie, finding the maximum stable matching is NP-hard [ Halldorsson et al, 2003]. • 1.875-approximation algorithm is developed by Iwama et al, 2007. Can we improve the approximation ratio? It is known that lower bound 1.105 unless P=NP .
Further work • Stable roommates problem This problem does not have solution for any preference list. This problem is a generalization of stable marriage problem.
Further work • Stable roommates problem
Further work • Stable roommates problem AB, CD B and D are a blocking pair. This is no solution for this list. AC, BD A and D are a blocking pair. AD, BC A and B are a blocking pair.
Gap between original and scored • When the solution of Gale-Shapley algorithm and the solution of Hungarian method? Men’s preference list Woman’s preference list δ
Gap between original and scored Men’s preference list Woman’s preference list Stable matching is (Aδ, Bα, Cβ Dγ) and the score is 4+30+51+40=125 The maximum score is 218 and the matching is (Aγ, Bβ , Cδ, Dα), (90+40+49+39). But this matching is unstable, because C and βis a blocking pair. Which is better for men ?
Further reading Please consult Google. • Edward G. Thurber, Concerning the maximum • number of stable matchings in the stable marriage • problem, Discrete Mathematics 248 (2002) 195–219. • Jan Eeckhout, On the uniqueness of stable marriage • matchings, Economics Letters 69 (2000) 1–8