Gale-Shapley Deferred Acceptance in R
In honor of today’s announcement of the Nobel Prize for Roth and Shapley, I found an illustration of the deferred acceptance algorithm from 1962 in R. Credit for the code goes to the blogger at Letters from London, and I’ve included a Gist below that illustrates the use of their deferred acceptance function.
It looks like it’s supposed to produce an animation, but it doesn’t seem to be doing so. Nevertheless, it does produce a nice, stable matching, useful for anything from marriages to Teaching Assistant assignments!
To leave a comment
for the author, please follow the link and comment on his blog: is.R()
offers daily e-mail updates
news and tutorials
on topics such as: visualization (ggplot2
), programming (RStudio
, Web Scraping
) statistics (regression
, time series
) and more...
If you got this far, why not subscribe for updates
from the site? Choose your flavor: e-mail
, or facebook