gcmpy
is a Python library that creates random graph models according
to the generalised configuration model (GCM). Random graph models provide
an excellent framework to integrate topology with dynamics. The topology
of a network is crucial to the outcome of a dynamical process, such as an
epidemic, occurring over a network.
To create the networks, gcmpy
creates a joint degree distribution object
through a variety of analytical or empirical methods. Once constructed, this
joint distribution is sampled to obtain a joint degree sequence. The joint
sequence is then used in the GCM algorithm to create a networkx graph. It can
also be used to create an edge list directly, which is significantly faster.
There is also a tools library for obtaining useful quantities from the network as well as converting a joint degree distribution into excess joint degree distributions and vice versa, for example. We also provide an MCMC rewiring algorithm to stochastically rewire a synthetic network's correlations structure to a target joint excess joint degree distributions.
You can install gcmpy
directly from PyPi using pip
:
pip install gcmpy
The master distribution of gcmpy
is hosted on GitHub. To obtain a
copy, just clone the repo:
git clone git@github.com:PeterStAndrews/gcmpy.git
cd gcmpy
pip install .
The unit tests can be discovered from the project root using
python3 -m unittest discover -v -s test/ -p 'test_*.py'
API documentation for gcmpy
is available on ReadTheDocs
Copyright (c) 2021, Peter Mann <pm78@st-andrews.ac.uk>
Licensed under the GNU General Public License v2 or later (GPLv2+).