networkx
Installation
SKILL.md
NetworkX - Network Analysis and Graph Theory
NetworkX is the go-to library for analyzing complex networks. It treats graphs as flexible containers for nodes (any hashable object) and edges, which can carry arbitrary metadata.
When to Use
- Analyzing social, biological, or infrastructure networks.
- Calculating path metrics (shortest paths, diameters, flow).
- Measuring node importance (Centrality, PageRank).
- Detecting communities and clusters within a network.
- Generating random graph models (Erdős-Rényi, Barabási-Albert).
- Finding connectivity components and cliques.
- Designing and optimizing routing or dependency trees.
Reference Documentation
Official docs: https://networkx.org/
Algorithm reference: https://networkx.org/documentation/stable/reference/algorithms/index.html
Search patterns: nx.Graph, nx.shortest_path, nx.degree_centrality, nx.connected_components