Skip to content

Commit 6fa6a44

Browse files
authored
Merge pull request #55 from JohT/feature/refine-centrality
Optimize centrality reports using in-memory mutate
2 parents 8131b12 + 44dfc6f commit 6fa6a44

File tree

103 files changed

+559
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+559
-199
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Centrality Summary
2+
3+
MATCH (codeUnit)
4+
WHERE (codeUnit.incomingDependencies > 0 OR codeUnit.outgoingDependencies > 0)
5+
AND $dependencies_projection_node IN LABELS(codeUnit)
6+
RETURN coalesce(codeUnit.fqn, codeUnit.fileName, codeUnit.signature, codeUnit.name) AS name
7+
,coalesce(codeUnit.name, replace(last(split(codeUnit.fileName, '/')), '.jar', '')) AS shortName
8+
,codeUnit.centralityPageRank AS pageRank
9+
,codeUnit.centralityArticleRank AS articleRank
10+
,codeUnit.centralityBetweenness AS betweenness
11+
,codeUnit.centralityCostEffectiveLazyForward AS costEffectiveLazyForward
12+
,codeUnit.centralityHarmonic AS harmonicCloseness
13+
,codeUnit.centralityCloseness AS closeness
14+
,codeUnit.centralityHyperlinkInducedTopicSearchAuthority AS hyperlinkInducedTopicSearchAuthority
15+
,codeUnit.centralityHyperlinkInducedTopicSearchHub AS hyperlinkInducedTopicSearchHub
16+
,codeUnit.incomingDependencies AS incomingDependencies
17+
,codeUnit.outgoingDependencies AS outgoingDependencies

cypher/Centrality/Centrality_2a_Page_Rank_Estimate.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//Centrality 2a Page Rank Estimate Memory
1+
// Centrality 2a Page Rank Estimate Memory
22

33
CALL gds.pageRank.write.estimate(
4-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
55
writeProperty: $dependencies_projection_write_property
66
,maxIterations: 50
77
,dampingFactor: 0.85
88
,tolerance: 0.00000001
9-
,relationshipWeightProperty: $dependencies_projection_weight_property
9+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
1010
,scaler: "L1Norm"
1111
})
1212
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView

cypher/Centrality/Centrality_2b_Page_Rank_Statistics.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//Centrality 2b Page Rank Statistics
1+
// Centrality 2b Page Rank Statistics
22

33
CALL gds.pageRank.stats(
4-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
55
maxIterations: 50
66
,dampingFactor: 0.85
77
,tolerance: 0.00000001
8-
,relationshipWeightProperty: $dependencies_projection_weight_property
8+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
99
,scaler: "L1Norm"
1010
})
1111
YIELD ranIterations
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Centrality 3c Page Rank Mutate
2+
3+
CALL gds.pageRank.mutate(
4+
$dependencies_projection + '-cleaned', {
5+
maxIterations: 50
6+
,dampingFactor: 0.85
7+
,tolerance: 0.00000001
8+
,scaler: "L2Norm"
9+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
10+
,mutateProperty: $dependencies_projection_write_property
11+
})
12+
YIELD nodePropertiesWritten
13+
,didConverge
14+
,ranIterations
15+
,preProcessingMillis
16+
,computeMillis
17+
,mutateMillis
18+
,postProcessingMillis
19+
,centralityDistribution
20+
RETURN nodePropertiesWritten
21+
,didConverge
22+
,ranIterations
23+
,preProcessingMillis
24+
,computeMillis
25+
,mutateMillis
26+
,postProcessingMillis
27+
,centralityDistribution.min
28+
,centralityDistribution.mean
29+
,centralityDistribution.max
30+
,centralityDistribution.p50
31+
,centralityDistribution.p75
32+
,centralityDistribution.p90
33+
,centralityDistribution.p95
34+
,centralityDistribution.p99
35+
,centralityDistribution.p999

cypher/Centrality/Centrality_3c_Page_Rank_Stream.cypher renamed to cypher/Centrality/Centrality_3d_Page_Rank_Stream.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//Centrality 3c Page Rank Stream
1+
// Centrality 3d Page Rank Stream
22

33
CALL gds.pageRank.stream(
4-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
55
maxIterations: 50
66
,dampingFactor: 0.85
77
,tolerance: 0.00000001
8-
,relationshipWeightProperty: $dependencies_projection_weight_property
8+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
99
,scaler: "L2Norm"
1010
})
1111
YIELD nodeId, score

cypher/Centrality/Centrality_3d_Page_Rank_Write.cypher renamed to cypher/Centrality/Centrality_3e_Page_Rank_Write.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//Centrality 3d Page Rank Write
1+
// Centrality 3e Page Rank Write
22

33
CALL gds.pageRank.write(
4-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
55
maxIterations: 50
66
,dampingFactor: 0.85
77
,tolerance: 0.00000001
8-
,relationshipWeightProperty: $dependencies_projection_weight_property
8+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
99
,scaler: "L2Norm"
1010
,writeProperty: $dependencies_projection_write_property
1111
})

cypher/Centrality/Centrality_4a_Article_Rank_Estimate.cypher

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
//Centrality 4a Article Rank Estimate Memory
1+
// Centrality 4a Article Rank Estimate Memory
2+
23
CALL gds.articleRank.write.estimate(
3-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
45
writeProperty: $dependencies_projection_write_property
56
,maxIterations: 30
67
,dampingFactor: 0.85
78
,tolerance: 0.00000001
8-
,relationshipWeightProperty: $dependencies_projection_weight_property
9+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
910
,scaler: "L1Norm"
1011
})
1112
YIELD nodeCount, relationshipCount, bytesMin, bytesMax, heapPercentageMin, heapPercentageMax, treeView

cypher/Centrality/Centrality_4b_Article_Rank_Statistics.cypher

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
//Centrality 4b Article Rank Statistics
1+
// Centrality 4b Article Rank Statistics
2+
23
CALL gds.articleRank.stats(
3-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
45
maxIterations: 30
56
,dampingFactor: 0.85
67
,tolerance: 0.00000001
7-
,relationshipWeightProperty: $dependencies_projection_weight_property
8+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
89
,scaler: "L1Norm"
910
})
1011
YIELD ranIterations
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//Centrality 4c Article Rank Mutate
2+
3+
CALL gds.articleRank.mutate(
4+
$dependencies_projection + '-cleaned', {
5+
maxIterations: 30
6+
,dampingFactor: 0.85
7+
,tolerance: 0.00000001
8+
,scaler: "L2Norm"
9+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
10+
,mutateProperty: $dependencies_projection_write_property
11+
})
12+
YIELD nodePropertiesWritten
13+
,didConverge
14+
,ranIterations
15+
,preProcessingMillis
16+
,computeMillis
17+
,mutateMillis
18+
,postProcessingMillis
19+
,centralityDistribution
20+
RETURN nodePropertiesWritten
21+
,didConverge
22+
,ranIterations
23+
,preProcessingMillis
24+
,computeMillis
25+
,mutateMillis
26+
,postProcessingMillis
27+
,centralityDistribution.min
28+
,centralityDistribution.mean
29+
,centralityDistribution.max
30+
,centralityDistribution.p50
31+
,centralityDistribution.p75
32+
,centralityDistribution.p90
33+
,centralityDistribution.p95
34+
,centralityDistribution.p99
35+
,centralityDistribution.p999

cypher/Centrality/Centrality_4c_Article_Rank_Stream.cypher renamed to cypher/Centrality/Centrality_4d_Article_Rank_Stream.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//Centrality 4c Article Rank Stream
1+
//Centrality 4d Article Rank Stream
22

33
CALL gds.articleRank.stream(
4-
$dependencies_projection + '-without-empty', {
4+
$dependencies_projection + '-cleaned', {
55
maxIterations: 30
66
,dampingFactor: 0.85
77
,tolerance: 0.00000001
8-
,relationshipWeightProperty: $dependencies_projection_weight_property
8+
,relationshipWeightProperty: CASE $dependencies_projection_weight_property WHEN '' THEN null ELSE $dependencies_projection_weight_property END
99
,scaler: "L2Norm"
1010
})
1111
YIELD nodeId, score

0 commit comments

Comments
 (0)