PGL provides a set of C++ objects and Python scripts to analyze, manipulate and simulate the structure of graphs (or complex networks).
Except for a few exceptions, every objects provided by the PGL are written in standard C++. They are provided via self-contained header files making them easily integrable into any C++ project (can be included similarly to any header-only libraries such as Boost or the STL).
The development of this library was motivated by the need of a fast, lightweight and customizable code, which was easy to install and straightforward to deploy on supercomputing facilities whose softwares are not always up-to-date.
At the beginning of this project, none of the existing high-quality libraries such as graph-tool, NetworkX or igraph fulfilled the aforementionned requirements.
I therefore decided to start writing my own code, adding new features following the needs of my research. This is a work in progress; comments, suggestions, contributions and bug reports are welcome.
- A C++11 (or newer) compliant compiler
- Python 3.x
Clone this reporsitory using the --recurse-submodules
option (see Git documentation), for example:
git clone --recurse-submodules https://github.com/antoineallard/a-portable-graph-library.git
and then
- copy the required header file (
<sub-module>/src/<class object>.hpp
) file in your project directory. - add
#include <class object>.hpp
to your C++ code
- copy the required script file (
<sub-module>/src/<script file>.hpp
) file in your project directory. - add
import <script file>
to your Python script
There is no extensive documentation. However we provide several tutorials in the form of C++ codes and Jupyter notebooks to illustrate how to use the PGL. Codes validating several functionalities of the PGL provide additional examples and are located in most sub-module's validation/
sub-directory.
directed_graph
: Provides functions to compute and extract various structural properties of simple unweighted directed graphs without self-loops.
-
geometric_Sd_model
: Generates random geometric graphs according to the S^D model. -
l-cloning
Generates an undirected edgelist using the L-cloning algorithm.
percolation_on_graph
: Provides functions to efficiently simulate bond percolation on simple unweighted undirected graphs without self-loops.
Most sub-modules of the PGL import graphs using an edgelist format (see each sub-module for details). A compatible edgelist file can be generated from NetworkX
via
networkx.write_edgelist(your_graph_object, filename_of_edgelist, delimiter=' ', data=False)