kpd_opt is a tool for finding optimal matching between donors and recipients in kidney paired donation. It is an implementation of the algorithms described in the paper "Finding long chains in kidney exchange using the traveling salesman problem" by Anderson et al. (2015). It takes as input a compatibility graph where each node represents an incompatible donor-recipient pair or a non-directed donor and each edge represents donor-recipient compability. It outputs cycles and chains of exchanges.
- Install Julia and GLPK
- Install the Julia packages to deal with graphs:
pkg> add LightGraphs
pkg> add LightGraphsFlows
pkg> add LightGraphsMatching
- Install the Julia packages to interface with GLPK:
pkg> add GLPK
pkg> add GLPKMathProgInterface
- Install the latest version of JuMP (from github) to solve with callbacks:
pkg> add https://github.com/JuliaOpt/JuMP.jl
- Run from terminal:
julia main.jl <input path> <output path> <formulation>
The formulation may be
basic
for the recursive formulationpctsp
to use the PC-TSP formulationparallel
to run both in parallel processes
See the example input and output files in /examples.
- Install Python 3 and GLPK
- Install the following packages:
- numpy: Scientific library, used to work with the weight matrices.
- lap: Fast C++ implementation of the Jonker-Volgenant algorithm to solve the assignment problem, used by the fallback formulation.
- python-igraph: Fast C/C++ library to work with graphs, used to work with in/out-neighbors, solve the maximum matching problem and the minimum cut subproblems.
- glpk: Python interface to GLPK solver, used to solve the MIPs with callbacks.
pip install numpy
pip install lap
pip install python-igraph
pip install glpk
- Run from terminal:
python main.py <input path> <output path> <formulation>
The formulation may be
basic
for the recursive formulationpctsp
to use the PC-TSP formulationfallback
to use the combinatorial matching formulation if applicable (unbounded cycles and chains, or 2-cycles and no chains)parallel
to run all in parallel processes
You can select the solver in constants.py. GLPK, Cbc, Gurobi, and CPLEX are supported.
See the example input and output files in /examples.
Itai Ashlagi, Lilia Chang, Sukolsak Sakshuwong, Felipe Subiabre