This is the JSON API for kep_solver, a Python package for finding optimal sets of transplants within kidney exchange programmes. This API models the objectives as used by the national UK KEP — the UK Living Kidney Sharing Scheme — which is run by NHS Blood and Transplant. This site demonstrates its usage, but the Python package is self-sufficient, far more flexible, and more suited to larger-scale experimentation.

This endpoint can be accessed with a HTTP POST request with Content-Type set to application/x-www-form-urlencoded (also known as a HTTP POST form request), and with one mandatory key-value pair and two optional key-value pairs. The three pairs are:

  • data: a string representation of the JSON containing the instance to solve
  • max_cycle_length: (optional) the maximum number of recipients in a cycle
  • max_chain_length: (optional) the maximum number of recipients in a chain
Note that max_chain_length can be at most 2, and max_cycle_length can be at most 3, as the UKLKSS objectives are not well-defined for longer cycles or chains.

As an example, one can download a sample JSON file from , and then using HTTPie one can run the following command to solve the instance: http --form data=@sample-1.json max_cycle_length=3 max_chain_length=2

Descriptions of both input and output formats can be found at .

This software is currently in active development. If you wish to see further objectives added (or you wish to use this software to model some particular set of objectives) please get in touch via the repository at kep_solver or email William Pettersson, the current maintainer of this software.