Python wrapper for dynSIS Fortran simulations
Project description
Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks: SIS-OGA
This code is part of the article "Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks" [ArXiv].
Fortran implementation
Versions
(this) Fortran implementation - for performance
Python implementation - learn and use
NetworkX Python implementation - range of options
GA Fortran implementation - Statistically exact, but NOT optimized
Citation
Full bibliographic details: Computer Physics Communications 219C (2017) pp. 303-312
DOI information: 10.1016/j.cpc.2017.06.007
@article{COTA2017303,
title = "Optimized Gillespie algorithms for the simulation of Markovian epidemic processes on large and heterogeneous networks",
journal = "Computer Physics Communications",
volume = "219",
number = "",
pages = "303 - 312",
year = "2017",
note = "",
issn = "0010-4655",
doi = "http://dx.doi.org/10.1016/j.cpc.2017.06.007",
url = "http://www.sciencedirect.com/science/article/pii/S0010465517301893",
author = "Wesley Cota and Silvio C. Ferreira",
keywords = "Complex networks",
keywords = "Markovian epidemic processes",
keywords = "Gillespie algorithm",
abstract = "Numerical simulation of continuous-time Markovian processes is an essential and widely applied tool in the investigation of epidemic spreading on complex networks. Due to the high heterogeneity of the connectivity structure through which epidemic is transmitted, efficient and accurate implementations of generic epidemic processes are not trivial and deviations from statistically exact prescriptions can lead to uncontrolled biases. Based on the Gillespie algorithm (GA), in which only steps that change the state are considered, we develop numerical recipes and describe their computer implementations for statistically exact and computationally efficient simulations of generic Markovian epidemic processes aiming at highly heterogeneous and large networks. The central point of the recipes investigated here is to include phantom processes, that do not change the states but do count for time increments. We compare the efficiencies for the susceptible–infected–susceptible, contact process and susceptible–infected–recovered models, that are particular cases of a generic model considered here. We numerically confirm that the simulation outcomes of the optimized algorithms are statistically indistinguishable from the original GA and can be several orders of magnitude more efficient."
}
Synopsis
This code is a implementation of the SIS-OGA (Optimized Gillespie Algorithm), as detailed in our paper. It receives as input a network file, containing a list of edges and read, via terminal, the dynamical parameters.
Dataset input
You need to provide a file containing the list of edges (in and out, two collumns). ID of the vertices must be enumerated sequentially as 1, 2, 3,..., N, where N is the total number of vertices of the network. Here, we assume undirected and unweighted networks without multiple neither self connections.
Consider, for example, a network with N=5 vertices represented by:
1,2
1,3
2,4
2,5
3,4
Examples of datasets and their specifications are available at https://wcota.me/dynSISdatasets.
Installation
In Linux and OSX, it is simple: just type make in the terminal in the *.f90 directory. If you need debugging, use make c=1.
For Windows, however, you must compile all mod*.f90 files and the program code dynamics.f90. An example is:
gfortran mod_read_tools.f90 mod_random.f90 mod_netdata.f90 dynamics.f90 -o dynamics
Use
If you want to manually input the dynamical parameters, just type:
./dynamics <edges_file> <output_file>
where <output_file> will be written with the average density of infected vertices versus time.
Alternatively, use (Linux):
bash run.sh <edges_file> <output_file> <number of samples> <infection rate lambda> <maximum time steps> <fraction of infected vertices (initial condition)>
Example:
bash run.sh edges/s01.edges.dat "s01.lb0.002_100-samples.dat" 100 0.002 1000000 0.5
License
This code is under GNU General Public License v3.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dynsis-2.0.0.tar.gz.
File metadata
- Download URL: dynsis-2.0.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d03677a30dc993f4ddca8febe233b8004e9472ff7c6ed235cf5f11fc2befffa4
|
|
| MD5 |
05e148c402d8060bdc76b153c9382102
|
|
| BLAKE2b-256 |
e44e2c9c6071ec10e1ffa5c9819f1aca203209b356139d802e8c75ca9b3ca392
|
Provenance
The following attestation bundles were made for dynsis-2.0.0.tar.gz:
Publisher:
python-publish.yml on wcota/dynSIS_new
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dynsis-2.0.0.tar.gz -
Subject digest:
d03677a30dc993f4ddca8febe233b8004e9472ff7c6ed235cf5f11fc2befffa4 - Sigstore transparency entry: 990830328
- Sigstore integration time:
-
Permalink:
wcota/dynSIS_new@bc202de5c02004f6f98ba8d820b3c6b4f24f94bd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wcota
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bc202de5c02004f6f98ba8d820b3c6b4f24f94bd -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dynsis-2.0.0-py3-none-any.whl.
File metadata
- Download URL: dynsis-2.0.0-py3-none-any.whl
- Upload date:
- Size: 844.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c35949b26c56fd02decaf5fed016bbb2a61d5d847b8621cf1a8809dd5834f7c
|
|
| MD5 |
597a63f49139ea19374e9da03e61100d
|
|
| BLAKE2b-256 |
452839dc981ad3f0e54553eb008d9eaf1ee6d2cc27f44c8e481865f1be13b26e
|
Provenance
The following attestation bundles were made for dynsis-2.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on wcota/dynSIS_new
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dynsis-2.0.0-py3-none-any.whl -
Subject digest:
1c35949b26c56fd02decaf5fed016bbb2a61d5d847b8621cf1a8809dd5834f7c - Sigstore transparency entry: 990830341
- Sigstore integration time:
-
Permalink:
wcota/dynSIS_new@bc202de5c02004f6f98ba8d820b3c6b4f24f94bd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wcota
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bc202de5c02004f6f98ba8d820b3c6b4f24f94bd -
Trigger Event:
workflow_dispatch
-
Statement type: