🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More

graphreveal

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphreveal

Small graphs database and search system

0.3.1
Maintainers
1

GraphReveal

PyPI - Python Version PyPI - Version Test

Have you ever needed an example of a graph that, e.g., is Hamiltonian, has exactly 8 vertices, and can be drawn on a plane without intersecting edges? Or wondered how many graphs of size 10 are bipartite, have no isolated vertices, and have exactly two components?

This package aims to answer some of your questions. You can search through all graphs with some reasonable order (currently 9 is the maximum) using a very simple DSL (domain-specific language).

Installation

Make sure that you have Python in a sufficiently recent version. To install the package using pip, you can use the following command:

pip install graphreveal

Basic usage

Firstly, you should create the database:

graphreveal create-database

This process should take less than two seconds and will create a database of graphs with an order no larger than 7. To use a larger database, add --n 8 or --n 9 flag to this command.

Some examples

graphreveal search "10 edges, bipartite, no isolated vertices, 2 components"
graphreveal search --count "5..6 vertices, connected"

Without --count, this command will print a list of graphs in graph6 format. You can use houseofgraphs.org to visualize them.

List of available properties

  • [N] vertices (alternatives: verts,V, nodes)
  • [N] edges (alternative: E)
  • [N] blocks (alternative: biconnected components)
  • [N] components (alternative: C)
  • acyclic (alternative: forest)
  • bipartite
  • complete
  • connected
  • cubic (alternative: trivalent)
  • eulerian (alternative: euler)
  • hamiltonian (alternative: hamilton)
  • no isolated vertices (alternatives: no isolated v, niv)
  • planar
  • regular
  • tree

As [N], you can use a simple number or range (e.g., 3-4, 3..4, < 5, >= 2). You can also negate any property using ! or not.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts