Skip to content

Commit 3c3c6ad

Browse files
committed
Give graph.dijkstra_single_source paths in result
1 parent bbda349 commit 3c3c6ad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

applications/algorithms/path-finding/src/main/java/org/neo4j/gds/applications/algorithms/pathfinding/PathFindingAlgorithmsMutateModeBusinessFacade.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,30 @@ public <RESULT> RESULT singleSourceShortestPathDijkstra(
298298
);
299299
}
300300

301+
public <RESULT> RESULT singleSourceShortestPathDijkstraWithPaths(
302+
GraphName graphName,
303+
AllShortestPathsDijkstraMutateConfig configuration,
304+
Map<String, Stream<PathUsingInternalNodeIds>> pathStore,
305+
ResultBuilder<AllShortestPathsDijkstraMutateConfig, PathFindingResult, RESULT, Void> resultBuilder
306+
) {
307+
var sideEffect = new StorePathsSideEffect(pathStore, configuration.mutateRelationshipType());
308+
309+
return algorithmProcessingTemplate.processAlgorithmAndAnySideEffects(
310+
Optional.empty(),
311+
graphName,
312+
configuration,
313+
Optional.empty(),
314+
Optional.empty(),
315+
SingleSourceDijkstra,
316+
DimensionTransformer.DISABLED,
317+
() -> estimationFacade.singleSourceShortestPathDijkstra(configuration),
318+
(graph, __) -> pathFindingAlgorithms.singleSourceShortestPathDijkstra(graph, configuration),
319+
Optional.of(sideEffect),
320+
new MutateResultRenderer<>(configuration, resultBuilder)
321+
);
322+
}
323+
324+
301325
public <RESULT> RESULT spanningTree(
302326
GraphName graphName,
303327
SpanningTreeMutateConfig configuration,

0 commit comments

Comments
 (0)