Graphs

traversal

Following relationships from one node to the next to reach other parts of a graph.

Also written: traverse, traversals

Example

Tom Hanks and Tim Allen both acted in Toy Story.

cypher
MATCH path = (:Person {name: 'Tom Hanks'})-[:ACTED_IN]->(:Movie)<-[:ACTED_IN]-(:Person)
RETURN path

Tim Allen is reached in two steps. The first follows the [:ACTED_IN] relationship out of Tom Hanks to the film, the second follows the [:ACTED_IN] relationship that arrives at it. The query never names him.

Lessons that use this term

The lesson and course links below open in a new tab.

No published lesson uses this term yet.

All glossary terms