Py2neo graph traversals

(pckrt) #1

I have created a graph database. How can I perform graph traversals using py2neo? Can I apply traversal algorithms such as BFS and DFS in py2neo?
Also how can I write a cypher query which gives all the relationships and nodes existing between two nodes when two nodes are given as input. ex: a-r1>b-r2>c-r3>d...and if I give a and d as input nodes, I want the output as set of relations: r1,r2,r3 and set of nodes: b,c..
How can I write a cypher query for this?

0 Likes

(Michael Hunger) #4

You can do such traversals with the apoc.expand procedures which have fine control over traversal modes.

I guess you already looked at the Cypher syntax and took the online training?

That should help you with figuring out the query which is a simple match + return of your pattern.

0 Likes