{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ps1num1a

# ps1num1a - CS4820 Problem Set 1 Liyuan Gao...

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

CS4820 Problem Set 1 Liyuan Gao [email protected] 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

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

View Full Document
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.
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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern