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!

By d-sparks

Tags: rstats thirdPartyGist