# El Problema del Matrimonio Estable El Problema del Matrimonio Estable Roger Z. Ríos Programa de Posgrado en Ing. de Sistemas Facultad de Ing. Mecánica.

## Presentation on theme: "El Problema del Matrimonio Estable El Problema del Matrimonio Estable Roger Z. Ríos Programa de Posgrado en Ing. de Sistemas Facultad de Ing. Mecánica."— Presentation transcript:

El Problema del Matrimonio Estable El Problema del Matrimonio Estable Roger Z. Ríos Programa de Posgrado en Ing. de Sistemas Facultad de Ing. Mecánica y Eléctrica Universidad Autónoma de Nuevo León http://yalma.fime.uanl.mx/~pisis Seminario de Clase “Optimización de Flujo en Redes” PISIS – FIME - UANL Cd. Universitaria24 Agosto 2007

Agenda  Problem definition  Solution algorithm  Variations and extensions  Real-world application

Problem Definition  2 disjoint sets of size n (women, men) 12143 24312 31432 42143 12413 23142 32314 44132 Men’s preferencesWomen’s preferences Matching M ={(1,1), (2,3), (3,2), (4,4)} Blocking pair (4,1)

Problem Definition  2 disjoint sets of size n (women, men) 12143 24312 31432 42143 12413 23142 32314 44132 Men’s preferencesWomen’s preferences Matching M ={(1,1), (2,3), (3,2), (4,4)} Blocking pair (4,1)

Problem Definition  2 disjoint sets of size n (women, men) 12143 24312 31432 42143 12413 23142 32314 44132 Men’s preferencesWomen’s preferences Matching M ={(1,1), (2,3), (3,2), (4,4)} Blocking pair (4,1)

Problem Definition (SMP)  Instance of size n (n women, n men) and strictly ordered preference list  Matching: 1-1 correspondence between men and women  If woman w and man m matched in M  w and m are partners, w=p M (m), m=p M (w)  (w,m) block a match M if w and m are not partners, but w prefers m to p M (w) and m prefers w to p M (m)  A match for which there is at least one blocking pair is unstable

Solution: Properties  Stability checking (for a given matching M) is easy  Stable matching existence (not obvious) due to Gale and Shapley (1962)

Solution: Stability for (m:=1 to n) do for (each w such that m prefers w to p M (m)) do if (w prefers m to p M (w)) then report matching unstable stop endif Report matching stable for (m:=1 to n) do for (each w such that m prefers w to p M (m)) do if (w prefers m to p M (w)) then report matching unstable stop endif Report matching stable Simple stability checking algorithm O(n 2 )

Solution assign each person to be free while (some man m is free) do { w:=first woman on m’s list to whom m has not yet proposed if (w is free) then assign m and w to be engaged {to each other} else if (w prefers m to her fiance m’) then assign m and w to be engaged and m’ to be free else w rejects m {and m remains free} } end while assign each person to be free while (some man m is free) do { w:=first woman on m’s list to whom m has not yet proposed if (w is free) then assign m and w to be engaged {to each other} else if (w prefers m to her fiance m’) then assign m and w to be engaged and m’ to be free else w rejects m {and m remains free} } end while Basic Gale-Shapley man-oriented algorithm

Solution: Proof  Theorem: For any given SMP instance the G-S algorithm terminates with a stable matching  Proof:  No man can be rejected by all woman  Termination in O(n 2 )  No blocking pairs  If m prefers w to p M (m), w must have rejected m at some point for a man she prefers better  Theorem: For any given SMP instance the G-S algorithm terminates with a stable matching  Proof:  No man can be rejected by all woman  Termination in O(n 2 )  No blocking pairs  If m prefers w to p M (m), w must have rejected m at some point for a man she prefers better

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 1 proposes to woman 4 (accepted) Partial matching M ={(4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 1 proposes to woman 4 (accepted) Partial matching M ={(4,1)} Man 2 proposes to woman 2 (accepted) Partial matching M ={(2,2), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 1 proposes to woman 4 (accepted) Partial matching M ={(4,1)} Man 2 proposes to woman 2 (accepted) Partial matching M ={(2,2), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 3 proposes to woman 2 (accepted and women 2 rejects man 2) Partial matching M ={(2,3), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 3 proposes to woman 2 (accepted and women 2 rejects man 2) Partial matching M ={(2,3), (4,1)} Man 2 proposes to woman 3 (accepted) Partial matching M ={(2,3), (3,2), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 3 proposes to woman 2 (accepted and women 2 rejects man 2) Partial matching M ={(2,3), (4,1)} Man 2 proposes to woman 3 (accepted) Partial matching M ={(2,3), (3,2), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 4 proposes to woman 3 (rejected, woman 3 prefers man 2) Partial matching M ={(2,3), (3,2), (4,1)}

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 4 proposes to woman 3 (rejected, woman 3 prefers man 2) Partial matching M ={(2,3), (3,2), (4,1)} Man 4 proposes to woman 1 (accepted) Final Matching M ={(1,4), (2,3), (3,2), (4,1)} (Stable matching)

Solution: Example 14132 21324 31234 44132 14123 22314 32431 43142 Men’s preferencesWomen’s preferences Man 4 proposes to woman 3 (rejected, woman 3 prefers man 2) Partial matching M ={(2,3), (3,2), (4,1)} Man 4 proposes to woman 1 (accepted) Final Matching M ={(1,4), (2,3), (3,2), (4,1)} (Stable matching)

Extensions/Variations  Stable Marriage Problem  Sets of unequal size  Unnacceptable partners  Indifference  Stable Roommate Problem  Stable Resident/Hospital Problem

Real-World Application Stable Resident/Hospital Problem (SRHP) Largest and best-known application of SMP Used by the National Resident Matching Program (NRMP)

SRHP Application  R (residents), H (hospitals), q i := # of available spots in hospital i  (r,h) is a blocking pair if r prefers h to his/her current hospital and h prefers r to at least one of its assigned residents  Solution:  Transformation into a SMP  Specialized algorithm

SRHP Application History 1 st dilemma: Early proposals 2 nd dilemma: Tight acceptance start -2

SRHP Application  Solution:  Transformation into a SMP  Specialized algorithm SRHP Instance Residents r 1  (h 1, h 2, h 3, …) … Hospitals h 1  (r 1, r 2, r 3, …), q 1 =3 … SMP Instance Residents r 1  (h 11, h 12, h 13, h 2, h 3, …) … Hospitals h 11  (r 1, r 2, r 3, …) h 12  (r 1, r 2, r 3, …) h 13  (r 1, r 2, r 3, …) …

Related Hard Problems  Finding all different stable matchings  Maximum number of stable matchings  Parallelization

Conclusions Stable matchings Gale-Shapley algorithm Math/Computer Science/Economics Scientific support to decision-making

Questions? http://yalma.fime.uanl.mx/~roger roger@yalma.fime.uanl.mx Acknowledgements: Racing - Barça El Sardinero This Sunday 12:00 CDT

Download ppt "El Problema del Matrimonio Estable El Problema del Matrimonio Estable Roger Z. Ríos Programa de Posgrado en Ing. de Sistemas Facultad de Ing. Mecánica."

Similar presentations