{"id":19006430,"url":"https://github.com/anty-filidor/network_diffusion","last_synced_at":"2026-03-04T17:01:59.756Z","repository":{"id":54777102,"uuid":"200487365","full_name":"anty-filidor/network_diffusion","owner":"anty-filidor","description":"Python package for simulating spreading phenomena in complex networks ","archived":false,"fork":false,"pushed_at":"2024-11-07T16:28:46.000Z","size":23029,"stargazers_count":18,"open_issues_count":5,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-11T12:24:44.727Z","etag":null,"topics":["diffusion","influence-maximization","multilayer-networks","network-science","networkx","simulator","spreading","temporal-networks"],"latest_commit_sha":null,"homepage":"https://network-diffusion.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anty-filidor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-04T12:01:53.000Z","updated_at":"2024-11-22T00:28:04.000Z","dependencies_parsed_at":"2024-01-16T12:36:49.642Z","dependency_job_id":"d74bc6d6-a8d3-487c-a34d-215eacd388ad","html_url":"https://github.com/anty-filidor/network_diffusion","commit_stats":{"total_commits":85,"total_committers":3,"mean_commits":"28.333333333333332","dds":0.07058823529411762,"last_synced_commit":"9efc773e0f205338139433e99c50a4333732b981"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anty-filidor%2Fnetwork_diffusion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anty-filidor%2Fnetwork_diffusion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anty-filidor%2Fnetwork_diffusion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anty-filidor%2Fnetwork_diffusion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anty-filidor","download_url":"https://codeload.github.com/anty-filidor/network_diffusion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445927,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion","influence-maximization","multilayer-networks","network-science","networkx","simulator","spreading","temporal-networks"],"created_at":"2024-11-08T18:32:21.895Z","updated_at":"2026-03-04T17:01:59.739Z","avatar_url":"https://github.com/anty-filidor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u003cp align=\"center\"\u003e \u003cb\u003eReference guide\u003c/b\u003e is available \u003ca href=\"https://network-diffusion.readthedocs.io/en/latest/\"\u003ehere\u003c/a\u003e! \u003c/p\u003e\n\nPlease note that **this project is still under development**, and the API may\nvary between versions. Nevertheless, the code is thoroughly commented and the\ndocumentation is kept up to date. Another way to become familiar with the\noperating principles of `network_diffusion` is to explore some example projects\nthat make use of it:\n\n- Assessment of using control methods for influence maximisation - _v0.17_ -\n  [repo](https://github.com/network-science-lab/infmax-mds-ltm-mln)\n- Generator of a dataset with actors' spreading potentials - _v0.16_ -\n  [repo](https://github.com/network-science-lab/infmax-simulator-icm-mln)\n- Influence max. under LTM in multilayer networks - _v0.14_ -\n  [repo](https://github.com/anty-filidor/rank-refined-seeding-bc-infmax-mlnets-ltm)\n- Modelling of concurrent spreading and a diffusion in temporal networks -\n  _v0.13_ - [repo](https://github.com/anty-filidor/bdma-experiments)\n- Seed selection methods for ICM in multilayer networks - _v0.10_ -\n  [repo](https://github.com/damian4060/Independent_Cascade_Model)\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## About Us\n\nThis library is developed and maintained by Network Science Lab from Wroclaw\nUniversity of Science and Technology. For more information and updates, please\nvisit our [website](https://networks.pwr.edu.pl/) or\n[GitHub](https://github.com/network-science-lab) page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanty-filidor%2Fnetwork_diffusion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanty-filidor%2Fnetwork_diffusion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanty-filidor%2Fnetwork_diffusion/lists"}