Stable Marriage Problem
In its most basic version, we are given men and women. Each man has complete, strict preferences over the women, and each woman has complete, strict preferences over the men.
Any collection of disjoint man-woman pairs will be referred to as a matching. A matching is considered perfect if it consists of pairs (i.e. it matches all of the men and women).
The objective is to compute a “good” perfect matching.
What Constitutes a Good Perfect Matching?
Ideal situation would be where we could give each man/woman their first choice. This isn’t always possible.
We need to identify an interesting notion of ‘good’ that is always achievable.
We’ll first identify a natural class of “defects” to avoid in our solution. A good perfect matching will be one that does not have these defects.
Useful Notation
Let be a matching (not necessarily perfect). For any man , we write to denote the match of under . If is unmatched, is 0.
We do the same for women, where women are denoted as instead of .
Blocking Pairs (Unstable Matching)
Let be a matching, we say that man and woman form a blocking pair with respect to if the following two conditions hold:
- Man prefers woman to
- Woman prefers man to
If admits such a blocking pair then we say that is unstable.
Stable Matchings
We define a stable matching as a perfect matching with no blocking pair.
Does every instance of the stable marriage problem admit a stable matching? If so, can we compute a stable matching efficiently (or even compute the existence of a stable matching efficiently)?
Gale-Shapley Proposal Algorithm
- Initialize to the empty matching.
- While some man is single,
- Let be an arbitrary single man
- Man proposes to the highest-ranked woman on his preference list to whome he has not already proposed
- If woman prefers man to her current match (which could be 0)
- If woman is currently matched with some man , then the pair is removed from
- The pair is added to
Properties of the Gale-Shapley Proposal Algorithm
Throughout the execution of the algorithm, is a matching. If the algorithm terminates, then it produces a perfect matching.
A woman is single until she is proposed to for the first time, thereafter, she is tentatively matched.
If a woman is tentatively matched to a man , and is subsequently tentatively matched to a man , then prefers to . Essentially, a woman will never be re-matched to someone less preferable.
Termination of Gale-Shapley Proposal Algorithm
No man makes more than proposals. Suppose a man makes an th proposal, after this proposal, all women have been proposed to and as such are all tentatively matched. Thus all men are also tentatively matched. Thus no man is single, and the algorithm terminates.
The algorithm terminates within iterations.
Stability of Gale-Shapley Proposal Algorithm
Let denote the output perfect matching.
Assume for the sake of contradiction that is a blocking pair for .
At some point in the execution, was rejected by in favor of a man . Furthermore, likes at least as well as , since her sequence of tentative matches can only improve. Thus, prefers to , which is a contradiction.
There can be multiple stable outcomes.
Man Optimality
Fix an instance of the stable marriage problem and let denote the set of all stable matchings. For any man , we say that a matching in is -optimal if the following condition holds: for any matching in , man likes at least as well as .
We say that a matching in is man-optimal if it is -optimal for every man .