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

Class 7: Stable Matching

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/

David Evans

February 05, 2019
Tweet

More Decks by David Evans

Other Decks in How-to & DIY

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. 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
  3. 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 .
  4. Stable Matching Anna Elsa E F Hans Kristoff Kristoff ≺OPPQ

    Hans Kristoff ≺RSTQ Hans Elsa ≺UQPT Anna Elsa ≺VWXTYZ[[ Anna
  5. 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)}
  6. 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)}
  7. 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
  8. David Gale (1921 – 2008) Alvin Roth (Stanford) born 1951

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

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

    (especially) and comments are valuable (but don’t fit on slides)
  13. D. Gale and L. S. Shapley. College Admissions and the

    Stability of Marriage, The American Mathematical Monthly, 1962.
  14. 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 .
  15. 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).
  16. Roth-Peranson Algorithm instability chaining: start with no matches loop through

    the proposers break matches when better found produces proposer-optimal stable match
  17. Who controls the match? Public schools in New York, Boston

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

    Algorithms, Mechanism Design Project 3: Kidney Matching