this library provides support to construct graphs and their coloring graphs. a coloring graph is a metagraph representing all the valid colorings of a graph. each vertex of a coloring graph represents a coloring of the base graph.
Project description
coloring-graphs
a coloring graphs library written in C++ for speedy computation and wrapped in Python for ease of development and extension!
what
this library provides support to construct graphs and their coloring graphs. a coloring graph is a metagraph representing all the valid colorings of a graph. each vertex of a coloring graph represents a coloring of the base graph.
in this project, we represent a coloring as an integer, which, when converted to base k (for a k-coloring), represents the vertex-wise colors [0,k).
the library is under development being written using Python and C/C++.
for documentation, feel free to take a look inside libcolgraph/
and read the docstrings.
for examples, see the files in test/
.
for questions, reach out.
usage
-
as a module
plot a BaseGraph, its ColoringGraph, and the Meta ColoringGraph generated by Tarjans. you would need to have a graph formatted in an adjacency matrix file. opens plots in new browser windows.
basic usage:
python3 -m libcolgraph [PATH_TO_FILE] [-k COLORS]
options:
usage: python3 -m libcolgraph [-h] [-k COLORS] [-v] [--no-bg] [--no-cg] [--no-mbg] [--no-mcg] INPUT_GRAPH positional arguments: INPUT_GRAPH read in BaseGraph from adjacency matrix file optional arguments: -h, --help show this help message and exit -k COLORS, --colors COLORS number of colors to use to create ColoringGraph -v, --verbosity set output verbosity --no-bg hide BaseGraph? --no-cg hide ColoringGraph? --no-mbg hide meta BaseGraph? --no-mcg hide meta ColoringGraph?
-
as a library
import libcolgraph bg = libcolgraph.BaseGraph() bg.load_txt('./in/hexmod.in') cg = bg.build_coloring_graph(4) print('bg {} led to a cg {}'.format(bg, cg)) for v in cg.get_vertices(): # do something pass
example output
installation
-
for installation from source refer to detailed install instructions
-
python3 -m pip install libcolgraph [--user] [--upgrade]
things to note:
- currently a binary wheel is available only for
manylinux
distributions e.g. centOS, Debian family, RedHat family, etc. - if your distribution is not
manylinux
-supported, then pip will need to compile locally usingswig
andsetuptools
. in that case, make sure you havesetuptools
and swig installed, as they will be needed for compilation. - in the future we will release wheels for MacOS as well. these
might not be as frequently maintained, however, so your best
bet would be to compile locally using
swig
.
- currently a binary wheel is available only for
contribute
help
full documentation coming soon
who
Coloring Graphs lab, University of Richmond. Multiple contributors. (C) 2017-2019
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for libcolgraph-0.0.2.post1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01bbb11100c50c0301fbbd91a1a1137f9e3422d67a728e12a785effdf5b6e750 |
|
MD5 | 55c0dfe4dbbfaae05a46edb43fbb688f |
|
BLAKE2b-256 | 20306efec5d88331551d04b433be6f088e8901f500d8a1e8440137384a1afea2 |