Skip to main content

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 Distribution

complex-network-tools-0.2.1.tar.gz (27.2 kB view hashes)

Uploaded Source

Built Distribution

complex_network_tools-0.2.1-py3-none-any.whl (39.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page