Skip to content
Circular Gaussian Random grAph Model
C++ Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


CiGRAM - Circular Gaussian Random gRAph Model

Build Status PyPI Supported versions

CiGRAM is a method for generating large complex networks with heterogeneous properties observed in real-world networks such as heavy tailed node degree distributions, assortative connectivity and community structure. Currently the model only supports unweighted, undirected graphs.

For a demonstration and brief definition of some of the features of cigram at glance please see the web visualisation developed with help from Paweł Widera at from the School of Computing Science at Newcastle University:

This work was developed as part of a PhD. If using this work in publications please cite the PhD thesis which also includes a comprehensive description of the network, its features and some applications (Chapters 4-5).

Gilbert, J. P. "A probabilistic model for the evaluation of module extraction algorithms in complex biological networks." PhD disseration., University of Nottingham, 2015.

Bibtex entry:

  title={A probabilistic model for the evaluation of module extraction algorithms in complex biological networks},
  author={Gilbert, JP},
  school={University of Nottingham}

This library also includes Lancichinetti–Fortunato–Radicchi (LFR) binary benchmark graphs. Future versions

Please read the docs:


Requires a C++ complier, libboost and python (versions 2.7, 3.5, 3.6 tested).

Install libbosst from

Should work with libboost version 1.58 to 1.66. Note that the libboost version in ubuntu 16.04 repositories (1.55) does not work.

Clone repository and use pip (virtualenv is suggested):

pip install cigram

Alternatively, the package developed here can be installed by cloning the git repository and running the command:

python install


The current version of the model can be used to generate graphs with the wrapper to the C++ model

To generate a random model with 1000 nodes, average degree of 5 split in to 5 communities

import cigram
graph, vertex_positions, community_memberships = cigram.cigram_graph(1000, 5, 5)

graph is a networkx model, vertex_positions is a dict of vertex positions by node id, and community memberships is a dict of vertex memberships of each cluster.

You can’t perform that action at this time.