Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- A solution to the stable marriage p... by Tùng Thanh 540 views
- [ACM-ICPC] Bipartite Matching by Chih-Hsuan Kuo 2179 views
- 15 - 12 Feb - Stable Matchings by Neeldhara Misra 157 views
- The gale shapley algorithm by Phyrex Tsai 126 views
- 駅空間におけるサインに着目した屋内測位技術の検討 by TomohiroSHIMIZU 913 views
- Simple algorithm & hopcroft karp fo... by Miguel Pereira 8783 views

722 views

564 views

564 views

Published on

Hi friends!! I have shared this PPT for you.

License: CC Attribution License

No Downloads

Total views

722

On SlideShare

0

From Embeds

0

Number of Embeds

3

Shares

0

Downloads

32

Comments

0

Likes

1

No embeds

No notes for slide

- 1. Stable MarriageStable Marriage ProblemProblem Sangita SatapathySangita Satapathy Asst. ProfessorAsst. Professor
- 2. # Introduction# Introduction # Background Theory# Background Theory # Formal Definition# Formal Definition # Real world Application# Real world Application # Issues# Issues
- 3. Whom to marry ?Whom to marry ? How to Distribute students amongHow to Distribute students among laboratory ?laboratory ? How to Distribute interns into hospitalHow to Distribute interns into hospital s ?s ? :: solving dilemmas of daily life, onesolving dilemmas of daily life, one algorithm at a timealgorithm at a time IntroductionIntroduction
- 4. WARNING: This lecture contains mathematical content that may be shocking to some Persons.
- 5. Problem NO:1Problem NO:1 Hospitals are offering Jobs to medicalHospitals are offering Jobs to medical studentsstudents • Medical students, when they receivedMedical students, when they received offers from hospitals, they used to waitoffers from hospitals, they used to wait in case a better offer would present itselfin case a better offer would present itself from a hospital more to their liking.from a hospital more to their liking. It ends up in :It ends up in : Background Theory:Background Theory:
- 6. unhappy students who accepted theirunhappy students who accepted their first offers only to regret itfirst offers only to regret it OROR unhappy hospitals when students didunhappy hospitals when students did not keepnot keep their earlier commitments.their earlier commitments.
- 7. Problem NO:2Problem NO:2 The problem of assigning sailors toThe problem of assigning sailors to boats in the U.S, Navy. Sailors areboats in the U.S, Navy. Sailors are given new assignments every fewgiven new assignments every few years and they are required toyears and they are required to hand in a preference list.hand in a preference list.
- 8. • Gale and Shapley came up to solveGale and Shapley came up to solve these types of problems with stablethese types of problems with stable matching : ( Stable Marriage Problem)matching : ( Stable Marriage Problem)
- 9. • TheThe Stable marriage problem (SMP)Stable marriage problem (SMP) is basically the problem of finding ais basically the problem of finding a stable matching between two sets ofstable matching between two sets of persons, the men and the women,persons, the men and the women, where each person in every group haswhere each person in every group has a list containing every person thata list containing every person that belongs to other group ordered bybelongs to other group ordered by preferencepreference DefinitionDefinition
- 10. • Genetic algorithms are used to solveGenetic algorithms are used to solve such problems and often producessuch problems and often produces better solutionsbetter solutions
- 11. The Mathematics Of 1950’s Dating:The Mathematics Of 1950’s Dating: Who wins the battle of the Marriage?Who wins the battle of the Marriage?
- 12. Marriage ScenarioMarriage Scenario • There are n boys and n girls • Each girl has her own ranked preference list of all the boys • Each boy has his own ranked preference list of all the girls • The lists have no ties Question: How do we pair them off?
- 13. C,B,A,D 1 B,A,D,C 2 D,C,A,B 3 A,B,C,D 4 A 3,4,1,2 B 1,2,3,4 C 4,3,2,1 D 1,3,4,2
- 14. Blocking CouplesBlocking Couples Suppose we pair off all the boys andSuppose we pair off all the boys and girls.girls. Now suppose that some boy andNow suppose that some boy and some girl prefer each other to thesome girl prefer each other to the people to whom they are paired.people to whom they are paired. TheyThey will be called awill be called a Blocking coupleBlocking couple..
- 15. Why be with them when we can be with each other?
- 16. Stable PairingsStable Pairings A pairing of boys and girls is calledA pairing of boys and girls is called stablestable if it contains no Blocking couples.if it contains no Blocking couples. C,B,A,D 1 B,A,D,C D,C,A,B 3 A,B,C,D 4 A 3,4,1,2 B 1,2,3,4 C 4,3,2,1 D 1,3,4,2 2
- 17. Given a set of preference lists,Given a set of preference lists, how do we find a stable pairing?how do we find a stable pairing?
- 18. Given a set of preference lists,Given a set of preference lists, how do we find a stable pairing?how do we find a stable pairing? Wait! We don’t even know that such a pairing always exists!
- 19. Can you argue that the couples will not continue breaking up and reforming forever?
- 20. The algorithm contains following fourThe algorithm contains following four steps.steps. 1. boy proposes to his desirable girl one by1. boy proposes to his desirable girl one by one.one. 2. girl decides whether accept or reject.2. girl decides whether accept or reject. 3. If a boy is refused, then he remove her3. If a boy is refused, then he remove her name from his preference list.name from his preference list. 4. Repeat the steps above, until every boy is4. Repeat the steps above, until every boy is accepted by a girl.accepted by a girl. Gale-ShapleyGale-Shapley algorithmalgorithm
- 21. For each day that some boy gets a “No” do:For each day that some boy gets a “No” do: • MorningMorning – Each girl stands on her balcony – Each boy proposes under the balcony of the best girl whom he has not yet crossed off • Afternoon (for those girls with at least one suitor)Afternoon (for those girls with at least one suitor) – To today’s best suitor: “Maybe, come back tomorrow”“Maybe, come back tomorrow” – To any others: “No, I will never marry you”“No, I will never marry you” • EveningEvening – Any rejected boy crosses the girl off his list Each girl marries the boy to whom she last said “maybe”Each girl marries the boy to whom she last said “maybe” Traditional Marriage AlgorithmTraditional Marriage Algorithm
- 22. Female The Traditional MarriageThe Traditional Marriage AlgorithmAlgorithm String Worshipping males
- 23. Traditional Marriage AlgorithmTraditional Marriage Algorithm While there is an unmatched boy, do:While there is an unmatched boy, do: • Some unmatched boy proposes to next girl on his listSome unmatched boy proposes to next girl on his list • If girl is unmatched:If girl is unmatched: – boy & girl get engaged • If girl is matched but prefers boy to her current fiancé:If girl is matched but prefers boy to her current fiancé: – boy & girl get engaged – previous fiancé becomes unmatched • If girl is matched and prefers fiancé to proposerIf girl is matched and prefers fiancé to proposer – proposer is rejected Each girl marries the boy to whom she is last engagedEach girl marries the boy to whom she is last engaged
- 24. Does the Traditional MarriageDoes the Traditional Marriage Algorithm always produce aAlgorithm always produce a stablestable pairing?pairing?
- 25. Does the Traditional MarriageDoes the Traditional Marriage Algorithm always produce aAlgorithm always produce a stablestable pairing?pairing? Wait! There is a more primary question!
- 26. Does TMA always terminate?Does TMA always terminate? • It might encounter a situation where algorithm does not specify what to do next (core dump error) • It might keep on going for an infinite number of days
- 27. Improvement LemmaImprovement Lemma: If a girl is: If a girl is engaged to a boy, then she willengaged to a boy, then she will always be engaged (or married) toalways be engaged (or married) to someone at least as good.someone at least as good. • She would only let go of him in order to get engaged to someone better • She would only let go of that guy for someone even better • She would only let go of that guy for someone even better • AND SO ON . . . . . . . . . . . . .
- 28. Improvement LemmaImprovement Lemma: If a girl is: If a girl is engaged to a boy, then she willengaged to a boy, then she will always be engaged (or married) toalways be engaged (or married) to someone at least as good.someone at least as good. • She would only let go of him in order to get engaged to someone better • She would only let go of that guy for someone even better • She would only let go of that guy for someone even better • AND SO ON . . . . . . . . . . . . . Proof by Induction
- 29. LemmaLemma: No boy can be rejected: No boy can be rejected by all the girlsby all the girls Proof by contradiction.Proof by contradiction. Suppose boy b is rejected by all the girls.Suppose boy b is rejected by all the girls. At that point:At that point: • Each girl must have a suitor other than b • The n girls have n suitors, b not among them. Thus, there are at least n+1 boys Contradictio n
- 30. TheoremTheorem: The TMA always: The TMA always terminates in at most nterminates in at most n22 daysdays • A “master list” of all n of the boys lists starts with a total of n X n = n2 girls on it. • Each day that at least one boy gets a “No”, at least one girl gets crossed off the master list • Therefore, the number of days is bounded by the original size of the master list n(n-1) <= n2 .
- 31. Steven Rudich: www.discretemath.com www.rudich.net CorollaryCorollary: Each girl will marry her: Each girl will marry her absolute favorite of the boys whoabsolute favorite of the boys who visit her during the TMAvisit her during the TMA
- 32. Great! We know that TMA willGreat! We know that TMA will terminate and produce a pairing.terminate and produce a pairing. But is it stable?But is it stable?
- 33. TheoremTheorem: Let T be the pairing: Let T be the pairing produced by TMA. T is stable.produced by TMA. T is stable. gg bb gg** bb**
- 34. TheoremTheorem: Let T be the pairing: Let T be the pairing produced by TMA. T is stable.produced by TMA. T is stable. gg bb I rejected you when youI rejected you when you came to my balcony, now Icame to my balcony, now I got someone better.got someone better. gg**
- 35. TheoremTheorem: Let T be the pairing: Let T be the pairing produced by TMA. T is stable.produced by TMA. T is stable. • Let b and g be any couple in T. • Suppose b prefers g* to g. We will argue that g* prefers her husband to b. • During TMA, b proposed to g* before he proposed to g. Hence, at some point g* rejected b for someone she preferred. By the Improvement lemma, the person she married was also preferable to b. • Thus, every boy will be rejected by any girl he prefers to his wife. T is stable.
- 36. Opinion PollOpinion Poll Who is better off in traditional dating, the boys or the girls?
- 37. Forget TMA for a momentForget TMA for a moment How should we define what weHow should we define what we mean when we say “the optimalmean when we say “the optimal girl for boy b”?girl for boy b”? Flawed Attempt:Flawed Attempt: “The girl at the top of b’s list”“The girl at the top of b’s list”
- 38. The Optimal GirlThe Optimal Girl A boy’sA boy’s optimal girloptimal girl is the highestis the highest ranked girl for whom there isranked girl for whom there is somesome stable pairing in which the boy getsstable pairing in which the boy gets her.her. She is theShe is the bestbest girl he can conceivablygirl he can conceivably get in a stable world.get in a stable world.
- 39. The Pessimal GirlThe Pessimal Girl A boy’sA boy’s pessimal girlpessimal girl is the lowestis the lowest ranked girl for whom there isranked girl for whom there is somesome stable pairing in which the boy getsstable pairing in which the boy gets her.her. She is theShe is the worstworst girl he can conceivablygirl he can conceivably get in a stable world.get in a stable world.
- 40. Dating Heaven and HellDating Heaven and Hell A pairing isA pairing is male-optimalmale-optimal ifif everyevery boy gets hisboy gets his optimaloptimal mate. This is the best of all possiblemate. This is the best of all possible stable worlds for every boy simultaneously.stable worlds for every boy simultaneously. A pairing isA pairing is male-pessimalmale-pessimal ifif everyevery boy getsboy gets hishis pessimalpessimal mate. This is the worst of allmate. This is the worst of all possible stable worlds for every boypossible stable worlds for every boy simultaneously.simultaneously.
- 41. Dating Heaven and HellDating Heaven and Hell Does a male-optimal pairing alwaysDoes a male-optimal pairing always exist?exist? If so, is it stable?If so, is it stable?
- 42. The MathematicalThe Mathematical Truth!Truth! The Traditional MarriageThe Traditional Marriage Algorithm always producesAlgorithm always produces aa male-optimalmale-optimal,, female-female- pessimalpessimal pairing.pairing.
- 43. Advice to femalesAdvice to females Learn to make the first move.Learn to make the first move. Conclusions…Conclusions…
- 44. REAL-WORLD APPLICATIONSREAL-WORLD APPLICATIONS • College admissions and the hospitalsCollege admissions and the hospitals residents problemresidents problem • The sailors-boats problemThe sailors-boats problem • The stable room-mates problemThe stable room-mates problem • Application in router technologyApplication in router technology • Stable allocation problemStable allocation problem
- 45. Application in router technologyApplication in router technology • MUFCA is an algorithm for solvingMUFCA is an algorithm for solving the problem of creating a Routerthe problem of creating a Router used in LAN switches that combineused in LAN switches that combine input and output queueinput and output queue • In order for it to handle inputsIn order for it to handle inputs and outputs, it uses the Gale Shapleyand outputs, it uses the Gale Shapley algorithmalgorithm
- 46. Each input in MUFCA has a urgency value andEach input in MUFCA has a urgency value and according to that value, the preference listsaccording to that value, the preference lists for each switch are created,for each switch are created, and then inputs are matched with theand then inputs are matched with the outputs.outputs.
- 47. Other issues…Other issues… • What if people lie?What if people lie? • What about same-sex couples,What about same-sex couples, or pairing roommates?or pairing roommates? ( Not a straight-forward instance( Not a straight-forward instance of SMP)of SMP)
- 48. REFERENCESREFERENCES • Biro, P. and boylove, D.F. and Mittal, S., (2010),Biro, P. and boylove, D.F. and Mittal, S., (2010), Size versusSize versus stability in the marriage problem. Theoreticalstability in the marriage problem. Theoretical Computer Science, 411 (16-18). pp. 1828-1841. ISSN 0304-Computer Science, 411 (16-18). pp. 1828-1841. ISSN 0304- 39753975 • D. Gale and L. S. Shapley,D. Gale and L. S. Shapley, College admissions and theCollege admissions and the stability of marriagestability of marriage, American Mathematical Monthly 69 (1962),, American Mathematical Monthly 69 (1962), 9-159-15 • Dan Gusfield and Robert W. Irving,Dan Gusfield and Robert W. Irving, The Stable MarriageThe Stable Marriage Problem: Structures and AlgorithmsProblem: Structures and Algorithms, MIT Press, 1989, MIT Press, 1989
- 49. THANK YOUTHANK YOU
- 50. ANY QUERY?ANY QUERY?

No public clipboards found for this slide

Be the first to comment