MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / CentroidDecomposition

Class CentroidDecomposition

src/graph/centroid_decomposition.rs:15–26  ·  view source on GitHub ↗

Centroid Decomposition for a tree. Given a tree, it can be recursively decomposed into centroids. Then the parent of a centroid `c` is the previous centroid that splitted its connected component into two or more components. It can be shown that in such decomposition, for each path `p` with starting and ending vertices `u`, `v`, the lowest common ancestor of `u` and `v` in centroid tree is a verte

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected