home

fail everything

Gale Shapley Source Code

If the title doesn’t ring any bells than stop reading now. Basically, I needed to implement the gale shapely algorithm for a uni assessment but whilst looking around for an implementation I could only find one in python here . The pseudo code for the algorithm from the wiki found here is this:

Here is the algorithm implemented in AS3, there is a difference in the else if part where the “else some pair already exists” from the pseudo code is assumed in the AS3. Also, the last else from the pseudo code is missing since it is redundant.

Download the full source here

3 Responses

  1. Pingback: Is there a fast, open-source implementation of the Gale-Shapley algorithm? - Quora

  2. csr

    at line 6, do you mean:
    while(manArray.length > 0)

    December 14, 2011 at 3:07 am

  3. Roman Kovalik

    Wow, must have happen when I was trying to get the syntax highlighting to work, fixed now. Thanks for pointing it out.

    December 14, 2011 at 8:04 pm

Leave a Reply

Your email address will not be published. Required fields are marked *