Algorithm Library
Raphtory's intelligence capabilities powered by battle-tested graph algorithms.
Choose by Goal
What intelligence do you need?
馃幆 Find Important Entities
Identify influential nodes, key connectors, or critical infrastructure points.
Algorithms: PageRank 路 Betweenness 路 Degree Centrality 路 HITS
Use Cases: Influencer identification, critical infrastructure, fraud ring leaders
馃懃 Discover Communities
Detect groups, clusters, or coordinated behavior automatically.
Algorithms: Louvain 路 Label Propagation
Use Cases: Customer segments, fraud rings, toxic communities, market clusters
鈴憋笍 Analyze Temporal Patterns
Understand how networks evolve, spread, and change over time.
Algorithms: Temporal Reachability 路 Temporal 3-Node Motifs
Use Cases: Attack chain reconstruction, viral spread, churn propagation
馃敆 Find Connected Components
Identify disconnected groups, isolated clusters, or network structure.
Algorithms: Weakly Connected 路 Strongly Connected 路 In/Out Components
Use Cases: Network fragmentation, isolated communities, dependency analysis
馃攳 Detect Patterns
Find recurring subgraph patterns and structural motifs.
Algorithms: Triangle Count 路 3-Node Motifs 路 Temporal Motifs
Use Cases: Pattern recognition, structural analysis, fraud detection
馃搹 Measure Structure
Quantify graph properties and structural characteristics.
Algorithms: Clustering Coefficient 路 Graph Density 路 Reciprocity
Use Cases: Network health, structural evolution, benchmark metrics
All Algorithms
Centrality
Identify important nodes based on their position in the network.
| Algorithm | What It Finds | Complexity | API |
|---|---|---|---|
| PageRank | Global influence/authority | O(V + E) per iteration | algorithms.pagerank() |
| Betweenness | Bridge nodes, connectors | O(V 脳 E) | algorithms.betweenness_centrality() |
| Degree Centrality | Directly connected hubs | O(V) | algorithms.degree_centrality() |
| HITS | Hubs and authorities | O(V + E) per iteration | algorithms.hits() |
Use Cases: Influencer identification, critical infrastructure detection, fraud ring leaders
Community Detection
Find groups, clusters, or coordinated behaviors.
| Algorithm | Detection Style | Complexity | API |
|---|---|---|---|
| Louvain | Modularity optimization | O(V log V) | algorithms.louvain() |
| Label Propagation | Iterative label spreading | O(V + E) | algorithms.label_propagation() |
Use Cases: Customer segmentation, fraud ring detection, community health monitoring
Components
Identify connectivity structure and isolated groups.
| Algorithm | What It Finds | API |
|---|---|---|
| Weakly Connected Components | Undirected connectivity | algorithms.weakly_connected_components() |
| Strongly Connected Components | Directed connectivity | algorithms.strongly_connected_components() |
| In-Components | Nodes that can reach target | algorithms.in_components() |
| Out-Components | Nodes reachable from source | algorithms.out_components() |
Use Cases: Network fragmentation analysis, dependency mapping, service reachability
Temporal Algorithms
Analyze how networks evolve and spread over time.
| Algorithm | Temporal Insight | Use Case | API |
|---|---|---|---|
| Temporal Reachability | Who can reach whom when | Attack chains, causality | algorithms.temporal_reachability() |
| Temporal 3-Node Motifs | 3-node temporal patterns | Pattern discovery | algorithms.temporal_three_node_motifs() |
| Temporal Rich Club | Elite connectivity over time | Core group evolution | algorithms.temporal_rich_club_coefficient() |
Use Cases: Cybersecurity (attack reconstruction), social analytics (viral spread), fraud (coordinated timing)
Motifs & Patterns
Find recurring structural patterns.
| Algorithm | Pattern Type | API |
|---|---|---|
| Triangle Count | 3-node closed triangles | algorithms.triangle_count() |
| Local Triangle Count | Per-node triangles | algorithms.local_triangle_count() |
| 3-Node Motifs | All 3-node patterns | algorithms.three_node_motifs() |
| Triplet Count | 3-node open patterns | algorithms.triplet_count() |
Use Cases: Structural analysis, fraud pattern detection, social network analysis
Metrics
Measure graph-level properties.
| Metric | What It Measures | API |
|---|---|---|
| Clustering Coefficient | Triangle density | algorithms.global_clustering_coefficient() |
| Graph Density | Edge saturation | algorithms.directed_graph_density() |
| Reciprocity | Mutual connections | algorithms.global_reciprocity() |
| Average Degree | Mean connectivity | algorithms.average_degree() |
Use Cases: Network health monitoring, structural evolution tracking, benchmark metrics
Path Finding
Trace connections, routes, and accessibility.
| Algorithm | What It Finds | API |
|---|---|---|
| Single Source Shortest Path | Shortest paths from source | algorithms.single_source_shortest_path() |
| Dijkstra | Weighted shortest paths | algorithms.dijkstra() |
Use Cases: Money laundering path tracing, supply chain routing, social distance
Embeddings
Learn vector representations for ML integration.
| Algorithm | Output | Use Case | API |
|---|---|---|---|
| FastRP | Node vectors | Graph ML features | algorithms.fast_rp() |
Use Cases: Feature engineering for ML models, similarity search, recommendations
By Industry
Financial Services
Fraud Detection:
- PageRank - Identify money mule accounts
- Louvain - Find fraud rings
- Temporal Motifs - Detect coordinated timing
Risk Scoring:
- Degree Centrality - Transaction velocity
- Betweenness - Critical payment nodes
Cybersecurity
Threat Hunting:
- Temporal Reachability - Attack chain analysis
- Weakly Connected Components - Botnet identification
- Betweenness - Critical attack paths
Social Platforms
Community Health:
- Louvain - Detect communities
- Triangle Count - Measure cohesion
- Label Propagation - Fast clustering
Operations
Infrastructure Monitoring:
- Betweenness - Critical services
- Strongly Connected Components - Dependency cycles
- Graph Density - System complexity
Performance Guide
Algorithm Selection by Scale
| Graph Size | Fast Algorithms | Moderate | Expensive |
|---|---|---|---|
| <1M edges | Any algorithm | - | - |
| 1M-10M edges | PageRank, Louvain, Label Propagation | Betweenness | Full motif enumeration |
| 10M-100M edges | Degree, Label Propagation | PageRank, Triangle Count | Betweenness |
| >100M edges | Streaming/sampling | PageRank (parallel) | - |
Optimization Tips
- Use temporal windows: Analyze recent data for real-time insights
- Parallelize: Most algorithms support multi-threading
- Sample strategically: Label propagation works on samples
- Cache centrality: Reuse scores across queries
Getting Started
Quick example:
Learn More
- How-To: Run Algorithms - Detailed usage guides
- Tutorials - Persona-based learning paths
Need Help Choosing?
- Case Studies - Real-world algorithm combinations
- Community Slack - Ask the Raphtory team