Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-greedy-and-interval-scheduling

Greedy Choice & Interval Scheduling (Sweep Line & Meeting Rooms)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Greedy Choice & Interval Scheduling (Sweep Line & Meeting Rooms) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-greedy-and-interval-scheduling/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-greedy-and-interval-scheduling)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-greedy-and-interval-scheduling)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-greedy-and-interval-scheduling" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Greedy Choice & Interval Scheduling (Sweep Line & Meeting Rooms) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Intervals start, end"]
  n1_1["Endpoint Sorter"]
  n2a_2["Sweep-Line Events"]
  n2b_3[("Active Min-Heap")]
  n3_4["Optimal Schedule"]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Sort O · Sort"| n1_1
  n1_1 -->|"2a. Sweep · Sweep"| n2a_2
  n1_1 -->|"2b. Reuse room · Heap"| n2b_3
  n2a_2 -->|"3a. Emit plan · ON log N"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Intervals [start, end]STATELESS
    Jobs, Bookings or Leases
  • Endpoint SorterSTATELESS
    Sort by end or start
  • Sweep-Line EventsSTATELESS
    +1 at start, -1 at end timeline
  • Active Min-HeapSTATEFUL
    Tracks earliest-ending room/worker
  • Optimal ScheduleSTATELESS
    Max jobs / min workers / merged
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Intervals [start, end] → Endpoint Sorter (Sort O)[Sort]
  2. Endpoint Sorter → Sweep-Line Events (Sweep)[Sweep]
  3. Endpoint Sorter → Active Min-Heap (Reuse room)[Heap]
  4. Sweep-Line Events → Optimal Schedule (Emit plan)[ON log N]
  5. Active Min-Heap → Optimal Schedule (Merge)[RAM]
  6. Optimal Schedule → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →