Get in touch with us
Send us an e-mail
Question
In this question, 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 n be the # of ladies. In this question, each gentleman is represented by an index between 1 and m, and each lady is represented by an index between 1 and n. The inputs are specified in a text file in the format below:
<# of gentlemen>
<# of ladies>
<gentleman in 1st acceptable pairing> <lady in 1st acceptable pairing>
<gentleman in 2nd acceptable pairing> <lady in 2nd acceptable pairing>
…
<gentleman in last acceptable pairing> <lady in last acceptable pairing>
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 to make your program fast and memory efficient.
Summary
The question belongs to Computer Science and it is about writing a program either in C or C++ for an online dating service, where one needs to pair men and women based on a network flow approach.
Total Word Count NA
I had a very bad calculus background and for that reason I was unable to deal with the difficult sums given in the process control assignments. However, luckily for me I came across HwA and since then, never had to worry about these assignments any more.
I actually had a research topic in mind but was unsure of how to frame the research question. The research question assignment expert of HwA has helped me to narrow down the topic to one single question which became the foundation of my entire research. They also helped me with the actual research paper where I got excellent grades.
I was unsure about a communicable disease case study assigned to me on my final year of nursing study. Then when I browsed through the net for help I landed on HwA and found that their experts are really well equipped with knowledge and expertise pertaining to the subject. I am really happy with the assistance I had received and I recommend this site for all nursing students.
I would have never known that placing the patient in semi-Flower’s position and resting the head and neck with sandbags or small pillows prevents hyperextension of the neck and protects integrity of the suture line for post thyroidectomy patients if not for HwA. I owe a lot to this nursing intervention assignment help unit of this website and it is indeed very rare to find dedicated experts dealing with specific things like this.
I was having a difficult time understanding the laws of conservation of mass and energy and use of tie components. With the brilliant tutors at TheReliableTutor I now have a much clearer understanding of the concepts. Their timely and professional tutoring with my chemical engineering assignments has helped me improve my grades and I am very satisfied with the way they provide their services
Comments
this is a very good website
I have 50 questions for the same test your page is showing only 28
hi can you please help or guide me to answer my assignments. thanks
hi can anyone help or guide me to my assignments. thanks
This solution is perfect ...thanks
Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes
Perfect bank of solution.
great !
thanks for the quick response. the solution looks good. :)
thnx for the answer. it was perfect. just the way i wanted it.
works fine.