A package for fast numerical computation of the structural diversity index of arbitrary networks
Project description
Structural diveristy index
This repository contains code for fast numerical computation of the structural diversity index
Contents
The repository contains four python scripts: MeetingTimesUI, RandomWalkSimulatorCUDA, RandomWalkSimulator and MeetingTimeEstimator Here is a brief description:
- MeetingTimeUI provides a user interface for the scripts
- RandomWalkSimulator computes the meeting time of a random walk on a graph.
- RandomWalkSimulatorCUDA computes the meeting time of random walks on a graph using CUDA and GPUs (much faster for large graphs). It requires Cudatoolkit to run.
- MeetingTimeEstimator is a class that makes educated guesses of the meeting times of two walks which have not met, based on the meeting times of walks which have met.
Each script is described in detail in the documentation provided here. If you are interested in a quick start tutorial see the section Tutorial below.
Installation
The scripts are provided in the form of a python package called structural_diversity_index. To install the package and its dependencies type into the terminal
pip install structural_diversity_index==0.0.5
This will install the 0.0.5 version (latest) of the package in your python packages directory.
WARNING: Installing the package via pip will allow NOT you to use the scripts that run computations on GPUs. See below for details of how to run the scripts computing on GPUs.
Installation for GPUs
If you are not interested in running computations on GPUs you can ignore this section.
Installing the structural_diversity_index package via pip does not enable you to run computations on GPUs. The reason is that the Cudatoolkit cannot be installed by pip (because it is not a python package).
To circumvent this issue one can use a package installer such as conda. Once you have installed conda on your computer, download the file environment.yml from the GitHub. In the terminal, go to the directory containing the environment.yml file you downloaded and type:
conda env create -f environment.yml
This will create a conda environment called sd_index and install all the dependencies necessary to computations on GPUs. Now you can set on_cuda=True (see Examples.ipynb in GitHub) and computations will run on GPUs.
Tutorial
The Jupyter notebook Example.ipynb (available here) contains a detailed tutorial explaining how to use the package structural_diversity_index.
Extending the code
If you are interested in extending, modifying or simply playing around with the code, I have created a detailed documentation with ReadTheDocs which is available here. Have fun!
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
Built Distribution
Hashes for structural_diversity_index-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37249845824e9d22939b046724c94d54fcdc2f47a7d1b160c45a5ccc78069455 |
|
MD5 | 4d0c7bdaeef41a809990584b16db70b4 |
|
BLAKE2b-256 | e6d47c4c5bae1a10f46c732e0a21e1950b6a2ca4c5086cae9539181986ef7864 |
Hashes for structural_diversity_index-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12b4c7ca8857761e014e52f1006f3bcbfc5ee08fd851c75158176e8521eca303 |
|
MD5 | 518033b33d1358f56da55131c91e8564 |
|
BLAKE2b-256 | f367e8f50c22164a9d54d06dc5250146ff2f258f3b719562a82cdd0c0415f235 |