Name | network-diffusion JSON |
Version |
0.17.0
JSON |
| download |
home_page | None |
Summary | Network Diffusion - a package for simulating spreading phenomena. |
upload_time | 2024-11-07 16:29:13 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.12 |
license | MIT License Copyright (c) 2019- Michał Czuba, Piotr Bródka Copyright (c) 2023 Damian Dąbrowski, Damian Serwata, Radosław Michalski Copyright (c) 2023- Mateusz Nurek, Yu-Xuan Qi, Mingshan Jia, Katarzyna Musial Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
influence maximisation
influence maximization
multilayer networks
networkx
network science
phenomena spreading
simulation
social influence
social networks
spreading
temporal networks
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Network Diffusion - Spreading Models in Networks
[![Licence](https://img.shields.io/github/license/anty-filidor/network_diffusion)](https://opensource.org/license/mit)
[![PyPI version](https://badge.fury.io/py/network-diffusion.svg)](https://badge.fury.io/py/network-diffusion)
![Tests](https://github.com/anty-filidor/network_diffusion/actions/workflows/tests.yml/badge.svg)
![Builds](https://github.com/anty-filidor/network_diffusion/actions/workflows/package-build.yml/badge.svg)
[![Docs](https://readthedocs.org/projects/network-diffusion/badge/?version=latest)](https://network-diffusion.readthedocs.io/en/latest)
[![Codecov](https://codecov.io/gh/anty-filidor/network_diffusion/branch/package-simplification/graph/badge.svg?token=LF52GAD73F)](https://codecov.io/gh/anty-filidor/network_diffusion)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fanty-filidor%2Fnetwork_diffusion.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fanty-filidor%2Fnetwork_diffusion?ref=badge_shield)
This Python library provides a versatile toolkit for simulating diffusion
processes in complex networks. It offers support for various types of models,
including temporal models, multilayer models, and combinations of both.
## Short Example
```python
import network_diffusion as nd
# define the model with its internal parameters
spreading_model = nd.models.MICModel(
seeding_budget=[90, 10, 0], # 95% act suspected, 10% infected, 0% recovered
seed_selector=nd.seeding.RandomSeedSelector(), # pick infected act randomly
protocol="OR", # how to aggregate impulses from the network's layers
probability=0.5, # probability of infection
)
# get the graph - a medium for spreading
network = nd.mln.functions.get_toy_network_piotr()
# perform the simulation that lasts four epochs
simulator = nd.Simulator(model=spreading_model, network=network)
logs = simulator.perform_propagation(n_epochs=3)
# obtain detailed logs for each actor in the form of JSON
raw_logs_json = logs.get_detailed_logs()
# or obtain aggregated logs for each of the network's layer
aggregated_logs_json = logs.get_aggragated_logs()
# or just save a summary of the experiment with all the experiment's details
logs.report(visualisation=True, path="my_experiment")
```
## Key Features
- **Complex Network Simulation**: The library enables users to simulate
diffusion processes in complex networks with ease. Whether you are studying
information spread, disease propagation, or any other diffusion phenomena,
this library has you covered.
- **Temporal Models**: You can work with temporal models, allowing you to
capture the dynamics of processes over time. These temporal models can be
created using regular time windows or leverage
[CogSnet](https://www.researchgate.net/publication/348341904_Social_Networks_through_the_Prism_of_Cognition).
- **Multilayer Networks**: The library supports multilayer networks, which are
essential for modelling real-world systems with interconnected layers of
complexity.
- **Predefined Models**: You have the option to use predefined diffusion models
such as the Linear Threshold Model, Independent Cascade Model, and more.
These models simplify the simulation process, allowing you to focus on your
specific research questions.
- **Custom Models**: Additionally, Network Diffusion allows you to define your
own diffusion models using open interfaces, providing flexibility for
researchers to tailor simulations to their unique requirements.
- **Centrality Measures**: The library provides a wide range of centrality
measures specifically designed for multilayer networks. These measures can be
valuable for selecting influential seed nodes in diffusion processes.
- **NetworkX Compatible**: The package is built on top of NetworkX, ensuring
seamless compatibility with this popular Python library for network analysis.
You can easily integrate it into your existing NetworkX-based workflows.
- **PyTorch representation**: Network Diffusion offers a plausible converter of
the multilayer network to PyTorch sparse representation. That feature can
help in deep-learning experiments utilising complex networks (e.g. GNNs).
## Package Installation
To install the package, run this command: `pip install network_diffusion`.
Please note that we currently support Linux, MacOS, and Windows, but the
package is mostly tested and developed on Unix-based systems.
To contribute, please clone the repo, switch to a new feature branch, and
install the environment:
```bash
conda env create -f env/conda.yml
conda activate network-diffusion
pip install -e .
```
## Documentation
<p align="center"> <b>Reference guide</b> is available <a href="https://network-diffusion.readthedocs.io/en/latest/">here</a>! </p>
Please bear in mind that **this project is still in development**, so the API
usually differs between versions. Nonetheless, the code is documented well, so
we encourage users to explore the repository. Another way to familiarise
yourself with the operating principles of `network_diffusion` are projects
which utilise it:
- Generator of a dataset with actors' spreading potentials - _v0.16.0_ -
[repo](https://github.com/network-science-lab/infmax-simulator-icm-mln)
- Influence max. under LTM in multilayer networks - _v0.14.0 pre-release_ -
[repo](https://github.com/anty-filidor/rank-refined-seeding-bc-infmax-mlnets-ltm)
- Comparison of spreading in various temporal network models - _v0.13.0_ -
[repo](https://github.com/anty-filidor/bdma-experiments)
- Seed selection methods for ICM in multilayer networks - _v0.10.0_ -
[repo](https://github.com/damian4060/Independent_Cascade_Model)
- Modelling coexisting spreading phenomena - _v0.6_ -
[repo](https://github.com/anty-filidor/network_diffusion_examples)
## Citing the Library
If you used the package, please consider citing us:
```bibtex
@article{czuba2024networkdiffusion,
title={Network Diffusion Framework to Simulate Spreading Processes in Complex Networks},
author={
Czuba, Micha{\l} and Nurek, Mateusz and Serwata, Damian and Qi, Yu-Xuan
and Jia, Mingshan and Musial, Katarzyna and Michalski, Rados{\l}aw
and Br{\'o}dka, Piotr
},
journal={Big Data Mining And Analytics},
volume={7},
number={3},
pages={637-654},
year={2024},
publisher={IEEE},
doi = {10.26599/BDMA.2024.9020010},
url={https://doi.org/10.26599/BDMA.2024.9020010},
}
```
Particularly if you used the functionality of simulating coexisting phenomena
in complex networks, please add the following reference:
```bibtex
@inproceedings{czuba2022coexisting,
author={Czuba, Micha\l{} and Br\'{o}dka, Piotr},
booktitle={9th International Conference on Data Science and Advanced Analytics (DSAA)},
title={Simulating Spreading of Multiple Interacting Processes in Complex Networks},
volume={},
number={},
pages={1-10},
year={2022},
month={oct},
publisher={IEEE},
address={Shenzhen, China},
doi={10.1109/DSAA54385.2022.10032425},
url={https://ieeexplore.ieee.org/abstract/document/10032425},
}
```
## Reporting Bugs
Please report bugs on
[this](https://github.com/anty-filidor/network_diffusion/issues) board or by
sending a direct [e-mail](https://github.com/anty-filidor) to the main author.
## About Us
This library is developed and maintained by
[Network Science Lab](https://networks.pwr.edu.pl/) from Politechnika
Wrocławska / Wrocław University of Science and Technology / Technische
Universität Breslau and external partners. For more information and updates,
please visit our [website](https://networks.pwr.edu.pl/) or
[GitHub](https://github.com/network-science-lab) page.
Raw data
{
"_id": null,
"home_page": null,
"name": "network-diffusion",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "influence maximisation, influence maximization, multilayer networks, networkx, network science, phenomena spreading, simulation, social influence, social networks, spreading, temporal networks",
"author": null,
"author_email": "Micha\u0142 Czuba <michal.czuba@pwr.edu.pl>, Piotr Br\u00f3dka <piotr.brodka@pwr.edu.pl>",
"download_url": "https://files.pythonhosted.org/packages/79/0e/9b7f4e8503f4b1fbe423a9107323efa41edc7d85451851e08fd3ecd2ae33/network_diffusion-0.17.0.tar.gz",
"platform": null,
"description": "# Network Diffusion - Spreading Models in Networks\n\n[![Licence](https://img.shields.io/github/license/anty-filidor/network_diffusion)](https://opensource.org/license/mit)\n[![PyPI version](https://badge.fury.io/py/network-diffusion.svg)](https://badge.fury.io/py/network-diffusion)\n\n![Tests](https://github.com/anty-filidor/network_diffusion/actions/workflows/tests.yml/badge.svg)\n![Builds](https://github.com/anty-filidor/network_diffusion/actions/workflows/package-build.yml/badge.svg)\n[![Docs](https://readthedocs.org/projects/network-diffusion/badge/?version=latest)](https://network-diffusion.readthedocs.io/en/latest)\n[![Codecov](https://codecov.io/gh/anty-filidor/network_diffusion/branch/package-simplification/graph/badge.svg?token=LF52GAD73F)](https://codecov.io/gh/anty-filidor/network_diffusion)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fanty-filidor%2Fnetwork_diffusion.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fanty-filidor%2Fnetwork_diffusion?ref=badge_shield)\n\nThis Python library provides a versatile toolkit for simulating diffusion\nprocesses in complex networks. It offers support for various types of models,\nincluding temporal models, multilayer models, and combinations of both.\n\n## Short Example\n\n```python\nimport network_diffusion as nd\n\n# define the model with its internal parameters\nspreading_model = nd.models.MICModel(\n seeding_budget=[90, 10, 0], # 95% act suspected, 10% infected, 0% recovered\n seed_selector=nd.seeding.RandomSeedSelector(), # pick infected act randomly\n protocol=\"OR\", # how to aggregate impulses from the network's layers\n probability=0.5, # probability of infection\n)\n\n# get the graph - a medium for spreading\nnetwork = nd.mln.functions.get_toy_network_piotr()\n\n# perform the simulation that lasts four epochs\nsimulator = nd.Simulator(model=spreading_model, network=network)\nlogs = simulator.perform_propagation(n_epochs=3)\n\n# obtain detailed logs for each actor in the form of JSON\nraw_logs_json = logs.get_detailed_logs()\n\n# or obtain aggregated logs for each of the network's layer\naggregated_logs_json = logs.get_aggragated_logs()\n\n# or just save a summary of the experiment with all the experiment's details\nlogs.report(visualisation=True, path=\"my_experiment\")\n```\n\n## Key Features\n\n- **Complex Network Simulation**: The library enables users to simulate\n diffusion processes in complex networks with ease. Whether you are studying\n information spread, disease propagation, or any other diffusion phenomena,\n this library has you covered.\n\n- **Temporal Models**: You can work with temporal models, allowing you to\n capture the dynamics of processes over time. These temporal models can be\n created using regular time windows or leverage\n [CogSnet](https://www.researchgate.net/publication/348341904_Social_Networks_through_the_Prism_of_Cognition).\n\n- **Multilayer Networks**: The library supports multilayer networks, which are\n essential for modelling real-world systems with interconnected layers of\n complexity.\n\n- **Predefined Models**: You have the option to use predefined diffusion models\n such as the Linear Threshold Model, Independent Cascade Model, and more.\n These models simplify the simulation process, allowing you to focus on your\n specific research questions.\n\n- **Custom Models**: Additionally, Network Diffusion allows you to define your\n own diffusion models using open interfaces, providing flexibility for\n researchers to tailor simulations to their unique requirements.\n\n- **Centrality Measures**: The library provides a wide range of centrality\n measures specifically designed for multilayer networks. These measures can be\n valuable for selecting influential seed nodes in diffusion processes.\n\n- **NetworkX Compatible**: The package is built on top of NetworkX, ensuring\n seamless compatibility with this popular Python library for network analysis.\n You can easily integrate it into your existing NetworkX-based workflows.\n\n- **PyTorch representation**: Network Diffusion offers a plausible converter of\n the multilayer network to PyTorch sparse representation. That feature can\n help in deep-learning experiments utilising complex networks (e.g. GNNs).\n\n## Package Installation\n\nTo install the package, run this command: `pip install network_diffusion`.\nPlease note that we currently support Linux, MacOS, and Windows, but the\npackage is mostly tested and developed on Unix-based systems.\n\nTo contribute, please clone the repo, switch to a new feature branch, and\ninstall the environment:\n\n```bash\nconda env create -f env/conda.yml\nconda activate network-diffusion\npip install -e .\n```\n\n## Documentation\n\n<p align=\"center\"> <b>Reference guide</b> is available <a href=\"https://network-diffusion.readthedocs.io/en/latest/\">here</a>! </p>\n\nPlease bear in mind that **this project is still in development**, so the API\nusually differs between versions. Nonetheless, the code is documented well, so\nwe encourage users to explore the repository. Another way to familiarise\nyourself with the operating principles of `network_diffusion` are projects\nwhich utilise it:\n\n- Generator of a dataset with actors' spreading potentials - _v0.16.0_ -\n [repo](https://github.com/network-science-lab/infmax-simulator-icm-mln)\n- Influence max. under LTM in multilayer networks - _v0.14.0 pre-release_ -\n [repo](https://github.com/anty-filidor/rank-refined-seeding-bc-infmax-mlnets-ltm)\n- Comparison of spreading in various temporal network models - _v0.13.0_ -\n [repo](https://github.com/anty-filidor/bdma-experiments)\n- Seed selection methods for ICM in multilayer networks - _v0.10.0_ -\n [repo](https://github.com/damian4060/Independent_Cascade_Model)\n- Modelling coexisting spreading phenomena - _v0.6_ -\n [repo](https://github.com/anty-filidor/network_diffusion_examples)\n\n## Citing the Library\n\nIf you used the package, please consider citing us:\n\n```bibtex\n@article{czuba2024networkdiffusion,\n title={Network Diffusion Framework to Simulate Spreading Processes in Complex Networks},\n author={\n Czuba, Micha{\\l} and Nurek, Mateusz and Serwata, Damian and Qi, Yu-Xuan\n and Jia, Mingshan and Musial, Katarzyna and Michalski, Rados{\\l}aw\n and Br{\\'o}dka, Piotr\n },\n journal={Big Data Mining And Analytics},\n volume={7},\n number={3},\n pages={637-654},\n year={2024},\n publisher={IEEE},\n doi = {10.26599/BDMA.2024.9020010},\n url={https://doi.org/10.26599/BDMA.2024.9020010},\n}\n```\n\nParticularly if you used the functionality of simulating coexisting phenomena\nin complex networks, please add the following reference:\n\n```bibtex\n@inproceedings{czuba2022coexisting,\n author={Czuba, Micha\\l{} and Br\\'{o}dka, Piotr},\n booktitle={9th International Conference on Data Science and Advanced Analytics (DSAA)},\n title={Simulating Spreading of Multiple Interacting Processes in Complex Networks},\n volume={},\n number={},\n pages={1-10},\n year={2022},\n month={oct},\n publisher={IEEE},\n address={Shenzhen, China},\n doi={10.1109/DSAA54385.2022.10032425},\n url={https://ieeexplore.ieee.org/abstract/document/10032425},\n}\n```\n\n## Reporting Bugs\n\nPlease report bugs on\n[this](https://github.com/anty-filidor/network_diffusion/issues) board or by\nsending a direct [e-mail](https://github.com/anty-filidor) to the main author.\n\n## About Us\n\nThis library is developed and maintained by\n[Network Science Lab](https://networks.pwr.edu.pl/) from Politechnika\nWroc\u0142awska / Wroc\u0142aw University of Science and Technology / Technische\nUniversit\u00e4t Breslau and external partners. For more information and updates,\nplease visit our [website](https://networks.pwr.edu.pl/) or\n[GitHub](https://github.com/network-science-lab) page.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2019- Micha\u0142 Czuba, Piotr Br\u00f3dka Copyright (c) 2023 Damian D\u0105browski, Damian Serwata, Rados\u0142aw Michalski Copyright (c) 2023- Mateusz Nurek, Yu-Xuan Qi, Mingshan Jia, Katarzyna Musial Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Network Diffusion - a package for simulating spreading phenomena.",
"version": "0.17.0",
"project_urls": {
"Documentation": "https://network-diffusion.readthedocs.io/en/latest/",
"Homepage": "https://github.com/anty-filidor/network_diffusion",
"Issues": "https://github.com/anty-filidor/network_diffusion/issues"
},
"split_keywords": [
"influence maximisation",
" influence maximization",
" multilayer networks",
" networkx",
" network science",
" phenomena spreading",
" simulation",
" social influence",
" social networks",
" spreading",
" temporal networks"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "14ef422600342e7e058c1deec5f46d60a2044e6f0a52c744420304e8f5485d99",
"md5": "381340fc898dccd9772c2875ca73f9f5",
"sha256": "8cb52fb6404d0cab3b9b0e9ab7cd6fcd1e63536042f4ceccd12cfa29325f1cab"
},
"downloads": -1,
"filename": "network_diffusion-0.17.0-cp312-cp312-macosx_10_13_universal2.whl",
"has_sig": false,
"md5_digest": "381340fc898dccd9772c2875ca73f9f5",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 132204,
"upload_time": "2024-11-07T16:29:08",
"upload_time_iso_8601": "2024-11-07T16:29:08.439142Z",
"url": "https://files.pythonhosted.org/packages/14/ef/422600342e7e058c1deec5f46d60a2044e6f0a52c744420304e8f5485d99/network_diffusion-0.17.0-cp312-cp312-macosx_10_13_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd13514d7f4dec198afa0b3b37c8b34e61fa893957a0b04d6f9e23923ca56b6d",
"md5": "b5bf9359e7165963e83716690bc0ee73",
"sha256": "2ce63cb4b044cab868beff18e97a8fc0dcf070c135636268ad76205cfcf6f448"
},
"downloads": -1,
"filename": "network_diffusion-0.17.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "b5bf9359e7165963e83716690bc0ee73",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 145061,
"upload_time": "2024-11-07T16:29:10",
"upload_time_iso_8601": "2024-11-07T16:29:10.274716Z",
"url": "https://files.pythonhosted.org/packages/dd/13/514d7f4dec198afa0b3b37c8b34e61fa893957a0b04d6f9e23923ca56b6d/network_diffusion-0.17.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fb40da6df8ece5183253231898277c47d7fb9520780e8497a78f6ca115f7324c",
"md5": "0224b6d12a6fd807a99b27a0e1b3ba5c",
"sha256": "e0a9c007c01df122f8f965f6e9be76f4a63df9e12d1f3eebeb69d20f079ab29e"
},
"downloads": -1,
"filename": "network_diffusion-0.17.0-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "0224b6d12a6fd807a99b27a0e1b3ba5c",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.12",
"size": 129468,
"upload_time": "2024-11-07T16:29:12",
"upload_time_iso_8601": "2024-11-07T16:29:12.988464Z",
"url": "https://files.pythonhosted.org/packages/fb/40/da6df8ece5183253231898277c47d7fb9520780e8497a78f6ca115f7324c/network_diffusion-0.17.0-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "790e9b7f4e8503f4b1fbe423a9107323efa41edc7d85451851e08fd3ecd2ae33",
"md5": "461e1d7f33c5b22032dcbcbe1916761a",
"sha256": "14ecee35ebba12fad644c9a88889a6db63f081070b9bb1e3d9487e6b97f50f30"
},
"downloads": -1,
"filename": "network_diffusion-0.17.0.tar.gz",
"has_sig": false,
"md5_digest": "461e1d7f33c5b22032dcbcbe1916761a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 98736,
"upload_time": "2024-11-07T16:29:13",
"upload_time_iso_8601": "2024-11-07T16:29:13.952129Z",
"url": "https://files.pythonhosted.org/packages/79/0e/9b7f4e8503f4b1fbe423a9107323efa41edc7d85451851e08fd3ecd2ae33/network_diffusion-0.17.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-07 16:29:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "anty-filidor",
"github_project": "network_diffusion",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "network-diffusion"
}