Top Trading Cycle Algorithm

Published by Mario Oettler on

The top trading cycle algorithm (TTCA) is a mechanism to improve the allocation of assets among a group of people. It can be a means in negotiations to reach a consensus about the utility transfer. The TTCA applies to exchange the assets in rounds to maximize the total welfare.

The TTCA is a truthful mechanism. This means the best strategy is to truthfully state its preferences.

Algorithm

There are N children. Each got a random present. Since the allocation is randomly, some kids are not very happy with their present while others got their favorite gift.

Step 1: Each child points to the child who’s present it would like to have instead of its own present. It is possible to point at oneself if there is no better present available.

Step 2: Now, we create a directed graph. Children are nodes, and the pointing is the edges. In this graph, we look for a directed circle.

Step 3: Presents are exchanged in the opposite direction of the circle. Nodes that participated in a circle are removed from the algorithm.

Then continue with step 1. Continue until all children are removed from the algorithm.

Numerical Example of the TTCA

First round:

Child1234567
1st choice1345312
2nd choice3551776
3rd choice4633133
4th choice6214541
5th choice5122625
6th choice27
7th choice74

The graph looks like that:

The directed circles are marked yellow.

Child 1 prefers its own present over all other presents and “exchanges” this with itself. Children 3, 4, and 5 form a circle. They exchange presents in the opposite direction of the arrows. Child 4 gives the present to child 3, child 5 gives its present to child 4, and child three gives the present to child 5.

Children 1, 3, 4, and 5 are removed from the algorithm. We continue with the second round.

Second round:

Child 2   67
1st choice 6   76
2nd choice 2   33
3rd choice 1   41
4th choice 7   25
5th choice 4   
6th choice     
7th choice       

Children 6 and 7 are removed from the algorithm. We continue with round three.

Third round:

Child 2     
1st choice 2     
2nd choice 1     
3rd choice 7     
4th choice 4     
5th choice       
6th choice       
7th choice       

The circle looks like that:

Result:

  • Child 1 receives its own present.
  • Child 2 receives its own present.
  • Child 3 receives the present of child 4.
  • Child 4 receives the present of child 5.
  • Child 5 receives the present of child 3.
  • Child 6 receives the present of child 7.
  • Child 7 receives the present of child 6.
Categories:

if()