{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec13

# lec13 - Spring 2010 6.851 Advanced Data Structures Lecture...

This preview shows pages 1–3. Sign up to view the full content.

6.851: Advanced Data Structures Spring 2010 Lecture 13 – Thursday, March 18, 2010 Prof. Erik Demaine Scribe: David Charlton 1 Overview This lecture covers two methods of decomposing trees into smaller subtrees: Separator Decompo- sition and ART / leaf-trimming-decomposition. The latter is applied to solve the marked ancestor problem and the decremental connectivity problem on trees. 2 Tree decompositions This course covers several ways of decomposing trees: Preferred paths: Rearranges a balanced tree to have a less balanced but nicer structure. We saw this in Tango trees, and will use it again when we cover link-cut trees. Heavy-light: Decomposes any tree (including an unbalanced one) into paths so that every leaf-to-root path hits only log n “heavy paths” (this means we can compress the heavy paths to get a balanced tree). This will also be used in link-cut trees. Separator decomposition: Rearranges any tree into a balanced tree by recursively splitting it into subtrees of roughly equal size. ART/leaf-trimming decomposition: Split the tree into “bottom” subtrees having lg n leaves and a “top” subtree consisting of the full tree with the bottom trees removed. This lecture covers the latter two decompositions, with some applications and open problems. 3 Separator theorem on trees A typical separator theorem on graphs would give a small set of vertices that splits the graph into balanced components. In the case of trees, we can do even better, as shown by this classic result of Camille Jordan [Jor69]: Theorem 1 (Jordan, 1869) . Any tree on n vertices has a vertex whose removal leaves connected components of size at most n/ 2 . Proof. Consider any vertex v . If v does not divide the tree into components of size n/ 2, then it is adjacent to a node of size > n/ 2, so take one step into that subtree and recurse (see Figure 1, where the recursion proceeds from v to u ). 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
>n/2 v u <n/2 Figure 1: A wrong choice of v results in an adjacent subtree having more than n/ 2 vertices. We change v to u , the root of the largest subtree adjacent to v , and recurse. This process will never cross the same edge twice, since a single tree edge can’t have > n/ 2 nodes on both sides, so we will find the desired separator vertex in at most n iterations (in fact, at most n/ 2, since we can’t start at distance more than n/ 2 from the target). 3.1 Separator decomposition The separator decomposition is defined recursively: given an input tree, apply Theorem 1 to get a balanced cut, and make the selected node v the root of a new tree. Remove v from the tree and recurse on the components to get the child subtrees. The resulting decomposition is a new tree on the same vertices with height at most log n . The decomposition will generally have different topology than the input: see the example in Figure 2.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern