Explore modules

Stable Matching (Gale–Shapley)

Edit two-sided preferences, replay deferred acceptance, inspect blocking pairs and compare proposer-optimal stable outcomes.

Free theory article

Edit two-sided preferences, replay deferred acceptance, inspect blocking pairs and compare proposer-optimal stable outcomes.

Concept & interpretation

Imagine three mentors and three learners. Everyone ranks every person on the opposite side, and each person can have one partner. Filling every place does not settle the problem: two people might both prefer to leave their assigned partners and work together. Stable matching asks whether any such pair remains. This explorer uses neutral names A, B, C and X, Y, Z so either side can make proposals.

Reproduce the replacement, then reverse the roles

Open the Stable Matching interactive module. Its controls operate on the rankings shown beside each participant.

  1. Select Competition under Scenario and Left (A, B, C) under Proposing side. Press Reset.
  2. Set Proposal step to 2. Confirm one held pair, four blocking pairs and the message that X switches from A to B.
  3. Press Finish. The displays show six proposals, three held pairs and zero blocking pairs. Press Play after Reset to replay at one proposal per second; Pause freezes the current step.
  4. Select Multiple stable outcomes, then Finish. Left proposes yields A–X, B–Y, C–Z in three proposals. Change Proposing side to Right (X, Y, Z) and Finish: A–Y, B–X, C–Z is also stable after three proposals. The lists stay unchanged; only the proposing side changes.
  5. Return to Competition and Left. Open Edit rankings, set A preference to Z > X > Y, then Finish. All left participants receive their first choices: A–Z, B–X, C–Y, with three proposals and no blocking pairs.
  6. Toggle Show blocking pairs, pan the graph and press Reset view. These presentation controls preserve the matching. Reset restarts the current ranking problem; selecting a scenario loads that scenario's original lists.
Read the full free theory article