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

Assignment Help:

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.


Related Discussions:- Program to develope dating service to form couples

Implement a algorithm to verify if the link list , Implement a Algorithm to...

Implement a Algorithm to verify if the link list is in Ascending order? A: template bool linklist::isAscending() const{ nodeptr ptr = head; while (ptr->_next)

C++, Byteland county is very famous for luminous jewels. Luminous jewels ar...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

C language, There is a pebble merchant. He sells the pebbles, that are used...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Recursion, Solve the Nine Queens problem recursively. The objective is to p...

Solve the Nine Queens problem recursively. The objective is to place nine queens on an empty chessboard so that no queen is “attacking” any other, i.e., no two queens are in the sa

Pointer, solution of problem based on poiter

solution of problem based on poiter

What are the two steps that happen while i say delete p?, A: N delete p is ...

A: N delete p is a two-step procedure: it calls the destructor, and then releases the memory. The code developed for delete p is functionally similar to this (supposing p is of typ

Gene program, Many human diseases could be controlled by the knowledge of t...

Many human diseases could be controlled by the knowledge of the gene’s structure and pattern. The human gene could be represented by four nucleotides. Each nucleotide is represente

Write Your Message!

Captcha
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