Skip to main content

Generalised Configuration Model random graphs in Python

Project description

gcmpy_animation.gif

gcmpy: Generalised Configuration Model random graphs in Python

https://badge.fury.io/py/gcmpy.svg https://readthedocs.org/projects/peterstandrews-gcmpy/badge/?version=latest https://github.com/PeterStAndrews/gcmpy/actions/workflows/ci.yml/badge.svg https://static.pepy.tech/personalized-badge/gcmpy?period=total&units=international_system&left_color=black&right_color=green&left_text=Downloads

Overview

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.

Installation

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
python setup.py install

The unit tests can be discovered from the project root using

python3 -m unittest discover -v -s test/ -p 'test_*.py'

Documentation

API documentation for gcmpy is available on ReadTheDocs

Author and license

Copyright (c) 2021, Peter Mann <pm78@st-andrews.ac.uk>

Licensed under the GNU General Public License v2 or later (GPLv2+).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcmpy-0.2.24.tar.gz (38.3 kB view details)

Uploaded Source

File details

Details for the file gcmpy-0.2.24.tar.gz.

File metadata

  • Download URL: gcmpy-0.2.24.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for gcmpy-0.2.24.tar.gz
Algorithm Hash digest
SHA256 33feee9da2dc0d8b5cac692fcdf6956af32a7ca517ee9d01d8a5480c9e400a91
MD5 e36c9f07c0da3884af35809487b8ce9d
BLAKE2b-256 ca817ca5bbb4e91dc628266256db37cd0d13c3e0166c1c08133ed0b89bce232e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page