sickn33/antigravity-awesome-skills/networkx
Claude Code and agent skill by sickn33/antigravity-awesome-skills
- community
Checking that the SKILL.md file is still in the repository.
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/networkxSKILL.md
Bundled upstream support
Supporting files are included at skill-relative paths. See UPSTREAM-NOTICE.md for their pinned sources, licenses, hashes, and import changes.
NetworkX
Overview
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs. Use this skill when working with network or graph data structures, including social networks, biological networks, transportation systems, citation networks, knowledge graphs, or any system involving relationships between entities.
When to Use This Skill
Invoke this skill when tasks involve:
- Creating graphs: Building network structures from data, adding nodes and edges with attributes
- Graph analysis: Computing centrality measures, finding shortest paths, detecting communities, measuring clustering
- Graph algorithms: Running standard algorithms like Dijkstra's, PageRank, minimum spanning trees, maximum flow
- Network generation: Creating synthetic networks (random, scale-free, small-world models) for testing or simulation
- Graph I/O: Reading from or writing to various formats (edge lists, GraphML, JSON, CSV, adjacency matrices)
- Visualization: Drawing and customizing network visualizations with matplotlib or interactive libraries
- Network comparison: Checking isomorphism, computing graph metrics, analyzing structural properties
Data and compatibility limits
Examples are independent fragments: initialize the required graph type/nodes/imports, check connectivity/empty inputs and pin NetworkX plus optional dependencies. Never unpickle untrusted or externally supplied files: pickle can execute arbitrary code. GraphML/GEXF XML and compressed files need trusted inputs and size limits. Export only to new authorized paths; SQL examples must not replace existing tables. Graph attributes and interactive HTML can expose private labels/data; escape untrusted labels and review external assets before sharing. Bound expensive cycle/clique/isomorphism enumeration and dense matrices. Same seed requires matching versions and parameters for reproducibility. Legacy root license metadata says BSD while bundled K-Dense support is MIT; these scopes remain explicit pending provenance reconciliation.
Core Capabilities
1. Graph Creation and Manipulation
NetworkX supports four main graph types:
- Graph: Undirected graphs with single edges
- DiGraph: Directed graphs with one-way connections
- MultiGraph: Undirected graphs allowing multiple edges between nodes
- MultiDiGraph: Directed graphs with multiple edges
Create graphs by:
Reference: See references/graph-basics.md for comprehensive guidance on creating, modifying, examining, and managing graph structures, including working with attributes and subgraphs.
2. Graph Algorithms
NetworkX provides extensive algorithms for network analysis:
Shortest Paths:
Centrality Measures:
Community Detection:
Connectivity:
Reference: See references/algorithms.md for detailed documentation on all available algorithms including shortest paths, centrality measures, clustering, community detection, flows, matching, tree algorithms, and graph traversal.
3. Graph Generators
Create synthetic networks for testing, simulation, or modeling:
Classic Graphs:
Random Networks:
Structured Networks:
Reference: See references/generators.md for comprehensive coverage of all graph generators including classic, random, lattice, bipartite, and specialized network models with detailed parameters and use cases.
4. Reading and Writing Graphs
NetworkX supports numerous file formats and data sources:
File Formats:
Pandas Integration:
Matrix Formats:
Reference: See references/io.md for complete documentation on all I/O formats including CSV, SQL databases, Cytoscape, DOT, and guidance on format selection for different use cases.
5. Visualization
Create clear and informative network visualizations:
Basic Visualization:
Customization:
Layout Algorithms:
Publication Quality:
Reference: See references/visualization.md for extensive documentation on visualization techniques including layout algorithms, customization options, interactive visualizations with Plotly and PyVis, 3D networks, and publication-quality figure creation.
Working with NetworkX
Installation
Ensure NetworkX is installed:
Common Workflow Pattern
Most NetworkX tasks follow this pattern:
- Create or Load Graph:
```python # From scratch G = nx.Graph() G.add_edges_from([(1, 2), (2, 3), (3, 4)])
# Or load from file/data G = nx.read_edgelist('data.txt') ```
- Examine Structure:
``python print(f"Nodes: {G.number_of_nodes()}") print(f"Edges: {G.number_of_edges()}") print(f"Density: {nx.density(G)}") print(f"Connected: {nx.is_connected(G)}") ``
- Analyze:
```python # Compute metrics degree_cent = nx.degree_centrality(G) avg_clustering = nx.average_clustering(G)
# Find paths path = nx.shortest_path(G, source=1, target=4)
# Detect communities communities = community.greedy_modularity_communities(G) ```
- Visualize:
``python pos = nx.spring_layout(G, seed=42) nx.draw(G, pos=pos, with_labels=True) plt.show() ``
- Export Results:
```python # Save graph nx.write_graphml(G, 'analyzed_network.graphml')
# Save metrics df = pd.DataFrame({ 'node': list(degree_cent.keys()), 'centrality': list(degree_cent.values()) }) df.to_csv('centrality_results.csv', index=False) ```
Important Considerations
Floating Point Precision: When graphs contain floating-point numbers, all results are inherently approximate due to precision limitations. This can affect algorithm outcomes, particularly in minimum/maximum computations.
Memory and Performance: Each time a script runs, graph data must be loaded into memory. For large networks:
- Use appropriate data structures (sparse matrices for large sparse graphs)
- Consider loading only necessary subgraphs
- Use efficient file formats (pickle for Python objects, compressed formats)
- Leverage approximate algorithms for very large networks (e.g.,
kparameter in centrality calculations)
Node and Edge Types:
- Nodes can be any hashable Python object (numbers, strings, tuples, custom objects)
- Use meaningful identifiers for clarity
- When removing nodes, all incident edges are automatically removed
Random Seeds: Always set random seeds for reproducibility in random graph generation and force-directed layouts:
Quick Reference
Basic Operations
Essential Algorithms
File I/O Quick Reference
Resources
This skill includes comprehensive reference documentation:
references/graph-basics.md
Detailed guide on graph types, creating and modifying graphs, adding nodes and edges, managing attributes, examining structure, and working with subgraphs.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/networkx/SKILL.md
Popularity
- Repository stars
- 22,857
- Repository forks
- 3,941
- Repository npm downloads, 7 days
- 11,772
- 7-day trend score
- 72
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/networkx)