Speed and Precision: Mastering Graph Traversal With Quantified Path Patterns
summary
Neo4j 5.9’s Quantified Path Patterns let Cypher filter while expanding, which prune-before-expand and avoids exploding intermediate rows. A supply‑chain query that needed an upper bound and took ~14s on 1k nodes/3k relationships returns in 3 milliseconds with only 107 rows. An anti‑money‑laundering refactor (transactions + accounts) runs on a 100× larger graph in ~600ms and still finds a 200-node cycle in ~481ms, with runtime linear in path length.
AI-written summary · about
chapters (14)
- 0:00Introduction to graph traversal
- 1:34Supply chain use case
- 4:24Cipher limitations with complex patterns
- 7:41Trying APOC path solutions
- 9:05Neo4j 5.9 Quantified Path Patterns
- 10:11What are Quantified Path Patterns
- 11:37Example with colored nodes
- 16:30Supply chain query with QPP
- 17:35Performance with QPP
- 17:56Anti-money laundering example
- 20:23Refactoring the graph
- 21:49Benchmark results
- 23:15Why QPP scales efficiently
- 24:19Key takeaways








