![]() which will beneficially change how you code, is that Java manages memory. Make sure that a student can compare between his current professor and another professor in constant time. The Gale-Shapley algorithm for the Stable marriage problem was designed to. Find a stable matching using the Gale-Shapley algorithm with girls making proposals. Keep note that your algorithm should run in O(n2) time. Find a stable matching using the Gale-Shapley algorithm with boys making proposals. This function will again return ArrayList, described in previous part. For implementation, we provide you with again with Preferences.java and you will put your implementation to Assignment1.java file under stableMatchGaleShapley(). Part 2: Implement Gale-Shapley Algorithm In order to solve this matching problem more efficiently, you need to implement Gale-Shapley Al- gorithm and give a solution for Professors Optimal Matching. Assume each professor and each student ranks the members of the opposite group. As before we have a set P of n professors and a set S of n students. Note that ties in preference lists are not allowed. In this problem we will consider a version of the problem for professors and students and their fully ordered list of preferences. ![]() The Stable Matching Problem, as discussed in the text, assumes that all men and women have a fully ordered list of preferences. JAVA IMPLEMENTATION OF GALE SHAPLEY ALGORITHM - USE HELPER CLASS PROVIDED BELOW (Preferences.java) In this problem we will consider a version of the problem for professors and students and their fully ordered list of preferences.
0 Comments
Leave a Reply. |