Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.

Math 123 Final Project: The Stable Roommates Problem

This repository contains the code used for our final project for MATH 1230 Spring 2021. This project is an overview of the stable roommates project, which is an extension to the classic stable marriage problem in graph theory. Here, we present an implementation of Irving's algorithm along with an interface to generate animations of problem instances and solutions. The animations are generated using the manim library, which is a community-maintained library based on work by 3Blue1Brown.

Animations can be generated by running:
python -m manim ClassName -pql
-p is preview
-q is quality, pick from {l, m, h, p, k}

Click the button below to open a test environment in a Jupyter notebook! This will let you define your own example and generate an animation.


The implementation of Irving's algorithm is based on an implementation which can be found here. We have modified the algorithm for use with manim, generalized it for relatively abstract data types (players must be given as a hashable data type), and removed the constraint that preference cycles be complete.


Math 123 Final Project



No releases published


No packages published