Overview
Equitable coloring for networkX graphs.
From Wikipedia:
In graph theory [..] an equitable coloring is an assignment of colors to the vertices of an undirected graph, in such a way that
No two adjacent vertices have the same color, and
The numbers of vertices in any two color classes differ by at most one.
Kierstead et. al. have provided a fast polynomial time algorithm for uncovering an equitable coloring using r + 1 colors for a graph with maximum degree r. This package is an implementation of the algorithm for networkX graphs.
Free software: MIT license
Installation
pip install equitable-coloring
Usage
To use equitable-coloring:
>>> import networkx as nx >>> from equitable_coloring import equitable_color >>> from equitable_coloring.utils import is_equitable >>> G = nx.cycle_graph(4) >>> d = equitable_color(G, num_colors=3) >>> is_equitable(G, d) True
Documentation
Development
To run the all tests run:
pip install pytest-cov # Needed the first time. python setup.py test
Or, you can use tox.
Changelog
0.1.2 (2018-06-30)
Update README and usage instructions.
0.1.1 (2018-06-30)
Initial version with tests.
0.1.0 (2018-06-11)
First commit.
Metadata
Release files for equitable-coloring 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| equitable_coloring-0.1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / equitable_coloring-0.1.2-py2.py3-none-any.whl
| Download URL | equitable_coloring-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 15.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0573cde9e529a0ebd841a7c3f40bd901f78f60792497dfbf08bf98d5720e033a
|
|
BLAKE2b-256 checksum How to use checksums |
57ccca3099b2871d445a941f1bd8ba6a4373872d94313692ccb8ea3461db7d63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for equitable-coloring 0.1.2
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.