Program to develope dating service to form couples, C/C++ Programming

In this assignment, you will develop a program named "match" to be used by a dating service to form couples. Given the number of gentlemen, the number of ladies, and a list of acceptable pairings, your program should use a network flow based approach to form as many couples as possible.

Let m be the # of gentlemen and m be the # of ladies. In this assignment, each gentleman is represented by an index between 1 and m, and each lady is represented by an index between 1 and m. The inputs are specified in a text file in the format below:

<# of gentlemen>

<# of ladies>

...

The output file of your program should include the number of couples formed and a list of those couples.

For example, the following input file represents a case with 3 gentlemen, 4 ladies and 6 potential pairings.

3

4

1 1

1 2

2 2

3 1

3 3

3 4

The best matching solution consists of 3 pairs and one feasible solution is that gentleman 1 is matched to lady 1, gentleman 2 is matched to lady 2, and gentleman 3 is matched to lady 4. (Note that there are many other feasible solutions with 3 pairs.) The corresponding output file of your program is shown below:

3

1 1

2 2

3 4

Your program should be implemented in either C or C++. Please try your best to make your program fast and memory efficient. Several input files are posted. For submission, please email to the TA your source code and the output file for each input file. For each input file, please also report the runtime, and the processor model and clock frequency of the machine that you used.

Posted Date: 2/19/2013 6:38:52 AM | Location : United States







Related Discussions:- Program to develope dating service to form couples, Assignment Help, Ask Question on Program to develope dating service to form couples, Get Answer, Expert's Help, Program to develope dating service to form couples Discussions

Write discussion on Program to develope dating service to form couples
Your posts are moderated
Related Questions
i have a project in BDD(Binary Decision Diagram).. where i have to use BDD library...i m using cudd package which uses BDD technique...i download cudd package..try to run in vc++ 6

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

Assume we wish to partition the square roots of the integers from 1 to 100 in to two piles of fifty numbers every, such that the sum of the numbers in the first pile is as close as

Write a program that reads a line of characters from the user and displays that entire line after converting any uppercase characters to lowercase also change any lowercase charact

C Programming and Data Structures 1. Define and explain flow chart with an example. 2. Write an algorithm to print all even numbers in descending order and draw the flowcha

A: Provide a friend operator class Base { public: friend std::ostream& operator ... protected: virtual void printOn(std::ostream& o) const; }; inline std::ostr

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

flow chart for prime or not

C program to demonstrate call by reference: void disp(int *,int*,int*,int*); void main() {                 int a=2,b=3, sum,mul;                 printf("Enter 1st n

Program of cascading: class vector{                 private :                 int v[3];                   public:                 friend istream & operator >> (