centroid_decomposition
Compute centroid decomposition of a tree to obtain centroid parents and depths for efficient tree traversal and hierarchical analysis.
Instructions
Compute the centroid decomposition of a tree, returning centroid parents and depths.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"vertex_count": "<vertex_count>",
"edges": "<edges>"
},
"name": "centroid_decomposition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edges | Yes | Tree edges as [u, v] pairs (must be N-1 edges) | |
| vertex_count | Yes | Number of vertices (max 50,000) |