cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

A Function to display a single relationship between nodes

marcelix161
Node Clone

After I've run the algorithm (Dijkstra Single Source), the outcome is following:

match (source:Node1 {NAME:'H'})
call gds.allShortestPaths.dijkstra.stream('undirectedGOES', {sourceNode: source})
yield index, sourceNode, targetNode, nodeIds, path
return 
index, sourceNode, targetNode, nodeIds, path
order by index

I know I can use nodes(path) function to show only one path, but that function only returns the original paths (which have incorrect directions).

match (source:Node1 {NAME:'H'})
call gds.allShortestPaths.dijkstra.stream('undirectedGOES', {sourceNode: source})
yield index, sourceNode, targetNode, nodeIds, path
return 
index, sourceNode, targetNode, nodeIds, nodes(path) as path
order by index

Is there a way to show only a single path between nodes, but produced by the algorithm?
Some directions are different (before and after running the algorithm) and that piece of information is exactly what I need.

0 REPLIES 0