Graph Databases
Traverse the dependency cycle within a stated depth
BOTIE
Examples, experiments and workspace controls
Connect a tool's inputs to see what it produces. You can try a branch before connecting it to Result.
Try your own inputs
Use a copy of the example to try your own data. Keep the problem's assumptions in mind, and predict the effect of a change before checking the output. You can also add another branch to compare two ways of doing the calculation.
Context for this challenge
Choose DEPENDS_ON edges and connect start and maximum depth to bounded reachability. Inspect the starting node at depth zero and the visited frontier.
Botie must stop revisiting equipment and keep the report’s reach explicit.
Inspect the component calculation
Find bounded reachable nodes(
Typed relationships: Choose a relationship type(
Relationships: Read graph relationships(
Graph: Directed dependency graph
)
Relationship type: DEPENDS_ON
)
Starting ID: Starting asset
Maximum depth: Maximum hop depth
)Examples and results
- Directed dependency graph
Nodes and properties (4)
- P7 · Asset
- S1 · Asset
- S2 · Asset
- S3 · Asset
- P7 to S1: DEPENDS_ON
- S1 to S2: DEPENDS_ON
- S2 to P7: DEPENDS_ON
- S2 to S3: DEPENDS_ON
Inspect the node and relationship records
{ "nodes": [ { "id": "P7", "kind": "Asset" }, { "id": "S1", "kind": "Asset" }, { "id": "S2", "kind": "Asset" }, { "id": "S3", "kind": "Asset" } ], "edges": [ { "id": "a", "source": "P7", "target": "S1", "type": "DEPENDS_ON" }, { "id": "b", "source": "S1", "target": "S2", "type": "DEPENDS_ON" }, { "id": "c", "source": "S2", "target": "P7", "type": "DEPENDS_ON" }, { "id": "d", "source": "S2", "target": "S3", "type": "DEPENDS_ON" } ] }- Starting asset
P7
- Maximum hop depth
2
- Required result
[ { "id": "P7", "depth": 0 }, { "id": "S1", "depth": 1 }, { "id": "S2", "depth": 2 } ]
- Directed dependency graph
Nodes and properties (4)
- P7 · Asset
- S1 · Asset
- S2 · Asset
- S3 · Asset
- P7 to S1: DEPENDS_ON
- S1 to S2: DEPENDS_ON
- S2 to P7: DEPENDS_ON
- S2 to S3: DEPENDS_ON
Inspect the node and relationship records
{ "nodes": [ { "id": "P7", "kind": "Asset" }, { "id": "S1", "kind": "Asset" }, { "id": "S2", "kind": "Asset" }, { "id": "S3", "kind": "Asset" } ], "edges": [ { "id": "a", "source": "P7", "target": "S1", "type": "DEPENDS_ON" }, { "id": "b", "source": "S1", "target": "S2", "type": "DEPENDS_ON" }, { "id": "c", "source": "S2", "target": "P7", "type": "DEPENDS_ON" }, { "id": "d", "source": "S2", "target": "S3", "type": "DEPENDS_ON" } ] }- Starting asset
P7
- Maximum hop depth
0
- Required result
[ { "id": "P7", "depth": 0 } ]
Try a fresh construction
This clears this draft, including its undo history. Earlier successful attempts stay recorded. Build again without opening hints to record an independent attempt.
Stuck? Inspect a worked construction
The tools below form one possible solution. You can assemble it, follow its signals, and undo that change to return to your own construction.
Assumptions and test precision
These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher. Numerical tests allow a difference of 0.001. Lists and structures must also have the right shape.
Your last tested pieces can start the full construction. An existing draft there keeps its own pieces.
Two branches rejoin before a deeper cycle
This check uses the pieces from “Return the reached dependencies without the start”.
BOTIE
- Directed dependency graph
Nodes and properties (6)
- R1 · Asset
- S1 · Asset
- S2 · Asset
- S3 · Asset
- S4 · Asset
- S9 · Asset
- R1 to S1: DEPENDS_ON
- R1 to S2: DEPENDS_ON
- S1 to S3: DEPENDS_ON
- S2 to S3: DEPENDS_ON
- S3 to S4: DEPENDS_ON
- S4 to S1: DEPENDS_ON
- R1 to S9: NEAR
Inspect the node and relationship records
{ "nodes": [ { "id": "R1", "kind": "Asset" }, { "id": "S1", "kind": "Asset" }, { "id": "S2", "kind": "Asset" }, { "id": "S3", "kind": "Asset" }, { "id": "S4", "kind": "Asset" }, { "id": "S9", "kind": "Asset" } ], "edges": [ { "id": "a", "source": "R1", "target": "S1", "type": "DEPENDS_ON" }, { "id": "b", "source": "R1", "target": "S2", "type": "DEPENDS_ON" }, { "id": "c", "source": "S1", "target": "S3", "type": "DEPENDS_ON" }, { "id": "d", "source": "S2", "target": "S3", "type": "DEPENDS_ON" }, { "id": "e", "source": "S3", "target": "S4", "type": "DEPENDS_ON" }, { "id": "loop", "source": "S4", "target": "S1", "type": "DEPENDS_ON" }, { "id": "near", "source": "R1", "target": "S9", "type": "NEAR" } ] }- Starting asset
R1
- Maximum hop depth
2
Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.
Build a construction in the workspace above first. This case will test those pieces.
Does excluding S3 at depth two establish that S3 is unreachable?
A bounded answer needs its boundary attached to the interpretation.
These components operate on the supplied records in your browser. They do not run a graph database or interpret Cypher.
Work through the Python challenges →