This code can be used to compute stable improvement cycles, as originally proposed by Erdil & Ergin (2008).
This code resolves a minor bug in the original code by Erdil & Ergin (https://doi.org/10.3886/E113247V1), which resulted in unstable matchings. A detailed description of this bug can be found in the accompanying note.