Last active
November 16, 2021 19:21
-
-
Save emaadmanzoor/5cb814250916ac030db531e7db30c5ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (source:Place {id: "Amsterdam"}), (destination:Place {id: "London"}) | |
CALL gds.shortestPath.dijkstra.stream({ | |
nodeProjection: 'Place', | |
relationshipProjection: { | |
ROAD: { | |
type: 'EROAD', | |
properties: 'distance', | |
orientation: 'UNDIRECTED' | |
} | |
}, | |
sourceNode: source, | |
targetNode: destination, | |
relationshipWeightProperty: null | |
}) | |
YIELD index, sourceNode, targetNode, totalCost, nodeIds, costs, path | |
RETURN | |
index, | |
gds.util.asNode(sourceNode).name AS sourceNodeName, | |
gds.util.asNode(targetNode).name AS targetNodeName, | |
totalCost, | |
[nodeId IN nodeIds | gds.util.asNode(nodeId).name] AS nodeNames, | |
costs, | |
nodes(path) as path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment