CyNetDiff
- Documentation: https://eliotwrobson.github.io/CyNetDiff/
- Examples: https://eliotwrobson.github.io/CyNetDiff/examples/preliminaries/
- Benchmarks:
Network diffusion processes aim to model the spread of trends through social networks, represented using graphs. Experimental work with these models usually involves simulating these processes many times over large graphs, which can be computationally very expensive. To address this, CyNetDiff is a Cython module implementing the independent cascade and linear threshold models. Development has been focused on performance, while still giving an intuitive, high-level interface to assist in research tasks. To learn more about these specific models, read this book chapter or the preliminaries page in the documentation.
Quick Start
Installation
pip install cynetdiff
Note: The installation includes a build step that requires having a C++ complier installed.
Basic Usage
We can run models over graphs we define, using pre-defined weighting schemes. Here is a simple example:
import random
import networkx as nx
from cynetdiff.utils import networkx_to_ic_model
# Randomly generate the graph
n = 1_000
p = 0.05
graph = nx.fast_gnp_random_graph(n, p)
# Randomly choose seed nodes
k = 10
nodes = list(graph.nodes)
seeds = random.sample(nodes, k)
# Set the activation probability uniformly and set seeds
model, _ = networkx_to_ic_model(graph, activation_prob=0.2)
model.set_seeds(seeds)
# Run a single diffusion process until completion
model.advance_until_completion()
# Get the number of nodes activated
model.get_num_activated_nodes()
The output from the last line is the number of nodes activated in a single
simulation of the model. To get the average number of activated nodes
across n_sim = 1_000 simulations, we can replace the last line in the
above with the following:
n_sim = 1_000
total = 0.0
for _ in range(n_sim):
# Resetting the model doesn't change the initial seed set used.
model.reset_model()
model.advance_until_completion()
total += model.get_num_activated_nodes()
avg = total / n_sim
Advanced Usage
See the documentation.
Citation
If you use this code in your research, please use the following citation:
@article{DBLP:journals/pvldb/RobsonRU24,
author = {Eilot W. Robson and
Dhemath Reddy and
Abhishek Kumar Umrawal},
title = {CyNetDiff: {A} Python Library for Accelerated Implementation of Network
Diffusion Models},
journal = {Proc. {VLDB} Endow.},
volume = {17},
number = {12},
pages = {4409--4412},
year = {2024},
url = {https://www.vldb.org/pvldb/vol17/p4409-umrawal.pdf},
timestamp = {Thu, 19 Sep 2024 13:09:38 +0200},
biburl = {https://dblp.org/rec/journals/pvldb/RobsonRU24.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
Project Status
This project is still considered in a beta stage of development. As such, the API could still change to facilitate easier community adoption.
All feedback is greatly appreciated!
Contributing
Contributions are always welcome! Take a look at the contributing guide.
Metadata
Release files for cynetdiff 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cynetdiff-0.1.18.tar.gz | 127.1 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 13.7 MB
Release files / cynetdiff-0.1.18.tar.gz
| Download URL | cynetdiff-0.1.18.tar.gz |
|---|---|
| Size | 127.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a28f1c78ff6cb28a5c11401eb7d73281adb08aff1c330268ee2b99735cf2a967
|
|
BLAKE2b-256 checksum How to use checksums |
14ba495faf426851011334056fd3b9b1764f3dd316761e21aeaf460c7c76da6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
58545d478fa2b94b8d9224a7a99c0dfb637682687d7ec628fb196eb9fc100536
|
|
BLAKE2b-256 checksum How to use checksums |
3ed23fb6758ae783fe7205aaa4913f716de258368565a033e75fc5253a6bdc74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-musllinux_1_2_i686.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
a92a00ce83f4fc70b61fbb75401e0b6af0e203604083168a9eb8dec13e30e06b
|
|
BLAKE2b-256 checksum How to use checksums |
4c3deaaccf8edaefb598be4a3a6cf86e4b375ccedc2f294a380a71d07a710c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 206.3 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ebc531b9788fdf0e7dcc3db95f254154401efac40fb82a4f4a39ff0defbb48cf
|
|
BLAKE2b-256 checksum How to use checksums |
cf179b2887f554304d05bf1549692f9f14a58708e196c33d918d7b6fad293db4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 213.4 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
4dbe7aa889d7166e27e48191210e59cf29179e0388fe506cee4b16340e99bad8
|
|
BLAKE2b-256 checksum How to use checksums |
ee6823a2d472920f07a32158b9fb7a9c0cd407dac64cf4b49c654cd7668ef4b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 163.3 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0582b134c3a72f58be07082ac2f4872ff6e29a352e8bfea1975a3ea8bfec8809
|
|
BLAKE2b-256 checksum How to use checksums |
c9f10a86d256d407f9df26c3e43649c637378203b0e3b976602833871b109655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 178.4 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
7741a20c6d8ce14b3a5fdc22c42970732f4712ab1e1642dbb9719e8067c06ceb
|
|
BLAKE2b-256 checksum How to use checksums |
deede21b1ac0108f601df174fc5341cf75de1f82a7b49db01408410d86c22fa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
2c4f5b419cb1f150dfb2e6d413ad487ab16736bcde9d7567f56453d5749a6c0e
|
|
BLAKE2b-256 checksum How to use checksums |
26e47f8e145413659b694ace155ef0fe33428f955f2c9607f91e0af009ca6b65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-musllinux_1_2_i686.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
149c9c9a299904d05c2be8e9651a8a87b25cffe279454c35ee5368a2dc322547
|
|
BLAKE2b-256 checksum How to use checksums |
13419cc1bef60a72ab4c5b1e5681dc2649f52d2c4c24042ec58ee1c6e02d41d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 206.7 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
3e00581800234384658a24996ee5e5585906bd3b529a275cc3eb00956452c351
|
|
BLAKE2b-256 checksum How to use checksums |
3f222241515284c05e9940c9d92f8ab08ad5d3263c275f1e112d4ab44c8c109a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 212.0 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
5cc4518f1dbbe6265e0ca4c5020cebffd6af8436c8ee3498f8af5cb742ae4841
|
|
BLAKE2b-256 checksum How to use checksums |
04103125008bae24ff9c094ecb673d1d43714ad326924130a352b0118df85138
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 164.4 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7aea56594e583c00317b2ce8c37033337bd7a6546b904530f5259e2621ecfa18
|
|
BLAKE2b-256 checksum How to use checksums |
3ef27d232d0ab4e2d5e6be930c6ec286faae2199c9e37988a124b9af2173d6b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 179.8 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
1169f879416f11ecee6b22113e0b25b90d1c51df3d854969245d5c397462de90
|
|
BLAKE2b-256 checksum How to use checksums |
c7302a145687e02ae1f2276ff90a5332cca8d2f111a2c6961598ee7f150c9567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9d54435c33fccc7b01a2a8e15b416cb874fe6b09bf06e4493798bd0a0ff065b
|
|
BLAKE2b-256 checksum How to use checksums |
1715b4fdb92b20f924bc70ecd43e9dd01de31ef1457feb86092f62d9fd2f3039
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-musllinux_1_2_i686.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
62282d739f52aa35c11cf00905cc062fbc4b2b02b8e09df258f4710e6e610796
|
|
BLAKE2b-256 checksum How to use checksums |
1558e039b63fcf7f6bbb9fb12c5764801a5d58d15245f0af839adb2552273d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 214.9 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8c6d7bc059b50d832710997d9362b482870247af0acf35b26366cce5b013907a
|
|
BLAKE2b-256 checksum How to use checksums |
57a6ca02d1afde8c61fc95319cde1869bbbd22fe4932b6a974c375bdbe486970
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 219.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
5c53c36878b44b3a1a1422f0d814b36ff308b67f1b72bd98c579564a5d91eaca
|
|
BLAKE2b-256 checksum How to use checksums |
84252cc7bbdbd414594c31308d8d389c3838df22535533fca41c9670ec5e4073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 165.0 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5c00346dc79d7b070f630d1eacd9871a9238e12fae8e032ff3e180aedcf3ee73
|
|
BLAKE2b-256 checksum How to use checksums |
07f6056da25d08c2d15129dcdd326b656479c5941da105d6fcdc9e9fc1875f11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 178.8 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
6cd893d1ec214af1af1aabfa2699deb9cf8caca045a5d2dc169a277c35fd8502
|
|
BLAKE2b-256 checksum How to use checksums |
ee5e36e8251fce08bcb6ebbea9efcce2816296e5776a13f0cba5ab143fd94df8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
d13651ed93bd4908a38316a035b56557ef47226b82f6f091ec00eb6f2c28eade
|
|
BLAKE2b-256 checksum How to use checksums |
93373169fcd027227ba61aff5836bd4e19f8e2fd8ab95eaedb7072cb6d7e1887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-musllinux_1_2_i686.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-musllinux_1_2_i686.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-32 |
|
SHA-256 checksum How to use checksums |
7b887540bf144e7e351c3edd18d00c3bcc45d655d6693cf5bb347f061db93a4c
|
|
BLAKE2b-256 checksum How to use checksums |
1a456203238bc42c3e36ec78898c9ade29e3462fb19525da89ca6e69ec2030d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 214.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
7771a11d6fbaa7c28f018d97dfe2a69fa5333407dda6b1453e26c9985b6d4b95
|
|
BLAKE2b-256 checksum How to use checksums |
5e5994bd86ba5b4d6c16e9f5f3ef4d1f495aa764fac4718d780d23d4032f339d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 220.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
84f9ecd7a8b629f9b1b120a25586a1e74f839a46dfeb4a9359962fdfa9d9b43a
|
|
BLAKE2b-256 checksum How to use checksums |
35212caaa40783004781dde338cf50ad7896d0131eb076dba2ef1322b200954b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 164.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
208e4744f948ab57ba2f5d71229085973723082b3f26d4b9a770941a484841c6
|
|
BLAKE2b-256 checksum How to use checksums |
451d16c686abf0539797ddba9e10bba1b6c40d97cb6bc02d0e5454b178c9be9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / cynetdiff-0.1.18-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | cynetdiff-0.1.18-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 177.9 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
8a7daacf510bee21bf38f221e4c35c644aa509118ac0b7c42ef405093b2b5ffa
|
|
BLAKE2b-256 checksum How to use checksums |
cbc6b9a594faf3f3f0cbf7d6c5e597d4106a7afe7cd38a7bf9f1622e3c2d30e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for cynetdiff 0.1.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.