Dynamic Trees:ET Trees.
ET Trees
ET trees, first introduced in [18], have been later used to design algorithms for a variety of problems on dynamic graphs, such as fully dynamic connectivity and bipartiteness (see, ., [10, 13]).
They provide an implicit representation of dynamic forests whose vertices are associated with weighted or unweighted keys. In addition to arbitrary edge insertions and deletions, updates allow it to add or remove the weighted key associated to a vertex.
Supported queries are the following:
• connected(u, v): tells whether vertices u and v are in the same tree.
• size(v): returns the number of vertices in the tree that contains v.
• minkey(v): returns a key of minimum weight in the tree that contains v; if keys are unweighted, an arbitrary key is returned.
The main concept for the definition of ET trees is that of Euler tour.
DEFINITION 35.4 An Euler tour of a tree T is a maximal closed walk over the graph obtained by replacing each edge of T by two directed edges with opposite direction.
The Euler tour of a tree can be easily computed in linear time by rooting the tree at an arbitrary vertex and running a depth first visit [4]. Each time a vertex v is encountered on the walk, we call this an occurrence of v and we denote it by o(v). A vertex of degree ∆ has exactly ∆ occurrences, expect for the root which is visited ∆ + 1 times. Furthermore, the walk traverses each directed edge exactly once; hence, if T has n vertices, the Euler tour has length 2n − 2. Given an n-vertex tree T , we encode it with a sequence of 2n − 1 symbols given by an Euler tour. We refer to this encoding as ET (T ). For instance, the encoding of the tree given in Figure 35.7 derived from the Euler tour shown below the tree itself is ET (T ) = a b c b d b g f g e g b a.
DEFINITION 35.5 An ET tree is a dynamic balanced d-ary tree over some Euler tour around T . Namely, the leaves of the ET tree are the nodes of the Euler tour, in the same order in which they appear (see Figure 35.7).
An ET tree has O(n) nodes due to the linear length of the Euler tour and to properties of d-ary trees. However, since each vertex of T may occur several times in the Euler tour, an arbitrary occurrence is marked as representative of the vertex.
Updates
We first analyze how to update the encoding ET (T ) when T is subject to dynamic edge operations. If an edge e = (u, v) is deleted from T , denote by Tu and Tv the two trees
Applications
The query connected(u, v) can be easily supported in time O(log n/d) by finding the roots of the ET trees containing u and v and checking if they coincide. The same time is sufficient to check whether one element precedes another element in the ordering.
To support size and minkey queries, each node q of the ET tree maintains two additional values: the number s(q) of representatives below it and the minimum weight key k(q) attached to a representative below it. Such values can be easily maintained during updates and allow it to answer queries of the form size(v) and minkey(v) in O(log n/d) time for any vertex v of the forest: the root r of the ET tree containing v is found and values s(r) and k(r) are returned, respectively. details of the method.
We refer the interested reader to [10] for additional In Section 36.4 we will see how ET trees have been used [10, 11] to design a polyloga- rithmic algorithm for fully dynamic connectivity. Here we limit to observe that trees in a spanning forest of the dynamic graph are maintained using the Euler tour data structure, and therefore updates and connectivity queries within the forest can be supported in logarithmic time. The use of randomization and of a logarithmic decomposition makes it possible to maintain also non-tree edges in polylogarithmic time upon changes in the graph.
Comments
Post a Comment