Stable Matching Simulator

Visualize deferred acceptance and discover why stability differs from maximum total satisfaction.

Stable Matching Simulator

Current matching

How this teaches game theory

Mode and Level Guide

Use this guide to understand what each setting changes, what you control, and what concept to observe.

Modes

Human Proposes vs Computer Market

You advance the market one proposal at a time with Next proposal. The proposer selected by the deferred-acceptance algorithm applies to the next receiver on its preference list.

The receiver side acts automatically: it tentatively accepts a better proposal and rejects the less preferred proposer.

Best for: following the consequences of each proposal while the market enforces receiver preferences automatically.

Human Steps Through Algorithm

You control the pace of the complete Gale–Shapley process by pressing Next proposal. The simulator performs the proposal, comparison, tentative acceptance, rejection, and rematching rules.

Pause after every step to inspect the preference table, current matching, and event log.

Best for: classroom demonstrations and learning the algorithm line by line.

Automatic Simulation

The computer immediately runs all remaining proposals until a stable matching is reached. Choosing this mode also starts the simulation automatically.

You can still generate a fresh instance with New preferences and inspect the completed matching and full event history.

Best for: quickly comparing many random preference profiles.

Mode note: All three modes use the same deferred-acceptance rules. The main difference is who controls the pace: manual step-by-step exploration or automatic completion.

Levels

Level 1 — 3 × 3

Three proposers and three receivers participate. Short preference lists make every proposal, rejection, and replacement easy to track.

Learning goal: understand tentative acceptance and why a receiver may later replace its current match.

Recommended mode: Human Steps Through Algorithm.

Level 2 — 4 × 4

Four proposers and four receivers create longer proposal chains and more opportunities for rejection and rematching.

Learning goal: observe how local preference decisions eventually produce a globally stable matching.

Recommended mode: Human Proposes vs Computer Market or Automatic Simulation.

Level 3 — Compare Proposer Sides

This level uses a 4 × 4 market and focuses attention on proposer advantage: deferred acceptance is optimal for the side that makes proposals among all stable matchings.

Run several fresh preference profiles and compare how highly proposers and receivers rank their assigned partners. To perform a full side-by-side comparison, conceptually exchange the proposer and receiver roles and repeat the process.

Learning goal: distinguish stability from fairness and understand why the choice of proposing side matters.

Mode–Level Combinations

CombinationWhat happensWhat to observe
Human Proposes vs Computer Market + Level 1You manually advance a small 3 × 3 market; receivers compare proposals automatically.The basic accept, reject, and replace rules.
Human Proposes vs Computer Market + Level 2You control proposal timing in a larger 4 × 4 market.Longer rejection chains and repeated proposals by unmatched proposers.
Human Proposes vs Computer Market + Level 3You manually inspect a 4 × 4 proposer-oriented run.Whether proposers tend to receive partners near the top of their lists.
Human Steps Through Algorithm + Level 1The smallest market is revealed one algorithmic action at a time.How tentative matches can change before completion.
Human Steps Through Algorithm + Level 2A larger market is processed step by step.How termination occurs after every proposer is matched or exhausts its list.
Human Steps Through Algorithm + Level 3You examine proposer advantage slowly in a 4 × 4 instance.Stability does not necessarily mean equal satisfaction for both sides.
Automatic Simulation + Level 1A 3 × 3 instance completes immediately.The final stable matching and concise event sequence.
Automatic Simulation + Level 2A 4 × 4 instance completes immediately.How a more complex preference profile still converges.
Automatic Simulation + Level 3A proposer-oriented 4 × 4 run completes immediately.Generate several instances to investigate proposer-side advantage statistically.
Suggested learning path: Begin with Level 1 in step-through mode, continue with Level 2 in manual mode, and finish with Level 3 in automatic mode using several new preference profiles. In every run, ask whether any unmatched proposer–receiver pair would both prefer each other to their assigned partners. If none exists, the matching is stable.