On benefits of converting the stable roommate problem to
the stable marriage problem within applicable data
Matthew Hutchinson
CS 315 Final Report
University of Kentucky
Mshu226@g.uky.edu
Abstract
The stable roommate problem is the dilemma
of matchmaking between elements of a single set of
data when each element has a preference list, often
visualized as assigning roommates to college dorm
rooms. A similar problem is the stable marriage
problem, the task of matchmaking between elements of
two sets of data with preference lists, often visualized
as men and women proposing to and marrying one
another. While these two problems are similar in that
they both seek to create a stable match between
members of their respective sets of data, they differ
from one another, especially in how they are solved.
Both the stable roommate problem and the stable
marriage problem have algorithmic solutions, the
Irving algorithm for the roommate problem and the
Gale-Shapely algorithm for the marriage problem, but
their solutions are different in a few essential ways. The
Gale-Shapely algorithm guarantees that for any
qualifying pair of data sets a stable matching can be
found, while half of the Irving algorithm is verifying
whether a stable matching even exists. The Gale-
Shapely algorithm can also be easily modified to
optimize the matching to meet the needs of one set of
data over another (i.e. choosing a matching that
benefits one data set more than the other), while the
Irving algorithm does not have an easy form of
customization. We propose that in order to solve
certain stable roommate problems, it can be beneficial
to modify the data so that it can be solved as a stable
marriage problem and will have the added benefits
associated with the Gale-Shapley algorithm while still
maintaining a quality matching.
Keywords
Stable matching; Stable marriage; Stable roommate;
Gale-Shapely Algorithm; Irving Algorithm;
1. Introduction
The stable marriage problems is a
matchmaking problem in economics, analytics, and
computer science that seeks to create stable unions
(called marriages) between two members (called a man
and woman) of two given sets one of all men and one
of all women. An unstable marriage is defined as a
union for which a blocking pair, a man and woman
who both prefer one another to their current partners,
exists, while a stable marriage is defined as a marriage
for which no blocking pair exists. Similarly, the stable
roommate problem, another matchmaking problem,
also seeks to create stable unions (called partnerships)
between two members of one dataset (called partners).
Instability of roommate partnerships is defined in the
same way as the instability of a marriage, the existence
of a pair of partners that would prefer one another
instead of their current partners [1]. However, despite
the similarities between the stable marriage and the
stable roommate problem, the solutions to the two
problems differ in that the solution to the stable
marriage problem guarantees a stable matching
(assuming that the preference lists of the men and
women contain all eligible members of the opposite
gender), while the solution to the stable roommate
problem does not guarantee a stable matching[1][3].
This means that the solution to the stable roommate
problem could fail to find a stable matching. In order
to counteract the uncertainty of the stable roommate
solution, I am proposing that it is often beneficial to
apply, where applicable, some sort of division to a
single set of partners in order to convert it into a set of
men and a set of women for marriage based
matchmaking.
2. Reasoning
The reasoning behind this proposal is the fact
that solving the stable roommate problem is not
guaranteed to find a stable matching, meaning that the
matching is not ideal for at least one of the pairings.
This uncertainty can cause issues because the solution
is not guaranteed, meaning that when attempting to
solve a matching with only one set the possibility of an
unstable matching must be taken into consideration.
However, with the marriage problem a stable matching
is guaranteed, so no additional planning or
consideration is required, the algorithm for solving the
problem, the Gale-Shapely algorithm, will always
yield a stable matching of the data provided [1]. Instead
of accounting for the possibility of a failure to create a
stable matching, by adding some arbitrary attribute or
making some division within a single data set, a new
marriage matching problem can be created and solved
using the Gale-Shapely algorithm. This opens the
stable roommate problem up to the benefits of applying
the Gale-Shapely algorithm to the problem, including
the previously mentioned guaranteed stable solution as
well as the reduced complexity of solving the stable
marriage problem [1]. The Gale-Shapely algorithm for
solving the stable marriage problem has already been
applied to many real world scenarios, including
matching medical interns with hospital residencies,
assigning New York City middle school students to
high schools, and creating nationwide organ donation
networks [6]. The algorithm has also earned its creators
the 2012 Nobel Prize in Economics for its use in market
design [6]. By expanding the range of the application
of this helpful algorithm to include problems that were
previously restricted to the stable roommate matching
problem a door is opened to even more real world
applications.
3. The Gale Shapely and Irving Algorithms
The Gale-Shapley algorithm, named for its
creators David Gale and Lloyd Shapely, is an algorithm
used for solving the stable marriage problem and
similar problems. The algorithm involves arranging
proposals in rounds, where in each round, each man
proposes to the most preferable woman on their list that
has not already refused a previous proposal. Each
woman then temporarily accepts the proposal of the
man who just proposed to them if their current match
is less preferable. This is the male-optimal method for
solving the problem (another method exists in which
the women propose and are matched with their
preferred men, this method is known as the female-
optimal method for solving the marriage problem. This
process is repeated until all the matches have been
made stable. [1]
PSEUDOCODE FOR GALE-SHAPELY ALGORITHM [2]
Initialize all men and women to free
while there exist a free man m who still has a
woman w to propose to
{ w = m's highest ranked such woman to whom he
has not yet proposed
if w is free
(m, w) become engaged
else some pair (m', w) already exists
if w prefers m to m'
(m, w) become engaged
m' becomes free
else
(m', w) remain engaged}
This algorithm runs in O(n2
) and guarantees
that each of the men and women will be married and
that the marriages will be stable, unlike the Irving
algorithm. [1]
The Irving algorithm is the algorithmic
solution to the stable roommate problem. Like the
Gale-Shapely algorithm, the Irving algorithm iterates
through the members of its dataset and attempts to
make stable matches within the data. Stability is also
defined in the same way as with the Gale-Shapely
algorithm, a matching is stable if there are no two
members of the data that would both rather be with
each other rather than their current partner. However,
unlike the Gale-Shapely algorithm, the Irving
algorithm attempts to solve the roommate problem in
two phases a phase to check the existence of a stable
matching and a phase to find the matching if it exists.
The first phase checks to see if a set of stable matchings
is possible for the dataset (since a stable matching is
not guaranteed) by creating reduced preference lists for
each member of the data [3].
PSEUDOCODE FOR IRVING ALG PHASE 1 [3]
Set proposed_to []
For n persons:
Proposer = person
Repeat
Proposer proposes to their next choice
If: not rejected
Then: If: next choice in proposed_to[]
Then: proposer=next_choice’s reject
Until not (next_choice in proposed_to)
Proposed_to = proposed_to + [next_choice]
End
The second phase finds the stable matching if
such a matching exists by looking at the shortened
preference lists generated in the first phase. This phase
looks for all-or-nothing cycles, sets of preference lists
that for which each member is matched with the first
on their list or none of the members are matched with
the first person on their list [3].
PSEUDOCODE FOR IRVING ALG PHASE 2 [3]
While (reduced pref. list len > 1) & (no reduced
pref. list has len <1)
{locate an all-or-nothing cycle
Carry out phase 2 reduction}
End
The Irving algorithm can also run in O(n2
)
time but is much harder to actually implement and
requires more advanced data structures than the
simpler Gale-Shapely algorithm for the purpose of
detecting cycles and unstable matches. The Gale-
Shapely algorithm can be implemented using simple
for loops and runs fairly quickly, while the Irving
algorithm can require more complex code and can take
longer to determine a stable matching (if one even
exists). [3]
4. Visualization of the Gale-Shapely Alg.
While the Gale-Shapely algorithm can be
applied to many different scenarios, for the purposes of
visualizing the algorithmic process the algorithm can
be visualized using playing cards. Using four kings and
four queens (of different suits) with randomly assigned
preferences is an excellent visual aid when
demonstrating the stable marriage problem. The
figures below illustrate how the algorithm finds a
stable matching:
Assume the preference lists are as follows:
K-S = {Q-D, Q-C, Q-H, Q-S}
K-C = {Q-S, Q-C, Q-D, Q-H}
K-H = {Q-C, Q-D, Q-S, Q-H}
K-D = {Q-C, Q-H, Q-S, Q-D}
Q-S = {K-C, K-D, K-H, K-S}
Q-C = {K-D, K-H, K-C, K-S}
Q-H = {K-H, K-C, K-D, K-S}
Q-D = {K-H, K-C, K-D, K-S}
State 0: Kings and Queens laid out in a grid
State 1: Each of the Kings propose to their most
preferred Queen
State 2: Since one Queen has two Kings propose, she
chooses the more preferable of the two.
State 3: The rejected King then proposes to his next
preferred Queen
State 4: Since one Queen has two Kings propose, she
chooses the more preferable of the two.
State 5: The King proposes to his next preferred Queen.
All Kings and Queens now have marriage partners.
This example serves as a simple illustration of how the
Gale-Shapely algorithm can create the stable matching
{(K-S, Q-H), (K-C, Q-S), (K-H, Q-D), (K-D, Q-C)}.
The matching between the Kings and Queens can be
proven stable by using the preference lists given at the
start of the example. The matching is stable so long as
a blocking pair does not exist within the marriages, so
by looking at each King and observing if one of his
more preferred Queens would prefer him over her
current match, the stability of the matching can be
proven. The King of Spades would prefer both the
Queen of Diamonds and Clubs over his current match
the Queen of Hearts, but neither would prefer him over
their current matches The King of Clubs would not
prefer any of the other Queens to his current match.
The King of Hearts would prefer the Queen of Clubs
but she would prefer her current match. Lastly the King
of Diamonds would not prefer any of the other Queens
to his current match, proving a blocking pair does not
exist and that this matching is stable. Inspiration for
this example came from the web application at [5].
5. A more complex example–Chess Players
The previous example served as a simple
illustration on the process of the Gale-Shapely
algorithm, the next example serves as an example of an
application of the algorithm.
In this example, the Gale-Shapely algorithm
will be used to create a stable matching for players in a
chess tournament. The players will be matched based
on level of skill (for this example randomly chosen
rankings), with players of similar skill level playing
one another. This is a problem well suited to the Irving
algorithm, since our dataset currently consists of one
set of players, but it can be adapted into a stable
marriage problem and solved using the Gale-Shapely
algorithm. By dividing the players into two groups,
those that will play white in their next game and those
that will play black we can create the two sets of
players needed to change this problem into a stable
marriage problem.
First we’ll need some players, we’ll call them
players 0 -12. Then we’ll need to rank them based on
their skill level, for the purposes of this example a
random number generator can be used to assign our
players their skill level. Then preference lists for each
of the players can be made by comparing their skill
level to skill level of the other players. Finally, by
randomly assigning each player a color (in this
example setting the lower half of the player base to play
black) the two sets of players can be created. Using a
C++ program designed for matchmaking at a chess
tournament a stable matching was created for this
example and the quality of the matches on average (by
checking the average difference between the skill
levels of two players) was calculated along with the
runtime of the algorithm.
Example for 12 chess players:
Player 0: Rank = 5 Preference List = { 3 5 8 4 7
10 9 6 2 1 11}
Player 1: Rank = 11 Preference List = { 2 11 6 10
4 5 0 3 8 7 9}
Player 2: Rank = 10 Preference List = { 6 1 10 11
4 5 0 3 8 7 9}
Player 3: Rank = 4 Preference List = { 8 0 7 5 9
4 10 6 2 1 11}
Player 4: Rank = 7 Preference List = { 5 10 0 6 3
2 8 1 7 11 9}
Player 5: Rank = 6 Preference List = { 0 4 3 10 8
6 7 2 9 1 11}
Player 6: Rank = 9 Preference List = { 10 2 4 1 5
11 0 3 8 7 9}
Player 7: Rank = 2 Preference List = { 9 8 3 0 5
4 10 6 2 1 11}
Player 8: Rank = 3 Preference List = { 7 3 9 0 5
4 10 6 2 1 11}
Player 9: Rank = 1 Preference List = { 7 8 3 0 5
4 10 6 2 1 11}
Player 10: Rank = 8 Preference List = { 4 6 5 2 0
1 3 11 8 7 9}
Player 11: Rank = 12 Preference List = { 1 2 6 10
4 5 0 3 8 7 9}
White Black
6 2
7 0
8 3
9 5
10 4
11 1
Average Difference between players: 2
Execution Time: 0.008
This program can be used to calculate a stable
matching for chess tournaments with a fairly high
quality on average (the average difference between
player skill levels will not be excessive). Other
randomized tests performed showed similar results.
For a test with 40 players the average difference was 3,
for 50 players the average difference was only 2, and
for 100 players the average difference was 7. This
shows that a stable roommate problem can be changed
to a stable marriage problem and a quality stable
matching produced using the Gale-Shapley algorithm.
A more in depth look at the application of
matchmaking algorithms to chess tournament
organization can be found at [4].
6. References
[1]Gale, D. and Shapley, L. 1962. College Admissions and the
Stability of Marriage. The American Mathematical
Monthly. 69, 1 (1962), 9.
[2]Stable Marriage Problem - GeeksforGeeks: 2013.
http://www.geeksforgeeks.org/stable-marriage-
problem/. Accessed: 2015- 12- 10.
[3]Irving, R. 1985. An efficient algorithm for the “stable
roommates” problem. Journal of Algorithms. 6, 4 (1985),
577-595.
[4]Kujansuu, E. et al. 2015. The Stable Roommates Problem and
Chess Tournament Pairings. Divulgaciones
Matematicas. 7, 1 (2015), 19-28.
[5]MathSite: Stable Marriage Problem: 2015.
http://mathsite.math.berkeley.edu/smp/smp.html.
Accessed: 2015- 12- 10.
[6]Stable Matching Algorithms - EPSRC research project: 2015.
http://www.dcs.gla.ac.uk/research/algorithms/stable/.
Accessed: 2015- 12- 14.

On Stable Matchmaking

  • 1.
    On benefits ofconverting the stable roommate problem to the stable marriage problem within applicable data Matthew Hutchinson CS 315 Final Report University of Kentucky Mshu226@g.uky.edu Abstract The stable roommate problem is the dilemma of matchmaking between elements of a single set of data when each element has a preference list, often visualized as assigning roommates to college dorm rooms. A similar problem is the stable marriage problem, the task of matchmaking between elements of two sets of data with preference lists, often visualized as men and women proposing to and marrying one another. While these two problems are similar in that they both seek to create a stable match between members of their respective sets of data, they differ from one another, especially in how they are solved. Both the stable roommate problem and the stable marriage problem have algorithmic solutions, the Irving algorithm for the roommate problem and the Gale-Shapely algorithm for the marriage problem, but their solutions are different in a few essential ways. The Gale-Shapely algorithm guarantees that for any qualifying pair of data sets a stable matching can be found, while half of the Irving algorithm is verifying whether a stable matching even exists. The Gale- Shapely algorithm can also be easily modified to optimize the matching to meet the needs of one set of data over another (i.e. choosing a matching that benefits one data set more than the other), while the Irving algorithm does not have an easy form of customization. We propose that in order to solve certain stable roommate problems, it can be beneficial to modify the data so that it can be solved as a stable marriage problem and will have the added benefits associated with the Gale-Shapley algorithm while still maintaining a quality matching. Keywords Stable matching; Stable marriage; Stable roommate; Gale-Shapely Algorithm; Irving Algorithm; 1. Introduction The stable marriage problems is a matchmaking problem in economics, analytics, and computer science that seeks to create stable unions (called marriages) between two members (called a man and woman) of two given sets one of all men and one of all women. An unstable marriage is defined as a union for which a blocking pair, a man and woman who both prefer one another to their current partners, exists, while a stable marriage is defined as a marriage for which no blocking pair exists. Similarly, the stable roommate problem, another matchmaking problem, also seeks to create stable unions (called partnerships) between two members of one dataset (called partners). Instability of roommate partnerships is defined in the same way as the instability of a marriage, the existence of a pair of partners that would prefer one another instead of their current partners [1]. However, despite the similarities between the stable marriage and the stable roommate problem, the solutions to the two problems differ in that the solution to the stable marriage problem guarantees a stable matching (assuming that the preference lists of the men and women contain all eligible members of the opposite gender), while the solution to the stable roommate problem does not guarantee a stable matching[1][3]. This means that the solution to the stable roommate problem could fail to find a stable matching. In order to counteract the uncertainty of the stable roommate solution, I am proposing that it is often beneficial to apply, where applicable, some sort of division to a single set of partners in order to convert it into a set of men and a set of women for marriage based matchmaking. 2. Reasoning The reasoning behind this proposal is the fact that solving the stable roommate problem is not guaranteed to find a stable matching, meaning that the matching is not ideal for at least one of the pairings. This uncertainty can cause issues because the solution is not guaranteed, meaning that when attempting to solve a matching with only one set the possibility of an unstable matching must be taken into consideration. However, with the marriage problem a stable matching is guaranteed, so no additional planning or consideration is required, the algorithm for solving the problem, the Gale-Shapely algorithm, will always yield a stable matching of the data provided [1]. Instead of accounting for the possibility of a failure to create a
  • 2.
    stable matching, byadding some arbitrary attribute or making some division within a single data set, a new marriage matching problem can be created and solved using the Gale-Shapely algorithm. This opens the stable roommate problem up to the benefits of applying the Gale-Shapely algorithm to the problem, including the previously mentioned guaranteed stable solution as well as the reduced complexity of solving the stable marriage problem [1]. The Gale-Shapely algorithm for solving the stable marriage problem has already been applied to many real world scenarios, including matching medical interns with hospital residencies, assigning New York City middle school students to high schools, and creating nationwide organ donation networks [6]. The algorithm has also earned its creators the 2012 Nobel Prize in Economics for its use in market design [6]. By expanding the range of the application of this helpful algorithm to include problems that were previously restricted to the stable roommate matching problem a door is opened to even more real world applications. 3. The Gale Shapely and Irving Algorithms The Gale-Shapley algorithm, named for its creators David Gale and Lloyd Shapely, is an algorithm used for solving the stable marriage problem and similar problems. The algorithm involves arranging proposals in rounds, where in each round, each man proposes to the most preferable woman on their list that has not already refused a previous proposal. Each woman then temporarily accepts the proposal of the man who just proposed to them if their current match is less preferable. This is the male-optimal method for solving the problem (another method exists in which the women propose and are matched with their preferred men, this method is known as the female- optimal method for solving the marriage problem. This process is repeated until all the matches have been made stable. [1] PSEUDOCODE FOR GALE-SHAPELY ALGORITHM [2] Initialize all men and women to free while there exist a free man m who still has a woman w to propose to { w = m's highest ranked such woman to whom he has not yet proposed if w is free (m, w) become engaged else some pair (m', w) already exists if w prefers m to m' (m, w) become engaged m' becomes free else (m', w) remain engaged} This algorithm runs in O(n2 ) and guarantees that each of the men and women will be married and that the marriages will be stable, unlike the Irving algorithm. [1] The Irving algorithm is the algorithmic solution to the stable roommate problem. Like the Gale-Shapely algorithm, the Irving algorithm iterates through the members of its dataset and attempts to make stable matches within the data. Stability is also defined in the same way as with the Gale-Shapely algorithm, a matching is stable if there are no two members of the data that would both rather be with each other rather than their current partner. However, unlike the Gale-Shapely algorithm, the Irving algorithm attempts to solve the roommate problem in two phases a phase to check the existence of a stable matching and a phase to find the matching if it exists. The first phase checks to see if a set of stable matchings is possible for the dataset (since a stable matching is not guaranteed) by creating reduced preference lists for each member of the data [3]. PSEUDOCODE FOR IRVING ALG PHASE 1 [3] Set proposed_to [] For n persons: Proposer = person Repeat Proposer proposes to their next choice If: not rejected Then: If: next choice in proposed_to[] Then: proposer=next_choice’s reject Until not (next_choice in proposed_to) Proposed_to = proposed_to + [next_choice] End The second phase finds the stable matching if such a matching exists by looking at the shortened preference lists generated in the first phase. This phase looks for all-or-nothing cycles, sets of preference lists that for which each member is matched with the first on their list or none of the members are matched with the first person on their list [3].
  • 3.
    PSEUDOCODE FOR IRVINGALG PHASE 2 [3] While (reduced pref. list len > 1) & (no reduced pref. list has len <1) {locate an all-or-nothing cycle Carry out phase 2 reduction} End The Irving algorithm can also run in O(n2 ) time but is much harder to actually implement and requires more advanced data structures than the simpler Gale-Shapely algorithm for the purpose of detecting cycles and unstable matches. The Gale- Shapely algorithm can be implemented using simple for loops and runs fairly quickly, while the Irving algorithm can require more complex code and can take longer to determine a stable matching (if one even exists). [3] 4. Visualization of the Gale-Shapely Alg. While the Gale-Shapely algorithm can be applied to many different scenarios, for the purposes of visualizing the algorithmic process the algorithm can be visualized using playing cards. Using four kings and four queens (of different suits) with randomly assigned preferences is an excellent visual aid when demonstrating the stable marriage problem. The figures below illustrate how the algorithm finds a stable matching: Assume the preference lists are as follows: K-S = {Q-D, Q-C, Q-H, Q-S} K-C = {Q-S, Q-C, Q-D, Q-H} K-H = {Q-C, Q-D, Q-S, Q-H} K-D = {Q-C, Q-H, Q-S, Q-D} Q-S = {K-C, K-D, K-H, K-S} Q-C = {K-D, K-H, K-C, K-S} Q-H = {K-H, K-C, K-D, K-S} Q-D = {K-H, K-C, K-D, K-S} State 0: Kings and Queens laid out in a grid State 1: Each of the Kings propose to their most preferred Queen
  • 4.
    State 2: Sinceone Queen has two Kings propose, she chooses the more preferable of the two. State 3: The rejected King then proposes to his next preferred Queen State 4: Since one Queen has two Kings propose, she chooses the more preferable of the two. State 5: The King proposes to his next preferred Queen. All Kings and Queens now have marriage partners.
  • 5.
    This example servesas a simple illustration of how the Gale-Shapely algorithm can create the stable matching {(K-S, Q-H), (K-C, Q-S), (K-H, Q-D), (K-D, Q-C)}. The matching between the Kings and Queens can be proven stable by using the preference lists given at the start of the example. The matching is stable so long as a blocking pair does not exist within the marriages, so by looking at each King and observing if one of his more preferred Queens would prefer him over her current match, the stability of the matching can be proven. The King of Spades would prefer both the Queen of Diamonds and Clubs over his current match the Queen of Hearts, but neither would prefer him over their current matches The King of Clubs would not prefer any of the other Queens to his current match. The King of Hearts would prefer the Queen of Clubs but she would prefer her current match. Lastly the King of Diamonds would not prefer any of the other Queens to his current match, proving a blocking pair does not exist and that this matching is stable. Inspiration for this example came from the web application at [5]. 5. A more complex example–Chess Players The previous example served as a simple illustration on the process of the Gale-Shapely algorithm, the next example serves as an example of an application of the algorithm. In this example, the Gale-Shapely algorithm will be used to create a stable matching for players in a chess tournament. The players will be matched based on level of skill (for this example randomly chosen rankings), with players of similar skill level playing one another. This is a problem well suited to the Irving algorithm, since our dataset currently consists of one set of players, but it can be adapted into a stable marriage problem and solved using the Gale-Shapely algorithm. By dividing the players into two groups, those that will play white in their next game and those that will play black we can create the two sets of players needed to change this problem into a stable marriage problem. First we’ll need some players, we’ll call them players 0 -12. Then we’ll need to rank them based on their skill level, for the purposes of this example a random number generator can be used to assign our players their skill level. Then preference lists for each of the players can be made by comparing their skill level to skill level of the other players. Finally, by randomly assigning each player a color (in this example setting the lower half of the player base to play black) the two sets of players can be created. Using a C++ program designed for matchmaking at a chess tournament a stable matching was created for this example and the quality of the matches on average (by checking the average difference between the skill levels of two players) was calculated along with the runtime of the algorithm. Example for 12 chess players: Player 0: Rank = 5 Preference List = { 3 5 8 4 7 10 9 6 2 1 11} Player 1: Rank = 11 Preference List = { 2 11 6 10 4 5 0 3 8 7 9} Player 2: Rank = 10 Preference List = { 6 1 10 11 4 5 0 3 8 7 9} Player 3: Rank = 4 Preference List = { 8 0 7 5 9 4 10 6 2 1 11} Player 4: Rank = 7 Preference List = { 5 10 0 6 3 2 8 1 7 11 9} Player 5: Rank = 6 Preference List = { 0 4 3 10 8 6 7 2 9 1 11} Player 6: Rank = 9 Preference List = { 10 2 4 1 5 11 0 3 8 7 9} Player 7: Rank = 2 Preference List = { 9 8 3 0 5 4 10 6 2 1 11} Player 8: Rank = 3 Preference List = { 7 3 9 0 5 4 10 6 2 1 11} Player 9: Rank = 1 Preference List = { 7 8 3 0 5 4 10 6 2 1 11} Player 10: Rank = 8 Preference List = { 4 6 5 2 0 1 3 11 8 7 9} Player 11: Rank = 12 Preference List = { 1 2 6 10 4 5 0 3 8 7 9} White Black 6 2 7 0 8 3 9 5 10 4 11 1 Average Difference between players: 2 Execution Time: 0.008 This program can be used to calculate a stable matching for chess tournaments with a fairly high quality on average (the average difference between player skill levels will not be excessive). Other randomized tests performed showed similar results. For a test with 40 players the average difference was 3, for 50 players the average difference was only 2, and for 100 players the average difference was 7. This shows that a stable roommate problem can be changed to a stable marriage problem and a quality stable matching produced using the Gale-Shapley algorithm. A more in depth look at the application of matchmaking algorithms to chess tournament organization can be found at [4].
  • 6.
    6. References [1]Gale, D.and Shapley, L. 1962. College Admissions and the Stability of Marriage. The American Mathematical Monthly. 69, 1 (1962), 9. [2]Stable Marriage Problem - GeeksforGeeks: 2013. http://www.geeksforgeeks.org/stable-marriage- problem/. Accessed: 2015- 12- 10. [3]Irving, R. 1985. An efficient algorithm for the “stable roommates” problem. Journal of Algorithms. 6, 4 (1985), 577-595. [4]Kujansuu, E. et al. 2015. The Stable Roommates Problem and Chess Tournament Pairings. Divulgaciones Matematicas. 7, 1 (2015), 19-28. [5]MathSite: Stable Marriage Problem: 2015. http://mathsite.math.berkeley.edu/smp/smp.html. Accessed: 2015- 12- 10. [6]Stable Matching Algorithms - EPSRC research project: 2015. http://www.dcs.gla.ac.uk/research/algorithms/stable/. Accessed: 2015- 12- 14.