How do you return the shortest path between two nodes in Memgraph. I found the algorithm for the weighted shortest path in their documentation [*WSHORTEST (r, n | r.weight)], but this is not what I am looking for. I need to find the shortest path between two specific nodes without using weights.
Neo4j has a way of doing this with Cypher's shortestPath((startNode) - [*] - (endNode) function, but as far as I know this is not supported in Memgraph which uses openCypher.
So the question is how to compute the shortest path in Memgraph; is there an algorithm for it or can I somehow use WSHORTEST without weights (I tried but could not made it work).
@cybersam is right! The variable length
bfsis most likely what you want.wshortestcan also be used by specifying1in the expression part, so:but it's too heavy for the simplest shortest path because it runs the full Dijkstra algorithm, which is not required if the weights are constants.