Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser.

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.
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.
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
A Constraint Programming Approach to the Hospitals / Residents Problem By David Manlove, Gregg O’Malley, Patrick Prosser and Chris Unsworth.
Matching problems Toby Walsh NICTA and UNSW. Motivation Agents may express preferences for issues other than a collective decision  Preferences for a.
Improved Efficiency for Private Stable Matching Matthew Franklin, Mark Gondree, and Payman Mohassel University of California, Davis 02/07/07 - Session.
What’s the problem? Something like stable marriage problem … but without sex.
Joint work with Rob Irving
1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
On Efficient Spatial Matching Raymond Chi-Wing Wong (the Chinese University of Hong Kong) Yufei Tao (the Chinese University of Hong Kong) Ada Wai-Chee.
Lecture 4 CSE 331 Sep 9, Blog posts for lectures Starts from today See Sep 8 post on the blog.
Constraint Satisfaction Problems
Chapter 5 Outline Formal definition of CSP CSP Examples
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.
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.
Chapter 10: Iterative Improvement Simplex Method The Design and Analysis of Algorithms.
The Stable Marriage Problem
Local Computation Mechanism Design Shai Vardi, Tel Aviv University Joint work with Avinatan Hassidim & Yishay Mansour Men’s preferences first second Women’s.
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
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
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.
All Pair Shortest Path IOI/ACM ICPC Training June 2004.
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
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
Implicit Hitting Set Problems Richard M. Karp Erick Moreno Centeno DIMACS 20 th Anniversary.
Arc consistency AC5, AC2001, MAC. AC5 A generic arc-consistency algorithm and its specializations AIJ 57 (2-3) October 1992 P. Van Hentenryck, Y. Deville,
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.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Matching Boys Girls A B C D E
Cybernetica AS & Tartu University
Stable Matching.
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
Chapter 10 Iterative Improvement
The Stable Marriage Problem
The minimum cost flow problem
Maximum Flow - Best algorithms
CSE 421: Introduction to Algorithms
Various Graph Algorithms
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.
Richard Anderson Autumn 2006 Lecture 1
Lecture 5 CSE 331 Sep 7, 2012.
Blah blah blah.
Chapter 1 Introduction: Some Representative Problems
Lecture 10 CSE 331 Sep 21, 2012.
Lecture 8 CSE 331 Sep 15, 2011.
Lecture 6 CSE 331 Sep 12, 2016.
Lecture 7 CSE 331 Sep 10, 2014.
Piyush Kumar (Lecture 3: Stable Marriage)
Lecture 5 CSE 331 Sep 9, 2011.
Lecture 7 CSE 331 Sep 11, 2013.
Presentation transcript:

Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

The Stable Marriage Problem Men Women Bob Ian Jon : Ian Jon Bob : Jon Ian Bob : Bob Jon Ian : Sue Jan Liz : Liz Jan Sue : Jan Sue Liz Jan Liz Sue We have n menand n women Each man ranks the n women And each woman ranks the n men Objective : To find a matching of men to women Such that the matching is Stable

The Stable Marriage Problem Men Women Bob Ian Jon : Ian Jon Bob : Jon Ian Bob : Bob Jon Ian : Sue Jan Liz : Liz Jan Sue : Jan Sue Liz Jan Liz Sue A Matching But not a stable one  Bob and Sue would rather be matched to each other than to there assigned partners In this matching Bob and Sue are a Blocking pair A matching is only stable iff it contains no Blocking pairs

The Stable Marriage Problem Men Women Bob Ian Jon : Ian Jon Bob : Jon Ian Bob : Bob Jon Ian : Sue Jan Liz : Liz Jan Sue : Jan Sue Liz Jan Liz Sue A Stable Matching And another Stable Match

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

The Extended Gale Shapley Algorithm Cycles through a list of free men until there are no free men remaining The man proposes to his most preferred woman If the woman was engaged then the engagement is broken and her previous fiancé will be added to the free list The man and woman become engaged All men the woman likes less than her new fiancé will be removed from her preference list, and she will also be removed from theirs

assign each person to be free WHILE (some man m is free) DO BEGIN w := first woman on m's list IF (some man p is engaged to w) THEN assign p to be free assign m and w to be engaged to each other FOR (each successor p of m on w's list) DO BEGIN delete p from w's list delete w from p's list END The Extended Gale Shapley Algorithm

The reduced preference lists are the MGS-Lists The female version yields the WGS- Lists The intersection of these lists are known as the GS-Lists Contains all possible stable matchings If all men are match to there best match in the GS-Lists that matching will be the man optimal matching Likewise with the women

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

Previous Constraint Models Two Constraint encodings presented by Ian Gent, Robert Irving, David Manlove, Patrick Prosser and Barbara Smith in CP01

Forbidden tuples model (CP01) 2n variables, one for each man and woman each with a domain (1.. N) n 2 table constraints One for each potential couple Set of pairs of values the constrained variables cannot simultaneously take Potentially O(n 2 ) pairs per constraint

Forbidden tuples model (CP01) When made arc consistent the variable domains are equivalent to the GS-Lists All stable matchings can be found in a failure free enumeration Space complexity O(n 4 ) Time complexity O(n 4 )

Boolean Encoding (CP01) 2n 2 variables with 0/1 domains m[i,j] = 1 means m[i] is married to a partner no better than j. m[i,j] = 0 means m[i] is married to a partner better than j O(n 2 ) constraints, mostly implication

Boolean Encoding (CP01) When made arc consistent the variable domains equal the bounds of the GS-lists All stable matchings can be found in a failure free enumeration Space complexity O(n 2 ) Time complexity O(n 2 )

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

Justification A Linear time algorithm already exists for this problem (linear to the size of input i.e. O(n 2 )) Optimal Constraint models have been published So why do we need a specialised constraint for this problem? Performance gap between Constraint models and algorithm Inflexibility of the algorithm The Aim of the Specialised Constraint Is then to reduce the performance gap whilst retaining the flexibility of the constraint models

Specialised N-ary Constraint 2n variables, one for each man and woman each with a domain (1.. N) Domain values represent preferences e.g. if the man variable m[1] were assigned the value 3 then man 1 would be assigned to his third choice woman 1 Specialised n-ary Constraint

Specialised N-ary Constraint 5 methods associated with a constraint Initialisation of constraints Lower bound of a variable increases Upper bound of a variable decreases Interior value removal Variable instantiation Assume constraint is processed in an AC5-like environment when a variable loses a value, process the constraints incident on that variable

Specialised N-ary Constraint Constraint requirements Access to all variable domains x[i] = variable for man i y[j] = variable for woman j The inverse preference lists mpw[i] = man i’s inverse preference list mpw[i][j] = man i’s inverse preference for woman j mpw[i][j] = k iff mpl[i][k] = j wpm[j] = woman j’s inverse preference list

Lower bound increases Man m i ’s lower bound increases The Lower bound method is called Get man m i ’s new lower bound Find woman w j that a corresponds to Remove all men from woman w j ‘s domain she likes less than m i LowerBound(i) a = getMin(x[i]) j = mpw[i][a] setMax(y[j],wpm[j][j])

Upper bound decreases Woman w j ’s upper bound is reduced The upper bound method is called Loop for each value k removed form the tail of woman w j ’s domain Find man m i that k represents Remove woman w j from m i ’s domain upperBound(j) for (k = value removed from the tail of j[j]) i = wpm[j][k] remVal(x[i],mpw[i][j])

Initialisation, Interior Removal, Instantiation Initialisation simply calls the lower bound method The Interior Removal and Instantiation methods are required for search and side constraints Read paper for more detail

Complexity Space complexity O(n 2 ) Time complexity O(n 2 ) See paper for complexity argument

Contents The Stable Marriage Problem The Algorithm Previous Constraint Models Specialised N-ary Constraint Computational Comparison Conclusion Applause

Computational Comparison Compare forbidden tuples (FT), Boolean (Bool) and the specialised N-ary constraint (SMN) on random SMP Time to make arc-consistent Time to find all solutions All times include model creation time

Computational Comparison Size n model FT Bool SMN Size n model FT Bool SMN Time in seconds to produce the GS-Lists Time in seconds to find all solutions

Computational Comparison Size n problem AC All Time in seconds to produce the GS-Lists and find all solutions with the SMN constraint

Computational Comparison Why is SMN dominating Bool? SMN is more space efficient Bool has 2n + 6n 2 constraints SMN has 1 constraint of size O(n 2 ) Bool has 2n 2 variables SMN has 2n variables Bool runs out of memory constructing the variable for n = 1300 SMN constructs the variables for n = 1300 in 0.25 seconds

Demonstration of Versatility The sex equal stable marriage problem Find the matching that is equally good for all Minimise the absolute difference between the sums of the preferences of the male and female assignment Minimise( ) Where P(m 1 ) gives m 1 ’s preference for his assigned partner This has been proven to be NP-hard

Demonstration of Versatility Implementation 2 summation constraints 1 over the male variable the other over the female 1 variable to hold the value of the absolute difference between the 2 summation constraints 1 minimising objective constraint Code needed : final IlcIntVar optVar = solver.intVar(0, n*n); solver.add(solver.eq(optVar, solver.abs( solver.diff(solver.sum(menVars), solver.sum(womenVars))))); solver.add(solver.minimize(optVar));

Demonstration of Versatility Time in seconds to find sex-equal optimal solution Size n problem SE All

Conclusion A new specialised N-ary constraint for SM Outperforms optimal constraint model Because compact and simple Versatile 1 st computational study of SESMP (we think)

Applause & Questions Thank you