Stable
Matchings
The story, all names, characters, and incidents portrayed in this class are fictitious.
No identification with actual persons is intended or should be inferred.
Blocking Pairs
When A is matched to B
and X is matched to Y
but A prefers Y over B
and Y prefers A over X.
Goal: Stable Marriage
An assignment with
no blocking pairs.
Men = [n] & Women = [n]
ManPref[m, j] is the identity of the j-th ranked woman in m’s preference list
WomanPref[w, j] is the identity of the jth
ranked man in w’s preference list.
Next[w] → the rank of the best unproposed man for w.
Current[m] → is the identity of the woman m is currently
engaged to and is −1 otherwise
FreeWomenList is the set of unmatched women.
Rank is an n ×n 2D array such that Rank[m,w] is the rank of w in m’s preference list.
Consider the following instance of the stable matching problem for 4 men (PQRS) and 4 women (WXYZ).
& P: W>X>Y>Z
& Q: X>Y>Z>W
& R: W>X>Z>Y
& S: X>Y>W>Z
and
W: S>Q>R>P
X: P>S>Q>R
Y: R>P>Q>S
Z: R>P>S>Q
Does the algorithm terminate?
Does the algorithm produce a valid matching?
Does the algorithm produce a stable matching?
How long does the algorithm need to run?