Python implementation of Dynamic SpringRank model described in:
-
A model for efficient dynamical ranking in networks
Andrea Della Vecchia, Kibidi Neocosmos, Daniel B. Larremore, Cristopher Moore, and Caterina De Bacco.
Physical Review E, 110, 034310 (2024). -
A preprint is also available.
Dynamic SpringRank is a physics-inspired method for inferring dynamic rankings in directed temporal networks — networks in which each directed and timestamped edge reflects the outcome and timing of a pairwise interaction. It is the natural extension of SpringRank to temporal networks.
src: contains the Python implementation of two versions of Dynamic SpringRank (Online and Offline) as well as SpringRank.data/input: contains synthetic data used to illustrate the functioning of the models. Note: 'static' data in folder refers to data without a meaningful time component (refer to 'The Relevance of Time' section in paper for further details)data/output: location for saved results after running models.
The project was developed in Python 3.8.11 with the packages contained in the requirements.txt. We recommend creating a conda environment and installing the pre-requisite packages with conda create --name DSR --file requirements.txt
The model can be run by executing the run_models.py while in the src directory. The run_models.py script has the following arguments:
--modelselect the model to run--datasetfile name of the synthetic dataset that will be used (excluding file extension)--saveflag that saves the output of the models--verboseflag that prints more details of internal procedures of model as it is running
The model accepts as input a numpy array of shape [T, N, N], where T is the number of timesteps and N is the number of nodes in the network.
The model outputs a Python Tuple containing the evaluations metrics and rankings of the nodes. Note: when the --save flag is called, the output is saved as a Python Dictionary containing the aforementioned results as well as the runtime of the model.