This is a simple python wrapper around https://github.com/TCS-Meiji/PACE2017-TrackA# (meiji treewidth solver from PACE 2017), based on jpype. The original implementation of the solver is in java. The algorithm is described in https://arxiv.org/abs/1704.05286.
Installation instructions
pip install pymeiji
Usage
def meiji_solver(edge_list):
"""
Exact computation of the treewidth of a graph.
Python-wrapper around the PACE 2017 meiji solver,
which was originally written in java,
and whose details are described in
https://arxiv.org/abs/1704.05286
Parameters
----------
edge_list: list of tuples of integers
list of edges of the graph. Each edge must
be a tuple of 2 integers (u,v).
The integers should range from 0 to
the number of vertices in the graph - 1.
Returns
-------
(treewidth, bags, bag_adj)
A tuple consisting of three objects. The first is an integer equal
to the treewidth. The second is a python dictionary associating
integers (bag index) to lists of integers (bag content). The
third is also a dictionary, associating integers (bag index)
to lists of integers (indices of the neighbors of that bag
in the tree decomposition).
"""
>>> from pymeiji import meiji_solver
>>> meiji_solver([(0,1),(1,2),(2,3),(0,3)])
(2, {1: [0, 1, 3], 2: [1, 2, 3]}, {1: [2], 2: [1]})
Metadata
Release files for pymeiji 1.0.1
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 |
|---|---|---|---|---|
| pymeiji-1.0.1.tar.gz | 73.1 kB | Without provenance | Details for pymeiji-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymeiji-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pymeiji-1.0.1-py3-none-any.whl |
Total release size: 145.0 kB
Release files / pymeiji-1.0.1.tar.gz
| Download URL | pymeiji-1.0.1.tar.gz |
|---|---|
| Size | 73.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de3363405cf1a863e48ad85b13a0e03616ff6a1eaf029b6cff3950d7ee6ca992
|
|
BLAKE2b-256 checksum How to use checksums |
5330b934db258df02d00d8b970df15f57c66bc0579e447378e68a6c20c1e6f14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pymeiji-1.0.1-py3-none-any.whl
| Download URL | pymeiji-1.0.1-py3-none-any.whl |
|---|---|
| Size | 71.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d09409bfc310f710a76545d5adba9b1920bb9684e346b3a6d1c3c4c268c7377
|
|
BLAKE2b-256 checksum How to use checksums |
468fe78d630bdf6286b0e9efbdad22eca0bfa8874e1ec985169e750bcdf9e4f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for pymeiji 1.0.1
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.