algo-net-centralitylisted
Install: claude install-skill charlieviettq/awesome-agent-skill
# Network Centrality Metrics
## Overview
Centrality measures quantify node importance in a network. Four classical metrics: degree (connections), betweenness (bridge role), closeness (proximity), eigenvector (connection quality). Each captures a different aspect of importance. Complexity ranges from O(V+E) for degree to O(V×E) for betweenness.
## When to Use
**Trigger conditions:**
- Identifying key influencers or critical nodes in social/organizational networks
- Analyzing network vulnerabilities (which node failure causes most damage)
- Comparing node importance across different dimensions
**When NOT to use:**
- For group/community detection (use community detection algorithms)
- For information spread modeling (use epidemic models)
## Algorithm
```
IRON LAW: Different Centrality Metrics Answer DIFFERENT Questions
- Degree: Who has the most connections? (popularity)
- Betweenness: Who bridges communities? (brokerage)
- Closeness: Who can reach everyone fastest? (efficiency)
- Eigenvector: Who is connected to important people? (prestige)
Using the WRONG metric answers the WRONG question. Choose based on
what "important" means in your context.
```
### Phase 1: Input Validation
Build network graph from edge list or adjacency matrix. Determine: directed vs undirected, weighted vs unweighted, connected vs disconnected.
**Gate:** Graph is well-formed, largest connected component identified.
### Phase 2: Core Algorithm
1. **Degree centrality:** C_D(v) = deg(v) / (N-1). O(