Stable Marriage Problem Solver — Find a Stable Matching Between Two Groups
Our Stable Marriage Problem Solver finds a matching between two equal-sized groups — proposers and reviewers — such that no pair would both prefer each other over their assigned match, using the Gale-Shapley deferred-acceptance algorithm, given each participant's ranked preference list over the other group.
Quick Answer
Enter ranked preference lists for two equal-sized groups to instantly find a stable matching via the Gale-Shapley algorithm.
One line per proposer: Name: pref1, pref2, ... ranking every reviewer, e.g. A1: B2, B1, B3.
One line per reviewer: Name: pref1, pref2, ... ranking every proposer, e.g. B1: A3, A1, A2.
How to Use the Stable Marriage Problem Solver — Gale-Shapley Algorithm Online
- 1
Enter each proposer's preferences as one line: Name: pref1, pref2, pref3, ... (ranked from most to least preferred).
- 2
Enter each reviewer's preferences the same way, ranking every proposer.
- 3
Click 'Calculate' to find a stable matching via the Gale-Shapley algorithm.
Why Use Stable Marriage Problem Solver — Gale-Shapley Algorithm Online?
A matching between two groups is 'stable' if there's no pair who would both rather be matched to each other than to their current assigned partners — such a pair would have an incentive to break their existing matches, making the pairing unstable. The Gale-Shapley algorithm always finds a stable matching (a foundational result that earned the 2012 Nobel Prize in Economics): each unmatched proposer proposes to their top remaining choice, each reviewer tentatively accepts their best offer so far and rejects the rest (even bumping a previous match if a better offer arrives), and this repeats until everyone is matched. The result is not just stable but proposer-optimal — every proposer gets the best partner they could possibly have in any stable matching.
Frequently Asked Questions
Related Tools
Network Flow Calculator — Max Flow via Edmonds-Karp Online
Find the maximum flow from a source to a sink in a capacitated directed graph using the Edmonds-Karp algorithm. Free calculator with a simple edge-list input.
Graph Coloring Calculator — Welsh-Powell Algorithm Online
Color a graph's vertices so no two connected nodes share a color, using the greedy Welsh-Powell algorithm. Free calculator with a simple edge-list input.
Permutation Calculator — Calculate P(n,r) Online
Calculate permutations P(n,r) — the number of ways to arrange r items from n total items where order matters. Free calculator with step-by-step solutions and formula breakdowns.