Skip to content

Commit 10adaf1

Browse files
committed
Add report with all pairs shortest paths distribution for dependencies
1 parent 9230c53 commit 10adaf1

File tree

5 files changed

+553
-0
lines changed

5 files changed

+553
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Path Finding - All shortest paths algorithm - Stream
2+
3+
CALL gds.allShortestPaths.stream($dependencies_projection + '-cleaned')
4+
YIELD sourceNodeId, targetNodeId, distance
5+
WITH sourceNodeId, targetNodeId, toInteger(distance) AS distance
6+
WHERE gds.util.isFinite(distance) = true
7+
WITH gds.util.asNode(sourceNodeId) AS source
8+
,gds.util.asNode(targetNodeId) AS target
9+
,distance
10+
WHERE source <> target
11+
RETURN distance
12+
,count(*) AS pairCount
13+
,collect(DISTINCT source.fileName + ' ->' + target.fileName)[0..2] AS examples
14+
ORDER BY distance
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Longest paths distribution
2+
3+
CALL gds.dag.longestPath.stream($dependencies_projection + '-cleaned')
4+
YIELD index, sourceNode, targetNode, totalCost, nodeIds, costs, path
5+
RETURN toInteger(totalCost) AS totalCost
6+
,count(*) AS nodeCount
7+
ORDER BY totalCost
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Example on how to set the parameters for centrality in this case for Packages and PageRank
2+
3+
:params {
4+
"dependencies_projection": "package-path-finding",
5+
"dependencies_projection_node": "Package",
6+
"dependencies_projection_weight_property": "weight25PercentInterfaces",
7+
}

0 commit comments

Comments
 (0)