ttc: Top-Trading-Cycles Algorithm for the house allocation problem

Description Usage Arguments Value Author(s) References Examples

View source: R/ttc.R

Description

Finds the stable matching in the house allocation problem with existing tenants. Uses the Top-Trading-Cycles Algorithm proposed in Abdulkadiroglu and Sonmez (1999).

Usage

1
ttc(P = NULL, X = NULL)

Arguments

P

matrix of individuals' preference rankings (Rank Order Lists) over objects.

X

2-column-matrix of objects (obj) and their owners (ind).

Value

ttc returns a 2-column matrix of the matching solution for the housing market problem based on the Top-Trading-Cycles algorithm.

Author(s)

Thilo Klein

References

Abdulkadiroglu, A. and Sonmez, T. (1999). House Allocation with Existing Tenants. Journal of Economic Theory, 88(2):233–260.

Shapley, L. and H. Scarf (1974). On Cores and Indivisibility. Journal of Mathematical Economics, 1(1):23–37.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## generate matrix of individuals' preference rankings over objects, a.k.a. Rank Order Lists (ROL)
P <- matrix(c(2, 5, 1, 4, 3,  # ROL of individual 1
              1, 5, 4, 3, 2,  # ind 2
              2, 1, 4, 3, 5,  # ind 3
              2, 4, 3,NA,NA,  # ind 4
              4, 3, 1, 2,NA), # ind 5
            byrow=FALSE, nrow=5); P 

## generate 2-column-matrix of objects ('obj') and their owners ('ind')
X <- data.frame(ind=1:5, obj=5:1); X

## find assignment based on TTC algorithm
ttc(P=P,X=X)

matchingMarkets documentation built on May 21, 2017, 12:15 a.m.

Search within the matchingMarkets package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.