---
name: "networkx-graph-centrality-pagerank"
description: "Analyze graph topologies, community structures, and node centrality using NetworkX."
metadata:
  author: "NetworkX"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "calculate pagerank networkx"
  - "find shortest path networkx"
  - "community detection networkx"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# NetworkX Complex Graph Analytics & Algorithms

Constructs and analyzes graphs with NetworkX: computing PageRank, betweenness and eigenvector centrality, shortest paths (Dijkstra, A*), detecting connected components, and exporting to GraphML/JSON.

## When to Invoke
Invoke this skill whenever you need to:
- calculate pagerank networkx
- find shortest path networkx
- community detection networkx

## Execution SOP & Rules
1. Instantiate graph: G = nx.DiGraph() and add weighted edges: G.add_edge('A', 'B', weight=2.5).
2. Calculate centrality: pagerank_scores = nx.pagerank(G, alpha=0.85, max_iter=100).
3. Compute shortest path: path = nx.shortest_path(G, source='source_id', target='target_id', weight='weight').
4. Identify weakly and strongly connected components: list(nx.strongly_connected_components(G)).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
