Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 7: Stable Matching

40e37c08199ed4d3866ce6e1ff0be06d?s=47 David Evans
February 05, 2019

Class 7: Stable Matching

Class 7: Stable Matching
https://uvammm.github.io/class7

Markets, Mechanisms, and Machines
University of Virginia
cs4501/econ4559 Spring 2019
David Evans and Denis Nekipelov
https://uvammm.github.io/

40e37c08199ed4d3866ce6e1ff0be06d?s=128

David Evans

February 05, 2019
Tweet

Transcript

  1. 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
  2. Plan Today: Resource allocation Stable matching algorithms Thursday: Kidney Exchange

    (focus of Project 3) 1
  3. How to allocate scarce resources? 2 How should we allocate

    scarce resources?
  4. 3 Fish Market, Bangladesh

  5. Allocation Goals Maximize Utility Minimize Overhead Maximize Fairness / Minimize

    Repugnance 4
  6. Allocation Strategies 5 Decentralized Centralized

  7. Allocation Strategies 6 Decentralized Centralized Fish Market (Bangledesh)

  8. Centralized Match based on Decentralized Declared Preferences

  9. Formal Problem Definition Input: Output:

  10. Utility of a Match

  11. 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
  12. 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 .
  13. Stable Matching Anna Elsa E F Hans Kristoff

  14. Stable Matching Anna Elsa E F Hans Kristoff Kristoff ≺OPPQ

    Hans Kristoff ≺RSTQ Hans Elsa ≺UQPT Anna Elsa ≺VWXTYZ[[ Anna
  15. 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)}
  16. 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)}
  17. 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
  18. Gale- Shapley Algorithm Lloyd Shapley (1923-2016) accepting Nobel Prize (2012)

    (co-awarded to Alvin Roth)
  19. David Gale (1921 – 2008) Alvin Roth (Stanford) born 1951

    Aaron Roth (U. Penn) Ben Roth (Harvard BS)
  20. 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
  21. 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
  22. Olfa ≺OPPQ Kristoff Kristoff ≺RSTQ Olaf Anna ≺\SQ[ Elsa Elsa

    ≺VWXTYZ[[ Anna Implementing Gale-Shapley
  23. Simplified Code (Non-Defensive) Do not write programs like this: assertions

    (especially) and comments are valuable (but don’t fit on slides)
  24. None
  25. None
  26. Cost of Gale-Shapley

  27. D. Gale and L. S. Shapley. College Admissions and the

    Stability of Marriage, The American Mathematical Monthly, 1962.
  28. Properties of a Matching Algorithm

  29. 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 .
  30. 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).
  31. Is that fair? https://youtu.be/l_FWKLpoGBc?t=16

  32. National Resident Matching Program Medical residents in US, Canada, others

    35,000 applicants
  33. New England Journal of Medicine, 1981

  34. Redesigned matching algorithm used in 1988

  35. Roth-Peranson Algorithm instability chaining: start with no matches loop through

    the proposers break matches when better found produces proposer-optimal stable match
  36. https://youtu.be/MMqThyNxbOw?t=23

  37. How can this possibly be legal?

  38. Anti-trust Exemption

  39. None
  40. None
  41. None
  42. None
  43. None
  44. https://www.collegepravesh.com/cutoff/iit-bombay-cutoff-2018/ IIT Bombay

  45. Gale & Shapley’s Conclusion

  46. Who controls the match? Public schools in New York, Boston

    Singapore University Admissions Medical residents in US, Canada, others 35,000 applicants
  47. 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
  48. 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
  49. Charge Scarce Resource Allocation is a core problem of economics

    Algorithms, Mechanism Design Project 3: Kidney Matching