(Latest Revision: Sunday, Dec 13, 2020)
best valid partner proof
Proof That The Gale-Shapley Algorithm Matches
Best Valid Partners to Worst Valid Partners
Claim: The GS algorithm matches each man to his best valid partner.
Proof:
- 1) The GS Algorithm always finds a stable matching for its input (N men and N
women, plus their preference lists). We already verified that.
- 2) A pairing of a man X to a woman Y is said to be
valid if there is a stable matching that pairs X to Y. In that case
X and Y are said to be valid partners of each other.
- 3) Each man's preference list begins with 0 or more non-valid partners. Next
comes the first valid partner of the man. Since the list is in order
by preference, we call this woman the best valid partner (BVP) of the man.
After the BVP, comes 0 or more additional names, who may or may not be
valid partners.
- 4) 1+2+3 imply that, in any particular execution of the GS algorithm, each man
eventually proposes to his BVP. (Proof? By definition of valid, an
execution of the GS algorithm matches each guy to a valid partner. The way
the algorithm works, guys are only matched to women to whom the guys propose.)
- 5) In an execution of the GS algorithm, is it possible for a guy's BVP to reject him?
Suppose it is possible. Suppose that M is a matching created by a
run of the GS Algorithm on some certain set of inputs, where a rejection
of a guy by his BVP happens. Consider the first time
during that run of GS when that happens - let's give names to the people -
say it is the rejection of Pete by Gladys. (Considering the first time
it happens is a set up for a form of induction argument.)
The rejection could happen right at the time when Pete proposes to Gladys,
or Gladys could reject Pete after first accepting him,
at some later time when she sets him free so she can accept
another proposal. In either case, right after Gladys rejects Pete,
she is engaged to someone else. Let's give that guy a name - call him Mark.
- 6) Since Gladys rejected Pete for Mark during the execution of GS,
we know Gladys has Mark higher on her list than Pete. (In other words
Gladys likes Mark more than she likes Pete.)
Also, we know that, because Mark is engaged to Gladys immediately after
she rejects Pete, in this execution of GS, Mark has already proposed to
Gladys, and to all the women on his list that he likes more than Gladys.
All of the women on Mark's list that he likes better than Gladys must
have rejected Mark. Otherwise the algorithm would not have allowed him to
propose to Gladys. Because the Gladys-Pete rejection is the first time
in this run of the GS algorithm that a valid partner has been rejected, we can
conclude this important fact:
- 7) None of the women that Mark ranks above Gladys are
valid partners for Mark.
Now consider a stable matching S in which Pete and Gladys are matched.
(S has to exist because Gladys is a valid partner for Pete.)
Under S, Mark has to be matched to someone - call her Violet. The fact
that they are matched under S proves that Violet and Mark are valid partners.
According to 7), that means Violet comes after Gladys in Mark's ranking.
So Mark likes Gladys MORE than Violet. However we also proved 6),
that Gladys likes Mark more than Pete.
So Gladys-Mark is an instability of the matching S. If the answer
to 5) is "Yes" then we can reach the conclusion that there exists this 'stable
matching S', which nonetheless has an instability, and so it is NOT stable.
This reasoning proves by contradiction that the answer to question 5 must be "No."
So we can conclude that each man's BVP does NOT reject him. In other
words, when GS executes, each guy eventually proposes to his BVP (the first valid
partner on his list), and remains engaged to her.
So we see that the GS algorithm matches each guy to his BVP.
Also, this proof is valid and independent of the question of which men are
chosen at which point in the run of the algorithm to make their proposals.
So we have also proved that the GS algorithm produces exactly the same matching,
no matter what order the men are selected to do their proposals.
Claim: The GS algorithm (also) matches each woman to her worst
valid partner
Proof:
- Suppose that the GS algorithm pairs Pete with Gladys, and suppose Pete is
not the worst valid partner (WVP) of Gladys.
- Then there is a stable matching M in which Gladys is paired with a (valid)
partner, Yuck-o, whom she likes less than Pete. In other words,
Gladys likes Pete more than she likes Yuck-o.
- Suppose Pete is paired under M with (valid partner) Nancy.
- Since Gladys is Pete's best valid partner,
Pete likes Gladys more than he likes Nancy.
- Therefore Pete & Gladys is an instability of M.
- This contradiction shows that the supposition that Pete is not the (WVP) of
Gladys is false.
- Therefore the claim is established: The GS algorithm matches each woman to
her worst valid partner.