Slide 1

Slide 1 text

MARKETS, MECHANISMS, MACHINES University of Virginia, Spring 2019 Class 7: Matching without Money 5 February 2019 cs4501/econ4559 Spring 2019 David Evans and Denis Nekipelov https://uvammm.github.io

Slide 2

Slide 2 text

Plan Today: Resource allocation Stable matching algorithms Thursday: Kidney Exchange (focus of Project 3) 1

Slide 3

Slide 3 text

How to allocate scarce resources? 2 How should we allocate scarce resources?

Slide 4

Slide 4 text

3 Fish Market, Bangladesh

Slide 5

Slide 5 text

Allocation Goals Maximize Utility Minimize Overhead Maximize Fairness / Minimize Repugnance 4

Slide 6

Slide 6 text

Allocation Strategies 5 Decentralized Centralized

Slide 7

Slide 7 text

Allocation Strategies 6 Decentralized Centralized Fish Market (Bangledesh)

Slide 8

Slide 8 text

Centralized Match based on Decentralized Declared Preferences

Slide 9

Slide 9 text

Formal Problem Definition Input: Output:

Slide 10

Slide 10 text

Utility of a Match

Slide 11

Slide 11 text

Utility of a Match ! "# , %& = the value of matching "# with %& 8 9 = { "; , %; , "< , %< , … , "> , %> } = @ !("B , %B ) > BD; Goal (?): find 9 that maximizes 8(9) Goal (?): find 9 that all individuals accept

Slide 12

Slide 12 text

Stable Matching Problem Input: Output: Stable matching between E and F E, F, ≺H , ≺I A matching, 9 = { "; , %; , "< , %< , … , "> , %> } is a stable matching if there is no pair ("B , %J ) where %B ≺KL %J and "J ≺MN "B .

Slide 13

Slide 13 text

Stable Matching Anna Elsa E F Hans Kristoff

Slide 14

Slide 14 text

Stable Matching Anna Elsa E F Hans Kristoff Kristoff ≺OPPQ Hans Kristoff ≺RSTQ Hans Elsa ≺UQPT Anna Elsa ≺VWXTYZ[[ Anna

Slide 15

Slide 15 text

Stable Matches? Anna Elsa Hans Kristoff Kristoff ≺OPPQ Hans Kristoff ≺RSTQ Hans Elsa ≺UQPT Anna Elsa ≺VWXTYZ[[ Anna {(Anna, Hans), (Elsa, Kristoff)} {(Anna, Kristoff), (Elsa, Hans)}

Slide 16

Slide 16 text

Stable Matches? Anna Elsa Olaf Kristoff Olfa ≺OPPQ Kristoff Kristoff ≺RSTQ Olaf Anna ≺\SQ[ Elsa Elsa ≺VWXTYZ[[ Anna {(Anna, Olaf), (Elsa, Kristoff)} {(Anna, Kristoff), (Elsa, Olaf)}

Slide 17

Slide 17 text

Students and Majors Avery: Computer Science, Economics, Music Blake: Music, Computer Science, Economics Corey: Economics, Music, Computer Science Computer Science: Blake, Corey, Avery Economics: Corey, Avery, Blake Music: Avery, Blake, Corey

Slide 18

Slide 18 text

Gale- Shapley Algorithm Lloyd Shapley (1923-2016) accepting Nobel Prize (2012) (co-awarded to Alvin Roth)

Slide 19

Slide 19 text

David Gale (1921 – 2008) Alvin Roth (Stanford) born 1951 Aaron Roth (U. Penn) Ben Roth (Harvard BS)

Slide 20

Slide 20 text

A matching, 9 = { "; , %; , "< , %< , … , "> , %> } is a stable matching if there is no pair ("B , %J ) where %B ≺KL %J and "J ≺MN "B . Finding a Stable Matching

Slide 21

Slide 21 text

Gale-Shapley Algorithm StableMatch E, F, ≺K , ≺M : 9 = { } # b"cdℎfg, hihch"jjk fblck foreach " ∈ E: "nQYop = ⊥, "rWZrZTst = 0 foreach % ∈ F: %vKwxy = ⊥ while ∃" ∈ E where "nQYop = ⊥ and "rWZrZTst < |F|: " ← pick(E) % = "ÅÇÉÑÖ "ÅÇÜÅÜÖÉá # highest − ranked F to whom " hasnãt already proposed if %vKwxy = ⊥: pair(", %) elseif %vKwxy ≺M ": # b prefers a to current match unpair(%vKwxy , %) pair(", %) "ÅÇÜÅÜÖÉá += 1

Slide 22

Slide 22 text

Olfa ≺OPPQ Kristoff Kristoff ≺RSTQ Olaf Anna ≺\SQ[ Elsa Elsa ≺VWXTYZ[[ Anna Implementing Gale-Shapley

Slide 23

Slide 23 text

Simplified Code (Non-Defensive) Do not write programs like this: assertions (especially) and comments are valuable (but don’t fit on slides)

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Cost of Gale-Shapley

Slide 27

Slide 27 text

D. Gale and L. S. Shapley. College Admissions and the Stability of Marriage, The American Mathematical Monthly, 1962.

Slide 28

Slide 28 text

Properties of a Matching Algorithm

Slide 29

Slide 29 text

Proving Correctness For all valid inputs, gale_shapley returns a stable matching of its inputs. A matching, 9 = { "; , %; … , "> , %> } is a stable matching if there is no pair ("B , %J ) where %B ≺KL %J and "J ≺MN "B .

Slide 30

Slide 30 text

Proving Optimality? For all valid inputs, gale_shapley returns a stable matching of its inputs. gale_shapley returns a matching that is optimal for the proposers (A).

Slide 31

Slide 31 text

Is that fair? https://youtu.be/l_FWKLpoGBc?t=16

Slide 32

Slide 32 text

National Resident Matching Program Medical residents in US, Canada, others 35,000 applicants

Slide 33

Slide 33 text

New England Journal of Medicine, 1981

Slide 34

Slide 34 text

Redesigned matching algorithm used in 1988

Slide 35

Slide 35 text

Roth-Peranson Algorithm instability chaining: start with no matches loop through the proposers break matches when better found produces proposer-optimal stable match

Slide 36

Slide 36 text

https://youtu.be/MMqThyNxbOw?t=23

Slide 37

Slide 37 text

How can this possibly be legal?

Slide 38

Slide 38 text

Anti-trust Exemption

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

https://www.collegepravesh.com/cutoff/iit-bombay-cutoff-2018/ IIT Bombay

Slide 45

Slide 45 text

Gale & Shapley’s Conclusion

Slide 46

Slide 46 text

Who controls the match? Public schools in New York, Boston Singapore University Admissions Medical residents in US, Canada, others 35,000 applicants

Slide 47

Slide 47 text

Who controls the match? Public schools in New York, Boston Singapore University Admissions Medical residents in US, Canada, others 35,000 applicants Use Trusted Third Party to run matching algorithm: - Receives all private rankings and keeps confidential - Produces correct result - uncorrupted

Slide 48

Slide 48 text

Phase Time Initialization 2.07 hours Bidding 15.01 hours Total 17.08 hours Simulated 2016 US National Medical Residency Match: 35,476 prospective residents matching with 4836 programs with 30,750 total slots Secure Stable Matching Garbled Circuit Protocol secret input a secret input b r = f(a, b) r = f(a, b) Learns nothing else about b Learns nothing else about a

Slide 49

Slide 49 text

Charge Scarce Resource Allocation is a core problem of economics Algorithms, Mechanism Design Project 3: Kidney Matching