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

  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.

  Why every nonempty propositional clause itself satisfiable

Describe why every nonempty propositional clause, by itself, is satisfiable. Prove rigorously that every set of five 3-SAT clause is satisfiable, given that each clause mentions exactly three distinct variables.

  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.

  Write mathematical formulation for non-terminal

Non-terminal A is useless if there is no derivation from start symbol to string of tokens in which A appears. Write a mathematical formulation of this property.

  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.

  Where could errors occur

Where could errors occur in Figure and for each error, what action would you take should the error occur

  The roommate problem and intern assignment problem

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

  Q1 consider a computer system with a single processor with

q.1. consider a computer system with a single processor with a single core. there are two processes to run in the

  Equivalence classes to construct minimal dfa for language

How many equivalence classes does this relation have and what are they? Use these equivalence classes to construct the minimal DFA for the language.

  Deterministic finite and non-deterministic finite automata

Describe the difference between a Deterministic Finite Automata and Non-Deterministic Finite Automata. In general, which one is expected to have less number of states ?

  If m is a dfa accepting language b

If M is a DFA accepting language B, then exchangeing the accept and reject states gives a new DFA accepting the complement of B. Does this work for an NFA, why?

  What ambiguity exists in the statement

Suppose f is a function that returns the result of reversing the string of symbols given as its input, and g. What ambiguity exists in the statement x?

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