Matching Boys Girls A B C D E

Slides:



Advertisements
Similar presentations
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Advertisements

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.
Matching Theory.
Matching problems Toby Walsh NICTA and UNSW. Motivation Agents may express preferences for issues other than a collective decision  Preferences for a.
CSE 421 Algorithms Richard Anderson Lecture 2. Announcements Office Hours –Richard Anderson, CSE 582 Monday, 10:00 – 11:00 Friday, 11:00 – 12:00 –Yiannis.
Lecture 4 CSE 331 Sep 9, Blog posts for lectures Starts from today See Sep 8 post on the blog.
1 Bipartite Matching Polytope, Stable Matching Polytope x1 x2 x3 Lecture 10: Feb 15.
The Stable Marriage Problem
1 Chapter 1 Introduction: Some Representative Problems Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Stable Matching Problem Goal. Given n men and n women, find a "suitable" matching. n Participants rate members of opposite sex. n Each man lists women.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Adapted from a presentation by Stephen Rudich.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Presentation by Shuchi Chawla with some modifications.
Stable Matchings a.k.a. the Stable Marriage Problem
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Stable Matching Lecture 7: Oct 3. Matching A B C DE Boys Girls Today’s goal: to “match” the boys and the girls in a “good” way.
Design & Co-design of Embedded Systems Final Project: “The Match Maker” Second Phase Oral Presentation Safa S. Mahmoodian.
Bipartite Matching. Unweighted Bipartite Matching.
The Stable Marriage Problem
Matching Lecture 19: Nov 23.
CSCI 256 Data Structures and Algorithm Analysis lecture 1 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Dating Advice from Mathematics
COMP9007: Algorithms Stable Matching. What's in an algorithm? Algorithms can have huge impact For example – A report to the White House from 2010 includes.
מתמטיקה בדידה Discrete Math Lecture 12 1 TexPoint fonts used in EMF.
IOI/ACM ICPC Training 4 June 2005.
Cybernetica AS & Tartu University
Stable Matching.
Chapter 1 Introduction: Some Representative Problems
Stable Marriage Problem
Lecture 4 CSE 331 Sep 7, 2016.
Introduction to the Design and Analysis of Algorithms
Chapter 10 Iterative Improvement
The Stable Marriage Problem
Bipartite Matching Lecture 8: Oct 7.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes?
CSE 421: Introduction to Algorithms
The Mathematics Of 1950’s Dating: Who wins The Battle of The Sexes?
Lecture 5 CSE 331 Sep 10, 2010.
Lecture 7 CSE 331 Sep 15, 2010.
Lecture 4 CSE 331 Sep 6, 2017.
Lecture 6 CSE 331 Sep 11, 2017.
Lecture 6 CSE 331 Sep 13, 2010.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes?
Richard Anderson (for Anna Karlin) Winter 2006 Lecture 1
S. Raskhodnikova; based on slides by K. Wayne
Matching Lirong Xia March 8, Matching Lirong Xia March 8, 2016.
Computational Processes II
Richard Anderson Autumn 2006 Lecture 1
CSE 421: Introduction to Algorithms
1.1 A First Problem: Stable Matching
Discrete Math for CS CMPSC 360 LECTURE 9 Last time: Strong induction
Lecture 5 CSE 331 Sep 6, 2013.
Lecture 5 CSE 331 Sep 7, 2012.
Blah blah blah.
Chapter 1 Introduction: Some Representative Problems
Matching and Resource Allocation
Richard Anderson Autumn 2016 Lecture 2
Computational Processes II
Computational Processes
Lecture 6 CSE 331 Sep 12, 2011.
Lecture 5 CSE 331 Sep 5, 2014.
Lecture 6 CSE 331 Sep 12, 2016.
Lecture 7 CSE 331 Sep 10, 2014.
Richard Anderson Winter 2019 Lecture 1
Stable Matchings.
Piyush Kumar (Lecture 3: Stable Marriage)
Derived Variables A derived variable v is simply a function
Lecture 7 CSE 331 Sep 11, 2013.
Week 10 - Wednesday CS221.
Richard Anderson Autumn 2015 Lecture 2
Presentation transcript:

Matching 1 2 3 4 5 Boys Girls A B C D E 1 2 3 4 5 Boys Girls A B C D E Today’s goal: to “match” the boys and the girls in a “good” way.

Matching Goal: to “match” the boys and the girls in a “good” way. What is a matching? Each boy is married to at most one girl. Each girl is married to at most one boy. Depending on the information we have. What is a good matching? A stable matching: They have no incentive to break up… A maximum matching: To maximize the number of pairs married…

Stable Matching Problem Perfect matching: everyone is matched monogamously. Each man gets exactly one woman. Each woman gets exactly one man. Stability: no incentive for some pair of participants to undermine assignment by joint action. In matching M, an unmatched pair m-w is unstable if man m and woman w prefer each other to current partners. Unstable pair m-w could each improve by eloping. Stable matching: perfect matching with no unstable pairs. Stable matching problem. Given the preference lists of n men and n women, find a stable matching if one exists.

Stable Matching The Stable Marriage Problem: There are n boys and n girls. For each boy, there is a preference list of the girls. For each girl, there is a preference list of the boys. Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Stable Matching What is a stable matching? Consider the following matching. It is unstable, why? Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Stable Matching Boy 4 prefers girl C more than girl B (his current partner). Girl C prefers boy 4 more than boy 1 (her current partner). So they have the incentive to leave their current partners, and switch to each other, we call such a pair an unstable pair. Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Stable Matching What is a stable matching? A stable matching is a matching with no unstable pair, and every one is married. Can you find a stable matching in this case? Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Stable Matching Does a stable matching always exists? Not clear… Can you find a stable matching in this case? Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Stable Roommate The Stable Roommate Problem: There are 2n people. There are n rooms, each can accommodate 2 people. Each person has a preference list of 2n-1 people. Find a stable matching (match everyone and no unstable pair). Does a stable matching always exist? Not clear… When is it difficult to find a stable matching? Idea: triangle relationship!

Stable Roommate Idea: triangle relationship! a prefers b more than c b prefers c more than a c prefers a more than b no one likes d So let’s say a is matched to b, and c is matched to d. Then b prefers c more than a, and c prefers b more than d. No stable matching exists!

Stable Matching Can you now construct an example where there is no stable marriage? Nope… Gale,Shapley [1962]: There is always a stable matching in the stable marriage problem. This is more than a solution to a puzzle: College Admissions (original Gale & Shapley paper, 1962) Matching Hospitals & Residents. Matching Dancing Partners. The proof is based on a marriage procedure…

Stable Matching Why stable marriage is easier than stable roommate? Intuition: It is enough if we only satisfy one side! This intuition leads us to a very natural approach. Boys Girls 1: CBEAD A : 35214 2 : ABECD B : 52143 3 : DCBAE C : 43512 4 : ACDBE D : 12345 5 : ABDEC E : 23415

Gale-Shapely Algorithm Initialize each person to be free. while (some man is free and hasn't proposed to every woman) { Choose such a man m w = 1st woman on m's list to whom m has not yet proposed if (w is free) assign m and w to be engaged else if (w prefers m to her fiancé m') assign m and w to be engaged, and m' to be free else w rejects m }

Proof of Gale-Shapley Theorem This procedure always find a stable matching in the stable marriage problem. What do we need to check? The procedure will terminate. Everyone is married. No unstable pairs.

Step 1 of the Proof Claim 1. The procedure will terminate in at most n2 days. 1. If every girl is matched to exactly one boy, then the procedure will terminate. 2. Otherwise, since there are n boys and n girls, there must be a girl receiving more than one proposal. 3. She will reject at least one boy in this case, and those boys will write off that girl from their lists, and propose to their next favourite girl. 4. Since there are n boys and each list has at most n girls, the procedure will last for at most n2 days.

Step 2 of the Proof Claim 2. Every one is married when the procedure stops. Proof: by contradiction. If B is not married, his list is empty. That is, B was rejected by all girls. A girl only rejects a boy if she already has a more preferable partner. Once a girl has a partner, she will be married at the end. That is, all girls are married (to one boy) at the end, but B is not married. This implies there are more boys than girls, a contradiction.

Step 3 of the Proof Claim 3. There is no unstable pair. Fact. If a girl G rejects a boy B, then G will be married to a boy (she likes) better than B. Consider any pair (B,G). Case 1. If G is on B’s list, then B is married to be the best one on his list. So B has no incentive to leave. Case 2. If G is not on B’s list, then G is married to a boy she likes better. So G has no incentive to leave.

Proof of Gale-Shapley Theorem There is always a stable matching in the stable marriage problem. Claim 1. The procedure will terminate in at most n2 days. Claim 2. Every one is married when the procedure stops. Claim 3. There is no unstable pair. So the theorem follows.

More Questions (Optional) Intuition: It is enough if we only satisfy one side! Is this marrying procedure better for boys or for girls?? All boys get the best partner simultaneously! All girls get the worst partner simultaneously! Why? That is, among all possible stable matching, boys get the best possible partners simultaneously. Can a boy do better by lying? Can a girl do better by lying? NO! YES!