Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4 CSE 331 Sep 3, 2014.

Similar presentations


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

1 Lecture 4 CSE 331 Sep 3, 2014

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

3 More clarification on sources

4 Office Hours Frank: Tue + Th 1:00-1:50pm Zulkar: Wed 4:00-4:50pm
Davis 302 Zulkar: Wed 4:00-4:50pm + Th 2:00-2:50pm Atri: Mon 2-2:50pm Wed 3-3:50pm

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

6 National Resident Matching

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

8 The situation can be unstable!

9 What happens in real life
Preferences Information Preferences

10 NRMP plays matchmaker

11 Questions/Comments?

12 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

13 Simplicity is good

14 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?

15 Questions/Comments?

16 Discuss: Naïve algorithm!

17 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

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

19 Moral of the story… >


Download ppt "Lecture 4 CSE 331 Sep 3, 2014."

Similar presentations


Ads by Google