Placet
🤝

Stable pairs

Pairs nobody has an interest in leaving.

Participants rank each other and are paired two by two, with no proposing side and no disposing side. No pair should prefer to leave their partners for each other.

Everyone ranks the other participants. Irving's algorithm looks for stable pairs: no two people would mutually prefer each other over their assigned partners. It can prove that no stable pairing exists — the fallback is then announced: picking rounds in a drawn order.

Start an assignment with this method →

How it works, precisely

Everyone ranks ALL the other participants. There is only one group, so no asymmetry between proposers and receivers.

First phase: everyone proposes to the highest-ranked person who has not yet rejected them; improving proposals are provisionally accepted, worse ones rejected. This yields a reduced table.

Second phase: rotations — chains of cyclic preferences that block stability — are found and removed, until everyone has exactly one partner, or the table empties, which proves no solution exists.

The resulting matching is stable: no two people not paired together prefer each other to their current partner.

A worked example

Four people to pair up, each having ranked the other three.

Person1st2nd3rd
ChloéAliBrunoDana
AliChloéDanaBruno
BrunoDanaChloéAli
DanaBrunoAliChloé
  1. Chloé and Ali put each other first: that pair is settled.
  2. Bruno and Dana do the same: second pair.
  3. No outside pair prefers each other: the matching is stable.

Here the preferences dovetail perfectly. Change a single ranking and the stable matching can disappear entirely — the fragility specific to this problem.

Where it comes from

The problem was posed in 1962 by David Gale and Lloyd Shapley, at the very end of their founding paper on stable marriage: what if, instead of two distinct groups, everyone belonged to the same set? They noted their algorithm does not apply, and left the question open.

They also proved that a stable matching may simply NOT EXIST — the essential difference from stable marriage, where one always does.

Robert Irving published the first polynomial-time algorithm in 1985: it determines whether a stable solution exists and constructs it if so, in two phases, the second of which methodically eliminates « rotations ».

Where it is used

  • Forming pairs for work, review or pair programming.
  • Allocating flatmates or roommates.
  • Pairing training or tournament partners.
  • Organising peer mentoring, with no hierarchy between the two roles.

Limits and pitfalls

✓ PROS
  • No pair wants to "run off" together
  • Based on both sides' preferences
  • Honestly detects impossible cases
✕ CONS
  • A stable pairing doesn't always exist
  • Requires an even count
  • Ranking everyone can take a while
May have no solution
Unlike stable marriage, stability is not guaranteed. That is a proven result, not a weakness of the implementation.
Even numbers required
With an odd number, someone is left alone by construction.
Demanding full rankings
Everyone must rank everyone else: the cost climbs fast with group size, and ranking your colleagues is socially loaded.

Frequently asked questions

What happens if no stable solution exists?

The tool says so plainly. That is real information about the group: preferences form an irreducible cycle. It is then up to you — pair by declared affinity, or accept a known instability.

How does this differ from two-sided Gale-Shapley?

Gale-Shapley assumes two distinct sets ranking each other (candidates and programmes) and always guarantees a solution. Here everyone is in the same set, so no side is favoured — but the existence guarantee is gone.

What exactly does « stable » mean?

That no two people who are not paired together would both prefer each other to their current partner. Such a pair would leave the arrangement: stability is precisely what prevents that.

See also

Two groups (Parcoursup)Trading circleMaximum satisfaction

Voting methods