Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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>

Release files for grinpy 19.7a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grinpy 19.7a0
File Size Uploaded
grinpy-19.7a0.tar.gz 27.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grinpy 19.7a0
File Interpreter ABI Platform
grinpy-19.7a0-py3-none-any.whl Python 3 none any Details

Total release size: 73.3 kB

Release files / grinpy-19.7a0.tar.gz

Download URL grinpy-19.7a0.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
90f287a1fd4e569591e2c1b3ab8d2785bd930bdb9b5cc0ae6bf9b541093cadab
BLAKE2b-256 checksum
How to use checksums
48c48cd84a17b5a5c5617c271e61330683009d690ae16d56d2ef5063c35ce87f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / grinpy-19.7a0-py3-none-any.whl

Download URL grinpy-19.7a0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a2425e372eb239a9d302d2d47e35555b03a044d7d589172e0d69474a5c69a1a
BLAKE2b-256 checksum
How to use checksums
aaf359151fec5ecc98d9a9cada303bc61f34e23fe93db02514d0830104f61df5
Upload date
Uploaded using Trusted Publishing?
What is 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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page