• No results found

3.2 Planarization of Circular Layouts

3.2.2 Related Work

Circular embedding of trees

If the input graph G = (V, E) is a tree, there is always a planar circular embedding of G. The order of the set of vertices is obtained by applying a depth first search traversal of G which takes O(|V | + |E|). As the input graph G is assumed to be a tree, dfs runs in O(|V |), as for every tree the number of edges |E| is determined by the number of vertices |E| = |V | − 1 [25].

Outerplanarity testing of biconnected graphs

Some of the crucial features of maximal outerplanar graphs help to define a outerpla- narity test.

Lemma 3.2.2. [14] Every maximal outerplanar graph with n vertices contains • exactly 2n - 3 edges

• at least two vertices of degree 2.

Theorem 3.2.3. [19] A graph G with n vertices is maximalouterplanar if and only if either G is a triangle or

transformed to a maximal outerplanar graph by triangulation.

The following algorithm is designed to test whether a biconnected graph is out- erplanar or not. It is based on the fact that any maximal outerplanar graph has a unique Hamiltonian cycle which determines the order of the vertices. The input graph without its Hamilton circuit forms a triangulation if the graph is maximal outerpla- nar. For testing a graph on outerplanarity the graph is extended by triangulation edges in order to achieve a maximal outerplanar graph which is only possible if the graph is outerplanar.

As both edges of a degree-2 vertex are part of the Hamiltonian circle the algorithm starts with decomposing the graph by removing these vertices sequentially. In order to obtain a biconnected graph after the removal we add a triangulation edge con- necting the two neighbors of the removed vertex if they are not connected. In the case that this edge already exists let’s denote it a pair edge. Both triangulation and pair edges are internal edges, i.e. they do not lie on the external face and are stored and marked as such. The algorithm repeats this procedure until a triangle remains. The insertion of the edge connecting the two neighbors of the last removed 2-vertex ensures that a triangle remains. Then the two edge lists, one containing both internal and external edges and the other one containing only the internal (triangulation and pair) edges are lexicographically sorted. A comparison of the two lists tests if the condition of only one existing edge between the vertices adjacent to 2-vertices holds. Theorem 3.2.6. [19] The algorithm outerplanar test runs in O(|V |).

Circular embedding of outerplanar biconnected graphs

Given that the input Graph G has been tested to be outerplanar we obtain the Hamilton circuit by removing all the stored edges P AIRS, i.e. all internal and triangulation edges from the set of edges E. Thus the required order of the vertices on the periphery of the embedding circle can be computed by applying a depth first search traversal on the graph with the remaining edges E0 = E \ P AIRS. The number of edges |E| of an outerplanar graph is determined by the number of vertices, |E| ≤ 2|V | − 3. Therefore the running time of dfs is bounded by O(|V |) [25] [19].

Algorithm 9: Outerplanar Test

Input: A biconnected graph G = (V, E), |V | = n, |E| = m if m > 2n − 3 then

printincorrect edge count; break;

LIST ← list of vertices of degree 2;

PAIRS ← ∅ stores internal and triangulation edges; if LIST.size < 2 then

print not enough 2-vertices; break;

L ← 1;

while L ≤ n − 2 do

N ODE ← LIST.get(L);

N EAR, N EXT ← {vertices adjacent to NODE }; if e = (N EAR, N EXT ) /∈ E then

e is triangulation edge; else

e is internal pair edge;

if e = (NODE, NEAR) is triangulation edge then E ∪ e add triangulation edge to E ;

else if e = (NODE, NEXT) is triangulation edge then E ∪ e add triangulation edge to E ;

P AIRS ∪ (N EAR, N EXT ) add the pair to the list PAIRS ; G \ {N ODE} remove vertex NODE from G ;

if any vertices become 2-vertices add them to LIST ;

forall v ∈ V : deg(v) = 2 do LIST ∪ {v} if LIST.size − L < 2 then print removing NODE leaves non-outerplanar graph;

break; L ← L + 1;

E ∪ (N EAR, N EXT ) add the last edge (NEAR, NEXT) to list of edges; sort E lexicographically;

sort PAIRS lexicographically;

if (u, v) ∈ E and (u, v) /∈ P AIRS then print graph is not outerplanar; else

can be found. An articulation node is a node that connects two biconnected com- ponents and is responsible for non-biconnectivity of the graph. The graph is now decomposed into biconnected components. Each biconnected component can now be represented as a dummy vertex which is linked to the corresponding articulation nodes that are part of the component. The now obtained structure is called a block- cutpoint tree [25], modeling all characteristics of a tree. This blockcutpoint tree can now be embedded on a circle following the algorithm described above.

Algorithm 10: Biconnected Components Input: stack SE (edges in open components)

Output: array of edges component (points to representative) traverse(vertex v, edge e, vertex w);

if e is loop then component[e] ← e; else

push e → SE;

if e is tree edge then push e → C;

if e is backwards edge then while w ≺ top(C) do pop C

backtrack(vertex w, edge e, vertex v); if e = top(C) and e 6= nil then

pop C; repeat

pop e0 ← SE;

component[e0] ← e; until e0 = e ;

In the next steps the dummy vertices are replaced by the biconnected compo- nents they represent. We apply the algorithm presented above in order to determine the order of the vertices of each biconnected component. As the articulation nodes are represented as proper vertices in the blockcutpoint tree structure, they are al- ready placed and do not have to be drawn again. Place the rest of the vertices of a biconnected component in relation to its articulation nodes.

Computational Complexity

Assume that the given graph G is outerplanar. Then the number of its edges is limited by the number of vertices |E| ≤ 2|V | − 3.

The discovery of articulation nodes and the decomposition of a graph into biconnected components runs in O(|V | + |E|). Therefore it runs in O|V |) for the input graph G. Performing a depth first search on the blockcutpoint tree costs O(|V |) and applying the algorithm to calculate the circular embedding on all outerplanar biconnected components requires O(|E1|) + O(|E2|) + . . . O(|Ek|) with |Ei| being the number of

edges in component i. AsP(|Ei|) = E and |E| is bounded by the number of vertices

|V | because of outerplanarity the time complexity of this step is O(|V |). Hence the overall running time of the algorithm is O(|V |).

Related documents