Write the output after explicitly checking to see match

Assignment Help Data Structure & Algorithms
Reference no: EM132374777

Assignment

1) Do Problem 4 in Chapter 1 on Pages 23-24 of the Kleinberg and Tardos text.

Problem 4. Gale and Shapley published their paper on the Stable Matching Problem in 1962; but a version of their algorithm had already been in use for ten years by the National Resident Matching Program, for the problem of assigning medical residents to hospitals.

Basically, the situation was the following. There were rn hospitals, each with a certain number of available positions for hiring residents.
There were tz. medical students graduating in a given year, each interested in joining one of the hospitals. Each hospital had a ranking of the students in order of preference, and each student had a ranking of the hospitals in order of preference. We will assume that there were more students graduating than there were slots available in the m hospitals.

The interest, naturally, was in finding a way of assigning each student to at most one hospital, in such a way that all available positions in all hospitals were filled. (Since we are assuming a surplus of students, there would be some students who do not get assigned to any hospital.) We say that an assignment of students to hospitals is stable if neither of the following situations arises.

• First type of instability: There are students s and s', and a hospital h,
so that

- s is assigned to tt, and
- s' is assigned to no hospital, and
- it prefers s' to s.

• Second type of instability: There are students s and s', and hospitals

It and le , so that

- s is assigned to h., and
- s' is assigned to le , and
- h prefers s' to s, and
- s' prefers h to h'.

So we basically have the Stable Matching Problem, except that (i) hospitals generally want more than one resident, and (ii) there is a surplus of medical students.

Show that there is always a stable assignment of students to hospitals, and give an algorithm to find one.

Specifically, implement Gale-Shapley Algorithm for computing the hospitals-residents matching Assignment in Python (or Java) using the approach and data structures described in the first two Chapters of Kleinberg and Tardos text (and reviewed in class).

Specifically, consider the residents as the “proposers” and the hospitals as the “disposers”. Note also that a hospital can have a number of slots and not all residency applicants will get a position. Watch the following video explaining the algorithm:

How the NRMP Matching Algorithm Works. (Youtube)

In your solution, make sure to:

(a) Assume that the input for an n-hospitals-m-residents problem is provided as a sequence of (n+1+m)-lines (encoding the preference lists – n lines for hospitals and m lines for residents with one empty line to separate the hospitals from residents) with each comma-separated line formatted as follows:

HOSPITAL_1, SLOTS, RESIDENT_a, …

**BLANK LINE**
RESIDENT_1, HOSPITAL_x, HOSPITAL_y, …


For example:
MERCY, 2, DARRIUS, JOSEPH
CITY, 2, DARRIUS, ARTHUR, SUNNY, LATHA, JOSEPH

ARTHUR, CITY
SUNNY, CITY, MERCY


For each hospital, we give the hospital name/id, the number of slots, and the preference list of residents. For each resident, we provide the resident id/name and the preference list of hospitals.

(b) Write the output after explicitly checking to see that it is a stable match. Note that writing and running a stability checker is a good debugging aid. When you turn in your solution, do include sample inputs and corresponding outputs in a separate file. Format the output as follows showing the matching of residents to hospitals:

HOSPITAL_1, RESIDENT_11, RESIDENT_12
HOSPITAL_2, RESIDENT_21, RESIDENT_22


(c) In your program, include pseudo-code of the modified Gale Shapley algorithm as a comment.

2) Do Problem 4 in Chapter 2 on Pages 67-68 of the Kleinberg and Tardos text. Justify your ordering of the growth rate functions in each case.

Reference no: EM132374777

Questions Cloud

Time required for speedy lube finish : The time required for Speedy Lube finish an oil change service on an automobile approximately follows a normal distribution, with mean of 17 minutes
What are the differences between sarcasm-irony and satire : You formulate your response to "The Science of Sarcasm" by Richard Chin. What are the differences between sarcasm, irony and satire?
How does being humble help a business owner : How does being humble help a business owner? How does not being able to take criticism hinder a business owner?
The story is full of fantastic imagery : The story is full of fantastic imagery. Identify some of your favorites and explain how those images support a major theme of the story.
Write the output after explicitly checking to see match : WRIGHT STATE UNIVERSITY- CS7200-Algorithm Design and Analysis-USA-Write the output after explicitly checking to see that it is a stable match.
Structure of organizations and the role of the ceo : How being accountable to the stock market has influenced the structure of organizations and the role of the CEO.
Write several pages of a detailed analysis or prose : The ability to summarize a salient point is every bit as important to a Ph.D. as being able to write several pages of a detailed analysis or prose.
Project cost management : Project Cost Management. Why do you think it's difficult to understand some of the basic cost terms in this chapter?
Discuss nike from a strategic perspective : Information concerning recent changes in the firm is readily available online and should be accessed. Strategic issues should be discussed in "real time."

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd