Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4 CSE 331 Sep 4, 2013.

Similar presentations


Presentation on theme: "Lecture 4 CSE 331 Sep 4, 2013."— Presentation transcript:

1 Lecture 4 CSE 331 Sep 4, 2013

2 Office Hours Beth: Wed + Fri 11:00-11:50am Jerry: Mon 11:00-11:50am
Davis 302 Jerry: Mon 11:00-11:50am + Th 10:00-10:50am Atri: Mon, Wed 2-2:50pm

3 Submit the form I’ll need confirmation in writing. No graded material will be handed back till I get this signed form from you!

4 Main Steps in Algorithm Design
Problem Statement Real world problem Problem Definition Precise mathematical def Algorithm “Implementation” Data Structures Analysis Correctness/Run time

5 National Resident Matching

6 (Screen) Docs are coming to BUF
Buffalo General Hawkeye (M*A*S*H) Millard Filmore (Gates Circle) JD (Scrubs) Millard Filmore (Suburban)

7 The situation can be unstable!

8 What happens in real life
Preferences Information Preferences

9 NRMP plays matchmaker

10 Questions/Comments?

11 Matching Employers & Applicants
Input: Set of employers (E) Set of applicants (A) Preferences Output: An assignment of applicants to employers that is “stable” For every x in A and y in E such that x is not assigned to y, either (i) y prefers every accepted applicant to x; or (ii) x prefers her employer to y

12 Simplicity is good

13 Questions to think about
1) How do we specify preferences? Preference lists 2) Ratio of applicant vs employers 1:1 3) Formally what is an assignment? (perfect) matching 4) Can an employer get assigned > 1 applicant? NO 5) Can an applicant have > 1 job? 6) How many employer/applicants in an applicants/employers preferences? All of them 7) Can an employer have 0 assigned applicants? NO 8) Can an applicant have 0 jobs?

14 Questions/Comments?

15 Discuss: Naïve algorithm!

16 The naïve algorithm Go through all possible perfect matchings S
n! matchings If S is a stable matching then Stop Else move to the next perfect matching

17 Gale-Shapley Algorithm
David Gale Lloyd Shapley O(n3) algorithm

18 Moral of the story… >


Download ppt "Lecture 4 CSE 331 Sep 4, 2013."

Similar presentations


Ads by Google