networkx

Create, analyze, and visualize complex networks and graphs in Python.

Updated Dec 17, 2025
One-click install
npx skills add https://github.com/robotlearning123/claude-scientific-skills --skill networkx-robotlearning123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: networkx
Source: https://github.com/robotlearning123/claude-scientific-skills/tree/main/scientific-skills/networkx
Command: npx skills add https://github.com/robotlearning123/claude-scientific-skills --skill networkx-robotlearning123

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires networkx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive toolkit for creating, analyzing, and visualizing complex networks and graphs in Python, enabling users to work with network or graph data structures, analyze relationships between entities, compute graph algorithms, detect communities, generate synthetic networks, and visualize network topologies.

Core Features & Use Cases

  • Graph Creation and Manipulation: Build and modify various graph types (Graph, DiGraph, MultiGraph, MultiDiGraph).
  • Graph Analysis: Compute centrality measures, find shortest paths, detect communities, measure clustering, and analyze connectivity.
  • Graph Algorithms: Run standard algorithms like Dijkstra's, PageRank, minimum spanning trees, maximum flow, and more.
  • Network Generation: Create synthetic networks for testing or simulation.
  • Graph I/O: Read from or write to various formats (edge lists, GraphML, JSON, CSV, adjacency matrices).
  • Visualization: Draw and customize network visualizations with matplotlib or interactive libraries.
  • Use Case: Imagine you are analyzing a social network. Use this Skill to create a graph from your data, compute centrality measures, detect communities, and visualize the network topology.

Quick Start

Use the networkx skill to create a graph from the provided data, compute the shortest path between nodes 1 and 5, and visualize the resulting network.

Frequently Asked Questions about networkx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze and visualize complex networks in Python?

To analyze and visualize complex networks in Python, you can build graph structures, compute centrality measures, detect communities, and draw network topologies using the networkx package. It handles social, biological, and transportation networks directly.

What's the best way to compute shortest paths and centrality measures for a graph?

Computing shortest paths and centrality measures requires running standard graph algorithms like Dijkstra's or PageRank. You load pairwise relationship data into a graph structure, then execute algorithms to analyze connectivity and node importance.

Can I create and manipulate directed graphs and multigraphs with Python?

Yes, you can create and manipulate directed graphs and multigraphs in Python. The toolkit supports Graph, DiGraph, MultiGraph, and MultiDiGraph structures, allowing you to model complex pairwise relationships and modify network topologies.

How do I import and export graph data using edge lists and GraphML formats?

To import and export graph data using edge lists and GraphML, use graph I/O functions to read from or write to various formats including JSON, CSV, and adjacency matrices. This converts external data into graph structures for analysis.

Does networkx support generating synthetic networks for simulation testing?

Networkx supports generating synthetic networks for simulation and testing. You can create synthetic network topologies to test graph algorithms or simulate network behaviors without needing real-world pairwise relationship data.