Download presentation
Presentation is loading. Please wait.
1
Lecture 3 CSE 331 Sep 1, 2017
2
Enroll on Piazza
3
Read the syllabus CAREFULLY!
No graded material will be handed back till you submit a signed form!
4
Autolab FAQ
5
TA office hours Finalized by Monday
6
Two comments on Programming
Programming is worth about 12% of your final grade Algorithm design/proofs are worth about 82% of your final grade Invest your time wisely C++, Java, Python from HW 1 331 is not the place to learn a new language!
7
Main Steps in Algorithm Design
Problem Statement Real world problem Problem Definition Precise mathematical def Algorithm “Implementation” Data Structures Analysis Correctness/Run time
8
National Resident Matching
9
(Screen) Docs are coming to BUF
Buffalo General Bailey (Grey’s Anatomy) Millard Filmore (Gates Circle) JD (Scrubs) Millard Filmore (Suburban)
10
What can go wrong?
11
The situation is unstable!
12
What happens in real life
Preferences Information Preferences
13
NRMP plays matchmaker
14
Stable Matching Problem
David Gale Lloyd Shapley
15
Questions/Comments?
16
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
17
Simplicity is good
18
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?
19
Questions/Comments?
20
Non-feminist reformulation
n men Each with a preference list n women Match/marry them in a “stable” way
21
On matchings Mal Wash Simon Inara Zoe Kaylee
22
A valid matching Mal Wash Simon Inara Zoe Kaylee
23
Not a matching Mal Wash Simon Inara Zoe Kaylee
24
Perfect Matching Mal Wash Simon Inara Zoe Kaylee
25
Preferences Mal Wash Simon Inara Zoe Kaylee
26
Instability Mal Wash Simon Inara Zoe Kaylee
27
Questions/Comments?
28
Discuss: Naïve algorithm!
29
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
30
Gale-Shapley Algorithm
David Gale Lloyd Shapley O(n3) algorithm
31
Moral of the story… >
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.