graph LR subgraph "Input Graph" A[s] --> B B --> C[t] D[s] --> E E --> F[t] end subgraph "Steiner Forest" A1[Source] --> S[* Steiner] S --> T1[Target] end
graph TB subgraph "Steiner Tree (Single Tree)" S1["sโ"] === T1["tโ"] S2["sโ"] === T2["tโ"] S3["sโ"] === T3["tโ"] end subgraph "Steiner Forest (Multiple Trees)" S1a["sโ"] --- T1a["tโ"] S2a["sโ"] --- T2a["tโ"] S3a["sโ"] --- T3a["tโ"] end
graph TD subgraph "Initial State (5 components)" A0(0) --> A0 B0(1) --> B0 C0(2) --> C0 D0(3) --> D0 E0(4) --> E0 end subgraph "After union(0,1), union(2,3)" A1(0) --> B1(1) C1(2) --> D1(3) end subgraph "After union(1,2) - Path Compression" A2(0) --> B2(1) --> C2(2) --> D2(3) end
flowchart LR A["1. Init: y=0, F={}"] --> B{"2. While โ unconnected pairs"} B -->|"Yes"| C["Identify Active Components"] C --> D["Increase y_C uniformly"] D --> E{"Edge becomes tight?"} E -->|"Yes"| F["Add e to F"] F --> G["Update Components"] G --> B B -->|"No"| H["3. Reverse Delete"] H --> I["Return Forest F'"]
graph TD subgraph "Grid Graph (hรw)" N00(0,0) --- N01(0,1) --- N02(0,2) N00 --- N10(1,0) --- N11(1,1) N01 --- N11 --- N12(1,2) N10 --- N11 --- N20(2,0) end
graph TD subgraph "Forest Property" C1(Cโ) --- C2(Cโ) C2 --- C3(Cโ) end Degree[Cโ]=1, Degree[Cโ]=2, Degree[Cโ]=1 Sum=4 โค 2ร3=6 โ