Advanced Stable Matching Calculator

Enter names, preferences, and proposing side for matches. Review stability, rounds, and fairness indicators clearly. Visual summaries support lessons, hiring models, and allocation drills.

Calculator Inputs

Examples: Applicants, Students, Residents, Teams.
Examples: Schools, Projects, Hospitals, Mentors.
The proposing side usually gets its best stable outcome.
Enter one name per line, or separate with commas.
Unequal groups are balanced with placeholder slots.

Preference format

Write one line per member.

Name: Choice1, Choice2, Choice3
Missing names are automatically added at the end.
Duplicate choices are cleaned automatically during parsing.

Example Data Table

Member Group Preference Order
AlexGroup AJordan, Harper, Riley, Morgan
BlakeGroup AHarper, Morgan, Jordan, Riley
CaseyGroup AHarper, Riley, Morgan, Jordan
DrewGroup ARiley, Harper, Jordan, Morgan
HarperGroup BBlake, Casey, Alex, Drew
JordanGroup BAlex, Blake, Casey, Drew
MorganGroup BCasey, Blake, Drew, Alex
RileyGroup BDrew, Alex, Casey, Blake

Formula Used

Core method: Gale-Shapley deferred acceptance algorithm.

Proposal rule: Each free proposer selects the highest-ranked option not yet proposed to.

Acceptance rule: A receiver keeps the more preferred proposal and rejects the other one.

Stopping rule: The process ends when no proposer remains free with an untried option.

Receiver comparison:

Choose p over q when rank(receiver, p) < rank(receiver, q)

A lower rank means higher preference.

Stability test:

A matching M is stable if no blocking pair exists.

(x, y) is a blocking pair when x prefers y over M(x), and y prefers x over M(y).

Time complexity: O(n²) for complete preference lists.

Interpretation: The proposing side obtains its proposer-optimal stable matching.

How to Use This Calculator

  1. Enter labels for both sides, such as students and schools.
  2. List names in each group, one per line or comma-separated.
  3. Enter ranked preferences using the format Name: Choice1, Choice2, Choice3.
  4. Select which side should make proposals during the algorithm.
  5. Click Calculate Stable Matching to generate pairs, metrics, and the proposal audit.
  6. Review average ranks, blocking pairs, and the chart to understand fairness and stability.
  7. Use the CSV button for spreadsheet work or the PDF button for reports.

FAQs

1) What problem does this calculator solve?

It solves two-sided matching problems where both groups rank each other. The tool produces a stable assignment, meaning no unmatched pair would rather be together than stay with their current partners.

2) What does stable mean here?

A stable result has no blocking pair. That means there is no person in one group and person in the other group who both prefer each other over their assigned partners.

3) Why does changing the proposer side matter?

The proposing side generally receives its best stable outcome under Gale-Shapley. Switching sides can change average ranks, fairness indicators, and the exact final matches.

4) What happens when group sizes differ?

The calculator adds placeholder slots to the smaller group. This keeps the algorithm balanced and makes unmatched outcomes visible without breaking the stable matching process.

5) Can I enter incomplete preference lists?

Yes. Missing choices are appended automatically in default order. That keeps the lists complete and lets the algorithm finish, though explicit rankings give more meaningful results.

6) What do the rank metrics mean?

Rank 1 means a top choice. Lower average ranks indicate better outcomes for that side. Comparing both averages helps you judge whether one side benefited more.

7) Why is the proposal audit trail useful?

It shows every proposal, rejection, and replacement step. This is helpful for teaching the algorithm, validating preference inputs, and explaining why a final pairing emerged.

8) When should I use stable matching instead of score sorting?

Use stable matching when both sides have preferences and mutual satisfaction matters. Simple score sorting can ignore pairwise incentives and may create unstable, easily contested assignments.

Related Calculators

adjacency matrix generatorpagerank calculatortopological sort calculatorminimum spanning tree calculatorgraph intersection calculatorgraph distance calculatorrandom graph generatorprim algorithm calculatorbreadth first search calculatorgraph compression calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.