Stable  Marriage Problem  Sangita Rani Satapathy
Upcoming SlideShare
Loading in...5
×
 

Stable Marriage Problem Sangita Rani Satapathy

on

  • 273 views

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

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

Statistics

Views

Total Views
273
Slideshare-icon Views on SlideShare
273
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Stable  Marriage Problem  Sangita Rani Satapathy Stable Marriage Problem Sangita Rani Satapathy Presentation Transcript

    • Stable MarriageStable Marriage ProblemProblem Sangita SatapathySangita Satapathy Asst. ProfessorAsst. Professor
    • # Introduction# Introduction # Background Theory# Background Theory # Formal Definition# Formal Definition # Real world Application# Real world Application # Issues# Issues
    • 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
    • WARNING: This lecture contains mathematical content that may be shocking to some Persons.
    • 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:
    • 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.
    • 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.
    • • 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)
    • • 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
    • • Genetic algorithms are used to solveGenetic algorithms are used to solve such problems and often producessuch problems and often produces better solutionsbetter solutions
    • 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?
    • 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?
    • 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
    • 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..
    • Why be with them when we can be with each other?
    • 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
    • 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?
    • 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!
    • Can you argue that the couples will not continue breaking up and reforming forever?
    • 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
    • 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
    • Female The Traditional MarriageThe Traditional Marriage AlgorithmAlgorithm String Worshipping males
    • 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
    • Does the Traditional MarriageDoes the Traditional Marriage Algorithm always produce aAlgorithm always produce a stablestable pairing?pairing?
    • Does the Traditional MarriageDoes the Traditional Marriage Algorithm always produce aAlgorithm always produce a stablestable pairing?pairing? Wait! There is a more primary question!
    • 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
    • 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 . . . . . . . . . . . . .
    • 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
    • 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
    • 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 .
    • 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
    • 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?
    • 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**
    • 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**
    • 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.
    • Opinion PollOpinion Poll Who is better off in traditional dating, the boys or the girls?
    • 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”
    • 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.
    • 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.
    • 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.
    • 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?
    • The MathematicalThe Mathematical Truth!Truth! The Traditional MarriageThe Traditional Marriage Algorithm always producesAlgorithm always produces aa male-optimalmale-optimal,, female-female- pessimalpessimal pairing.pairing.
    • Advice to femalesAdvice to females Learn to make the first move.Learn to make the first move. Conclusions…Conclusions…
    • 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
    • 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
    • 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.
    • 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)
    • 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
    • THANK YOUTHANK YOU
    • ANY QUERY?ANY QUERY?