Background statement:
I want to find all the path between Node A and Node F (something like how many ways I can reach F from A), then my Cypher like this bellow:
MATCH (start:kg:test), (end:kg:test), p = allShortestPaths((start)-[*..8]-(end)) where start.value = 'A' and end.value = 'F' RETURN start, end, p
shortestPath
function), like bellow:
Problems
allShortestPaths
function?thanks
shortestPath()
returns the single shortest path between the nodes (and if there are multiple of the same size it just returns the first that it finds).
If there are multiple paths that could have been returned by shortestPath()
(they will all have the same size), then allShortesPaths()
will return them.
If you just want to find all possible paths between two nodes (the length of the path doesn't matter, and you don't care about shortest paths at all), then you don't need to use either of these functions.
MATCH p=(start:kg:test)-[*..8]-(end:kg:test)
where start.value = 'A' and end.value = 'F'
RETURN start, end, p