Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-04-2019 07:14 AM
I have a graph database representing a subway system. I am interested in finding all simple paths (paths that do not visit the same station twice) possible from one station to another. Due to the complexity of the train network, there may be thousands of possible ways to get from one "A" to station "B".
I am currently using this query:
MATCH (start:Station{sid:'351'}), (end:Station{sid:'355'})
CALL algo.kShortestPaths.stream(start, end, 50, 'cost' ,{})
YIELD index, nodeIds, costs
RETURN [node in algo.getNodesById(nodeIds) | node.name] AS places
However, that only finds the first 50 shortest paths. If I try to query the first 1000 paths the DB crashes.
I am not too concerned with how long it will take but I want to be certain I have all possible paths.
Thoughts?
All the sessions of the conference are now available online