Implementation of both the algorithms using cc code 1

Assignment Help Theory of Computation
Reference no: EM13372333

Implementation of both the algorithms using C/C++ code 1. roommates problem 2. Intern Problem

1. The Roommate Problem

The roommate problem involves a single set of agents of even cardinality n, each agent having a preference list over the other n - 1 agents. A stable matching in this case is a partition of this single set into n/2 pairs so that no two unmatched members both prefer each other over their partners under the matching. There exist instances of the roommate problem (both with and without ties) for which no stable matching exists. One such instance is due to Gale and Shapley [l], Example 1.1:

1899_Roommate Problem.png

Anyone assigned to 4 will find a person whom he prefers and who prefers him.

An efficient algorithm to constructively determine for any instance of the roommate problem without ties whether a stable assignment exists (and if one exists to determine one) has recently been discovered by Irving [3]. This algorithm is dependent on properties of the roommate problem that hold only for the case without ties. A result of this paper, to be demonstrated in Section 2 is that this dependency is unavoidable. When ties are allowed, the roommate problem is NP-complete.

The marriage problem is a special case of the roommate problem. Every instance I of the marriage problem can be converted to an instance of the roommate problem by adding to the bottom of the preference list of every agent A of I a list of the agents of the same gener as A (other than A itself) in arbitrary order. It is easy to see that the set of stable matchings of this generated instance of the roommate problem coincides with the set of stable matchings of the original marriage problem.

2. The Intern Assignment Problem (IAP)

The intern assignment problem is merely the polygamous form of the marriage problem, in which the members of one of the geners can take on up to a (preset) number of partners of the opposite gender. An algorithm that solves this problem, called the NIMP (National Internship Matching Program) algorithm, has been used since 1953 to assign graduating medical students as interns in hospitals throughout the United States (hence the name of the problem). The NIMP algorithm can be considered a generalization of the Gale-Shapley method. A description of the method and a history of this program can be found in Roth [9].

Formally stated, the intern assignment problem is a stable matching problem where a set of interns are assigned to a set of hospitals. Each
hospital has a preset number of positions it wants to fill and a priority list that ranks the interns in accordance with its preferences over whom to hire to fill those positions. Note that since a hospital's preferences are one- dimensional, one should regard these multiple positions as identical. Different sections in the same hospital should be considered as different hospitals in this scheme. A hospital can rank in its preference list the possibility of leaving a position unassigned over being assigned to some of the interns.

On the other hand, each of the interns has a preference list over the hospitals that specifies which hospitals the intern would like to be assigned to. An intern can rank in his preference list the possibility of remaining unassigned to any one among a list of undesired hospital positions.

An assignment of interns to hospitals is unstable if one of the following holds:

There exists a hospital or an intern that prefers to remain unassigned rather than accept the assignment under the matching; or There exist a hospital and an intern such that the intern prefers that hospital over the one to which the intern had been assigned and the hospital prefers that intern over the current assignment of that position.

As mentioned, the marriage problem is a special case of the intern assignment problem. An instance of the marriage problem is an instance of the intern assignment problem. The difference is that the options of polygamy and not assigning some of the agents are not used.

Reference no: EM13372333

Questions Cloud

You will implement an end-to-end document classication : you will implement an end-to-end document classi?cation system that predicts which category pages belong to using the
1 industry demand function q 14 - frac12p 0001income : 1. industry demand function q 14 - frac12p 0.001income. marginal cost is fixed and equal to 16. fixed costs 0. you
Question a a consumer organization wishes to test 12 : question a a consumer organization wishes to test 12 different new perfumes and has devised a number of tests to
Question capital gains taxin july 2011 the labour party put : question capital gains taxin july 2011 the labour party put forward a proposal to have a comprehensive capital gains
Implementation of both the algorithms using cc code 1 : implementation of both the algorithms using cc code 1. roommates problem 2. intern problem1. the roommate problemthe
In this project you need to write a program called : in this project you need to write a program called ecc.javato implement elliptic curve
Project title email spam filterabstractanalyze the emails : project title email spam filterabstractanalyze the emails and predict whether the mail is a spam or not a spam.to work
You are required to set up a small network with network id : you are required to set up a small network with network id 200.100.50.16027. in this network there are three routers
Question 1 you are designing a grocery delivery business : question 1 you are designing a grocery delivery business. via the internet your company will offer staples and frozen

Reviews

Write a Review

Theory of Computation Questions & Answers

  If l recognized by dfa then language left half is regular

We showed to prove that if L can be identified by DFA then the language left half(L) = {x ∈ ∑*|∃y xy ∈ L and |x| = |y|} is also regular; here |x| means length of x.

  Explanation of turing machine

Devise a Turing machine with input given in unary notation such that the equipments produces the following output, 0 if x is divisible by 4,

  Cs476 automata theory and formal languages

CS476: Automata Theory and Formal Languages, State whether the following statements are true or not. You must give a BRIEF explanation or show a counter example to receive full credit.

  The latest entry into the snack food industry

The latest entry into the snack food industry is a health-conscious offering named Hooks, Wheels, and Ladders. Each box mixes several flavors, such as ranch, cheddar, and salsa. The snack is designed to appeal to kids based on the snack shapes

  Write grammar for language comprising of strings

Write down the grammar for language comprising of strings which have n copies of letter a followed by same number of copies of letter b, where n > 0.

  Create standard 1-tape turing machine to calculate function

Create a standard 1-tape Turing machine M to calculate the function sub3. Specifically, calculate sub3 of a natural number represented in binary.

  Create and dfa or lr items for grammar

Create and DFA or LR(0) items for this grammar. Is this grammar LR(0) parsing table? If not, explain LR(0) conflict. If so create LR(0) parsing table.

  Millenium development goal

Millenium Development Goal has proved to be one of the most ambitious and difficult and global education starts with, well, education-informing and inciting into action those who are more capable of bringing about change.

  Extend the ac scanner

A floatdcl can be represented as either f or float, allowing a more Java-like syntax for declarations - a intdcl can be represented as eitheri or int.

  Modify the syntax of a programming language

Sometimes it is necessary to modify the syntax of a programming language. This is done by changing the CFG that the language uses. What changes would have to be made to ac's CFG (Figure) to implement the following changes?

  Design mealy fsm with the input a and output z

Design a Mealy FSM with the input A and an output Z. If 10101 shows up on A, then in same cycle 1 must show up on Z, else Z is 0.

  Subset-sum problem

Calculate some number x= Sum - 2K. Create new set A by add x to the set B {b1, b2,....., bn} U {x}, where the summation now is B+x. it is possible to split the numbers in A into some subsets iff they can summing up to K:

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