CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 1.

Slides:



Advertisements
Similar presentations
Intro to CIT 594
Advertisements

CIS101 Introduction to Computing Week 11 Spring 2004.
Welcome to CSE105 and Happy and fruitful New Year
Welcome to MAT 170 MWF 9:40 SLN Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 9:15 am – 10: 15 am Tuesday and Thursday.
Welcome to MAT 170. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Tuesday and Thursday 10:30 am – 11:30 am Wednesday 9:40.
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.
Administrivia- Introduction CSE 373 Data Structures.
CSE 421 Algorithms Richard Anderson Autumn 2006 Lecture 2.
EE 220 (Data Structures and Analysis of Algorithms) Instructor: Saswati Sarkar T.A. Prasanna Chaporkar, Programming.
MATH 330: Ordinary Differential Equations Fall 2014.
CSE 220 (Data Structures and Analysis of Algorithms) Instructor: Saswati Sarkar T.A. Dimosthenes Anthomelidis
Slide 1 Instructor: Dr. Hong Jiang Teaching Assistant: Mr. Sheng Zhang Department of Computer Science & Engineering University of Nebraska-Lincoln Classroom:
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.
University of Colorado - Dept of Aerospace Engineering Sciences - Introduction to FEM This is ASEN 5007: Introduction to Finite Element Methods.
CSE 1111 Week 1 CSE 1111 Introduction to Computer Science and Engineering.
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
MATH 310, FALL 2003 (Combinatorial Problem Solving) MoWeFr 1:20 McGregory 214.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 1.
Administrative Issues ICS 151 Winter 2010 Instructor: Eli Bozorgzadeh.
CS 390 Introduction to Theoretical Computer Science.
CSE 403 Software Engineering Richard Anderson Autumn 2002.
Lecture 4 CSE 331 Sep 6, TA change Swapnoneel will leave us for 531 Jiun-Jie Wang will join us.
ICS 6B Boolean Logic and Algebra Fall 2015
CSC 171 – FALL 2001 COMPUTER PROGRAMMING LECTURE 0 ADMINISTRATION.
ICS 6B Boolean Algebra and Logic Winter 2015
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.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
Association Rules Plan for this week Progress report Midterm review In class Minute paper.
Great Theoretical Ideas in Computer Science.
CS 456 Advanced Algorithms Where: Engineering Bldg When: Monday & Wednesday 12:00 – 1:15 p.m. Texts: Algorithm Design, Jon Kleinberg & Eva Tardos.
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
Introduction to Computer Programming (FIT-I pro) J. H. Wang Sep. 17, 2007.
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)
Chemistry 101 Beth Lindquist 7 Chemistry Annex Office Hours: 9-10 am Tuesdays and Thursdays And by appointment.
CSE 421 Algorithms Richard Anderson (for Anna Karlin) Winter 2006 Lecture 2.
The Stable Marriage Problem
CSCI 256 Data Structures and Algorithm Analysis lecture 1 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
CSE 1340 Introduction to Computing Concepts Class 1 ~ Intro.
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
Physics 211 College Physics I. Introduction  Instructor:Larry Watson  Office:105 Witmer  Phone:   web:und.nodak.edu/instruct/lwatson/211.
Prof. James A. Landay University of Washington Winter 2009 Introduction & Course Overview CSE 441 – Advanced HCI January 6, 2009.
ICS 6D Discrete Math for Computer Science Spring 2016.
Christina Markert Introduction to 317K, spring Introduction to PHYSICS class 317K Christina Markert University of Texas at Austin General Physics.
Stable Matching.
CSE 421: Introduction to Algorithms
Lecture 4 CSE 331 Sep 6, 2017.
Richard Anderson (for Anna Karlin) Winter 2006 Lecture 1
Organization of Programming Languages
Richard Anderson Autumn 2006 Lecture 1
CSE 421: Introduction to Algorithms
Automata and Formal Languages
Richard Anderson Autumn 2015 Lecture 1
Richard Anderson Autumn 2016 Lecture 2
Richard Anderson Autumn 2006 Lecture 1
Lecture 6 CSE 331 Sep 12, 2011.
Richard Anderson Winter 2009 Lecture 2
Lecture 7 CSE 331 Sep 10, 2014.
Richard Anderson Winter 2019 Lecture 1
Lecture 5 CSE 331 Sep 9, 2011.
Type Systems for Programming Languages
Richard Anderson Winter 2019 Lecture 2
Richard Anderson Autumn 2016 Lecture 1
Introduction Lecture 1 Wed, Jan 17, 2007.
Richard Anderson Autumn 2015 Lecture 2
Richard Anderson Autumn 2019 Lecture 2
Richard Anderson Autumn 2019 Lecture 1 Announcements only
Presentation transcript:

CSE 421 Algorithms Richard Anderson Winter 2009 Lecture 1

CSE 421 Course Introduction CSE 421, Introduction to Algorithms –MWF, 1:30-2:20 pm –EEB 037 Instructor –Richard Anderson, –Office hours: CSE 582 Monday, 3:00-3:50 pm, Thursday, 11:00-11:50 am Teaching Assistant –Aeron Bryce, –Office hours: CSE 216 Monday, 12:30-1:20 pm, Tuesday, 12:30-1:20 pm

Announcements It’s on the web. Homework due Wednesdays –HW 1, Due January 14, 2009 –It’s on the web (or will be soon) Subscribe to the mailing list

Text book Algorithm Design Jon Kleinberg, Eva Tardos Read Chapters 1 & 2 Expected coverage: –Chapter 1 through 7

Course Mechanics Homework –Due Wednesdays –About 5 problems + E.C. –Target: 1 week turnaround on grading Exams (In class) –Midterm, Monday, Feb 9 (probably) –Final, Monday, March 16, 2:30-4:20 pm Approximate grade weighting –HW: 50, MT: 15, Final: 35 Course web –Slides, Handouts, Recorded Lectures from 2006

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 m1m1 w1w1 m2m2 w2w2

Example (1 of 3) m 1 : w 1 w 2 m 2 : w 2 w 1 w 1 : m 1 m 2 w 2 : m 2 m 1 m1m1 m2m2 w2w2 w1w1

Example (2 of 3) m 1 : w 1 w 2 m 2 : w 1 w 2 w 1 : m 1 m 2 w 2 : m 1 m 2 m1m1 m2m2 w2w2 w1w1

Example (3 of 3) m 1 : w 1 w 2 m 2 : w 2 w 1 w 1 : m 2 m 1 w 2 : m 1 m 2 m1m1 m2m2 w2w2 w1w1

Formal Problem Input –Preference lists for m 1, m 2, …, m n –Preference lists for w 1, w 2, …, w n Output –Perfect matching M satisfying stability property: If (m’, w’)  M and (m’’, w’’)  M then (m’ prefers w’ to w’’) or (w’’ prefers m’’ to m’)

Idea for an Algorithm m proposes to w If w is unmatched, w accepts If w is matched to m 2 If w prefers m to m 2 w accepts m, dumping m 2 If w prefers m 2 to m, w rejects m Unmatched m proposes to the highest w on its preference list that it 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 (m 2, w) is matched if w prefers m to m 2 unmatch (m 2, w) match (m, w)

Example m 1 : w 1 w 2 w 3 m 2 : w 1 w 3 w 2 m 3 : w 1 w 2 w 3 w 1 : m 2 m 3 m 1 w 2 : m 3 m 1 m 2 w 3 : m 3 m 1 m 2 m1m1 m2m2 w2w2 w1w1 m3m3 w3w3

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 (have higher m-rank) –Once w is matched, w stays matched –w’s partners get better (have lower w-rank)

Claim: The algorithm stops in at most n 2 steps

When the algorithms halts, every w is matched Why? Hence, the algorithm finds a perfect matching

The resulting matching is stable Suppose (m 1, w 1 )  M, (m 2, w 2 )  M m 1 prefers w 2 to w 1 How could this happen? m1m1 w1w1 m2m2 w2w2

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

A closer look Stable matchings are not necessarily fair m 1 : w 1 w 2 w 3 m 2 : w 2 w 3 w 1 m 3 : w 3 w 1 w 2 w 1 : m 2 m 3 m 1 w 2 : m 3 m 1 m 2 w 3 : m 1 m 2 m 3 m1m1 m2m2 m3m3 w1w1 w2w2 w3w3 How many stable matchings can you find?

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 Formalize the notion of best possible solution: (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 See the text book – pages 9 – 12 Related result: Proposal algorithm is the worst case for W Algorithm is the M-optimal algorithm Proposal algorithms where w’s propose is W-Optimal

Best choices for one side may be bad for the other Design a configuration for problem of size 4: 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 m1:m2:m3:m4:w1:w2:w3:w4:m1:m2:m3:m4:w1:w2:w3:w4:

But there is a stable second choice Design a configuration for problem of size 4: 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 m1:m2:m3:m4:w1:w2:w3:w4:m1:m2:m3:m4:w1:w2:w3:w4:

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 Under specification of algorithm Establishing uniqueness of solution