Query, Chomp, Repeat
Blog post from Neo4j
In the Neo4j Developer Blog post, Finbar Good explores the introduction of the REPEATABLE ELEMENTS match mode in Cypher 25, which allows relationships in a graph database to be traversed multiple times within a single match query. This new feature enhances pathfinding capabilities in Neo4j by accommodating scenarios where backtracking or cycle repetition is necessary, such as optimal pathfinding with constraints, covering path problems, and peer-to-peer reachability in hierarchical structures. The blog illustrates various use cases, including finding optimal routes with constraints, modeling real-world movement like a doctor's rounds, and exploring family trees for common ancestors. However, the author cautions that enabling relationship repetition significantly increases the number of potential paths, necessitating careful constraints to manage computational complexity, such as limiting path length or dividing the problem into smaller, manageable subproblems.