pyhrtc
pyhrtc is a Python module to inspect various types of stable matching problems. In particular, it can handle the Hospital-Residents problem with both Ties and Couples, also known as HRTC. Having no couples reduces this to the Hospital-Residents problem with Ties, HRT, and by letting all hospitals have capacity 1 we get the Stable Marriage with Ties and Incomplete Lists problem, SMTI.
Features
This package can currently
- read instance files in multiple formats,
- write instance files,
- inspect agents (residents and hospitals),
- combine some pairs of agents into couples,
- find maximum size matchings,
- find maximum size and maximum weight stable matchings.
Status
File formats
This package supports a number of file formats. For these, we will talk about the set of "left" and "right" agents. These are the two bi-partitions of the agents, such that agents on the left may only express preferences for agents on the right, and vice-versa.
The Glasgow format
This format used by researchers working at the University of Glasgow, or their collaborators.
The first line should just be a zero (0). The next two lines contain the number of agents in the left and right partitions respectively. Following this, we have one line for each agent on the left, and then one line for each agent on the right. These are as follows:
For agents on the left, first the line contains an identifier (numeric only), and then the preferences. Preferences within brackets indicate a tie.
For agents on the right, first the line contains an identifier (numeric only), and then the agent's capacity, and then the preferences. Preferences within brackets indicate a tie.
SMTI-GRP
A CSV file containing a row-column matrix, with the first row and columns used as identifiers, can be read in to create an instance of SMTI-GRP.
There is also a second format for SMTI-GRP, which does not have headings. This file contains, as its first two lines, the number of rows and columns respectively. The rest of the file is the matrix of scores, separated by spaces only.
Future plans
This mostly started as a tool to inspect instances of HRTC for various parameters, but it is growing. One day I might even write up a model that would solve HRTC, but that day is not today.
Can I help?
Yes! If you want to add features, or request features, please just raise an issue. I can't promise anything, but it's good to know what people want.
Metadata
Release files for pyhrtc 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyhrtc-0.0.13.tar.gz | 389.3 kB | Without provenance | Details for pyhrtc-0.0.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyhrtc-0.0.13-py3-none-any.whl | Python 3 | none | any | Details for pyhrtc-0.0.13-py3-none-any.whl |
Total release size: 438.9 kB
Release files / pyhrtc-0.0.13.tar.gz
| Download URL | pyhrtc-0.0.13.tar.gz |
|---|---|
| Size | 389.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3f26a37829b5e16ddb83d20de733909d8aeafd74c0f2cb259fae99d504f6461
|
|
BLAKE2b-256 checksum How to use checksums |
18440196598a1768dd0b8bce172b478d96224e3d9a985c2c7f9c4e93b58df82f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / pyhrtc-0.0.13-py3-none-any.whl
| Download URL | pyhrtc-0.0.13-py3-none-any.whl |
|---|---|
| Size | 49.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cd3753860566bcae5120904af772a22b554e4b9b44c34127d7ff92c220d4d37
|
|
BLAKE2b-256 checksum How to use checksums |
beb60d924dbccedabf78e948dd529f291235f9f584f9810585a2255e76493c71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for pyhrtc 0.0.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.