Version 2.2.7 of graph-tool released!

This version includes several bugfixes, and a slight modification of the binning semantics of the various histogram functions, so that it corresponds to the numpy  histogram function. Get it in the download section.

graph

Welcome to graph-tool!

graph-tool is an efficient  python module for manipulation and statistical analysis of  graphs. With graph-tool you can do the following:

  • Easily create directed or undirected graphs and manipulate them in an arbitrary fashion, using the convenience and expressiveness of the python language!
  • Associate arbitrary information to the vertices, edges or even the graph itself, by means of property maps.
  • Filter vertices and/edges edges "on the fly", such that they appear to have been removed from the graph, but can be easily recovered.
  • Instantaneously reverse the edge direction of directed graphs, and easily transform directed graphs into undirected, and vice-versa.
  • Save and load your graphs from files using the graphml and dot file formats, which provide interoperability with other software. You can also pickle your graphs at will!
  • Conveniently draw your graphs, using a variety of algorithms and output formats (including to the screen). graph-tool works as a very comfortable interface to the excellent graphviz package.
  • Collect all sorts of statistics: degree/property histogram, combined degree/property histogram, vertex-vertex correlations, assortativity, average vertex-vertex shortest distance, etc.
  • Run several topological algorithms on your graphs, such as isomorphism, minimum spanning tree, connected components, dominator tree, maximum flow, etc.
  • Generate random graphs, with arbitrary degree distribution and degree correlation.
  • Calculate clustering coefficients, motif statistics, communities, centrality measures, etc.
  • Ad-hoc compilation and execution of C++ code, for efficient implementation of throw-away code for specific projects.
  • And probably more stuff I'm forgetting...

graph-tool is fast!

Despite its nice, soft outer appearance of a regular python module, the core algorithms and data structures of graph-tool are written in C++, making use of the  Boost Graph Library and  template metaprogramming, with performance in mind. Most of the time, you can expect the algorithms to run just as fast as if graph-tool were a pure C++ library.

graph-tool is fully documented!

Every single function in the module is documented in the docstrings and in the online documentation, which is full of examples.

Getting started

You should probably start by the quick start guide, which gives a short overview of the basic features, with some usage examples.

Downloading it

You can get it from the download page. From there you can grab the latest release.

Problems and bugs

See the support page for instructions on how to submit bugs or ask for help.

Related software

See the related software list, for some information of other software out there which is somehow related to graph-tool.

Authorship and license

graph-tool was written by  Tiago de Paula Peixoto and is free software, released under the  GPL.