Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
courses:cs211:winter2014:journals:shannon:section1 [2014/01/15 01:13] – created nollets | courses:cs211:winter2014:journals:shannon:section1 [2014/01/15 01:16] (current) – nollets | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Section 1.1 : A First Problem: Stable Matching ====== | =====Section 1.1 : A First Problem: Stable Matching ====== | ||
+ | |||
+ | Stable matching is an algorithm that solves the classic problem of creating pairs from two parties, both with their own preferences, | ||
+ | The section then walked through how to build the algorithm step by step and proved that the algorithm actually solved our problem. It showed that the algorithm terminated, created perfect matches (one man to one woman and no one left out), and stable matches. | ||
+ | Finally, the section looked deeper into questions one could ask about the algorithm. It discussed fairness, as in the algorithm the man is allowed to choose his first choice of woman, so often men can get their first choice while women do not. More generalized, | ||
+ | |||
+ | This problem was motivated by the need to create a system that could provide matchings that made people and companies happy while at the same time preventing self-interest from interfering. | ||
+ | |||
+ | The algorithm is outlined like this: | ||
+ | Initially all men and women are free/ | ||
+ | While there is a man m who is free and has not proposed to every woman: | ||
+ | Choose such a man m | ||
+ | Let w be m’s highest ranked woman to who he has not proposed yet | ||
+ | If w is free (m,w) become engaged | ||
+ | Else w is currently engaged to m’ | ||
+ | If w prefers m’ to m then m remains free | ||
+ | Else w prefers m to m’ and (m,w) becomes engaged and m’ becomes free | ||
+ | Return set of engaged pairs. | ||
+ | The runtime of the algorithm is n2 as the loop will execute at most n2 and the operations within the loop run in constant time. The way the while loop is worded ensures that the algorithm will not terminate until all men and women are matched. In this algorithm a woman’s partner can only “upgrade” while a man can only “downgrade” his partner. | ||
+ | The unfairness idea made more sense after reading it. We briefly discussed it in class but the book elaborated upon the subject. | ||
+ | I find this problem to be very interesting so the section was a 9. I like the idea that matching people, even based off of their own emotions and preferences can be boiled down to an algorithm. | ||
+ |