networkx

Comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python. Use when working with network/graph data structures, analyzing relationships between entities, computing graph algorithms (shortest paths, centrality, clustering), detecting communities, generating synthetic networks, or visualizing network topologies. Applicable to social networks, biological networks, transportation systems, citation networks, and any domain involving pairwise relationships.

Install

Hot:22

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-networkx&locale=en&source=copy

NetworkX - Python tool for complex network analysis and visualization

Overview of Capabilities


NetworkX is a powerful Python library for creating, manipulating, and analyzing complex networks and graph structures. Whether social networks, biological networks, transportation systems, or knowledge graphs, NetworkX can help you complete the full workflow from graph data construction to algorithmic analysis, from file I/O to visualization.

Use Cases

1. Social network and relationship analysis


Analyze follow relationships, friend networks, and information propagation paths between users. Compute influence metrics (such as centrality measures, PageRank), detect community structures, and identify key nodes and opinion leaders.

2. Biological and medical network research


Study protein–protein interaction networks, metabolic pathways, and gene regulatory networks. Use graph algorithms to mine functional modules, analyze network robustness, and visualize complex relationships in biological systems.

3. Transportation and infrastructure optimization


Analyze transportation networks, subway lines, and logistics distribution networks. Compute shortest paths, network connectivity, and critical nodes to provide data support for urban planning and system optimization.

Core Features

1. Rich library of graph algorithms


Includes 500+ graph algorithms, such as shortest paths (Dijkstra, A*), centrality measures (degree centrality, betweenness centrality, closeness centrality), community detection, clustering coefficients, max flow/min cut, graph isomorphism testing, etc., covering a wide range of network analysis needs.

2. Flexible graph data structures


Supports four graph types: undirected Graph, directed DiGraph, undirected multigraph MultiGraph, and directed multigraph MultiDiGraph. Nodes can be any hashable object, and rich node and edge attributes are supported to facilitate integration with real-world business data.

3. Comprehensive file I/O and visualization


Supports many data formats for reading and writing (Edge List, GraphML, GML, JSON, CSV) and integrates seamlessly with Pandas and NumPy. Provides various layout algorithms and visualization options to quickly generate publication-quality network diagrams, and supports visualization backends such as matplotlib, Plotly, and PyVis.

Frequently Asked Questions

What is NetworkX? What is it used for?


NetworkX is a Python library for graph theory and complex network analysis. It helps you create and manage graph data structures, run various network algorithms (such as shortest paths, centrality analysis, community detection), generate different types of random network models, and supports multiple formats for data import/export and network visualization.

How large of a network can NetworkX handle?


NetworkX is suitable for small-to-medium scale networks (typically thousands to tens of thousands of nodes). For very large-scale networks (millions of nodes or more), due to memory and performance limitations, it is recommended to consider specialized large-graph tools like GraphTool, SNAP, or distributed graph computation frameworks. NetworkX also supports optimizations for large graphs via sparse matrices and sampling approximations.

What file formats does NetworkX support?


NetworkX supports a wide range of file formats: text formats (Edge List, Adjacency List, GML), XML format (GraphML), JSON formats (node-link, adjacency), matrix formats (NumPy array, SciPy sparse matrix), CSV, and conversion to/from Pandas DataFrame. It also supports importing data from other software such as Cytoscape and DOT.