A Python package for generating, learning, and analysis of complex networks.
Project description
complex-network-tools
complex-network-tools is a Python package for generating, learning, and analysis of complex networks.
Examples
Synthetic network generating
from cnt.generator import erdos_renyi_graph
# generate a Erdos Renyi(ER) random graph
G = erdos_renyi_graph(num_nodes=100, num_edges=400, is_directed=False, is_weighted=False)
# generate a Barabasi Albert(BA) scale-free graph
G = barabasi_albert_graph(num_nodes=100, num_edges=400, is_directed=False, is_weighted=False)
Network attack
from cnt.robustness.network_attack import network_attack
# get attack sequence of nodes
G = erdos_renyi_graph(num_nodes=100, num_edges=400, is_directed=False, is_weighted=False)
# node-removal based network attacks, use the targeted-degree based node-removal strategy
attack_sequence = network_attack(graph=G, attack='node', strategy='degree')
Spectral measure
from cnt.spectral_measure.robustness_spectral_measure import spectral_gap
# calculate spectral gap for a graph
G = erdos_renyi_graph(num_nodes=100, num_edges=400, is_directed=False, is_weighted=False)
spectral_gap(G)
Install
pip install complex-network-tools
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for complex_network_tools-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 814185c4e049290d8d0eeb2eedf9172cc5409c04b681ae245bb291dccd506a4c |
|
MD5 | 0b140b359731014e92d24ca8e8b63ed0 |
|
BLAKE2b-256 | 60cc1219da8613e5a612da74a2c855db5f36f445271ed3db3e8cabff059d4993 |