*Motivation.* Imagine a situation where $n$ people each have their own house. They would like to exchange houses to be better off. How do we go about doing that?
In this setting we say:

- Preferences are strict (no agent is indifferent about two different items)

def. **Stable allocation** (=“in the *core*”). An allocation $a$ is stable there is no blocking coalition.
A *blocking coalition* for allocation $a$ is a subset of agents who, when trading amongest themselves, achieves a higher utility for at least one agent, and doesn’t reduce the utility of anybody else in the subset.

def. **Top Trading Cycles (TTC)** algorithm.

- Algorithm is in multiple rounds
- Round $k$:
- Agents point to favorite remaining house
- This graph will always have a cycle, because all edges have out-degree 1 (thm)
- Take an arbitrary cycle, and swap houses according to that cycle
- Eliminate these people from the graph

- Repeat

thm. **(TTC is strategy-proof w.r.t. individual agents).** let allocation $A$ be an allocation generated by TTC. Fixing all other agent’s preferences, no one agent can benefit by lying about their preference ordering.
*Proof sketch* by induction

- Round 1: Agents point to favorite house.
- Let those who win in round 1 be $W_{1}$; they don’t lie, because they will win their favorite house if they’re truthful.
- Those who lose, will proceed to the next round…

- Round 2: Agents not in $W_{1}$ (=losers) have not gotten their favorite house; let’s say a loser $ℓ∈W_{2}$ (a round 2 winner) got their $k$-th favorite house as a result of the second round.
- Say $ℓ$ prefers a house from someone in $W_{1}$. $ℓ$ will lie and point to that house to attempt to be included in the cycle.
- However, nobody in $W_{1}$ pointed to our loser. Therefore the loser will not be able to form a cycle, as long as everybody else is truthful.

- Induction until final round (assume round $1..k$ is truthful, then round $k+1$ is truthful. ■

thm. **(TTC is stable).** Allocation $A$ generated by TTC has no blocking coalition.
*Proof by contradiction.* Suppose there was a blocking coalition they are the black dots. We list them by the rounds in which they won in TTC: $W_{1},W_{2},…$

- If there is a blocking coalition of agents separated in two disparate rounds of TTC $i,j$ such that $W_{i},W_{j},i<j$, then the coalition’s alternative trading cycle must have an agent who, in the informal trade, pointed from round $i$ to round $j$. This doesn’t make sense, because they chose their favorite in round $i$ already and won. Thus such a coalition cannot exist.
- It is trivial to see also that a coalition spread across three or more rounds of TTC is impossible.

- If there is a blocking coalition of agents who are all in $W_{k}$, the TTC algorithm already trades amongst them. Thus such a coalition cannot exist.
■
thm.
**(TTC is the only stable algorithm)**let $A$ be allocation by the TTC algorithm. There exists no other allocation $A_{′}$ that is stable. (=TTC is the only allocation in the core.)*Proof by Induction and Contradiction.*Suppose TTC produced allocation $A$. Presume there was an alternative allocation $A_{′}$ that was also stable. Let the agents whose allocation differs between $A$ and $A_{′}$ be $S$, the “switchers”. - Round 1: Let the switchers in $W_{1}$ be $S_{1}⊆W_{1}$. Every switcher $s∈S_{1}$ would gotten switched to an alternative house in a latter round. But since in the TTC $s$ pointed to another agent in $W_{1}$, this is a contradiction. Therefore, no switcher exists in $S_{1}$.
- Round 2: Let the switchers in $W_{2}$ be $S_{2}$. Switcher $s∈S_{2}$ cannot have switched with anybody in $W_{1}$ because there are no switchers in $W_{1}$. (equivalent)
- Induction until final round (assume there are no switchers until round $i$, then any switcher in round $i+1$ must have switched with latter round, but impossible.) ■

## Kidney Exchange

*Motivation.* Let’s think of an alternative situation. A patient needs a kidney, and the patient’s family or friend wants to donate the kidney to them. However the donor’s may not be compatible with the patient. Therefore we need to find other compatible donor(-patient pair) to do a cross-kidney swap.
When there are lots of patient-donor pairs, we need to find a trading cycle with compatible donors. We model the situation such that each patient-donor entity has a compatibility list for all other patient-donor pairs. Think of each patient-donor as one entity.
However, Unlike the swapping housing example above we cannot trade along long cycles because we need to operate on all patients simultaneously which is not feasible. Therefore, we only consider a matching; i.e. a pairs of patient-donors do a cross-kidney swap. This is equvalent an (unpartitioned) *maximum graph matching problem*. Construct an undirected graph:

- All entities point to any subset of compatible entities (obviously not themselves)
- If both entities point to each other, then create an undirected edge. Remove all other directed edges.
def
**Priority Matching.**On an undirected graph $G$: - Randomly fix an ordering of agents.
- let $M_{0}:=$ set of all possible maximum matchings on $G$.
- Obviously, these maximum matchings are of the same degree (=have same number of edge matchings in them)

- For $i=1…n$ for every entity:
- $Z_{i}$ ← subset of $M_{i−1}$ that includes agent $i$ in the matching
- If $Z_{i}=∅$ then $M_{i}$← $M_{i−1}$ (if $i$ cannot be included ever, then ignore $i$)
- If $Z_{i}=∅$ then $M_{i}$ ← $Z_{i}$ (make sure $i$ is included in all subsequent matchings)

- This will result in $M_{n}$. Every matching $m∈M_{n}$ is a matching.

thm. (**PM matchings always match same agents.**) All matchings $M_{n}$ returned by PM matches the same agents.
*Proof Sketch.* Inside the loop:

- If $Z_{i}=∅$ then agent $i$ is not included in any $m$.
- If $Z_{i}=∅$ then agent $i$ is definitely included in all $m$.

thm. **(PM is DSIC)** In PM, all agents will always report all of their compatible partners.
*Proof Sketch.* Reporting a lesser number of edges will only reduce the edges they are connected to, and thus only makes it less possible to be included in a matching.