MIT6_851S10_lec17

MIT6_851S10_lec17 - 6.851: Advanced Data Structures Spring...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6.851: Advanced Data Structures Spring 2010 Lecture 17 April 8, 2010 Prof. Erik Demaine 1 Overview Last lecture we covered dynamic trees, also known as link-cut trees. Link-cut trees are able to represent a dynamic forest of rooted trees in O (log n ) amortized time per operation. In this lecture we will see how to maintain connectivity information for general graphs. We will start by examining a simpler, although not strictly better, alternative to link-cut trees known as Euler tour trees. We will then use Euler tour trees to achieve dynamic connectivity in general graphs in O (log 2 n ) time. Finally we will survey some of what is and is not known for dynamic graphs. 2 Euler Tour Trees Euler Tour trees are due to Henzinger and King [1] and are an alternative to link-cut trees for representing dynamic trees. Euler tour trees are simpler and easier to analyze than link-cut trees, but do not naturally store aggregate information about paths in the tree. Euler tour trees are well suited for storing aggregate information on subtrees, which is a feature we will use in the next section. The idea behind Euler Tour trees is to store the Euler tour of the tree. In an arbitrary graph, an Euler tour is a path that traverses each edge exactly once. For trees we say that each edge is bidirectional, so the Euler tour of a tree is the path through the tree that begins at the root and ends at the root, traversing each edge exactly twice once to enter the subtree, and once to exit it. The Euler tour of a tree is essentially the depth-first traversal of a tree that returns to the root at the end. The correspondence between a tree and its Euler tour is shown in Figure 1. A B D E R G C F Figure 1: An example tree and its Euler tour. The order in which nodes in the tree are visited is indicated by the curved red arrows. The Euler tour of the tree shown here corresponds to the sequence: R A R B C D C E C B F B G B R . 1 In an Euler-Tour tree, we store the Euler tour of a represented tree in a balanced binary search tree (BST). For some represented tree, each visit to a node in that trees Euler tour corresponds to a node in the BST. Each node in the represented tree holds pointers to the nodes in the BST representing the first and last times it was visited. As an example, the pointers between the root of the tree in Figure 1 and its Euler-tour node visitations is shown in Figure 2. A B D E R G C F R A R B C D C E C B F B G B R Figure 2: We represent a trees Euler tour as a sequence of visitations starting and ending at the root. Pointers from that sequence point to the node, and pointers from the node point to the first and last visitations. In this figure only the pointers relating to the root are shown....
View Full Document

This note was uploaded on 03/31/2011 for the course EECS 6.851 taught by Professor Erikdemaine during the Spring '10 term at MIT.

Page1 / 7

MIT6_851S10_lec17 - 6.851: Advanced Data Structures Spring...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online