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

Slides:



Advertisements
Similar presentations
1 Stable Matching A Special Case of Stable Marriage.
Advertisements

Constraint Satisfaction Problems
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Fast optimal instruction scheduling for single-issue processors with arbitrary latencies Peter van Beek, University of Waterloo Kent Wilken, University.
Strong Stability in the Hospitals/Residents Problem Robert W. Irving, David F. Manlove and Sandy Scott University of Glasgow Department of Computing Science.
1 Almost stable matchings in the Roommates problem David Abraham Computer Science Department Carnegie-Mellon University Péter Biró Department of Computer.
1 Approximability Results for Induced Matchings in Graphs David Manlove University of Glasgow Joint work with Billy Duckworth Michele Zito Macquarie University.
Stable Matching Problems with Constant Length Preference Lists Rob Irving, David Manlove, Gregg OMalley University Of Glasgow Department of Computing Science.
1 Student-Project Allocation with Preferences over Projects David Manlove Gregg OMalley University of Glasgow Department of Computing Science Supported.
1 Almost stable matchings in the Roommates problem David Abraham Computer Science Department Carnegie-Mellon University, USA Péter Biró Department of Computer.
1 Student-Project Allocation with Preferences over Projects David Manlove University of Glasgow Department of Computing Science Joint work with Gregg OMalley.
Strong Stability in the Hospitals/Residents Problem
An empirical study of the stable marriage problem with ties and incomplete lists (SMTI) Ian Gent & Patrick Prosser.
Blah blah blah. Zoes shark Thanks to the conference artist Phoebe.
The Stable Marriage Problem and Constraint Programming.
LAW February A 5/3 approximation algorithm for a hard case of stable marriage Rob Irving Computing Science Department University of Glasgow (joint.
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 2.
A Constraint Programming Approach to the Hospitals / Residents Problem By David Manlove, Gregg O’Malley, Patrick Prosser and Chris Unsworth.
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.
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
Lecture 2: Greedy Algorithms II Shang-Hua Teng Optimization Problems A problem that may have many feasible solutions. Each solution has a value In maximization.
Matching problems Toby Walsh NICTA and UNSW. Motivation Agents may express preferences for issues other than a collective decision  Preferences for a.
Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser.
What’s the problem? Something like stable marriage problem … but without sex.
Joint work with Rob Irving
Stabile Marriage Thanks to Mohammad Mahdian Lab for Computer Science, MIT.
Lecture 4 CSE 331 Sep 9, Blog posts for lectures Starts from today See Sep 8 post on the blog.
130 September 2003 Tractability by Approximating Constraint Languages Martin Green and David Cohen CP 2003 Ninth International Conference on Principles.
Strong Stability in the Hospitals/Residents Problem Robert W. Irving, David F. Manlove and Sandy Scott University of Glasgow Department of Computing Science.
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
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
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.
L3 #1 The Hospitals / Residents Problem and Some Extensions David Manlove University of Glasgow Department of Computing Science Supported by EPSRC grant.
Pelvic floor Specialised Constraints for Stable Matching Problems Contact details: 17 Lilybank Gardens Glasgow G12 8QQ The Problem.
Lecture 4 CSE 331 Sep 6, TA change Swapnoneel will leave us for 531 Jiun-Jie Wang will join us.
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.
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Specialised Binary Constraint for the Stable Marriage Problem with Ties and incomplete preference lists By Chris Unsworth and Patrick Prosser.
A Constraint Programming Approach to the Hospitals / Residents Problem By David Manlove, Gregg O’Malley, Patrick Prosser and Chris Unsworth.
Algorithms for Student-Project Allocation
The Stable Marriage Problem
Matching Lecture 19: Nov 23.
1 “Almost stable” matchings in the Roommates problem David Abraham Computer Science Department Carnegie-Mellon University, USA Péter Biró Department of.
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 ( 陈宁 )
Matching Boys Girls A B C D E
Stable Matching.
Chapter 1 Introduction: Some Representative Problems
Lower bound for the Stable Marriage Problem
Stable Marriage Problem
Lecture 4 CSE 331 Sep 7, 2016.
Introduction to the Design and Analysis of Algorithms
The Stable Marriage Problem
Apollo Weize Sun, Mar.10th, 2017.
Lecture 4 CSE 331 Sep 6, 2017.
Lecture 6 CSE 331 Sep 13, 2010.
S. Raskhodnikova; based on slides by K. Wayne
CSE 421: Introduction to Algorithms
Blah blah blah.
Lecture 6 CSE 331 Sep 12, 2011.
Piyush Kumar (Lecture 3: Stable Marriage)
A Grand Tour of Stable Matching Problems
Lecture 7 CSE 331 Sep 11, 2013.
15th Scandinavian Workshop on Algorithm Theory
Presentation transcript:

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

29/07/ SM Formalisation Set n men S M = {m 1, m 2, …., m n } Set n men S M = {m 1, m 2, …., m n } Set n women S W = {w 1, w 2, …., w n } Set n women S W = {w 1, w 2, …., w n } Each man ranks the women in S W in strict order of preference. Each man ranks the women in S W in strict order of preference. Each woman ranks the men in S M in strict order of preference. Each woman ranks the men in S M in strict order of preference. A matching M is a bijection between the men and women. A matching M is a bijection between the men and women. We say a (man, woman) pair (m,w) blocks M if: We say a (man, woman) pair (m,w) blocks M if: m prefers w to his partner in M, and m prefers w to his partner in M, and w prefers m to her partner in M. w prefers m to her partner in M. A matching that admits no blocking pair is said to be stable A matching that admits no blocking pair is said to be stable Can t improve by making an arrangement outside the matching. Can t improve by making an arrangement outside the matching. SM was first formalised by David Gale and Lloyd Shapley in SM was first formalised by David Gale and Lloyd Shapley in 1962.

29/07/ Example Stable Marriage Instance 1: : : : : : : : Mens preferencesWomens preferences

29/07/ Example Stable Matching M = {(1, 4), (2, 3), (3, 2), (4, 1)} M = {(1, 4), (2, 3), (3, 2), (4, 1)} 1: : : : : : : : Mens preferencesWomens preferences

29/07/ Extended Gale-Shapley Algorithm 1. assign each person to be free; 2. while (some man m is free) 3. w := first women on m's list; 4. if (w is currently assigned to some man p) 5. assign p to be free; 6. end if 7. assign m to w; 8. foreach (m' successors w (m) ) 9. delete (m', w); 10. end loop 11. end loop Algorithm complexityO(n 2 )– so linear in size of problem instance. Algorithm complexity O(n 2 ) – so linear in size of problem instance.

29/07/ SM and CSPs In the last few years SM and CSPs have been the focus of much attention in the literature. In the last few years SM and CSPs have been the focus of much attention in the literature. Gent et al: CP 01 with two SM encodings Gent et al: CP 01 with two SM encodings Lustig and Puget, 2001 Lustig and Puget, 2001 Green and Cohen, CP 03 Green and Cohen, CP 03 Aldershof and Carducci, 1999 Aldershof and Carducci, 1999

29/07/ Motivation CP 01 paper by Gent et al. presented two ways to encode an instance of SM as a Constraint Satisfaction Problem (CSP). CP 01 paper by Gent et al. presented two ways to encode an instance of SM as a Constraint Satisfaction Problem (CSP). First encoding: time taken to establish AC is O(n 4 ) - the variables domains after AC corresponded to the GS-lists. First encoding: time taken to establish AC is O(n 4 ) - the variables domains after AC corresponded to the GS-lists. Second encoding: time taken to establish AC is O(n 2 ) - the variables domains after AC corresponded to a weaker structure. Second encoding: time taken to establish AC is O(n 2 ) - the variables domains after AC corresponded to a weaker structure. Can we find an encoding that finds GS-lists in O(n 2 ) time? Can we find an encoding that finds GS-lists in O(n 2 ) time? Shows that CP algorithms give rise to the same structure and the same time complexity as conventional methods. Shows that CP algorithms give rise to the same structure and the same time complexity as conventional methods. Many stable matching problems are NP-hard – can CP help us here? Many stable matching problems are NP-hard – can CP help us here?

29/07/ Structure of SM The Gale-Shapley (GS) algorithm has two possible orientations : The Gale-Shapley (GS) algorithm has two possible orientations : man-oriented GS (MEGS) algorithm : where the men propose to the women. man-oriented GS (MEGS) algorithm : where the men propose to the women. women-oriented GS (WEGS) algorithm : where the women propose to the men. women-oriented GS (WEGS) algorithm : where the women propose to the men. Optimality properties of each algorithm: Optimality properties of each algorithm: MEGS algorithm - man-optimal stable matching M 0 - simultaneously the best possible stable matching for all men. MEGS algorithm - man-optimal stable matching M 0 - simultaneously the best possible stable matching for all men. WEGS algorithm - woman-optimal stable matching M z - simultaneously the best possible stable matching for all women. WEGS algorithm - woman-optimal stable matching M z - simultaneously the best possible stable matching for all women. Deletions that occur during an execution of either algorithm result in a set of reduced preference lists on termination of each algorithm: Deletions that occur during an execution of either algorithm result in a set of reduced preference lists on termination of each algorithm: The MGS-lists for the MEGS algorithm. The MGS-lists for the MEGS algorithm. The WGS-lists for the WEGS algorithm. The WGS-lists for the WEGS algorithm. The intersection of the MGS-lists and the WGS-lists is called the GS-lists. The intersection of the MGS-lists and the WGS-lists is called the GS-lists. The GS-lists have many important structural properties. The GS-lists have many important structural properties.

29/07/ New CSP Encodings We present two new CSP encodings for SM. We present two new CSP encodings for SM. First encoding (n-valued) is simple and easy to understand, presents a natural way to represent SM as CSP. First encoding (n-valued) is simple and easy to understand, presents a natural way to represent SM as CSP. Second encoding (4-valued) is more complex but addresses the problem of establishing AC and finding the GS-lists in O(n 2 ). This will only briefly be mentioned here. Second encoding (4-valued) is more complex but addresses the problem of establishing AC and finding the GS-lists in O(n 2 ). This will only briefly be mentioned here.

29/07/ n-valued Encoding Encode SM instance I with n men and n women as a CSP instance J with 2n variables. Encode SM instance I with n men and n women as a CSP instance J with 2n variables. For each man m i S M we introduce a variable x i in J. For each man m i S M we introduce a variable x i in J. For each woman w j S W we introduce a variable y j in J. For each woman w j S W we introduce a variable y j in J. The initial domain for each variable is: The initial domain for each variable is: dom( x i ) = dom( y j ) = {1, 2,…, n}. dom( x i ) = dom( y j ) = {1, 2,…, n}. Constraints: Constraints: 1. x i p y j q ( 1 i n, 1 p n ) 2. y j q x i p ( 1 j n, 1 q n ) 3. y j q x i p ( 1 j n, 1 q n ) 4. x i p y j q ( 1 i n, 1 p n ) In Constraints 1 and 4, j is such that rank( m i, w j ) = p and also rank( w j, m i ) = q. In Constraints 2 and 3; i is such that rank( w j, m i ) = q and also rank( m i, w j ) = p.

29/07/ n-valued Properties and Structure We prove that after AC propagation the variables domains correspond to the GS-lists. We prove that after AC propagation the variables domains correspond to the GS-lists. AC propagation in encoding takes O(n 3 ) time. AC propagation in encoding takes O(n 3 ) time. We also prove that we can enumerate all stable matchings in a failure free manner. We also prove that we can enumerate all stable matchings in a failure free manner.

29/07/ valued Encoding Far more complex, extends second encoding in CP 01 paper. Far more complex, extends second encoding in CP 01 paper. Name arises from the fact that each variables domain contains 4 values Name arises from the fact that each variables domain contains 4 values 1 - is always in the domain, ensures domain never becomes empty. 1 - is always in the domain, ensures domain never becomes empty. 0 - corresponds to a proposal. 0 - corresponds to a proposal. 2 - corresponds to a deletion during the MEGS algorithm. 2 - corresponds to a deletion during the MEGS algorithm. 3 - corresponds to a deletion during the WEGS algorithm. 3 - corresponds to a deletion during the WEGS algorithm. Gives us the GS-lists after AC propagation. Gives us the GS-lists after AC propagation. AC can be established in O(n 2 ) time. AC can be established in O(n 2 ) time. Failure free enumeration of all stable matchings also holds. Failure free enumeration of all stable matchings also holds.

29/07/ Summary Presented two new encodings for SM: Presented two new encodings for SM: Time complexities O(n 3 ) and O(n 2 ). Time complexities O(n 3 ) and O(n 2 ). AC propagation finds the GS-lists. AC propagation finds the GS-lists. Can be extended to SM with incomplete lists. Can be extended to SM with incomplete lists. First encoding has been extended to Hospitals / Residents problem (HR) First encoding has been extended to Hospitals / Residents problem (HR) Will be presented at workshop in CP 05. Will be presented at workshop in CP 05. Extension to NP-hard variants Extension to NP-hard variants HR with couples HR with couples HR with ties under weak stability HR with ties under weak stability