Unformatted text preview: The algorithm is very similar to the basic Gale—Shapley algorithm from the text. At any
point in time, a student is either “committed” to a hospital or “free.” A hospital either has
available positions, or it is “full.” The algorithm is the following: While some hospital h, has available positions
in offers a position to the next student 5, on its preference list
if s, is free then
s, accepts the offer
else (5, is already committed to a hospital bk)
if s, prefers hk to h, then
5, remains committed to hk
else 5, becomes committed to h,
the number of available positions at hk increases by one.
the number of available positions at h, decreases by one. The algorithm terminates in 0(mn) steps because each hospital offers a positions to a
student at most once, and in each iteration, some hospital offers a position to some student.
Suppose there are p,- > 0 positions available at hospital h,. The algorithm terminates
with an assignment in which all available positions are ﬁlled, because any hospital that did
not ﬁll all its positions must have offered one to every student; but then, all these students
would be committed to some hospital, which contradicts our assumption that 22:1 19,- < n. Finally, we want to argue that the assignment is stable. For the ﬁrst kind of instability,
suppose there are students .9 and 5’, and a hospital h as above. If h prefers 5’ to s, then b
would have offered a position to 5’ before it offered one to s; from then on, 5’ would have a
position at some hospital, and hence would not be free at the end 7 a contradiction. For the second kind of instability, suppose that (hi, Sj) is a pair that causes instability.
Then h,- must have offered a position to 5,, for otherwise it has 19,- residents all of whom it
prefers to 5,. Moreover, .9, must have rejected h,- in favor of some hk which he/she preferred;
and Sj must therefore be committed to some hg (possibly different from bk) which he/she
also prefers to hi. 1ex3045339.892 ...
View Full Document
- Spring '11