7
Lecture 6 CSE 331 Sep 14

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

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

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

Lecture 6

CSE 331Sep 14

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

A run of the GS algorithm

Mal

Wash

Simon

Inara

Zoe

Kaylee

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

The Preferences

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

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

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

GS algorithm: Firefly Edition

1

1

2

2

3

3

4

4

5

5

6

6

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

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

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

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