Reputation: 485
I have a graph where multiple (more than 300) paths can exist between two nodes.
I want to find paths between a particular node and set of nodes. I'm using following query to accomplish this.
// 2,153 and 485 are nodeid.
START startnode=node(2), group = node(153 ,485)
MATCH p=startnode-[:C0038969primrel*1..4]->group
RETURN DISTINCT p
If I change the depth from 1..4 to 1..3 then it returns the result but for 1..4 it doesn't return.
I'm using embedded database. Should I have my database on server and increase maxmemory? would that help?
Should I have different kind of query to accomplish the same?
I'm kind of stuck because of this. Would really appreciate, moreover, grateful for your help.
Upvotes: 3
Views: 1844
Reputation: 41676
Use shortestPath
or allShortestPaths
START startnode=node(2), group = node(153 ,485)
MATCH p=allShortestPaths(startnode-[:C0038969primrel*..4]->group)
RETURN p
Upvotes: 8