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.

80 lessons use this term. The 40 with the highest term density are listed here.

Intermediate Cypher Queries30 mentions

Modeling and Importing Data into Neo4j Workshop18 mentions

  • Multi-Hop Traversals for RecommendationsMany-to-Many Relationshipsyou'll see the full power of graph traversals4 mentions
  • CongratulationsBuilding Recommendations and Reviewverbs - Connections with meaning and direction (PLACED, CONTAINS) Graph traversal - Following relationships in memory (fast)2 mentions
  • Understanding RelationshipsModeling Relationshipsthe need for global index lookups and join materialization, making deep traversals more predictable and often significantly faster than equivalent multi-join relational queries—especially when4 mentions
  • Building the Recommendation QueryBuilding Recommendations and ReviewBuild queries incrementally to understand traversal patterns Optimize graph queries using list expressions Measure query performance with3 mentions
  • Workshop OverviewIntroductionto 38 lines of SQL Performance understanding - How anchor nodes and traversal make queries fast Hands-on experience - Import data, write queries, and understand graph database3 mentions

Neo4j Management, Optimization, and Refactoring Workshop10 mentions

  • Query Good PracticeQuery Performancetypes are specified - Always provide relationship types to narrow traversals Relationship directions are specified - Always specify the direction of the relationship when it is known -2 mentions
  • Indirect relationships between nodesGraph refactoringindirect relationships between nodes can help improve traversal performance and create more efficient query2 mentions
  • Why refactor?Graph refactoringtaking longer than expected as data grows Memory errors during complex traversals High CPU usage for simple operations Queries that don't scale linearly with data2 mentions

Context Graphs: Agent Memory with Neo4j25 mentions

  • Why Graphs for Agent MemoryIntroduction to Agent Memoryit cannot do is traverse5 mentions
  • Why graphs over vector embeddingsLong-Term Memorywill learn what vector embeddings can and cannot do — and why multi-hop graph traversal answers questions that embeddings alone5 mentions
  • The Persistent Knowledge ProblemLong-Term Memoryneed to traverse these connections, not just look up individual2 mentions
  • The Short-Term Memory APIShort-Term MemoryThis traversal is structurally impossible in a flat table without a sort column — and the pattern becomes more capable when combined2 mentions
  • The Long-Term Memory APILong-Term Memoryto restrict the traversal2 mentions
  • The Three Memory TypesIntroduction to Agent Memory— indefinite retention | | Access pattern | Semantic search + multi-hop graph traversal | | Primary question | "What do you know about this entity?"3 mentions

Neo4j & GenerativeAI Fundamentals11 mentions

  • Graph-Enhanced Vector RetrieverIntegrating Neo4j with Generative AIthe graph, you can create a retriever that uses both vector search and graph traversal to find relevant5 mentions
  • GraphRAGRetrieval Augmented Generation (RAG)Improved Accuracy - By combining vector similarity with graph traversal, results are more precise and6 mentions

Cypher Fundamentals2 mentions

  • Finding RelationshipsReading Data from Neo4jWe can extend the pattern in the MATCH clause to traverse through all relationships with a type of ACTED_IN to any2 mentions

Importing Data into Neo4j Workshop2 mentions

  • How to Model DataImporting data into Neo4jRelationships are fast to traverse and2 mentions

AuraDB Fundamentals14 mentions

  • Query toolToolsConnect to your Aura instance using the Query tool Write Cypher queries that traverse relationships Visualize query results in different formats Understand how relationship traversal works in graph6 mentions

AI on Your Lakehouse: Context Comes in Shapes, Not Queries4 mentions

  • Optional Library PracticeNavigate What's There - Table of ContentsThese exercises build the traversal fluency the themes shape and the estate questions rely2 mentions
  • Graph Reasoning with neo4j-cliGraph Reasoning with neo4j-clishapes, one database - the agent reads the schema to know which to traverse1 mention

Full-Text Search in Neo4j3 mentions

  • Build a Movie Search with Cast and CrewFull-Text Searcheverything from the lab —search operators, relevance scoring, and graph traversal —into a single query that returns rich movie2 mentions

GraphRAG Hackathon11 mentions

  • Understanding GraphRAGIntroduction to GraphRAGcombines graph traversal with vector search to give LLMs richer5 mentions
  • Build your first agent applicationTime to Builda running application that connects to Neo4j and returns results from a graph traversal2 mentions
  • Understanding Neo4jIntroduction to GraphRAGmakes traversal fast regardless of data size, and makes your data model match how you actually think about the2 mentions

Path Finding with GDS5 mentions

  • Why use graphsWhy Graphs?databases is that you don't know beforehand how many relationships you must traverse to get from node A to node3 mentions

Introduction to Graph Databases Workshop1 mention

Aura In Production5 mentions

Introduction to Neo4j & GraphQL5 mentions

  • GraphQL RelationshipsGraphQL Queriesupdate the Matrix movie search query to traverse from the movie nodes to the actors and2 mentions

Graph Data Modeling Fundamentals4 mentions

  • Specific RelationshipsUsing Specific Relationshipsas a native graph database is implemented to traverse relationships2 mentions
  • Specializing RATED RelationshipsUsing Specific Relationshipsquery would need to traverse all RATED relationships and evaluate the rating1 mention

Neo4j Fundamentals3 mentions

  • Graphs Are EverywhereGraph Thinkinggraph query can traverse this pattern and recommend the Yoga Mat to Alice —a customer who bought a similar product also bought2 mentions

All glossary terms