Stable matching problem: Difference between revisions

Content deleted Content added
Algorithmic solution: any source on this topic will include this, but might as well reuse the same footnote used for this in Gale–Shapley algorithm
OAbot (talk | contribs)
m Open access bot: url-access=subscription updated in citation with #oabot.
 
(11 intermediate revisions by 8 users not shown)
Line 1:
{{Short description|Pairing where no unchosen pair prefers each other over their choice}}
In [[mathematics]], [[economics]], and [[computer science]], the '''stable marriagematching problem''' (also<ref>{{cite '''stableweb matching|author=Tesler, problem''')G.|url=https://mathweb.ucsd.edu/~gptesler/154/slides/154_galeshapley_20-handout.pdf|website=mathweb.ucsd.edu|title=Ch. 5.9: Gale-Shapley Algorithm|date= 2020|publisher=[[University of California San Diego]]|access-date=26 April 2025|url-status=|archive-url=|archive-date=}}</ref><ref>{{cite web|last1=Kleinberg|first1=Jon |last2=Tardos|first2=Éva |url=https://www.cs.princeton.edu/~wayne/kleinberg-tardos/pdf/01StableMatching.pdf|website=www.cs.princeton.edu|title=Algorithmn Design: 1. Stable Matching|date= 2005|publisher=[[Pearson PLC|Pearson]]-[[Addison Wesley]]: [[Princeton University]]|access-date=26 April 2025|url-status=|archive-url=|archive-date=}}</ref><ref>{{cite web |last1=Goel|first1=Ashish |editor1-last=Ramseyer|editor1-first=Geo |url=https://web.stanford.edu/~ashishg/cs261/win21/notes/l5_note.pdf|website=web.stanford.edu|title=CS261 Winter 2018- 2019 Lecture 5: Gale-Shapley Algorith|date= 21 January 2019|publisher=[[Stanford University]]|access-date=26 April 2025|url-status=|archive-url=|archive-date=}}</ref> is the problem of finding a stable matching between two equally sized sets of elements given an ordering of preferences for each element. A [[Matching (graph theory)|matching]] is a [[bijection]] from the elements of one set to the elements of the other set. A matching is ''not'' stable if:
 
{{Ordered list|list-style-type=numeric
Line 16:
Algorithms for finding solutions to the stable marriage problem have applications in a variety of real-world situations, perhaps the best known of these being in the assignment of graduating medical students to their first hospital appointments.<ref>[http://www.dcs.gla.ac.uk/research/algorithms/stable/ Stable Matching Algorithms]</ref> In 2012, the [[Nobel Memorial Prize in Economic Sciences]] was awarded to [[Lloyd S. Shapley]] and [[Alvin E. Roth]] "for the theory of stable allocations and the practice of market design."<ref>{{cite web|url=https://www.nobelprize.org/nobel_prizes/economics/laureates/2012/ |title=The Prize in Economic Sciences 2012 |publisher=Nobelprize.org |access-date=2013-09-09}}</ref>
 
An important and large-scale application of stable marriage is in assigning users to servers in a large distributed Internet service.<ref name=nuggets>{{cite journal | author= Bruce Maggs and [[Ramesh Sitaraman]] | title = Algorithmic nuggets in content delivery | journal= ACM SIGCOMM Computer Communication Review |year=2015|volume=45|issue=3|url = http://www.sigcomm.org/sites/default/files/ccr/papers/2015/July/0000000-0000009.pdf}}</ref> Billions of users access web pages, videos, and other services on the Internet, requiring each user to be matched to one of (potentially) hundreds of thousands of servers around the world that offer that service. A user prefers servers that are proximal enough to provide a faster response time for the requested service, resulting in a (partial) preferential ordering of the servers for each user. Each server prefers to serve users that it can with a lower cost, resulting in a (partial) preferential ordering of users for each server. [[Content delivery network]]s that distribute much of the world's content and services solve this large and complex stable marriage problem between users and servers every tens of seconds to enable billions of users to be matched up with their respective servers that can provide the requested web pages, videos, or other services.<ref name=nuggets />
 
The [[Gale-ShapleyGale–Shapley algorithm]] for stable matching is used to assign rabbis who graduate from [[Hebrew Union College – Jewish Institute of Religion|Hebrew Union College]] to Jewish congregations.<ref>{{Cite journal |lastlast1=Bodin |firstfirst1=Lawrence |last2=Panken |first2=Aaron |date=June 2003 |title=High Tech for a Higher Authority: The Placement of Graduating Rabbis from Hebrew Union College—Jewish Institute of Religion |url=https://pubsonline.informs.org/doi/10.1287/inte.33.3.1.16013 |journal=Interfaces |language=en |volume=33 |issue=3 |pages=1–11 |doi=10.1287/inte.33.3.1.16013 |issn=0092-2102|url-access=subscription }}</ref>
 
==Different stable matchings==
{{mainMain|Lattice of stable matchings}}
In general, there may be many different stable matchings. For example, suppose there are three men (A, B, C) and three women (X, Y, Z) which have preferences of:
 
: A: YXZ &nbsp; B: ZYX &nbsp; C: XZY &nbsp;
: X: BAC &nbsp; Y: CBA &nbsp; Z: ACB
 
There are three stable solutions to this matching arrangement:
 
* men get their first choice and women their third - (AY, BZ, CX);
* all participants get their second choice - (AX, BY, CZ);
* women get their first choice and men their third - (AZ, BX, CY).
 
All three are stable, because instability requires both of the participants to be happier with an alternative match. Giving one group their first choices ensures that the matches are stable because they would be unhappy with any other proposed match. Giving everyone their second choice ensures that any other match would be disliked by one of the parties. In general, the family of solutions to any instance of the stable marriage problem can be given the structure of a finite [[distributive lattice]],
Line 69:
| title = Proceedings of the 50th Symposium on Theory of Computing (STOC 2018)
| year = 2018| arxiv = 1711.01032
| isbn = 978-1-4503-5559-9 }}</ref>
Counting the number of stable matchings in a given instance is [[♯P-complete|#P-complete]].<ref>{{cite journal
| last1 = Irving | first1 = Robert W.
Line 83:
 
==Algorithmic solution==
{{mainMain|Gale–Shapley algorithm}}
[[File:Gale-Shapley.gif|thumb|right|Animation showing an example of the Gale–Shapley algorithm]]
In 1962, [[David Gale]] and [[Lloyd Shapley]] proved that, for any equal number in different groups, in the context of mencollege admissions and women,individuals wanting marriage it is always possible to solve theas stablematched marriagecouples problem andto make all marriagesresultant pairings / matched factors stable. They presented an [[algorithm]] to do so.<ref name=gs62>{{cite journal |first1=D. |last1=Gale |first2=L. S. |last2=Shapley |title=College Admissions and the Stability of Marriage |journal=[[American Mathematical Monthly]] |volume=69 |issue= 1|pages=9–14 |year=1962 |jstor=2312726 |doi=10.2307/2312726|url=http://www.dtic.mil/get-tr-doc/pdf?AD=AD0251958 |archive-url=https://web.archive.org/web/20170925172517/http://www.dtic.mil/get-tr-doc/pdf?AD=AD0251958 |url-status=dead |archive-date=September 25, 2017 }}</ref><ref>[[Harry Mairson]]: "The Stable Marriage Problem", ''The Brandeis Review'' 12, 1992 ([http://www1.cs.columbia.edu/~evs/intro/stable/writeup.html online]).</ref>
 
The [[Gale–Shapley algorithm]] (also known as the deferred acceptance algorithm) involves a number of "rounds" (or "[[iteration]]s"):
Line 118:
| editor1-last = Azar | editor1-first = Yossi
| editor2-last = Erlebach | editor2-first = Thomas
| contribution = Cheating by men in the Gale-ShapleyGale–Shapley stable matching algorithm
| doi = 10.1007/11841036_39
| mr = 2347162
Line 124:
| publisher = Springer
| series = Lecture Notes in Computer Science
| title = Algorithms - ESA 2006, 14th Annual European Symposium, Zurich, Switzerland, September 11-1311–13, 2006, Proceedings
| volume = 4168
| year = 2006}}</ref>| isbn = 978-3-540-38875-3
}}</ref>
The GS algorithm is non-truthful for the women (the reviewing side): each woman may be able to misrepresent her preferences and get a better match.
 
== Rural hospitals theorem ==
{{mainMain|Rural hospitals theorem}}
The rural hospitals theorem concerns a more general variant of the stable matching problem, like that applying in the problem of matching doctors to positions at hospitals, differing in the following ways from the basic {{mvar|n}}-to-{{mvar|n}} form of the stable marriage problem:
* Each participant may only be willing to be matched to a subset of the participants on the other side of the matching.
* The participants on one side of the matching (the hospitals) may have a numerical capacity, specifying the number of doctors they are willing to hire.
* The total number of participants on one side might not equal the total capacity to which they are to be matched on the other side.
* The resulting matching might not match all of the participants.
In this case, the condition of stability is that no unmatched pair prefer each other to their situation in the matching (whether that situation is another partner or being unmatched). With this condition, a stable matching will still exist, and can still be found by the Gale–Shapley algorithm.
 
Line 142 ⟶ 143:
* Any hospital that has some empty positions in some stable matching, receives exactly the same set of doctors in ''all'' stable matchings.
 
== Related problems ==
In '''[[stable matching with indifference]]''', some men might be indifferent between two or more women and vice versa.
 
Line 155 ⟶ 156:
The '''matching with contracts''' problem is a generalization of matching problem, in which participants can be matched with different terms of contracts.<ref>{{cite journal |first1=John William |last1=Hatfield |first2=Paul |last2=Milgrom |title=Matching with Contracts |journal=[[American Economic Review]] |volume=95 |issue=4 |year=2005 |pages=913–935 |jstor=4132699 |doi=10.1257/0002828054825466}}</ref> An important special case of contracts is matching with flexible wages.<ref>{{cite journal |first1=Vincent |last1=Crawford |first2=Elsie Marie |last2=Knoer |title=Job Matching with Heterogeneous Firms and Workers |year=1981 |journal=[[Econometrica]] |volume=49 |issue=2 |pages=437–450 |jstor=1913320 |doi=10.2307/1913320}}</ref>
 
== See also ==
* [[Matching (graph theory)]] – matching between different vertices of the graph; usually unrelated to preference-ordering.
 
* [[Envy-free matching]] – a relaxation of stable matching for many-to-one matching problems
*[[Matching (graph theory)]] – matching between different vertices of the graph; usually unrelated to preference-ordering.
* [[Envy-freeRainbow matching]] – a relaxation of stable matching for many-to-oneedge matchingcolored problemsgraphs
* [[RainbowStable matching polytope]] for edge colored graphs
* [[Lattice of stable matchings]]
*[[Stable matching polytope]]
* [[Secretary problem]] (also called '''marriage problem''') – deciding when to stop to obtain the best reward in a sequence of options
*[[Lattice of stable matchings]]
*[[Secretary problem]] (also called '''marriage problem''') – deciding when to stop to obtain the best reward in a sequence of options
 
==References==