Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-topological-ordering

Topological Ordering & Dependency Resolution (Kahn BFS & Build DAGs)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Topological Ordering & Dependency Resolution (Kahn BFS & Build DAGs) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-topological-ordering/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-topological-ordering)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-topological-ordering)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-topological-ordering" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Topological Ordering & Dependency Resolution (Kahn BFS & Build DAGs) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Dependency Graph"]
  n1_1[("In-Degree Counter")]
  n2a_2[("Ready Queue")]
  n2b_3["Cycle Detector"]
  n3_4["Parallel Execution Plan"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Init indeg · OV+E"| n1_1
  n1_1 -->|"2a. Enqueue 0 · Kahn BFS"| n2a_2
  n1_1 -->|"2b. Assert DAG · Check"| n2b_3
  n2a_2 -->|"3a. Schedule · DAG"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Dependency GraphSTATELESS
    Tasks / Modules / Models
  • In-Degree CounterSTATEFUL
    Counts unmet prerequisites per node
  • Ready QueueSTATEFUL
    Parallel wave execution frontier
  • Cycle DetectorSTATELESS
    visited < V proves cycle exists
  • Parallel Execution PlanSTATELESS
    Ordered waves / critical path
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Dependency Graph → In-Degree Counter (Init indeg)[OV+E]
  2. In-Degree Counter → Ready Queue (Enqueue 0)[Kahn BFS]
  3. In-Degree Counter → Cycle Detector (Assert DAG)[Check]
  4. Ready Queue → Parallel Execution Plan (Schedule)[DAG]
  5. Cycle Detector → Parallel Execution Plan (Merge)[RAM]
  6. Parallel Execution Plan → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →