Given rankings on both sides, deferred acceptance always finds a stable matching — one with no pair who would both rather have each other. Proposers propose in preference order; receivers hold their best offer and reject the rest; it always terminates, always stable. The twist: the answer is not unique. Proposers get their best possible stable partner, receivers their worst — so who proposes changes the outcome.
The demo checks a 2×2 instance where the proposer-optimal and receiver-optimal matchings differ — and both are stable: live demo
“The stable matching is unique.” — there can be many; deferred acceptance yields the proposer-optimal one, and the receiver-proposing version gives a different, also-stable matching. cited
Stable, but which stable one depends on who asks. algorithm
On i-13, for this instance the proposer-optimal and receiver-optimal matchings both have no blocking pair, yet they differ: