Purpose
- A second way to decompose trees, alongside the preferred-path decomposition
10:52. - Crucial distinction: preferred paths are maintained by the data structure (they are what aux trees store); the heavy-light decomposition is purely an analysis device — never materialized in the structure
10:52,11:43. - Aside: structures that want worst-case (not amortized) bounds do maintain it explicitly; splay-tree-based link-cut trees only need amortized bounds, so they don't
11:43.
Definitions
size(v)= number of vertices inv's subtree in the represented tree12:12.- For a child
uofv, the edgeuvis:
Four edge types
Every edge of the represented tree carries two independent labels, giving four types 13:22, 14:12:
| preferred | not preferred | |
|---|---|---|
| heavy | ✔ | ✔ |
| light | ✔ | ✔ |
Creation / destruction vocabulary
- Accessing
vmakes the root-to-vpath preferred, so edges hanging off a different subtree that used to be preferred stop being so14:12,15:05. - If
vis the parent ofuandw, anduvwas preferred but nowwvis:uvwas destroyed,wvwas created15:30.
Two structural facts used later
- A vertex has at most one heavy child — heavy means strictly more than half the descendants, and two such children cannot coexist
24:37. It may have many light children, or no heavy child at all25:06. - Any root-to-vertex path contains at most
log nlight edges: subtree size is bounded above byn, and traversing a light edge halves the size28:24,29:01,29:26.