Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
if (student is unmatched)
Add the pair to the set of matches (, ) → .
else if ( prefers to employer ʹ of current match (’, ) )
Replace the match → (′, ) with (, ) →
else rejects offer from
return the set of stable matches
While Gale-Shaley is an iterative solution, the recursive McVitie-Wilson will be easier to implement in
some paradigms. One can think of McVitie-Wilson as an alternating recursion of two functions: a
function offer and evaluate (see the pseudocode on the next page). These two recursive function
need to be called from a main loop which calls offer for each coop employer once.
if found evaluate match (, ) by calling evaluate((, ))
return
evaluate ( match (, ) )
if (student is unmatched)
Add the pair to the set of matches (, ) → .
else if ( prefers to employer ʹ of current match (’, ) )
Replace the match → (′, ) with (, ) →
offer(′)
else rejects offer from
offer()
return
Part 1: Object-oriented solution (Java) [3 marks]
Create the classes needed to solve the stable matching problem for coop employers and students with the
iterative Gale-Shapley algorithm. Your program must be a Java application called StableMatching
that takes as input the names of two files containing the preference of coop employers and students as
csv files. Your program must save the stable matching to a csv file called matches_java_nxn.csv
where n is the size of in the problem. The file is to be saved in the current directory.
In addition to the source code, you must also submit a UML class diagram showing all classes, their
attributes, methods, and associations. You can not use static methods (except main).
You must follow proper object-oriented design for full marks.
Part 2: Concurrent solution (Go) [3 marks]
Create a Go application that solve the stable matching problem for coop employers and students with the
recursive McVitie-Wilson algorithm.