stable matching / analyzing efficiency - umass amherstsheldon/teaching/mhc/cs312... ·...
TRANSCRIPT
![Page 1: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/1.jpg)
Stable Matching /Analyzing Efficiency
![Page 2: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/2.jpg)
Today
Announcement: HW1 is posted, due next Thursday in class
Topics
Stable matching proofs
Efficiency of algorithms
![Page 3: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/3.jpg)
Propose-and-Reject (Gale-Shapley) Algorithm
Initialize each college and student to be free.while (some college is free and hasn't made offers to every student) {
Choose such a college cs = 1st student on c’s list to whom c has not made offerif (s is free)
assign c and s to be engagedelse if (s prefers c to current college c’)
assign c and s to be engaged, and c’ to be free
elses rejects c
}
![Page 4: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/4.jpg)
Questions about the Gale-Shapley Algorithm
Does the loop terminate?
Is the matching perfect, that is, is it one-to-one?
Is the matching stable?
✔
![Page 5: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/5.jpg)
Proof by Contradiction(Review)
Goal: prove that A is true
1. Assume A is false.2.Reason to a contradiction with some other
known fact3.Conclude that A must therefore be true.
![Page 6: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/6.jpg)
On Fairness...
Gale-Shapley algorithm is asymmetric: seems that colleges have the upper hand
What can we say formally?
![Page 7: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/7.jpg)
A Remarkable ResultA given problem instance may have several stable matchings
Def. College c is a valid partner of student s if there exists some stable matching in which they are matched.
College-optimal assignment. Each college receives best valid student.
Claim. All executions of GS yield college-optimal assignment, which is a stable matching!
What proof technique should we use?
![Page 8: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/8.jpg)
Algorithm Design
Formulate the problem precisely
Design an algorithm to solve the problem
Prove the algorithm correct
Analyze the algorithm’s runtime
✔
✔
✔
![Page 9: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/9.jpg)
Analyzing Running Time(Chapter 2)
What is efficiency?
Tools: asymptotic growth of functions
Practice finding asymptotic running time of algorithms
![Page 10: Stable Matching / Analyzing Efficiency - UMass Amherstsheldon/teaching/mhc/cs312... · 2014-01-19 · A given problem instance may have several stable matchings Def. College c is](https://reader035.vdocument.in/reader035/viewer/2022070723/5f0202c77e708231d40222ce/html5/thumbnails/10.jpg)
Is My Algorithm Efficient?Idea: Implement it, time how long it takes.
Problems?
Effects of the programming language?Effects of the processor?Effects of the amount of memory?Effects of other things running on the computer?Effects of the input values?Effects of the input size?