Graph Analysis

A Python graph analysis package. This package strongly builds on top of graph_io for the handling of graph objects and NumPy for the math part.


This package will be deprecated in favor of RaGraph (migration docs).

Graph Analysis features a set of domains, each with its own subpackage. The currently covered domains are:

  • Bus detection: Detecting bus nodes in graphs, also called “hubs” or “integrative components”. See graph_analysis.bus.

  • Clustering: Detecting (nested) clusters of nodes in graphs that are relatively tightly connected. Both hierarchical and flat clustering algorithms are provided in the graph_analysis.cluster subpackage.

  • Sequencing: Searching for sequences of nodes according to different algorithms using the graph_analysis.sequence subpackage. There are several metrics from literature available to grade sequences as well.

  • Heuristics: Useful combinations of algorithms available in the other subpackages are included in graph_analysis.heuristics.

Typically used functionality for each subpackage is directly included at the subpackage’s top-level. This means, that for some analysis step, we typically import the subpackage (like sequence below) and work from there:

from graph_io import Graph, Node
from graph_analysis import sequence

nodes = [Node("b"), Node("a")]
seq =  # seq = [Node("a"), Node("b")].

Developer guide


This project uses semantic versioning. Version increments are checked using Raver.

Python packaging information

This project is packaged using flit. Packaging information as well as dependencies are stored in pyproject.toml.

Installing the project and its dependencies can be done using raver install.

Building the project (creating a wheel) can be done using raver build.


The tests need to be put in the tests/ directory and can be run using raver test on both Windows and Linux as long as Raver and its dependencies pytest and pytest-cov are installed in the active Python environment. Running pytest in the tests directory works as well.


Building the documentation (in HTML) can be done using raver docs. The documentation is then built locally at doc/build using sphinx.