🧅 Onion Network
Onion-structured networks are special kinds of scale-free networks with special topologies.
They tend to possess a high degree assortativity. It makes it possible to decompose them into layers of same-degree nodes, hence the name.
This property gives them strong resilience to node deletion attacks.
This library can help you explore these networks, giving access to both a generation and visualization method.
Algorithm
A generative algorithm producing synthetic scale-free networks with onion structure is implemented as described in the paper: Onion structure and network robustness.
Note: This algorithm can fail under certain circumstances. Therefore a
max_trialnumber has been added so that the process can be tried different times until a viable solution is found.
Visualization
A side module allows plotting the generated graphs, radially separating onion layers.
Usage
Installation
You can install the package using pip.
pip install onion-network
Example
# Example usage of the onion generation and plotting.
from onion_network import plot_onion, onion_graph
G = onion_graph(n=100, gamma=2.5, alpha=3, max_trial=100)
plot_onion(G, cmap="tab20b")
References
Papers
Chan, H., & Akoglu, L. (2016). Optimizing network robustness by edge rewiring : A general framework. Data Mining and Knowledge Discovery, 30(5), 1395‑1425. https://doi.org/10.1007/s10618-015-0447-5 Chujyo, M., & Hayashi, Y. (2022). Adding links on minimum degree and longest distance strategies for improving network robustness and efficiency. PLOS ONE, 17(10), e0276733. https://doi.org/10.1371/journal.pone.0276733 Hayashi, Y. (2018). A new design principle of robust onion-like networks self-organized in growth. Network Science, 6(1), 54‑70. https://doi.org/10.1017/nws.2017.25 Liu, X., Sun, S., Wang, J., & Xia, C. (2019). Onion structure optimizes attack robustness of interdependent networks. Physica A: Statistical Mechanics and Its Applications, 535, 122374. https://doi.org/10.1016/j.physa.2019.122374 Louzada, V. H. P., Daolio, F., Herrmann, H. J., & Tomassini, M. (2013). Smart Rewiring for Network Robustness. Journal of Complex Networks, 1(2), 150‑159. https://doi.org/10.1093/comnet/cnt010 Wu, Z.-X., & Holme, P. (2011, août 9). Onion structure and network robustness. ArXiv.Org. https://doi.org/10.1103/PhysRevE.84.026106
Blog article
Metadata
Release files for onion-network 1.0.2
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 | Actions |
|---|---|---|---|---|
| onion_network-1.0.2.tar.gz | 6.8 kB | Without provenance | Details for onion_network-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| onion_network-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for onion_network-1.0.2-py3-none-any.whl |
Total release size: 13.9 kB
Release files / onion_network-1.0.2.tar.gz
| Download URL | onion_network-1.0.2.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ac4975bacf0a1bd78dc5e4442e167644370b78f39f1c1542d803463931e9430
|
|
BLAKE2b-256 checksum How to use checksums |
369432753be46f1ef51632a5195486414926d4f7867f833b7c6322fc9d30bd56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / onion_network-1.0.2-py3-none-any.whl
| Download URL | onion_network-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cfe832ae324737795173b089cea96fe502a975da8eb269dcf122ac6e4adca91
|
|
BLAKE2b-256 checksum How to use checksums |
1976ee96c7a124d53e8d92fb681afa64bc1f7c899aa82beeb39a901be311b527
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for onion-network 1.0.2
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.