Skip to main content

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

structural_diversity_index-0.0.6.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structural_diversity_index-0.0.6-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file structural_diversity_index-0.0.6.tar.gz.

File metadata

File hashes

Hashes for structural_diversity_index-0.0.6.tar.gz
Algorithm Hash digest
SHA256 3e9979cb83b89c41a4ad6cf9bb53d78c49476587a901b001165eb2d58a8c5ded
MD5 2603c6aa271523adb978e3cf412dfa1e
BLAKE2b-256 ef420f1dfab12bd6f0361acfa68002b1345a955400223ac8b97abfb5fad0736c

See more details on using hashes here.

File details

Details for the file structural_diversity_index-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for structural_diversity_index-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d2fd36808ad32766b831ab291b7f3a0f839fadf4495d575bb2a6782073b9352d
MD5 d7491c38bfe1722c239e5b453ab8b571
BLAKE2b-256 5b48ec531fa132ad8a1b670e6e3f297252b7fbeb5dbf44d281050e98323e6ef4

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