• Keine Ergebnisse gefunden

5. Layout 29

5.2. Voronoi Treemap

Figure 5.4.: Voronoi Treemap of a software hierarchy (from [6])

Balzer et al. [5, 6] introduced the Voronoi Treemap as a visualization technique which has some nice advantages compared to e.g. rectangle-based techniques.

Note that Andrews et. al [1] used already three years before a similar technique by nesting Voronoi diagrams. They positioned the cells with a higher importance on the outer of a region; the results are Voronoi cells with more area. Thus the contribution of Balzer et. al was to combine Lloyd’s method and the weighted Voronoi diagram to get a more flexible technique with better aspect ratio.

The goal of a Voronoi Treemap is to map a hierarchy in a plane and use the available space completely to represent the information. By nesting polygons in each other, the hierarchy is represented with the area-inclusion metaphor. But it is not enough to just nest the polygons arbitrarily. The area of the polygon has to reflect the desired importance of the corresponding node in the hierarchy. In this section we will describe in detail how a Voronoi Treemap can be constructed using a Monte Carlo method and the analytical approach.

5.2 Voronoi Treemap 35

(a)

(b) (c) (d)

Figure 5.5.: A hierarchy (a) which is used to create a Voronoi Treemap (d). Initial positions of the first hierarchy layer (blue nodes) are used to generate a Voronoi diagram (b)-(c). Each resulting region is used for the child nodes in the second layer.

36 5 LAYOUT

5.2.1. Voronoi diagram

Figure 5.6.: Voronoi diagram of a set of sites in the plane. Outer cells are not bounded.

A Voronoi diagram consists of a set of points S in the plane which divide the plane in non empty regions with certain characteristics for the points in a region.

The points in S are also called sites in the literature. Each site has exactly one continuous region and each region belongs to exactly one site. For every point in a region the corresponding site of the region is the nearest site of all sites in S. There are a lot of ways to formally define a Voronoi diagram. Since we will compute it in an analytical way with the Fortune Algorithm [36], we use Fortune’s definition.

Let S ={p1, p2, ..., pn} be a set of n distinct points in the plane. Each site p ∈ S has Cartesian coordinates; p = (px, py) ∈ R2. The set of points is finite and has to divide the plane into at least two non empty regions, so 2 ≤ n ≤ ∞. Although it might already be clear from the fact that S is a set, it is important to notice that we have distinct sites inS, so∀p, q ∈S, p 6=q: (px 6=qx)∨(py 6=qy).

The Euclidean distance between two points p= (px, py)∈R2 andq = (qx, qy)∈ R2 is defined as

e(p, q) = q

(px−qx)2+ (py−qy)2. (5.7) Forp∈S and z ∈R2 let the functions d, dp :R2 →R be

dp(z) = e(p, z) (5.8)

and

d(z) = min

pS dp. (5.9)

The bisector Bpq of p, q ∈S is Bpq =

z ∈R2|dp(z) =dq(z) . (5.10)

5.2 Voronoi Treemap 37

The Voronoi diagram V of a set S can be described as V(S) = This means that all points which have at least two closest sites and thus are part of a bisector are part of the Voronoi diagram. As we can see in Fig. 5.6, a Voronoi diagram consists of lines, half-lines and segments.

Theorem 5.1. The complexity of a Voronoi diagram is in O(n).

Proof. Having a Voronoi diagram withn sites, one might think that there could be O(n2) bisectors in the worst case. To show that this is not the case we can consider the Voronoi diagram as a planar Graph and analyse the complexity. Unfortunately there are have half-lines which do not exist in graph theory. To fix this, we connect all the half-lines to a new node which is infinite far away, see Fig. 5.7. Note that if two half-lines intersect arbitrarily far away from the sites, they were no half-lines but just two segments which lead to one half-line after their intersection. Given

Figure 5.7.: Connecting the half-lines of a Voronoi diagram to a vertex, which lies in infinity, to get a connected planar Graph with linear edges in n a Graph G = (V, E) which is connected (no node is isolated) and planar, we can draw it on a plane without intersection of two edges. We have v =|V|ande=|E|. Let f be the number of faces, which is just the number of regions we would get by cutting the plane along the edges. Euler’s formula tells us that the following holds:

v−e+f = 2 (5.14)

38 5 LAYOUT For more Information on Euler’s formula and planar graphs we refer the reader to [60].

Having constructed the Graph from our Voronoi diagram we see that the amount of faces f = n. Let nv be the amount of nodes which are automatically created from the Voronoi diagram because the edges intersect at the same point. Since we added one extra node in infinity we have that v = nv + 1. nv is the amount of vertices in the Voronoi diagram. A vertex is an intersection point of at least 2 bisectors. Each edge belongs to two sites and each node (except for the infinity node) belongs to three edges. This implies 2e ≥ 3nv = 3(v−1) = 3n−3. Using

This means that the amount of edges in a Voronoi diagram is linear in the amount of sites.

5.2.2. Additive weighted Voronoi diagram

Let S be a set with n sites. The weight of a site p ∈ S is given by wp ∈ R+. It turns out that the additive weighted (AW) Voronoi diagram is identical to the Voronoi diagram of circles. For the Voronoi diagram of circles the metric is defined as the euclidean distance to the circle if the point is outside the circle and as the negative euclidean distance to the circle if the point is inside the circle. The radius rp of the circle Cp with center p is defined as rp =W −wp, where W =max

qS (wq).

The distance of a point z ∈R2\S to a site pis defined as

ep(z) =e(p, z)−rp. (5.15) Definition 5.2. Letp, q ∈S, p6=q. We say thatpdominates q ife(p, q) +wp ≤ wq. If neither p dominates q, nor q dominates p, then there exists a bisector Bpq. The Bisector Bpq and its two regions Rpq and Rqp are

Bpq ={z∈R2|ep(p, z) = eq(z)} (5.16) Rpq ={z ∈R2|ep(z)≤eq(z)} (5.17) Rqp ={z ∈R2|ep(z)≥eq(z)} (5.18)

5.2 Voronoi Treemap 39 Note that if ep(q) =wq we define Bpq =∅. Otherwise we would have a half-line with endpoint in q and not a region, which is what we want. In the case of p dominates q, we have Bpq =∅, Rpq =R2 and Rqp =∅.

The Voronoi diagram V of a set S can be described as V(S) = Cenroidal Voronoi Tesselation A Voronoi diagram is also called Voronoi tesse-lation. A Centroidal Voronoi tesselation is a special Voronoi diagram where the sites are coincident to the centroid of the corresponding Voronoi regions.

The centroid for k points in the plane p1, p2, . . . , pk ∈R2 is defined as Centroid({p1, ..., pk}) = p1+p2+· · ·+pk

k (5.22)

For a region Rp which is a subset of R2 the centroid can be formulated as Centroid(Rp) =

R

Viρ(x)xdx R

Viρ(x) dx , (5.23)

where ρ is the density function which in our case is constantly 1. A Centroidal Voronoi Tesselation with V(S) = {∪pSRp} gives local minima to the following energy function [39] Centroidal Voronoi tesselations can be derived iteratively using Lloyd’s method [43], which for a given set S of sites works by repeating the following steps:

• Compute V(S)

• S ← S

pS

Centroid(Rp)

Fig. 5.8a shows the initial site configuration and the movement of the sites by applying Lloyd’s method. As we can see in Fig. 5.8b the movements of the sites are not arbitrary but local, which we will use to get our layout.

40 5 LAYOUT

(a) (b)

Figure 5.8.: (a) Voronoi diagram with initial sites. (b) Voronoi diagram after 50 iterations with Lloyd’s method. The move of the sites is described by the points.

The strength of local optima: Given an initialisation of sites Lloyd’s method finds a local optimum in most cases [25]. There are many attempts in the lit-erature [62] to improve the results of Lloyd’s algorithm by choosing appropriate initialisation positions.

By using the relative positions of the mental map as initial positions we make use of the sensitivity of Lloyd’s method and get local optima which fulfill our needs of mental map preservation. In section 5.7 we try to make more precise statements concerning the mental map stability.