Post on 15-Apr-2017
transcript
CS 321. Algorithm Analysis & Design Lecture 15
Interlude: Stable MatchingsA Valentine Day Special
Disclaimer - People shown on these slides are a part of a fictitious story. Not to be taken seriously!
Input: Two sets of agents (men and women), and some notion of preferences.
The Matching Problem
Output: A pairing of the agents that satisfies some reasonable property.
There is a perfect matching between A and B if, and only if,
there is no congestion*.
Hall’s Marriage Theorem
Let G = (V,E) be a bipartite graph with bipartition V = (A,B); and suppose |A| = |B|.
(i.e, there is no subset S of A for which N(S) is smaller than S.)
>
>
Stability
A marriage between A and B is stable if there is no pair of couples
(a ⟷ p) and (b ⟷ q)
such that a prefers q over p and q prefers a over b.
Goal: Design an Stable Matching Algorithm
The men keep proposing.
The women keep rejecting, as long as it makes sense.
To begin with, every man proposes to the
woman on the top of his list.
A woman always accepts her first proposal,
and accepts the best among multiple proposals.
The first round Proposals on the left
and engagements on the right.
As long as a man is free, he proposes to the next woman on
his list.
A woman accepts a proposal either if she is single, or if the proposal is better than
her current partner.
The second round Proposals on the left
and engagements on the right.
The third round Proposals on the left
and engagements on the right.
The algorithm terminates because we now have a matching.
The total number of proposals made is at most n2.
The algorithm always terminates with a matching.
The matching is stable.
If m is free at some point in the execution of the algorithm, then there is a woman to whom he has
not yet proposed.
The algorithm always terminates with a matching.
>
>
This situation is not possible with the algorithm - RK would have proposed to KK first, and
she has no reason to reject the proposal!
Proof of STABILITY