Lecture 6 CSE 331 Sep 14. A run of the GS algorithm Mal Wash Simon Inara Zoe Kaylee

Preview:

Citation preview

Lecture 6

CSE 331Sep 14

A run of the GS algorithm

Mal

Wash

Simon

Inara

Zoe

Kaylee

The Preferences

Gale-Shapley AlgorithmIntially all men and women are free

While there exists a free woman who can propose

Let w be such a woman and m be the best man she has not proposed to

w proposes to m

If m is free

(m,w) get engaged

Else (m,w’) are engaged

If m prefers w’ to w

w remains freeElse

(m,w) get engaged and w’ is free

Output the engaged pairs as the final output

GS algorithm: Firefly Edition

1

1

2

2

3

3

4

4

5

5

6

6

Last LectureIntially all men and women are free

While there exists a free woman who can propose

Let w be such a woman and m be the best man she has not proposed to

w proposes to m

If m is free

(m,w) get engaged

Else (m,w’) are engaged

If m prefers w’ to w

w remains freeElse

(m,w) get engaged and w’ is free

Output the engaged pairs as the final output

At most n2 iterationsAt most n2 iterations

Two Observations

Every man is free until he gets engaged

1

1

2

2

3

3

4

4

5

5

6

6

After that he gets engaged to better women

No monotone property for a woman

Her engagements get worse and worse