This preview shows pages 1–3. Sign up to view the full content.
CS 70
Discrete Mathematics for CS
Fall 2006
Lecture 6
Stable Marriage  Application of Proof Techniques for Algo
rithmic Analysis
Consider a dating agency that must match up
n
men and
n
women. Each man has an ordered preference list
of the
n
women, and each woman has a similar list of the
n
men. Is there a good algorithm that the agency
can use to determine a good pairing?
Example
Consider for example
n
=
3 men (represented by numbers 1, 2, and 3) and 3 women (
A
,
B
, and
C
), and the
following preference lists:
Men
Women
1
A
B
C
2
B
A
C
3
A
B
C
Women
Men
A
2
1
3
B
1
2
3
C
1
2
3
What properties should a good pairing have? One possible criterion for a “good” pairing is one in which the
number of first ranked choices is maximized. Another possibility is to minimize the number of last ranked
choices. Or perhaps minimizing the sum of the ranks of the choices, which may be thought of as maximizing
the average happiness. In this lecture we will focus on a very basic criterion:
stability
. A pairing is unstable
if there is a man and a woman who prefer each other to their current partners. We will call such a pair a
rogue couple. So a pairing of
n
men and
n
women is stable if it has no rogue couples.
An unstable pairing from the above example is:
{
(1,C), (2,B), (3,A)
}
. The reason is that 1 and B form a
rogue couple, since 1 would rather be with B than C (his current partner), and since B would rather be with
1 than 2 (her current partner). An example of a stable pairing is:
{
(2,A), (1,B), (3,C)
}
. Note that (1,A) is not
a rogue couple. It is true that man 1 would rather be with woman A than his current partner. Unfortunately
for him, she would rather be with her current partner than with him. Note also that both 3 and C are paired
with their least favorite choice in this matching.
Before we discuss how to find a stable pairing, let us ask a more basic question: do stable pairings always
exist? Surely the answer is yes, since we could start with any pairing and make it more and more stable as
follows: if there is a rogue couple, modify the current pairing so that they are together. Repeat. Surely this
procedure must result in a stable pairing! Unfortunately this reasoning is not sound. To demonstrate this,
let us consider a slightly different scenario, the roommates problem. Here we have 2
n
people who must be
paired up to be roommates (the difference being that unlike the dating scenario, a person can be paired with
any of the remaining 2
n

1). The point is that nothing about the above reasoning relied on the fact that men
can only be paired with women in the dating scenario, so by the same reasoning we would expect that there
would be a stable pairing for the roommates problem as well. The following counterexample illustrates the
fallacy in the reasoning:
Roommates Problem:
CS 70, Fall 2006, Lecture 6
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentRoommates
A
B
C
D
B
C
A
D
C
A
B
D
D
–
–
–
Visually, we have the following situation:
What is interesting about this problem is that there is no stable pairing (i.e. there is always a rogue couple).
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '08
 HAULLGREN

Click to edit the document details