Skip to main content

Graph invariants in Python.

Project description

CircleCI Documentation Status BCH compliance codecov Code style: black PyPI version

GrinPy

A NetworkX extension for calculating graph invariants.

What is it?

GrinPy is an extension for NetworkX used for calculating graph invariants of simple graphs.

NP-hard invariants included are:

  • Chromatic number
  • Clique number
  • Independence number
  • Domination number
  • Total domination number
  • Connected domination number
  • Independent domination number
  • Power domination number
  • Zero forcing number
  • Total zero forcing number
  • Connected zero forcing number
  • Minimum maximal matching number
  • Generalized k versions of almost all of the above invariants

Other invariants included are:

  • Annihilation number
  • Matching number
  • Residue
  • Slater number
  • Sub-k-domination number
  • Topological indices, like the Randić and Zagreb indices

In addition to the graph invariants listed above, we have included some simple checks for structural properties of a graph:

  • is_triangle_free
  • is_bull_free
  • is_claw_free

How do I use it?

Full documentation is available at https://grinpy.rtfd.io.

You can install GrinPy from the command line with pip:

pip install grinpy

Here is a sample of how to calculate the independence number:

>>> import grinpy as gp
>>> G = gp.petersen_graph()
>>> gp.independence_number(G)
4

GrinPy automatically imports NetworkX and provides all of the NetworkX classes and methods in the same interface.

Why does it exist?

The motivation for this project is to filter a database of graphs into an ordered tree of subsets. This database will be used in an experimental automated conjecturing program. In creating the required packages for this database, we realized that a Python package for calculating graph invariants would be useful for professional research and for graph theory education.

License

Released under the 3-Clause BSD license (see LICENSE.txt):

Copyright (C) 2017-2019 GrinPy Developers
David Amos <somacdivad@gmail.com>
Randy Davila <davilar@uhd.edu>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grinpy-19.7a0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

grinpy-19.7a0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file grinpy-19.7a0.tar.gz.

File metadata

  • Download URL: grinpy-19.7a0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for grinpy-19.7a0.tar.gz
Algorithm Hash digest
SHA256 90f287a1fd4e569591e2c1b3ab8d2785bd930bdb9b5cc0ae6bf9b541093cadab
MD5 e2372d9a4c9f37f7f23406cf761a8bc0
BLAKE2b-256 48c48cd84a17b5a5c5617c271e61330683009d690ae16d56d2ef5063c35ce87f

See more details on using hashes here.

File details

Details for the file grinpy-19.7a0-py3-none-any.whl.

File metadata

  • Download URL: grinpy-19.7a0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for grinpy-19.7a0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2425e372eb239a9d302d2d47e35555b03a044d7d589172e0d69474a5c69a1a
MD5 377160c692cb2de0ce2a6d0a82dd4777
BLAKE2b-256 aaf359151fec5ecc98d9a9cada303bc61f34e23fe93db02514d0830104f61df5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page