leonardodalinky/scider/network-graph-analysis
Claude Code and agent skill by leonardodalinky/scider
- community
Checking that the SKILL.md file is still in the repository.
Graph and network analysis — graph construction, centrality measures, community detection, graph ML basics, and visualization. Use when data has relational/network structure.
Install
npx vskill@latest install leonardodalinky/scider/network-graph-analysisSKILL.md
Network Graph Analysis
Overview
Graph and network analysis extracts structural information from relational data. Use this skill when your data describes connections between entities — citations, protein interactions, social ties, trade flows, co-occurrence matrices, or any adjacency structure. The key insight: if relationships carry information that tabular rows cannot, model the structure explicitly.
When to Use This Skill
Use this skill when:
- Your data is fundamentally relational (entities linked by edges)
- You need to identify influential nodes, bridging nodes, or tightly-knit communities
- You are building or evaluating a graph neural network (GNN)
- You need to visualize network structure for publication or exploration
- Your dataset is a co-occurrence matrix, adjacency matrix, or edge list
Do not reach for graph methods if rows in your tabular dataset are independent (no meaningful pairwise relationships). First run EDA (EDA skill) to understand data shape, then apply this skill.
Graph Construction from Data
From a NumPy/SciPy Adjacency Matrix
From an Edge List CSV
From Bipartite Data (e.g., users x items)
Weighted vs Unweighted / Directed vs Undirected
| Choice | When to use | |
|---|---|---|
| Undirected | Symmetric relationships (co-authorship, friendship) | |
| Directed | Asymmetric relationships (citations, follows, flows) | |
| Unweighted | Only presence/absence of edge matters | |
| Weighted | Edge strength matters (call frequency, correlation strength) |
Use nx.DiGraph() for directed, nx.Graph() for undirected. Add weight edge attributes for weighted graphs — most centrality functions respect the weight keyword.
Basic Graph Statistics
Centrality Measures
Degree Centrality — Who Has the Most Connections?
The simplest measure. Node importance = fraction of other nodes it connects to. Use as a baseline; fast to compute.
Betweenness Centrality — Bridges Between Communities
Fraction of shortest paths passing through a node. High betweenness = bottleneck / broker. Expensive: O(VE) for unweighted, slower for weighted. Sample for large graphs.
Closeness Centrality — Reaches Others Quickly
Average shortest path distance to all other nodes (inverted). High closeness = spreads information fast. Meaningful only in connected graphs (or apply per component).
Eigenvector Centrality — Connected to Important Nodes
Score proportional to scores of neighbors. Being connected to high-scoring nodes raises your own score. PageRank is a damped variant. Use for undirected or directed networks where prestige propagates.
When to Use Each
| Measure | Best for | |
|---|---|---|
| Degree | Quick scan, finding hubs, baseline | |
| Betweenness | Finding brokers, bridges, critical infrastructure nodes | |
| Closeness | Information diffusion, finding broadcast centers | |
| Eigenvector/PageRank | Influence, authority, prestige propagation |
Compute all four and compare — they often disagree and the disagreement is informative.
Community Detection
Louvain — Fast, Large Graphs (Recommended Default)
Maximizes modularity greedily. Non-deterministic; run multiple times and pick highest modularity. Available via python-louvain (community package) or igraph.
Girvan-Newman — Hierarchical, Small Graphs
Removes edges with highest betweenness iteratively, revealing community hierarchy. Slow (O(E²V)); use only when n < 1000 and you need a dendrogram.
Spectral Clustering — Exactly k Communities
Use when you know k in advance. Builds graph Laplacian, finds k eigenvectors, runs k-means in spectral space.
Label Propagation — Very Fast, Non-Deterministic
Each node inherits the most common label of its neighbors. Converges in O(E). Results vary between runs; use when speed matters more than stability.
Graph ML Basics
When Does Graph Structure Help?
Graph structure adds value beyond tabular features when:
- Nodes are connected in ways that predict the target (social influence, protein proximity)
- Labels propagate through edges (homophily: connected nodes share labels)
- Global topology matters (scale-free vs random network properties)
If nodes have no meaningful connections or edges are arbitrary, stick with tabular models.
GNN Overview: Message Passing
At each layer, each node aggregates feature vectors from its neighbors, then updates its own representation. After k layers, a node sees its k-hop neighborhood.
Key architectures:
- GCN (Graph Convolutional Network): normalized sum aggregation — simple, effective
- GraphSAGE: sample-and-aggregate — scales to large graphs via mini-batching
- GAT (Graph Attention Network): learns attention weights over neighbors — best when neighbor importance varies
Task Types
| Task | Input | Output | Example | |
|---|---|---|---|---|
| Node classification | Node features + graph | Label per node | Classify paper topics in citation network | |
| Link prediction | Node features + partial graph | Edge probability | Recommend friends, predict protein interactions | |
| Graph classification | Full graph | Label per graph | Classify molecules, detect fraud subgraphs |
Libraries
Visualization
NetworkX + Matplotlib — Small Graphs (<500 nodes)
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 repositoryChecking.scider/skills/network-graph-analysis/SKILL.md
Popularity
- Repository stars
- 88
- Repository forks
- 7
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/leonardodalinky/scider/network-graph-analysis)