Skip to content

Structure: Utilities

Ben Whitehead edited this page Mar 9, 2026 · 2 revisions

Generators

This set of utilities produces valid instances of each problem class for larger-scale experiments. Here, we show the class diagram for SMT and SM but the others are analogous with the exception of SR which currently has no tied parallel SRT.

The basic structure is as follows: SMT/SM Generator Class Diagram

Enumerators

This set of utilities takes in an instance and produces a list of all matchings that meets the problem's criteria for stability. For each problem class we have:

  1. <problem acronym>GenericBruteForcer.py, which contains helpers for mutating a matching and saving ones that we find to be stable. It also contains abstract methods for agent's trial order, which we discuss more below, and _has_stability.
  2. <problem acronym>GenericEnumerator.py, which contains the process for recursively enumerating all stable matchings. It inherits from (1) but does not implement the above abstract methods.
  3. <problem acronym>Enumerator.py, one for the case with ties and one for the case without ties. These inherit from (2) and also the problem definition file <problem acronym>Abstract.py. It implements _has_stability by calling the definition of stability in the abstract file. It additionally defines the agent's trail order.

The trail order is a generator function that takes an agent, retrieves its preference list, and then unpacks it moving from best to worst.

Clone this wiki locally