Shortest Path (shortestPath)

shortestPath (a:Person {name: 'Alice'}), (b:Person {name: 'Dave'})

BFS-based shortest path between two nodes. Returns the path as a sequence of nodes and relationships.

Syntax#

shortestPath (a:Label {key: value}), (b:Label {key: value})

See Also#

Try it
Open ↗
Loading engine…