Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-union-find-and-spanning-trees

Union-Find (Disjoint Set) & Minimum Spanning Trees (Kruskal)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Union-Find (Disjoint Set) & Minimum Spanning Trees (Kruskal) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-union-find-and-spanning-trees/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-union-find-and-spanning-trees)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-union-find-and-spanning-trees)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-union-find-and-spanning-trees" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Union-Find (Disjoint Set) & Minimum Spanning Trees (Kruskal) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Edge / Equivalence"]
  n1_1[("Parent & Rank Forest")]
  n2a_2["Path Compression"]
  n2b_3["Union by Rank/Size"]
  n3_4["Connected Components"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Find root · OalphaN"| n1_1
  n1_1 -->|"2a. Compress · O1 am"| n2a_2
  n1_1 -->|"2b. Merge sets · Union"| n2b_3
  n2a_2 -->|"3a. Emit group · Forest"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Edge / EquivalenceSTATELESS
    Pairs
  • Parent & Rank ForestSTATEFUL
    Flat integer arrays in L1 cache
  • Path CompressionSTATELESS
    Flattens tree pointers on find
  • Union by Rank/SizeSTATELESS
    Attaches smaller tree under larger
  • Connected ComponentsSTATELESS
    Entity dedup / Kruskal MST
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Edge / Equivalence → Parent & Rank Forest (Find root)[OalphaN]
  2. Parent & Rank Forest → Path Compression (Compress)[O1 am]
  3. Parent & Rank Forest → Union by Rank/Size (Merge sets)[Union]
  4. Path Compression → Connected Components (Emit group)[Forest]
  5. Union by Rank/Size → Connected Components (Merge)[RAM]
  6. Connected Components → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →