Skip to main content

Logo

blossalg

CI Status Test Coverage Code style: black

blossalg is a Python implementation of the Edmonds algorithm for constructing maximum matchings on graphs. For more information on how the Edmonds algorithm works see the Wikipedia page.

Installation

You can install blossalg from PyPI:

pip install blossalg

blossalg is supported on Python 2.7 and Python 3.8.

Usage

You can run blossalg as follows:

blossalg infile.csv [outfile.txt]

The input file infile.csv contains information on the number of nodes and the neighbours of each node. This information is stored using a series of comma-delimited binary-valued strings. Nodes are identified by different rows and columns and a value of 1 indicates a node neighbour. By convention a node cannot be a neighbour with itself.

For example, the input file of a three node graph where both node 0 and node 2 are neighbours of node 1 would look as follows:

0,1,0
1,0,1
0,1,0

Given an input file, blossalg will compute the maximum matching using the Edmonds blossom algorithm. The total number of matched nodes will then be output to screen.

If an output file outfile.txt is supplied the matched pairs from the maximal matching will be saved to the file. The format of the output is as follows. Each node and its matched node will be stored as node_number: matched_node_number. The node number will correspond to the node number from the input file (e.g. row 1 in the input file will represent node 0 in the output file). Each matched pair in the output file will be separated by a newline. By convention, unmatched nodes are not included in the outfile.

Release files for blossalg 1.1.0

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

Source distribution (sdist)

Source distribution for blossalg 1.1.0
File Size Uploaded
blossalg-1.1.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blossalg 1.1.0
File Interpreter ABI Platform
blossalg-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / blossalg-1.1.0.tar.gz

Download URL blossalg-1.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
65c2dd9b084659a20f338552eeea7dc0226a58b6bfc4e5a3e91475d6ad7ec77d
BLAKE2b-256 checksum
How to use checksums
a6fb1f10980b40f10ee62c22532ca737828b9992b8ad28fc29390cd737d2a903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release files / blossalg-1.1.0-py3-none-any.whl

Download URL blossalg-1.1.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e74d6f5865fe8f35096ee5797ee3ece6389f1974319134f0e82cecec34507f6e
BLAKE2b-256 checksum
How to use checksums
34de422d7e98676e5ff4ec8c9fecd56c1873cea57de7dee3e360b58d34217118
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

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