A package for stable matching problems with couples
Project description
Scarf
Scarf is a python library for solving stable matching problems with couples, where one application is the National Resident Matching Program. The package is named after Hebert Scarf, the inventor of Scarf's lemma and algorithm.
Features
- Written in python3.
- Solve for a near feasible stable matching given the preference of doctors and hospitals, and hospital capacities.
- Generate random doctor hospital instances.
- Accelerated with Numba. It is fast!
Accepted input format:
- Python Lists
- JSON
Algorithms:
- Scarf's algorithm with Iterative Rounding [Nguyen and Vohra 2016]
Usage
import scarf
single_pref = [[0, 1, 2],
[1, 0]]
couple_pref = [[(0, 0), (1, 1), (1, 0), (0, 1), (2, 2)],
[(1, 1), (2, 2), (1, -1)]]
hospital_pref = [0, (0, 1), 1, (1, 0), (0, 0), (1, 1)]
hospital_cap = [2, 3, 1]
S = scarf.create_instance(single_pref, couple_pref, hospital_pref, hospital_cap)
sol = scarf.solve(S)
Support
License
Released under MIT license
Copyright (c) 2019 Dengwang Tang <dwtang@umich.edu>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scarfmatch-0.0.1.tar.gz
(16.2 kB
view hashes)
Built Distribution
scarfmatch-0.0.1-py3-none-any.whl
(18.7 kB
view hashes)
Close
Hashes for scarfmatch-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b71df1d9a5a5f606a8cc121ca9e3abb9aebcb35f49e7642f7b44e75f2f51bd7 |
|
MD5 | 507a0334424c89ca469a826174feb9c1 |
|
BLAKE2b-256 | 27adc0f25e0533b939c485604602115e6357af4dc615d645d97d46e3aa884494 |