ARCHOS 525 BLUEPRINT · /d/dgm_code-graph-traversal-bfs-dfs
Graph Traversal (BFS Shortest Hop, DFS Cycles & Iterative Safety)
6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_code-graph-traversal-bfs-dfs) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-graph-traversal-bfs-dfs)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-graph-traversal-bfs-dfs" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Graph Traversal (BFS Shortest Hop, DFS Cycles & Iterative Safety) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0["Graph Adjacency List"]
n1_1[("Visited / Color State")]
n2a_2[("BFS Level Queue")]
n2b_3["Iterative DFS Stack"]
n3_4["Reachability / Path"]
downstream_5["Downstream & OTel"]
client_0 -->|"1. Mark state · Array/Se"| n1_1
n1_1 -->|"2a. Pop FIFO · OV+E"| n2a_2
n1_1 -->|"2b. Explore · OV+E"| n2b_3
n2a_2 -->|"3a. Emit path · OV+E"| n3_4
n2b_3 -->|"3b. Merge · RAM"| n3_4
n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5COMPONENT STACK (6)
- Graph Adjacency ListSTATELESSNodes V + Edges E
- Visited / Color StateSTATEFUL0=Unvisited, 1=Active, 2=Done
- BFS Level QueueSTATEFULUnweighted shortest path + multi-src
- Iterative DFS StackSTATELESSAvoids stack overflow on deep graphs
- Reachability / PathSTATELESSParent pointers reconstruct path
- Downstream & OTelSTATELESSConsumers, metrics & SLOs
REQUEST & DATA FLOW (6)
- Graph Adjacency List → Visited / Color State (Mark state)[Array/Se]
- Visited / Color State → BFS Level Queue (Pop FIFO)[OV+E]
- Visited / Color State → Iterative DFS Stack (Explore)[OV+E]
- BFS Level Queue → Reachability / Path (Emit path)[OV+E]
- Iterative DFS Stack → Reachability / Path (Merge)[RAM]
- Reachability / Path → Downstream & OTel (Emit /)[OTLP/API]