I have a graph with many hundread thousand nodes. In that, there is one particular node of interest. I want to get all nodes connected to that node with any relationship and any relationship depth (that is it might be connected to the original node through several other nodes). I queries node with its id
property and expanded all its neighboring nodes. The graph looks like this with the node of interest highlighted/clicked:
I tried following query to get all those nodes:
MATCH (a {id :"8e5b90c5242f4382bd8e71ae901b0433"})
CALL apoc.path.expandConfig(a,
{
uniqueness: 'NODE_PATH'
}) yield path
return path
But this makes the neo4j take gigs of RAM and I have only 4GBs. The query hangs pc and never completes. Whats wrong with cypher?
(a)-[]->(b)
is considered different from(a)-[]->(b)-[]->(a)
? If yes, does that imply any graph with a cycle will lead to infinite number of paths? – Mahesha999