Richard Anderson (for Anna Karlin) Winter 2006 Lecture 1

Slides:



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

Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 2.
Tutorial 5 of CSCI2110 Eulerian Path & Hamiltonian Cycle Tutor: Zhou Hong ( 周宏 )
1 Discrete Structures & Algorithms Graphs and Trees: IV EECE 320.
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.
CSE 421 Algorithms Richard Anderson Autumn 2006 Lecture 2.
CSE 421 Algorithms Richard Anderson Lecture 3. Classroom Presenter Project Understand how to use Pen Computing to support classroom instruction Writing.
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
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 1.
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.
Lecture 4 CSE 331 Sep 6, TA change Swapnoneel will leave us for 531 Jiun-Jie Wang will join us.
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 –
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.
CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 1.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 1.
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.
Bipartite Matching. Unweighted Bipartite Matching.
CSE 421 Algorithms Richard Anderson (for Anna Karlin) Winter 2006 Lecture 2.
The Stable Marriage Problem
Great Theoretical Ideas in Computer Science for Some.
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
Matching Boys Girls A B C D E
Cybernetica AS & Tartu University
Stable Matching.
Stable Marriage Problem
Lecture 4 CSE 331 Sep 7, 2016.
Lecture 8 CSE 331 Sep 14, 2011.
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 4 CSE 331 Sep 6, 2017.
Lecture 6 CSE 331 Sep 11, 2017.
S. Raskhodnikova; based on slides by K. Wayne
Richard Anderson Autumn 2006 Lecture 1
CSE 421: Introduction to Algorithms
Richard Anderson Lecture 3
Richard Anderson Lecture 6 Greedy Algorithms
Lecture 5 CSE 331 Sep 6, 2013.
Lecture 5 CSE 331 Sep 7, 2012.
Richard Anderson Autumn 2015 Lecture 1
Richard Anderson Autumn 2016 Lecture 7
Richard Anderson Lecture 7 Greedy Algorithms
Richard Anderson Autumn 2016 Lecture 2
Richard Anderson Autumn 2006 Lecture 1
Lecture 6 CSE 331 Sep 12, 2011.
Lecture 5 CSE 331 Sep 5, 2014.
Lecture 6 CSE 331 Sep 12, 2016.
Richard Anderson Winter 2009 Lecture 2
Lecture 7 CSE 331 Sep 10, 2014.
Richard Anderson Winter 2019 Lecture 1
Piyush Kumar (Lecture 3: Stable Marriage)
Lecture 5 CSE 331 Sep 9, 2011.
Richard Anderson Winter 2019 Lecture 7
Lecture 7 CSE 331 Sep 11, 2013.
Richard Anderson Autumn 2015 Lecture 7
Richard Anderson Winter 2019 Lecture 2
Richard Anderson Autumn 2016 Lecture 1
Richard Anderson Autumn 2015 Lecture 2
Richard Anderson Autumn 2019 Lecture 7
Richard Anderson Autumn 2019 Lecture 2
Richard Anderson Autumn 2019 Lecture 1 Announcements only
Presentation transcript:

Richard Anderson (for Anna Karlin) Winter 2006 Lecture 1 CSE 421 Algorithms Richard Anderson (for Anna Karlin) Winter 2006 Lecture 1

Course Introduction Instructor Impostor Teaching Assistants Anna Karlin, karlin@cs.washington.edu Impostor Richard Anderson, anderson@cs.washington.edu Teaching Assistants Lloyd Parlee, parlee@cs.washington.edu Vibhor Rastogi, vibhor@cs.washington.edu

Announcements It’s on the web. Homework 1, Due Jan 12 Subscribe to the mailing list Anna will have an office hour Monday, Jan 9, 11am-noon. CSE 594

Text book Algorithm Design Jon Kleinberg, Eva Tardos Read Chapters 1 & 2

All of Computer Science is the Study of Algorithms

How to study algorithms Zoology Mine is faster than yours is Algorithmic ideas Where algorithms apply What makes an algorithm work Algorithmic thinking

Introductory Problem: Stable Matching Setting: Assign TAs to Instructors Avoid having TAs and Instructors wanting changes E.g., Prof A. would rather have student X than her current TA, and student X would rather work for Prof A. than his current instructor.

Formal notions Perfect matching Ranked preference lists Stability m1 w1 m2 w2

Examples m1: w1 w2 m2: w2 w1 w1: m1 m2 w2: m2 m1 m1: w1 w2 m2: w1 w2

Examples m1: w1 w2 m2: w2 w1 w1: m2 m1 w2: m1 m2

Intuitive Idea for an Algorithm m proposes to w If w is unmatched, w accepts If w is matched to m2 If w prefers m to m2, w accepts If w prefers m2 to m, w rejects Unmatched m proposes to highest w on its preference list that m has not already proposed to

Algorithm Initially all m in M and w in W are free While there is a free m w highest on m’s list that m has not proposed to if w is free, then match (m, w) else suppose (m2, w) is matched if w prefers m to m2 unmatch (m2, w) match (m, w)

Does this work? Does it terminate? Is the result a stable matching? Begin by identifying invariants and measures of progress m’s proposals get worse Once w is matched, w stays matched w’s partners get better

Claim: The algorithm stops in at most n2 steps Why? Each m asks each w at most once

The algorithm terminates with a perfect matching Why? If m is free, there is a w that has not been proposed to

The resulting matching is stable Suppose m1 prefers w2 to w1 w2 prefers m1 to m2 How could this happen? m1 w1 m2 w2 m1 proposed to w2 before w1 w2 rejected m1 for m3 w2 prefers m3 to m1 w2 prefers m2 to m3

Result Simple, O(n2) algorithm to compute a stable matching Corollary A stable matching always exists

A closer look Stable matchings are not necessarily fair m1: w1 w2 w3 w1: m2 m3 m1 w2: m3 m1 m2 w3: m1 m2 m3 m2 w2 m3 w3

Algorithm under specified Many different ways of picking m’s to propose Surprising result All orderings of picking free m’s give the same result Proving this type of result Reordering argument Prove algorithm is computing something mores specific Show property of the solution – so it computes a specific stable matching

Proposal Algorithm finds the best possible solution for M And the worst possible for W (m, w) is valid if (m, w) is in some stable matching best(m): the highest ranked w for m such that (m, w) is valid S* = {(m, best(m)} Every execution of the proposal algorithm computes S*

Proof Argument by contradiction Suppose the algorithm computes a matching S different from S* There must be some m rejected by a valid partner. Let m be the first man rejected by a valid partner w. w rejects m for m1. w = best(m)

S+ stable matching including (m, w) Suppose m1 is paired with w1 in S+ m1 prefers w to w1 w prefers m1 to m Hence, (m1, w) is an instability in S+ m w m1 w1 Since m1 could not have been rejected by w1 at this point, because (m, w) was the first valid pair rejected. (m1, v1) is valid because it is in S+. m w m1 w1

The proposal algorithm is worst case for W In S*, each w is paired with its worst valid partner Suppose (m, w) in S* but not m is not the worst valid partner of w S- a stable matching containing the worst valid partner of w Let (m1, w) be in S-, w prefers m to m1 Let (m, w1) be in S-, m prefers w to w1 (m, w) is an instability in S- m w1 w prefers m to m1 because m1 is the wvp w prefers w to w1 because S* has all the bvp’s m1 w

Could you do better? Is there a fair matching Design a configuration for problem of size n: M proposal algorithm: All m’s get first choice, all w’s get last choice W proposal algorithm: All w’s get first choice, all m’s get last choice There is a stable matching where everyone gets their second choice

Key ideas Formalizing real world problem Model: graph and preference lists Mechanism: stability condition Specification of algorithm with a natural operation Proposal Establishing termination of process through invariants and progress measure Underspecification of algorithm Establishing uniqueness of solution