Graph-tool is an efficient Python module for manipulation and statistical analysis of graphs (a.k.a. networks) with computationally expensive routines implemented in C++. It claims to be substantially faster than NetworkX.

User instructions

graph-tool is available via the modules system. To add it to your environment run:

$ module load graph-tool/2.22

There is comprehensive documentation on the graph-tool website.


GNU General Public License 3.

Admin notes

I installed the following packages to meet the dependency requirements (including optional features): libsparsehash-dev, libcgal-dev, libboost-graph-dev, libboost-python-dev, libboost-iostreams-dev, libcairomm-1.0-dev, python-cairo-dev. I then compiled it for both python2 and 3 using:

mkdir build-2.22-python2
cd build-2.22-python2
PYTHON=python ../graph-tool-2.22/configure --prefix=/common/debian/9.1/PythonPackages/python/2.7/graph-tool/graph-tool-2.22 --with-python-module-path=/common/debian/9.1/PythonPackages/python/2.7/graph-tool/graph-tool-2.22/lib/python2.7/site-packages --enable-openmp
make &> make.log &
make install

cd ..; mkdir build-2.22-python3
cd build-2.22-python3
PYTHON=python3 ../graph-tool-2.22/configure --prefix=/common/debian/9.1/PythonPackages/python/3.5/graph-tool/graph-tool-2.22 --with-python-module-path=/common/debian/9.1/PythonPackages/python/3.5/graph-tool/graph-tool-2.22/lib/python3.5/site-packages --enable-openmp
make &> make.log &
make install

Note the use of --with-python-module-path to ensure the python module ends up in /common. Using --prefix by itself is not enough!