ps1num1a - CS4820 Problem Set 1 Liyuan Gao...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS4820 Problem Set 1 Liyuan Gao lg342@cornell.edu Collaborators: Nicholas Beaumont and Detian Shi 1(a). Input: Applicant and Job pools: A1: [J2, J1, J3] <-> J1: [A1, A3, A2] – cost = 3 A2: [J2, J3, J1] <-> J2: [A1, A2, A3] – cost = 3 A3: [J3, J1, J2] <-> J3: [A3, A1, A2] – cost = 2 Total cost = 8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
However, A1 prefers J2 to J1 while J2 prefers A1 to A2, hence while this is the minimum costing solution, it is in no way stable. 1(b). Construction of the input : We want to find an input that given a certain set of transformations, will return to one of its intermediate states. These transformations can be expressed as adding additional constraints to the preference of the jobs and applicants that do no conflict with previous constraints, and from these we can construct the preference list of each applicant and job. We will start with the basic 4x4 ladder configuration: The set of transformations are as follows: 1->2: (A1: J2>J1, J2: A1>A2) 2->3: (A1: J3>J2, J3: A1>A3) 3->4: (A1: J4>J3, J4: A1>A4) 4->5: (A4: J1>J3, J1: A4>A2) 5->6: (A3: J4>J2, J4: A3>A1) 6->7: (A3: J1>J4, J1: A3>A4) 7->8: (A3: J3>J1, J3: A3>A2) which gives us the following preference list: A1: [J4, J3, J2, J1] J1: [A3, A4, A2] A2: [J1, J3] J2: [A1, A2] A3: [J1, J3, J4, J2] J3: [A1, A3, A2] A4: [J1, J3] J4: [A3, A1, A4] Note that entries with less than 4 elements can add the other elements in any order as only the relative positions of the elements within the ordering in the above diagram are important. 1(c). Input: Give the applicant set {A1, A2, …, An} and the job set {J1, J2, …, Jn} such that every applicant and every job ranks the other in exactly the reverse order. E.g. each applicant has preference in the order of {Jn, Jn-1, …, J1} and each job has preference in the order of {An, An-1, …, A1}. Complexity : The above input will cause the program to run in O (n!) which is exponential. Base case: if we’re given that n = 1, then there’s exactly one matching between J1 and A1, which is stable by default. So one operation is performed which is exponential in 1.
Background image of page 2
Note : at every step within the subproblem of k<n, if Ak – Jn are not matched, the marriage is unstable because each whoever Ak is matched with will be higher on his preference list than Jn and vice versa for Jn to Ak. Assume that for some n=k-1, the running time for the function of our inputs A and J is O((n-1)!),
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the 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 University (Engineering School).

Page1 / 6

ps1num1a - CS4820 Problem Set 1 Liyuan Gao...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online