Graph Theory37 sections · 1633 units
Open in Course

Check Your Understanding

(Decomposition depth)

The decomposition tree has depth O(logn)O(\log n) because each centroid removal halves the maximum component size. If you start with nn nodes, after one level you have components of size at most n/2n/2. After two levels, at most n/4n/4. After kk levels, at most n/2kn/2^k. When the size reaches 11, you stop. This logarithmic depth is why Centroid Decomposition is efficient. Quiz: For a tree with 10001000 nodes, what is the maximum depth of the decomposition tree?

Use the formula n/2k=1n/2^k = 1.

Space complexity is O(n)O(n) for the data structures used.