Metadata-Version: 2.4
Name: graphreveal
Version: 1.2.0
Summary: Small graphs database and search system
Project-URL: Changelog, https://github.com/mdbrnowski/GraphReveal/releases
Project-URL: Source, https://github.com/mdbrnowski/GraphReveal
Author-email: Michał Dobranowski <mdbrnowski@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: database,graph-theory,graphs
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Requires-Dist: antlr4-python3-runtime>=4.13.2
Requires-Dist: networkx>=3.4.2
Requires-Dist: platformdirs>=4.3.6
Requires-Dist: rich>=13.9.4
Requires-Dist: typer>=0.17.4
Description-Content-Type: text/markdown

# GraphReveal

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/graphreveal)](https://pypi.org/project/graphreveal/)
[![PyPI - Version](https://img.shields.io/pypi/v/graphreveal)](https://pypi.org/project/graphreveal/)
[![Test](https://github.com/mdbrnowski/GraphReveal/actions/workflows/test.yml/badge.svg)](https://github.com/mdbrnowski/GraphReveal/actions/workflows/test.yml)

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:

```shell
pip install graphreveal
```

## Basic usage

Firstly, you should create the database:

```shell
graphreveal create-database
```

This process should take less than two seconds and will create a database of graphs with an order no greater than 7. To use a larger database, add the `--n 8` or `--n 9` flag to this command (it should take no more than half an hour).

### Some examples

```shell
graphreveal search "10 edges, bipartite, no isolated vertices, 2 components"
```

```shell
graphreveal count "5..6 vertices, connected"
```

```shell
graphreveal count "5 vertices, connected, not (eulerian | planar)"
```

Command `search` will print a list of graphs in [graph6](https://users.cecs.anu.edu.au/~bdm/data/formats.html) format.
You can use [houseofgraphs.org](https://houseofgraphs.org/draw_graph) to visualize them.
Command `count` will simply output the number of specified graphs.

### 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`.
Use `|` for alternatives (disjunction) and parentheses `()` for grouping.
Conjunction (`,` or `;`) binds tighter than `|`.
