• Keine Ergebnisse gefunden

3.2 Preprocessing

3.2.2 When is a Cut-Vertex Covered?

A block-cut tree’s edgee∈ET is said to becoveredby an augmentation edgeeA= (u, v)∈EA if and only if e is part of the tree path connecting u with v. In order to completely cover a cut-vertex vc VT, all its incident tree-edges need to be covered, but this is in general not sufficient.

If vc and its incident edges are removed from T, the tree falls apart into l connected componentsC1vc, . . . , Clvc, wherel is the degree ofvc inT; we call themcut-components of vc; Figure 3.4 illustrates this. To completely covervc, at leastl−1 augmentation edges are needed such that all cut-componentsC1vc, . . . , Clvc are united into one connected graph.

We say that an augmentation edge eA= (u, v)∈EAcontributes in covering the cut-vertex

3.2. PREPROCESSING 43 vc, if it connects two cut-componentsCivc andCjvc. Note that two tree-edges incident tovcare covered byeA.

For any cut-vertexvc∈VT, let Γ(vc)⊆EAbe the set of augmentation edges that contribute in covering vc. Furthermore, for each eA EA, let Ψ(eA) VT be the set of cut-vertices to whose covering eA contributes, i.e., Ψ(eA) = {vc VT |eA Γ(vc)}. Preprocessing explicitly computes and stores the sets Γ(vc) for all cut-vertices and the sets Ψ(eA) for all augmentation edges as supporting data structures. This is done by first performing a depth-first search onT and storing for each vertex its depth and a reference to its parent vertex, in order to be able to efficiently determine the tree-path between any pair of vertices. Then, the computation of all sets Γ(vc) and Ψ(eA) can be performed in O(|EA| |VT|) time. The space required for these data structures is bounded above byO(|EA| |VT|).

Let us consider the following special case in which the graph G is complete, and the fixed graphG0 represents a balanced binary tree:

Definition 8. [Perfect Binary Tree]

A perfect binary tree of height h 0 is a binary tree T = {r, TL, TR}, with the following properties:

If h= 0, then TL= andTR=∅,

If h >0, then bothTL and TR are perfect binary trees of height h−1.

The vertex r is called the root vertex of the tree.

It follows directly from the definition that a perfect binary tree of height h has exactly n= 2h+11 vertices.

Augmenting a Perfect Binary Tree. Suppose we are given a complete graph G= (V, E) with a fixed perfect binary treeG0 = (V, E0) of heighth.

We want to answer the following question: What are the memory complexities of Γ and Ψ data structures in this special case? After the transformation ofG0 into the block-cut tree T, we obtain a perfect binary block-cut tree with block-vertices representing leaves, while the rest of the vertices are cut-vertices with one-to-one correspondence to the inner vertices ofG04. Thus, the total number of vertices in T is alson= 2h+11. Let us first compute the average number of edges that contribute in covering of a certain cut-vertex. The root vertex r has degree two, i.e. its removal disconnects the graph into two connected components, each having (n1)/2 = 2h1 vertices. Hence, the size of Γ(r) is the number of edges representing the maximal edge-cut between two subtrees:

|Γ(r)|= (2h1)2 .

Let the root have depth zero, and let each leaf have depthh. Consider now the removal of a cut-vertex vkc in depth k, where 1≤k≤h−1. Each of these cut-vertices has degree three,

4Empty block-vertices can be taken out of consideration. For an explanation, see the next section.

and the treeT will fall apart into three trees: Two of them are perfect binary subtrees T1 and T2 of heighth−k−1, i.e:

|V[T1]|=|V[T2]|= 2h−k1 . The total number of vertices in the third threeT3 is:

|V[T3]|=|V[T]| − |V[T1]| − |V[T2]| − |{vck}| , i.e.

|V[T3]|= 2h+112·(2h−k1)1 = 2h+12h−k+1 . The number of edges that contribute in covering of the cut-vertex vck is then:

|Γ(vck)|=|E[T1 :T2]|+|E[T2 :T3]|+|E[T1 :T3]| ,

Therefore, the memory space needed to store the whole Γ data-structure for this special case isO(n2logn).

On the other hand, it is easy to see that the average length of a path inT is:

|Ψ(eA)|= Θ(logn) ,

which implies that the average space needed to store data-structure Ψ isO(n2logn).

How Much Space doΓ andΨ Need on Average in the General Case? If we suppose that the tree structure is not degenerated, i.e. that the tree’s diameter is O(log|VT|), then the same as above holds, i.e. each augmentation edge eA EA covers on average O(log|VT|) vertices. In total, Ψ needs O(|EA|log|VT|) space.

The average space needed to store Γ is O(|EA|log|VT|) as well. One observes that the Γ and Ψ data-structures are “dual” to each other.

For each entry e∈ Γ(vc), preprocessing also stores references to the two tree-edges being incident tovcand covered bye; we denote them byevTc1(e) andevTc2(e). They directly correspond to the two cut components edge ecan connect.

3.2. PREPROCESSING 45

vc v

C2vc C1vc

e00A vc

eA

e0A

(c) (d)

(b) (a)

e00A

Figure 3.5: Reducing the block-cut graph: (a) Assuming c(eA) c(e0A), edge e0A can be eliminated. (b)e00A is the only edge able to connect the cut-componentsC1vc and C2vc of vcand is therefore fixed. This introduces a new biconnected component inT (c), which is shrunk into the single new block-vertexv (d).

Check whether a Cut-Vertex is Covered. In the memetic algorithm, it is necessary to efficiently check if a certain cut-vertex is covered by a subset of augmentation edges S EA. With the precomputed Γ and Ψ and the aid of a temporary union-find data structure with weight balancing and path compression [5, pp. 183–189], this check can be performed in O(|S| ·α(|VT|,|S|)) time. In most cases the degree of the cut-vertexvc is less than four. Then, not even a union-find data structure is needed, since it is sufficient to check whether each of the tree-edges incident tovc is covered by some augmentation edge being not incident tovc.