Question: I am having real trouble with my Java project as follows (using eclipse) the Project1TestData.txt file looks something like this my plan is to read
I am having real trouble with my Java project as follows (using eclipse)
the Project1TestData.txt file looks something like this
my plan is to read the file in using a buffered reader and then implement one stack for each group and use the Gale/Shapley algorithm to find each stable match. Any help is appreciated!
Description In this project you will implement a stack and use it to solve the stable marriage problem using backtracking. We will address the stable marriage problem in class along with backtracking You are to explicitly use your stack to keep track of state in this implementation. Details Input to this problem will come from a file. The file contains the number of pairings to make and two arrays indicating the preferences of each side. The input data will come from a file "Project1TestData.txt" and will be formatted as follows 4 Bobbie number of pairings to make First person 's name in group A Bob's preferences (O - highest) Second person 's name in group A Ted Gina 3 2 10 Harry 0 2 13 Mel 3 2 1 0 Barb 2 13 O olive 2 3 10 Sam 2013 Your program is to determine a pairing where there exist no two programmers that are not paired but would prefer each other to their actual partners. Your output upon finding a suitable pairing should be a list of the team pairs. First person 's name in group B Mel 's preferences (O - highest) Team 0: Gina and Mel Team 1: Harry and Sam Team 2: Bobbie and Olive Team 3: Ted and Barb If no such pairing exists you should output the message No stable pairing exists. Program Guidelines Your main program should be in a class named Project1 Your name should be in the comments at the top of each source file Your variable names should be meaningful, they should reflect the usage or contents of the variable You should have Javadoc block comments for each class and non-trivial method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
