top trading cycle

Top trading cycle (TTC) is an algorithm for trading indivisible items without using money. It was developed by David Gale and published by Herbert Scarf and Lloyd Shapley.{{cite journal|doi=10.1016/0304-4068(74)90033-0|title=On cores and indivisibility|journal=Journal of Mathematical Economics|volume=1|pages=23–37|year=1974|last1=Shapley|first1=Lloyd|last2=Scarf|first2=Herbert|s2cid=154744803}}{{rp|30–31}}

Housing market

The basic TTC algorithm is illustrated by the following house allocation problem. There are n students living in the student dormitories. Each student lives in a single house. Each student has a preference relation on the houses, and some students prefer the houses assigned to other students. This may lead to mutually-beneficial exchanges. For example, if student 1 prefers the house allocated to student 2 and vice versa, both of them will benefit by exchanging their houses. The goal is to find a core-stable allocation – a re-allocation of houses to students, such that all mutually-beneficial exchanges have been realized (i.e., no group of students can together improve their situation by exchanging their houses).

The algorithm works as follows.

  1. Ask each agent to indicate his "top" (most preferred) house.
  2. Draw an arrow from each agent i to the agent, denoted \operatorname{Top}(i), who holds the top house of i.
  3. Note that there must be at least one cycle in the graph (this might be a cycle of length 1, if some agent i currently holds his own top house). Implement the trade indicated by this cycle (i.e., reallocate each house to the agent pointing to it), and remove all the involved agents from the graph.
  4. If there are remaining agents, go back to step 1.

The algorithm must terminate, since in each iteration we remove at least one agent. It can be proved that this algorithm leads to a core-stable allocation.

For example,{{Cite Moulin 2004}}{{rp|223–224}} suppose the agents' preference ordering is as follows (where only the at most 4 top choices are relevant):

class="wikitable"
Agent:123456
1st choice:333212
2nd choice:251534
3rd choice:46. . .625
4th choice:1. . .. . .4. . .6
. . .. . .. . .. . .. . .. . .. . .

In the first iteration, the only top-trading-cycle is {3} (it is a cycle of length 1), so agent 3 keeps his current house and leaves the market.

In the second iteration, agent 1's top house is 2 (since house 3 is unavailable). Similarly, agent 2's top house is 5 and agent 5's top house is 1. Hence, {1,2,5} is a top-trading-cycle. It is implemented: agent 1 gets house 2, agent 2 gets house 5 and agent 5 gets house 1. These three agents leave the market.

In the third iteration, the top-trading-cycle {4,6} is, so agents 4 and 6 exchange their houses. There are no more agents left, so the game is over. The final allocation is:

class="wikitable"
Agent:123456
House:253614

This allocation is core-stable, since no coalition can improve its situation by mutual exchange.

The same algorithm can be used in other situations, for example: suppose there are 7 doctors that are assigned to night-shifts; each doctor is assigned to a night-shift in one day of the week. Some doctors prefer the shifts given to other doctors. The TTC algorithm can be used here to attain a maximal mutually-beneficial exchange.

Properties

TTC is a truthful mechanism. This was proved by Alvin Roth.{{Cite journal|date=1982-01-01|title=Incentive compatibility in a market with indivisible goods|journal=Economics Letters|language=en|volume=9|issue=2|pages=127–132|doi=10.1016/0165-1765(82)90003-9|issn=0165-1765|last1=Roth|first1=Alvin E.}}

When the preferences are strict (there are no indifferences), TTC always finds a strictly Pareto-efficient allocation. Moreover, it always finds a core-stable allocation. Moreover, with strict preferences, there is a unique core-stable allocation, and it is the one found by TTC.

In the strict preferences domain, TTC is the only mechanism that satisfies Individual rationality, Pareto efficiency and Strategy-proofness.{{Cite journal|last=Ma|first=Jinpeng|date=1994-03-01|title=Strategy-proofness and the strict core in a market with indivisibilities|url=https://doi.org/10.1007/BF01242849|journal=International Journal of Game Theory|language=en|volume=23|issue=1|pages=75–83|doi=10.1007/BF01242849|s2cid=36253188|issn=1432-1270}}{{Cite journal|last=Anno|first=Hidekazu|date=2015-01-01|title=A short proof for the characterization of the core in housing markets|url=https://www.sciencedirect.com/science/article/pii/S0165176514004388|journal=Economics Letters|language=en|volume=126|pages=66–67|doi=10.1016/j.econlet.2014.11.019|issn=0165-1765}}

Preferences with indifferences

The original TTC algorithm assumed that the preferences are strict, so that each agent always has a single top house. In realistic settings, agents may be indifferent between houses, and an agent may have two or more top houses. Several different algorithms have been suggested for this setting.{{Cite journal|last1=Alcalde-Unzu|first1=Jorge|last2=Molis|first2=Elena|date=2011-09-01|title=Exchange of indivisible goods and indifferences: The Top Trading Absorbing Sets mechanisms|url=https://www.sciencedirect.com/science/article/pii/S0899825610001971|journal=Games and Economic Behavior|language=en|volume=73|issue=1|pages=1–16|doi=10.1016/j.geb.2010.12.005|hdl=2454/18593|issn=0899-8256|hdl-access=free}}{{Cite journal|last1=Jaramillo|first1=Paula|last2=Manjunath|first2=Vikram|date=2012-09-01|title=The difference indifference makes in strategy-proof allocation of objects|url=https://www.sciencedirect.com/science/article/pii/S0022053112000713|journal=Journal of Economic Theory|language=en|volume=147|issue=5|pages=1913–1946|doi=10.1016/j.jet.2012.05.017|issn=0022-0531}} They were later generalized in several ways.{{Cite journal|last1=Aziz|first1=Haris|last2=Keijzer|first2=Bart de|date=2012|title=Housing Markets with Indifferences: A Tale of Two Mechanisms|url=https://ojs.aaai.org/index.php/AAAI/article/view/8239|journal=Proceedings of the AAAI Conference on Artificial Intelligence|language=en|volume=26|issue=1|pages=1249–1255|doi=10.1609/aaai.v26i1.8239 |s2cid=15395473 |issn=2374-3468|doi-access=free}}{{Cite book|last1=Saban|first1=Daniela|last2=Sethuraman|first2=Jay|title=Proceedings of the fourteenth ACM conference on Electronic commerce |chapter=House allocation with indifferences |date=2013-06-16|chapter-url=https://doi.org/10.1145/2492002.2482574|series=EC '13|location=New York, NY, USA|publisher=Association for Computing Machinery|pages=803–820|doi=10.1145/2492002.2482574|isbn=978-1-4503-1962-1}}[https://web.archive.org/web/20211219104050/http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.392.8872&rep=rep1&type=pdf Unknown] The general scheme is as follows.

  1. Ask each agent to indicate all his top houses.
  2. Construct the TTC-graph G: a directed graph in which each agent points to all agents who hold his top houses.
  3. Repeat:
  4. * Analyze the strongly connected components of G.
  5. * Identify the sinks - the components with no outgoing edges (there is at least one).
  6. * Identify the terminal sinks - the sinks in which each agent owns one of his top choices.
  7. ** If there are no terminal sinks - break and go to step 4.
  8. ** Otherwise, for each terminal sink S: permanently assign each agent in S to his current house, remove them from the market, update the TTC graph, and go back to step 3.
  9. Select a set of disjoint trading cycles, using a pre-determined selection rule. Implement the trade indicated by these cycles, and remove them from the market.
  10. If there are remaining agents, go back to step 1.

The mechanisms differ in the selection rule used in Step 4. The selection rule should satisfy several conditions:

  • Uniqueness: the rule selects, for each agent, a unique house from among his top houses.
  • Termination: the algorithm using the rule is guaranteed to terminate.
  • Persistence: in the reduced graph obtained by the rule, each directed path ending at an unsatisfied agent i (an agent who does not hold a top house) is persistent - the path remains in the graph until agent i leaves the market or trades his house.
  • Independence of unsatisfied agents: if agent i is unsatisfied, and two TTC graphs only differ in the edges outgoing from i, then the reduced TTC graphs only differ in the edge outgoing from i.

If the selection rule satisfies Uniqueness and Termination, the resulting mechanism yields an allocation that is Pareto-efficient and in the weak core (no subset of agents can get a strictly better house for all of them by trading among themselves). Weak core also implies that it is individually-rational. If, in addition, the selection rule satisfies Persistence, Independence of unsatisfied agents, and some other technical conditions, the resulting mechanism is strategyproof.

A particular selection rule that satisfies these conditions is the Highest Priority Object (HPO) rule. It assumes a pre-determined priority-ordering on the houses. It works as follows.

  • (a) Every unsatisfied agent points to the owner of the highest-priority house among his top houses. All unsatisfied agents are labeled.
  • (b) From the unlabeled agents, consider the ones that have a top house owned by a labeled agent. Among them, pick the agent i who owns the highest-priority house. Make i point to a highest-priority house owned by a labeled agent. Label agent i.
  • (c) If there are unlabeled agents, go back to (b).

When the rule terminates, each all agents are labeled, and every labeled agent has a unique outgoing edge. The rule guarantees that, at each iteration, all cycles contain at least one unsatisfied agent. Therefore, in each iteration, at least one new agent becomes satisfied. Therefore, the algorithm ends after at most n iterations. The run-time of each iteration is O(n \log{n} + n \gamma), where \gamma is the maximum size of an indifference class. Therefore, the total run-time is O(n^2 \log{n} + n^2 \gamma).

Other extensions

The TTC algorithm has been extended in various ways.

1. A setting in which, in addition to students already living in houses, there are also new students without a house, and vacant houses without a student.{{cite journal|doi=10.1006/jeth.1999.2553|title=House Allocation with Existing Tenants|journal=Journal of Economic Theory|volume=88|issue=2|pages=233–260|year=1999|last1=Abdulkadiroğlu|first1=Atila|last2=Sönmez|first2=Tayfun|doi-access=free}}. See also [http://www18.in.tum.de/files/brandt-teaching/2013_ec/talks/5%20-%20Vortrag_kurz_Katharina.pdf Presentation by Katharina Schaar].

2. The school choice setting.{{Cite journal|doi=10.1257/000282803322157061|title=School Choice: A Mechanism Design Approach|journal=American Economic Review|volume=93|issue=3|pages=729–747|year=2003|last1=Abdulkadiroğlu|first1=Atila|last2=Sönmez|first2=Tayfun|hdl=10161/2090|s2cid=15609227 |url=https://dukespace.lib.duke.edu/dspace/bitstream/10161/2090/1/fulltext.pdf|hdl-access=free}} The New Orleans Recovery School District adopted school choice version of TTC in 2012.{{cite news |last=Vanacore |first=Andres |date=April 16, 2012 |title=Centralized enrollment in Recovery School District gets first tryout |url=http://www.nola.com/education/index.ssf/2012/04/centralized_enrollment_in_reco.html |newspaper=The Times-Picayune|location=New Orleans |access-date= April 4, 2016}}

3. The kidney exchange setting: Top Trading Cycles and Chains (TTCC).{{Cite journal|doi=10.1162/0033553041382157|title=Kidney Exchange|year=2004|journal=Quarterly Journal of Economics|volume=119|issue=2|pages=457–488|last1=Roth|first1=Alvin|last2=Sönmez|first2=Tayfun|last3=Unver|first3=M. Utku|url=http://nrs.harvard.edu/urn-3:HUL.InstRepos:2580565}}

Implementation in software packages

  • R: The Top-Trading-Cycles algorithm for the housing market problem is implemented as part of the matchingMarkets package.{{cite journal |first=T. |last=Klein |year=2015 |title=Analysis of Stable Matchings in R: Package matchingMarkets |journal=Vignette to R Package MatchingMarkets |url=http://cran.at.r-project.org/web/packages/matchingMarkets/vignettes/matching.pdf }}{{cite web |title=matchingMarkets: Analysis of Stable Matchings |work=R Project |date= 12 January 2020|url=http://cran.at.r-project.org/web/packages/matchingMarkets/index.html }}
  • API: The MatchingTools API provides a free application programming interface for the Top-Trading-Cycles algorithm.{{cite web |title=MatchingTools API |url=https://matchingtools.com }}

See also

References