Centrality
algo.pagerank
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
1 |
Syntax
CALL algo.pagerank([{dampingFactor: 0.85, maxIterations: 20, tolerance: 0.0001, weightProperty: null}])
YIELD node, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
config map |
Map |
No |
see defaults |
Configuration properties (all optional) |
|
Double |
No |
|
Probability of following an edge vs. teleporting |
|
Integer |
No |
|
Maximum number of power-iteration steps |
|
Double |
No |
|
Convergence threshold (max score change) |
|
String |
No |
|
Edge property for weighted PageRank |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
PageRank score |
Description
Computes the PageRank centrality score for every vertex using the power-iteration method. Dangling nodes (no outgoing edges) contribute their rank to all nodes proportionally via the teleportation mechanism. When weightProperty is specified, edge weights are used as transition probabilities (normalized per node).
Use Cases
-
Web page and document importance ranking
-
Identifying authoritative nodes in citation networks
-
Social network influence scoring
Example
CALL algo.pagerank({dampingFactor: 0.85, maxIterations: 30})
YIELD node, score
RETURN node, score ORDER BY score DESC LIMIT 10
References
algo.betweenness
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
1 |
Syntax
CALL algo.betweenness([{normalized: true}])
YIELD node, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
config map |
Map |
No |
see defaults |
Configuration properties (all optional) |
|
Boolean |
No |
|
Divide scores by |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Betweenness centrality score |
Description
Measures how often a vertex lies on the shortest path between all other pairs, using the Brandes algorithm with stack-based back-propagation. When normalized is true, scores are divided by 2/n-1)(n-2 (undirected normalization factor).
Use Cases
-
Identifying bridge nodes and bottlenecks in networks
-
Communication hub detection in social graphs
-
Critical infrastructure analysis
Example
CALL algo.betweenness({normalized: true})
YIELD node, score
RETURN node, score ORDER BY score DESC LIMIT 20
References
-
Brandes, U. (2001). A faster algorithm for betweenness centrality. Journal of Mathematical Sociology, 25(2), 163–177.
algo.closeness
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
3 |
Syntax
CALL algo.closeness([relTypes, direction, normalized])
YIELD node, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
String |
No |
|
Traversal direction: |
|
Boolean |
No |
|
Use Wasserman-Faust formula for disconnected graphs |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Closeness centrality score |
Description
Computes closeness centrality via BFS from each vertex. For disconnected graphs, the Wasserman-Faust formula is applied: score = (reachable / sumDist) × (reachable / (n-1)), where reachable is the number of vertices reached and sumDist is the sum of shortest path distances to those vertices.
Use Cases
-
Identifying well-positioned nodes for information spread
-
Supply chain hub identification
-
Social network influence reach analysis
Example
CALL algo.closeness('KNOWS', 'BOTH', true)
YIELD node, score
RETURN node, score ORDER BY score DESC LIMIT 10
References
-
Wasserman, S. & Faust, K. (1994). Social Network Analysis.
algo.degree
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
2 |
Syntax
CALL algo.degree([relTypes, direction])
YIELD node, inDegree, outDegree, degree, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
String |
No |
|
Traversal direction: |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Long |
Number of incoming edges |
|
Long |
Number of outgoing edges |
|
Long |
Total degree (in + out for BOTH, else directional) |
|
Double |
Normalized degree: |
Description
Efficiently counts in-degree, out-degree, and total degree for every vertex using vertex.countEdges() to avoid materializing edge objects. The normalized score divides total degree by (n-1), representing the fraction of all possible connections.
Use Cases
-
Identifying high-degree hubs in social networks
-
Popularity ranking by connection count
-
Network connectivity baseline measurement
Example
CALL algo.degree('FOLLOWS', 'IN')
YIELD node, inDegree, score
RETURN node, inDegree, score ORDER BY inDegree DESC LIMIT 10
References
algo.harmonic
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
3 |
Syntax
CALL algo.harmonic([relTypes, direction, normalized])
YIELD node, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
String |
No |
|
Traversal direction: |
|
Boolean |
No |
|
Divide raw score by |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Harmonic centrality score |
Description
Computes harmonic centrality as the sum of reciprocal shortest-path distances from a vertex to all reachable vertices: score = Σ 1/dist(v, u). When normalized is true, divides by (n-1). Harmonic centrality handles disconnected graphs naturally (unreachable vertices contribute 0 to the sum), unlike closeness centrality.
Use Cases
-
Centrality measure robust to disconnected components
-
Influence reach in sparse networks
-
Alternative to closeness in disconnected graphs
Example
CALL algo.harmonic('KNOWS', 'BOTH', true)
YIELD node, score
RETURN node, score ORDER BY score DESC LIMIT 10
References
algo.eigenvector
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
4 |
Syntax
CALL algo.eigenvector([relTypes, direction, maxIterations, tolerance])
YIELD node, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
String |
No |
|
Traversal direction: |
|
Integer |
No |
|
Maximum power-iteration steps |
|
Double |
No |
|
Convergence threshold |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Eigenvector centrality score in [0, 1] |
Description
Computes eigenvector centrality using the power iteration method. A node scores highly if it is connected to other high-scoring nodes. L∞ normalization (divide by maximum score) keeps values in [0, 1]. Convergence is checked against the maximum absolute change in scores between iterations.
Use Cases
-
Identifying globally influential nodes
-
Academic citation influence analysis
-
Prestige scoring in directed networks
Example
CALL algo.eigenvector('CITES', 'IN', 50, 1e-8)
YIELD node, score
RETURN node, score ORDER BY score DESC LIMIT 10
References
algo.hits
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
3 |
Syntax
CALL algo.hits([relTypes, maxIterations, tolerance])
YIELD node, hubScore, authorityScore
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
Integer |
No |
|
Maximum number of iterations |
|
Double |
No |
|
Convergence threshold (max score change) |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Hub score (good hub points to good authorities) |
|
Double |
Authority score (good authority is pointed to by good hubs) |
Description
Computes Hyperlink-Induced Topic Search (HITS) scores using alternating updates: authority scores are the sum of hub scores of incoming neighbors; hub scores are the sum of authority scores of outgoing neighbors. Both score vectors are L2-normalized after each iteration.
Use Cases
-
Web link analysis (hubs = index pages, authorities = content pages)
-
Identifying experts vs. curators in knowledge networks
-
Bipartite influence analysis
Example
CALL algo.hits('LINKS_TO', 30, 1e-8)
YIELD node, hubScore, authorityScore
RETURN node, hubScore, authorityScore ORDER BY authorityScore DESC LIMIT 10
References
-
Kleinberg, J. M. (1999). Authoritative sources in a hyperlinked environment. Journal of the ACM, 46(5), 604–632.
algo.katz
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
4 |
Syntax
CALL algo.katz([relTypes, alpha, maxIterations, tolerance])
YIELD nodeId, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
Double |
No |
|
Attenuation factor (must be less than 1/λ_max) |
|
Integer |
No |
|
Maximum number of iterations |
|
Double |
No |
|
Convergence threshold |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Katz centrality score (normalized to [0, 1]) |
Description
Computes Katz centrality, which counts all paths between nodes with exponential decay by path length. Formula: k[i] = alpha × Σ_j(A[j][i] × k[j]) + 1, normalized by the maximum score. Unlike eigenvector centrality, every node receives a base score (the +1 term), making it robust for directed and sparse graphs.
Use Cases
-
Influence ranking in directed social networks
-
Ranking nodes when direct connection is sparse
-
Early-stage recommendation systems
Example
CALL algo.katz('FOLLOWS', 0.01, 50, 1e-8)
YIELD nodeId, score
RETURN nodeId, score ORDER BY score DESC LIMIT 10
References
algo.voteRank
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
2 |
Syntax
CALL algo.voteRank([relTypes, topK])
YIELD nodeId, rank
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
Integer |
No |
all nodes |
Maximum number of top spreaders to return |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Integer |
1-based rank (1 = most influential spreader) |
Description
Identifies the most influential spreaders in a network using an iterative election process. In each round, the node with the highest accumulated votes is selected as a spreader. After selection, each of its neighbors has its voting ability reduced by 1/degree. This suppression mechanism ensures that the selected spreaders are structurally diverse rather than clustered together.
Use Cases
-
Viral marketing seed set selection
-
Identifying structurally independent influencers
-
Epidemic intervention: selecting individuals for immunization
Example
CALL algo.voteRank('KNOWS', 5)
YIELD nodeId, rank
RETURN nodeId, rank ORDER BY rank ASC
References
-
Zhang, J., et al. (2016). Identifying a set of influential spreaders in complex networks. Scientific Reports, 6, 27823.
algo.eccentricity
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
2 |
Syntax
CALL algo.eccentricity([relTypes, direction])
YIELD node, eccentricity, isCenter, isPeripheral
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
String |
No |
all types |
Comma-separated relationship types |
|
String |
No |
|
Traversal direction: |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Integer |
Maximum shortest-path distance to any reachable vertex |
|
Boolean |
|
|
Boolean |
|
Description
Computes the eccentricity of each vertex (the greatest shortest-path distance to any other reachable vertex) via BFS from each node. The graph radius is the minimum eccentricity and the graph diameter is the maximum. Center nodes have eccentricity equal to the radius; peripheral nodes have eccentricity equal to the diameter.
Use Cases
-
Graph center identification for optimal facility placement
-
Network diameter and radius computation
-
Peripheral node analysis for vulnerability assessment
Example
CALL algo.eccentricity('ROAD', 'BOTH')
YIELD node, eccentricity, isCenter, isPeripheral
RETURN node, eccentricity, isCenter, isPeripheral ORDER BY eccentricity ASC
References
algo.personalizedPageRank
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
1 |
Max Args |
5 |
Syntax
CALL algo.personalizedPageRank(sourceNode [, relTypes, dampingFactor, maxIterations, tolerance])
YIELD nodeId, score
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
|
Vertex |
Yes |
— |
The personalization origin vertex |
|
String |
No |
all types |
Comma-separated relationship types |
|
Double |
No |
|
Probability of following an edge |
|
Integer |
No |
|
Maximum power-iteration steps |
|
Double |
No |
|
Convergence threshold |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
RID |
Vertex identity |
|
Double |
Personalized PageRank score relative to the source node |
Description
Computes Personalized PageRank (PPR) relative to a single source vertex. Unlike standard PageRank, the teleportation probability is concentrated entirely at the source node (personalization vector = 1 at source, 0 everywhere else). Scores represent structural proximity/importance relative to the source. Dangling nodes contribute their rank back to the source only.
Use Cases
-
Node-centric similarity and proximity ranking
-
Recommendation systems ("nodes similar to X")
-
Query-centric graph exploration
Example
MATCH (s:Person {name:'Alice'})
CALL algo.personalizedPageRank(s, 'KNOWS', 0.85, 20, 0.000001)
YIELD nodeId, score
RETURN nodeId, score ORDER BY score DESC LIMIT 10
References
algo.articlerank
| Property | Value |
|---|---|
Procedure |
|
Category |
Centrality |
Complexity |
CPU |
Min Args |
0 |
Max Args |
1 |
Syntax
CALL algo.articlerank([config]) YIELD node, score
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
Map |
|
Configuration map (see below) |
Config Parameters
| Key | Type | Default | Description |
|---|---|---|---|
|
Float |
|
Damping factor (probability of following a link) |
|
Integer |
|
Maximum number of iterations |
|
Float |
|
Convergence threshold (sum of absolute score changes) |
Yield Fields
| Field | Type | Description |
|---|---|---|
|
Vertex |
The vertex |
|
Float |
ArticleRank score for the vertex |
Description
ArticleRank is a variant of PageRank that dampens the contribution of low-degree nodes. While standard PageRank divides a node’s rank equally among its out-degree neighbours, ArticleRank divides by outDegree(v) + avgOutDegree. This reduces the influence of nodes with very few connections, producing more balanced centrality scores in sparse or scale-free graphs.
Formula: AR(u) = (1 − d) / N + d × Σ AR(v) / (outDeg(v) + avgOutDeg)
Use Cases
-
Web page importance ranking where low-citation pages should have less influence
-
Academic citation networks with highly skewed degree distributions
-
Any domain where hub dampening is desirable
Example
CALL algo.articlerank({dampingFactor: 0.85, maxIterations: 20})
YIELD node, score
RETURN node.name AS name, score
ORDER BY score DESC LIMIT 10
References