2
STABLE
MARRIAGES
A High School has N boys and M
≥
N girls.
Each
has a ranked list of dates for the 1951 Senior Prom.
Albert
Bob
Charlie
Alice
Betty
Carol
B,C,A
A,C,B
A,B,C
B,A,C
C,A,B
C,B,A
An unstable couple prefer each other to their current dates.
STABLE = {
〈
B,G
〉
| There is a pairing with no unstable couple}
STABLE
MARRIAGES in P
Albert
Bob
Charlie
Alice
Betty
Carol
B,C,A
A,C,B
A,B,C
B,A,C
C,A,B
C,B,A
1. Each boy asks his “first choice” to the prom.
2. Each girl “accepts” her best offer – for now.
3. Repeat until every boy has a date:
a. Each boy with no date asks the next girl on his list.
b. Each girl “accepts” her new best offer – for now.