Matching problems Toby Walsh NICTA and UNSW. Motivation Agents may express preferences for issues other than a collective decision  Preferences for a.

Slides:



Advertisements
Similar presentations
Modelling and Solving the Stable Marriage problem using Constraint Programming David Manlove and Gregg OMalley University Of Glasgow Department of Computing.
Advertisements

Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science.
Blah blah blah. Zoes shark Thanks to the conference artist Phoebe.
The Stable Marriage Problem and Constraint Programming.
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 2.
Marriage, Honesty, & Stability N ICOLE I MMORLICA, N ORTHWESTERN U NIVERSITY.
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.
1 Overview of Graph Theory Addendum “The Stable Marriage Problem” Instructor: Carlos Pomalaza-Ráez Fall 2003 University of Oulu, Finland.
Matching Theory.
Men Cheating in the Gale-Shapley Stable Matching Algorithm Chien-Chung Huang Dartmouth College.
Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser.
Social Networks 101 P ROF. J ASON H ARTLINE AND P ROF. N ICOLE I MMORLICA.
Telling a computer how to behave (via pseudocode -- a workaround for Computing’s Tower of Babel.) COS 116, Spring 2010 Adam Finkelstein.
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.
Lecture 5 CSE 331 Sep 11, HW 1 out today Will be handed out at the END of the lecture Read the homework policy document carefully START EARLY! ©ehow.com.
Lecture 8 CSE 331 Sep 17, HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm.
Lecture 6 CSE 331 Sep 10, Homeworks HW 1 posted online: see blog/piazza Pickup graded HW 0 in TA OHs.
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.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013.
L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant.
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.
Advanced Algorithms Piyush Kumar (Lecture 1: Introduction) Welcome to COT5405.
Lecture 2 CSE 331. Day 1 Survey On UBlearns Day 1 Survey (talking points) Security MS PhD for research Building PC’s for 442 It’s ok to play games –
Stable Matchings a.k.a. the Stable Marriage Problem
Lecture 5 CSE 331 Sep 11, Submit the form I’ll need confirmation in writing. No graded material will be handed back till I get this signed form.
Great Theoretical Ideas in Computer Science.
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Lecture 23: Stable Marriage ( Based on Lectures of Steven Rudich of CMU and Amit Sahai of Princeton) Shang-Hua Teng.
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.
1 Chapter 1 Introduction: Some Representative Problems Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Stable Marriages (Lecture modified from Carnegie Mellon University course Great Theoretical Ideas in Computer Science)
Design & Co-design of Embedded Systems Final Project: “The Match Maker” Second Phase Oral Presentation Safa S. Mahmoodian.
The Stable Marriage Problem
Great Theoretical Ideas in Computer Science for Some.
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.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Market Design and Analysis Lecture 2 Lecturer: Ning Chen ( 陈宁 )
Market Design and Analysis Lecture 1 Lecturer: Ning Chen ( 陈宁 )
18.1 CompSci 102 Today’s topics 1950s TV Dating1950s TV Dating.
Algorithms used by CDNs Stable Marriage Algorithm Consistent Hashing.
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.
Matching Boys Girls A B C D E
Cybernetica AS & Tartu University
Stable Matching.
Chapter 1 Introduction: Some Representative Problems
Stable Marriage Problem
The Stable Marriage Problem
CSE 421: Introduction to Algorithms
Lecture 5 CSE 331 Sep 10, 2010.
Lecture 6 CSE 331 Sep 11, 2017.
S. Raskhodnikova; based on slides by K. Wayne
CSE 421: Introduction to Algorithms
1.1 A First Problem: Stable Matching
Discrete Math for CS CMPSC 360 LECTURE 9 Last time: Strong induction
Blah blah blah.
Chapter 1 Introduction: Some Representative Problems
Lecture 6 CSE 331 Sep 12, 2011.
Lecture 6 CSE 331 Sep 12, 2016.
Richard Anderson Winter 2019 Lecture 1
Piyush Kumar (Lecture 3: Stable Marriage)
Lecture 7 CSE 331 Sep 11, 2013.
Presentation transcript:

Matching problems Toby Walsh NICTA and UNSW

Motivation Agents may express preferences for issues other than a collective decision  Preferences for a spouse  Preferences for a room-mate  Preferences for a work assignment  … All examples of matching problems  Husbands with Wives  Students with Rooms  Doctors with Hospitals  …

Stable marriage What do I know?  Ask me again after June 21st Mathematical abstraction  Idealized model  All men can totally order all women  …

Stable marriage Given preferences of n men  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare Given preferences of n women  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian

Stable marriage Given preferences of n men  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare Given preferences of n women  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian Find a stable marriage

Stable marriage Given preferences of n men Given preferences of n women Find a stable marriage  Assignment of men to women (or equivalently of women to men) Idealization: everyone marries at the same time  No pair (man,woman) not married to each other would prefer to run off together Idealization: assumes no barrier to divorce!

Stable marriage Unstable solution  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian Bertha & Greg would prefer to elope

Stable marriage One solution  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian Men do ok, women less well

Stable marriage Another solution  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian Women do ok, men less well

Gale Shapley algorithm Initialize every person to be free While exists a free man  Find best woman he hasn’t proposed to yet  If this woman is free, declare them engaged Else if this woman prefers this proposal to her current fiance then declare them engaged (and “free” her current fiance) Else this woman prefers her current fiance and she rejects the proposial

Gale Shapley algorithm Initialize every person to be free While exists a free man  Find best woman he hasn’t proposed to yet  If this woman is free, declare them engaged Else if this woman prefers this proposal to her current fiance then declare them engaged (and “free” her current fiance) Else this woman prefers her current fiance and she rejects the proposial Greg: Amy>Bertha>Clare Harry: Bertha>Amy>Clare Ian: Amy>Bertha>Clare Amy: Harry>Greg>Ian Bertha: Greg>Harry>Ian Clare: Greg>Harry>Ian

Gale Shapley algorithm  Terminates with everyone matched Suppose some man is unmatched at the end Then some woman is also unmatched But once a woman is matched, she only “trades” up Hence this woman was never proposed to But if a man is unmatched, he has proposed to and been rejected by every woman This is a contradiction as he has never proposed to the unmatched woman!

Gale Shapley algorithm Terminates with perfect matching  Suppose there is an unstable pair in the final matching  Case 1. This man never proposed to this woman As men propose to women in preference order, man must prefer his current fiance Hence current pairing is stable!

Gale Shapley algorithm Terminates with perfect matching  Suppose there is an unstable pair in the final matching  Case 1. This man never proposed to this woman  Case 2. This man had proposed to this woman But the woman rejected him (immediately or later) However, women only ever trade up Hence the woman prefers her current partner So the current pairing is stable!

Gale Shapley algorithm Each of n men can make at most (n-1) proposals Hence GS runs in O(n 2 ) time There may be more than one stable marriage GS finds man optimal solution There is no stable matching in which any man does better GS finds woman pessimal solution In all stable marriages, every woman does at least as well or better

Gale Shapley algorithm GS finds male optimal solution  Suppose some man is engaged to someone who is not the best possible woman Then they have proposed and been rejected by this woman Consider first such man A, who is rejected by X in favour ultimately of marrying B There exists (some other) stable marriage with A married to X and B to Y By assumption, B has not yet been rejected by his best possible woman Hence B must prefer X at least as much as his best possible woman So (A,X) (B,Y) is not a stable marriage as B and X would prefer to elope!

Gale Shapley algorithm GS finds woman pessimal solution  Suppose some womman is engaged to someone who is not the worst possible man Let (A,X) be married but A is not worst possible man for X There exists a stable marriage with (B,X) (A,Y) and B worse than A for X By male optimality, A prefers X to Y Then (A,Y) is unstable!

Gale Shapley algorithm Initialize every person to be free While exists a free man  Find best woman he hasn’t proposed to yet  If this woman is free, declare them engaged Else if this woman prefers this proposal to her current fiance then declare them engaged (and “free” her current fiance) Else this woman prefers her current fiance and she rejects the proposial Greg: Amy>Bertha>Clare Harry: Bertha>Amy>Clare Ian: Amy>Bertha>Clare Amy: Harry>Greg>Ian Bertha: Greg>Harry>Ian Clare: Greg>Harry>Ian

Gale Shapley algorithm woman optimal Initialize every person to be free While exists a free woman  Find best man she hasn’t proposed to yet  If this man is free, declare them engaged Else if this man prefers this proposal to his current fiance then declare them engaged (and “free” his current fiance) Else this man prefers his current fiance and he rejects the proposial Greg: Amy>Bertha>Clare Harry: Bertha>Amy>Clare Ian: Amy>Bertha>Clare Amy: Harry>Greg>Ian Bertha: Greg>Harry>Ian Clare: Greg>Harry>Ian

Extensions: ties Cannot always make up our minds  Angelina or Jennifer?  Either would be equally good! Stability  (weak) no couple strictly prefers each other  (strong) no couple such that one strictly prefers the other, and the other likes them as much or more

Extensions: ties Stability  (weak) no couple strictly prefers each other  (strong) no couple such that one strictly prefers the other, and the other likes them as much or more Existence  Strongly stable marriage may not exist O(n 4 ) algorithm for deciding existence  Weakly stable marriage always exists Just break ties aribtrarily Run GS, resulting marriage is weakly stable!

Extensions: incomplete preferences There are some people we may be unwilling to marry  I’d prefer to remain single than marry Margaret (m,w) unstable iff  m and w do not find each other unacceptable  m is unmatched or prefers w to current fiance  w is unmatched or prefers w to current fiance

Extensions: incomplete prefs GS algorithm  Extends easily Men and woman partition into two sets  Those who have partners in all stable marriages  Those who do not have partners in any stable marriage

Extensions: ties & incomplete prefs Weakly stable marriages may be different sizes  Unlike with just ties where they are all complete Finding weakly stable marriage of max. cardinality is NP-hard  Even if only women declare ties

Extensions: unequal numbers For instance, more men than woman  See China! Matching unstable if pair (m,w)  m and w do not find each other unacceptable  m is unmatched or prefers w to current fiance  w is unmatched or prefers w to current fiance

Extensions: unequal numbers GS algorithm  Extends easily If |men|>|women| then all woman are married in a stable solution  Men partition into two sets Those who have partners in all stable marriages Those who do not have partners in any stable marriage

Strategy proofness GS is strategy proof for men  Assuming male optimal algorithm  No man can do better than the male optimal solution However, women can profit from lying  Assuming male optimal algorithm is run  And they know complete preference lists

Strategy proofness  Greg: Amy>Bertha>Clare  Harry: Bertha>Amy>Clare  Ian: Amy>Bertha>Clare  Amy: Harry>Greg>Ian  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian  Amy lies  Amy: Harry>Ian>Greg  Bertha: Greg>Harry>Ian  Clare: Greg>Harry>Ian

Impossibility of strategy proofness [Roth 82]  No matching procedure for which stating the truth is a dominant strategy for all agents when preference lists can be incomplete  Consider Greg: Amy>Bertha Amy: Harry>Greg Harry: Bertha>Amy Bertha: Greg>Harry  Two stable marriages: (Greg,Amy)(Harry,Bertha) or (Greg,Bertha)(Harry,Amy)

Impossibility of strategy proofness  Consider Greg: Amy>Bertha Amy: Harry>Greg Harry: Bertha>Amy Bertha: Greg>Harry  Two stable marriages: (Greg,Amy)(Harry,Bertha) or (Greg,Bertha)(Harry,Amy)  Suppose we get male optimal solution (Greg,Amy)(Harry,Bertha) If Amy lies and says Harry is only acceptable partner Then we must get (Harry,Amy)(Greg,Bertha) as this is the only stable marriage  Other cases can be manipulated in a similar way

Impossibility of strategy proofness  Strategy proofness is hard to achieve  [Roth and Sotomayor 90] With any matching procedure, if preference lists are strict, and there is more than one stable marriage, then at least one agent can profitably lie assuming the other agents tell the truth  But one side can have no incentive to lie  [Dubins and Freedman 81] With a male-proposing matching algorithm, it is a weakly-dominant strategy for the men to tell the truth Weakly-dominant=???

Some lessons learnt? Historically men have in fact proposed to woman  Men: propose early and often  Men: don’t lie  Women: ask out the guys  (Bad news) Women: lying and turning down proposals can be to your advantage!

Hospital residents problem Matching of residents to hospitals  Hospitals express preferences over resident  Hospitals declare how many residents they take  Residents express preferences over hospitals Matching (h,r) unstable iff  They are acceptable to each other  r is unmatched or r prefers h to current hospital  h is not full or h prefers r to one its current residents

Stable roommate 2n agents  Each ranks every other agent  Pair up agents according to preferences No stable matching may exist  Adam: Bob>Chris>Derek  Bob: Chris>Adam>Derek  Chris: Adam>Bob>Derek  Derek: Adam>Bob>Chris

Conclusions Preferences turn up in matching problems  Stable marriage  Roommate  Hospital-residents problem We may wish to represent  Ties  Incompatability (aka “incomplete preference lists) .. Complexity depends on this  Stable marriage on total orders is O(n 2 )  Stable marriage with ties and incomplete preference lists is NP-hard

Conclusions Many different formalisms for representing preferences  CP nets, soft constraints, utilities, … Many different dimensions to analyse these formalisms along  Expressiveness, succinctness, … Many interesting computational problems  Computing optimal, ordering outcomes, manipulating result, deciding when to terminate preference elicitation, …