Giter Club home page Giter Club logo

grinpy's Introduction

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 <[email protected]>
Randy Davila <[email protected]>

grinpy's People

Contributors

somacdivad 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.