heavy_light_decomposition
Decompose a tree into heavy and light paths to enable efficient path queries.
Instructions
Perform heavy-light decomposition of a tree for efficient path queries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | No | Root vertex (default 0) | |
| edges | Yes | Edges as [u, v] pairs (0-indexed) | |
| vertex_count | Yes | Number of vertices |