Stable Marriage Problem William Kozma Jr ECE 443/543.

Slides:



Advertisements
Similar presentations
Chocoholic Anonymous: Scenario. 1. John goes to ChocoAn to join as a member: a.Member information is added. b.Insurance plans are shown and John buy one.
Advertisements

Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Tutorial 5 of CSCI2110 Eulerian Path & Hamiltonian Cycle Tutor: Zhou Hong ( 周宏 )
Matching Theory.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
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.
Basic Algorithms on Arrays. Learning Objectives Arrays are useful for storing data in a linear structure We learn how to process data stored in an array.
Specialised N-ary Constraint for the Stable Marriage Problem By Chris Unsworth and Patrick Prosser.
Joint work with Rob Irving
1 Discrete Structures & Algorithms Graphs and Trees: IV EECE 320.
Advanced Topics in Algorithms and Data Structures Lecture 6.1 – pg 1 An overview of lecture 6 A parallel search algorithm A parallel merging algorithm.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Do/Loops A loop repeats a series of instructions. An iteration is a single execution of the statement(s) in the loop. Used when the exact number of iterations.
June Searching CE : Fundamental Programming Techniques 16 Searching1.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
1 Bipartite Matching Polytope, Stable Matching Polytope x1 x2 x3 Lecture 10: Feb 15.
CS 106 Introduction to Computer Science I 03 / 07 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 03 / 2008 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 03 / 08 / 2010 Instructor: Michael Eckmann.
CS 106 Introduction to Computer Science I 10 / 16 / 2006 Instructor: Michael Eckmann.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
The Stable Marriage Problem
MATH AND LOVE G6. ITRODUCE  Only boys can pursue women.  Every girls can only have one boy friend. So do boys.  Every boys and girls has there own.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Control Structures. Important Semantic Difference In all of these loops we are going to discuss, the braces are ALWAYS REQUIRED. Even if your loop/block.
Standard Algorithms –search for an item in an array –count items in an array –find the largest (or smallest) item in an array.
 2006 Pearson Education, Inc. All rights reserved Searching and Sorting.
The Mathematics Of Dating and Marriage: Who wins the battle of the sexes? The Mathematics Of Dating and Marriage: Who wins the battle of the sexes? (adapted.
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
Great Theoretical Ideas in Computer Science.
CSC 211 Data Structures Lecture 13
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
Lecture 23: Stable Marriage ( Based on Lectures of Steven Rudich of CMU and Amit Sahai of Princeton) Shang-Hua Teng.
JETT 2005 Session 5: Algorithms, Efficiency, Hashing and Hashtables.
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.
Research Topics in Computational Science. Agenda Survey Overview.
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.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
The Stable Marriage Problem
Great Theoretical Ideas in Computer Science for Some.
Matching Lecture 19: Nov 23.
CS 106 Introduction to Computer Science I 03 / 02 / 2007 Instructor: Michael Eckmann.
Course Code #IDCGRF001-A 5.1: Searching and sorting concepts Programming Techniques.
Java & C++ Comparisons How important are classes and objects?? What mechanisms exist for input and output?? Are references and pointers the same thing??
18.1 CompSci 102 Today’s topics 1950s TV Dating1950s TV Dating.
CHP-4 QUEUE Cont…. 7.DEQUE Deque (short form of double-ended queue) is a linear list in which elements can be inserted or deleted at either end but not.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Visual C# 2005 Using Arrays. Visual C# Objectives Declare an array and assign values to array elements Initialize an array Use subscripts to access.
 2006 Pearson Education, Inc. All rights reserved. 1 Searching and Sorting.
Algorithms used by CDNs Stable Marriage Algorithm Consistent Hashing.
18.1 CompSci 102 Today’s topics Impaired wanderingImpaired wandering Instant InsanityInstant Insanity 1950s TV Dating1950s TV Dating Final Exam reviewFinal.
Stable marriages Competitive programming and problem solving Yoram Meijaard.
Dating Advice from Mathematics
Matching Boys Girls A B C D E
Stable Matching.
Stable Marriage Problem
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes?
The Mathematics Of 1950’s Dating: Who wins The Battle of The Sexes?
فصل سوم The Church-Turing Thesis
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes?
Computational Processes II
Discrete Math for CS CMPSC 360 LECTURE 9 Last time: Strong induction
Note the rights settings.
Computational Processes II
Piyush Kumar (Lecture 3: Stable Marriage)
Presentation transcript:

Stable Marriage Problem William Kozma Jr ECE 443/543

History Gale-Shapley 1962, “College Admissions and the Stability of Marriage” Introduced both monogamous and polygamous versions Polygamous version used for years Assigned “job applicants” to “job positions”

The Problem Exists two equal-sized sets Each element ranks all elements in other set Match is one-to-one between sets Matching must be stable – Cannot exists a member from each set which would rather be matched with each other, than with their current match

Example Alice Rank = {bob, adam} Beth Rank = {bob, adam} adam Rank = {Alice, Beth} bob Rank = {Alice, Beth}

Algorithm [Morning] Each Boy goes to the Girl on the top of his list. [Afternoon] Girl selects the highest ranking Boy visiting her. Sends rest home. [Night] All Boys not selected cross the top Girl off their list.

Program: Input Rankings imputed in data file First line must contain size of each set List Rankings 3 a A B C b A C B c B C A A b a c B b c a C a c b file.txt

Program: Data Structures Allocate memory for, – 2 arrays [iSize x iSize]: hold rankings – 2 arrays [iSize]: list members of each set – 2 arrays [iSize]: current position on respective list Initialize Boys position to 1 and Girls to -1

Program: Loop [Morning] *already done in position array [Afternoon] Each Girl searches Boy’s position on his list to see if corresponds to her. Sets her position to highest ranking Boy found. [Night] Each Boy checks of he is listing in any of the Girls position. In not, increment his ranking.

Program: Loop (cont) Initialize iCounter == 0 each loop iteration iCounter++ if rejection occurs Loop until iCounter == 0; Result is Stable Matching

Program: Demo

Program: Improvements In “real-world” all Girls make decisions simultaneously Since program is linear, allow Boys to visit more than 1 Girl per day If a Boy is rejected, automatically send him to his next highest ranking Girl May not always result in less days, but will never be worse.

Program: Demo 2

Questions?