List paths from all reachable nodes from a given node

62 views
Skip to first unread message

Kevin Andrews

unread,
Jan 5, 2018, 1:06:30 PM1/5/18
to Neo4j
If this question has already been answered, please point me to the relevant post. I searched and couldn't find one.
Am looking for a cypher query to list all paths for nodes that can be reached from a given node. 

Thanks

Michael Hunger

unread,
Jan 6, 2018, 4:23:32 PM1/6/18
to ne...@googlegroups.com
Either use something like this:

MATCH (n:Label {id:124})
MATCH path = (n)-[*]->(m)
RETURN distinct m

Or for large graphs the neo4j-graph-algorithms also offer similar capabilities: https://neo4j-contrib.github.io/neo4j-graph-algorithms/#_minimum_weight_spanning_tree

Michael


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages