Giter Club home page Giter Club logo

equitable-coloring's Introduction

Overview

Update: This is now merged into networkx package (via networkx/#3127). See networkx.algorithms.coloring.equitable_color.

docs Documentation Status
tests
Travis-CI Build Status
Coverage Status
package
PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

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

https://equitable-coloring.readthedocs.io/

Development

To run the all tests run:

pip install pytest-cov  # Needed the first time.
python setup.py test

Or, you can use tox.

equitable-coloring's People

Contributors

musically-ut avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.