![]() In the handout and any limitations your program has beyond what is allowed as per this While implementing, it is very easy to codeĬertain segments of the algorithm which are not spelt in full detail in such a way that theĬomplexity of your program becomes more than the specified complexity of the algorithms.Ĭreate a brief ”readme” file which has instructions on how one should compile andĮxecute your program, any assumptions that you made beyond what is explicitly given Make sure to test your program on several test cases so that youĬan reasonably be confident that it is correct. That they can run on the xlogin system (that runs SUSE Linux OS) of the department ![]() ![]() General remarks: Make sure that your programs are written in C, C++ or Java and Should get the men’s preferences from the file “boys” and should get the women’s preferencesįrom the file “girls” and should place the stable matching found in the file “matching”. Sample Command Lines: Suppose your executable is called ”stable”, then The output should simply be n man-woman pairs, one per line. Output Format: Your program should create a file whose name is specified as the fourthĬommand line parameter and place the output in that file. You can assume that the dataįiles are consistent and don’t have to check for their integrity. The format for the women’s preference file is identical. The following example, Man 1’s first preference is Women 2, second preference is Women 3 Represent the preference of Man 1, Man 2 etc (the preferences are separated by a space). In the very first line, the number of men is shown. A sample input file showing preferences of men for the case of n = 4 is shownīelow. The third command line parameter will specify the name of theįile in which women’s preferences can be found. The second command line parameter will specify the name of the file in which men’s Input Format: You will be given the preference lists of men and women as two separateįiles. (that is implemented either as an array or as a linked list) to hold the set of unmatched ![]() UseĪn array data structure to represent the preferences of women. Use a linked list to represent the preference lists of men. ![]() You are expected to write the whole program (including implementation of data strucutures involved) yourself and not borrow any existing classes or functions from the librariesĭata Structures: I want to make sure that all of you are comfortable in dealing withĭifferent data structures. Your implementation should be running in O(n Program should output the man-optimal stable matching produced by the Gale-ShapleyĪlgorithm. Men are numbered 1 through n and similarly, the women are numbered 1 through n. For simplicity, instead of using names, we will assume that the Your Task: For this assignment you will need to implement Gale-Shapley Algorithm forįinding a stable matching. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |