Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Build statuscodecov

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 1.0.0rc6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyhrtc 1.0.0rc6
File Size Uploaded Provenance Actions
pyhrtc-1.0.0rc6.tar.gz 368.2 kB Without provenance Details for pyhrtc-1.0.0rc6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyhrtc 1.0.0rc6
File Interpreter ABI Platform Actions
pyhrtc-1.0.0rc6-py3-none-any.whl Python 3 none any Details for pyhrtc-1.0.0rc6-py3-none-any.whl

Total release size: 407.0 kB

Release files / pyhrtc-1.0.0rc6.tar.gz

Download URL pyhrtc-1.0.0rc6.tar.gz
Size 368.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ccfffa6a8d6e87c3ae57493ba8df6434ac774f75e74461b1e588edf5e04a959f
BLAKE2b-256 checksum
How to use checksums
6e735e1f70650806aa192a1ef7e6d860deb81ff9b196106a2e4dfccd19033465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / pyhrtc-1.0.0rc6-py3-none-any.whl

Download URL pyhrtc-1.0.0rc6-py3-none-any.whl
Size 38.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5ed3ee7c6e0947cb25ec8237a24adb7566ae1b7f497140b796131156dd7d9b2
BLAKE2b-256 checksum
How to use checksums
c5bf73f57640b4e5b8394f4a0ea2adcbe12def715ffd9f856b964db74a3e0bfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for pyhrtc 1.0.0rc6

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page