Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| courses:cs211:winter2018:journals:holmesr:section_1.1 [2018/01/16 18:19] – holmesr | courses:cs211:winter2018:journals:holmesr:section_1.1 [2018/01/21 17:37] (current) – holmesr | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Section 1.1 ====== | + | ====== Chapter 1 ====== |
| + | |||
| + | ===== Section 1.1 ===== | ||
| Section 1.1 deals with the Stable Matching Problem. The algorithm that solves this problem can be used for a variety of different applications, | Section 1.1 deals with the Stable Matching Problem. The algorithm that solves this problem can be used for a variety of different applications, | ||
| Line 5: | Line 7: | ||
| First, we must define a stable matching as 1) all matches are perfect (monogamous) and 2) no matches are unstable. It is necessary to note here that an unstable match is one where //m// prefers //w// to his current match and //w// prefers //m// to her current match. So in order to devise a method to match each man and women in a stable way, we need a set of men of size n, a set of women of size n and a preference list for each man and woman. | First, we must define a stable matching as 1) all matches are perfect (monogamous) and 2) no matches are unstable. It is necessary to note here that an unstable match is one where //m// prefers //w// to his current match and //w// prefers //m// to her current match. So in order to devise a method to match each man and women in a stable way, we need a set of men of size n, a set of women of size n and a preference list for each man and woman. | ||
| - | The algorithm works by choosing a man //m// and looping through the women in his preference list from top to bottom. If a woman is not engaged or is engaged to a man //m'// who ranks lower on her preference list than //m//, then she will accept // | + | The algorithm works by choosing a man //m// and looping through the women in his preference list from top to bottom. If a woman is not engaged or is engaged to a man //m'// who ranks lower on her preference list than //m//, then she will accept // |
| + | |||
| + | Finally, this algorithm runs in O(n< | ||
