Unformatted text preview: then for n = k, the algorithm will attempt to make matches until the An-Jn match is made, at which time the marriage will finally become stable. Since each iteration within the for loop removes Jn and Ai to be matched up later, the recursive call will be made on an applicant set A’ and a job set J’ of cardinality k-1 and of which every element of each set have a list of preference into the other set in the exact opposite order, which can be exchanged exactly as the input for the subproblem of n=k-1, which from the induction hypothesis takes O ((n-1)!) time to solve. However, since we can guarantee that no set of marriages are stable until the An-Jn match is made, which doesn’t happen until after the for loop iterates for n steps, we will have to solve the same subproblem of order O((n-1)!) n times, making for O(n!) complexity....
View Full Document
This note was uploaded on 03/12/2012 for the course CS 4820 taught by Professor Kleinberg during the Spring '08 term at Cornell.
- Spring '08