Find the shortest path between two nodes using Breadth-First Search.
ShortestPath
::ShortestPath<EdgeType>::To(to_id: ID) ::ShortestPath<EdgeType>::From(from_id: ID)
QUERY GetShortestPath(from_id: ID, to_id: ID) { path_to <- N<User>(from_id)::ShortestPath::To(to_id) path_from <- N<User>(from_id)::ShortestPath::From(to_id) RETURN path_to, path_from }
[([Nodes], [Edges])]
Was this page helpful?