Limiting Graph Traversals

For my app I have multiple trees of varying depth. The leaves of the tree are linked to a shared set of nodes that represent the company that owns the leaf node. The companies are linked to multiple nodes in multiple trees. When I traverse a tree the traversal ‘walks’ across the company nodes and into the the next tree. I’d like to break the traversal at the company nodes. Is there is a best practice for setting logical boundaries inside a graph?

Hi @hethcox

What do you mean by setting logical boundaries inside the graph? You can set traversal conditions on the single queries (TRAVERSE or MATCH), but there is no concept of traversal boundary for the graph by itself



In my case I’d like to traverse until I hit a particular class of nodes and the stop traversing. I’m still learning graph DB techniques so I was trying to frame my question as a general one for utilizing best practices. It looks like traversals an be limited by WHERE clauses, but the directionality (in/out) of the edged could also be leveraged. Is one better than the other?