• Keine Ergebnisse gefunden

Curve Representation

Im Dokument Constrained Graph Drawing (Seite 60-66)

Angles and Distances

3.3 Angle and Distance Constraints

3.3.3 Curve Representation

Instead of using polylines, we can also represent the edges as smooth curves. A cubic B´ezier curve is determined by two endpoints b0, b3 and two inner control points b1, b2. We call the segments b0b1 and b3b2 the (initial) control segments, while b1b2 is called the inner segment. A B´ezier curve is contained within the convex hull of its defining points. The tangents at its endpoints are collinear with the initial control segments, so the outgoing angle of a B´ezier curve is the angle of its control segment. See Fig. 3.23 for examples.

For the B´ezier curve of an edge we use the control segments of the corre-sponding polyline as initial control segments. We refer to the B´ezier curve from v towi for 0≤i≤k−1 withci and Hi the convex hull of its control points. In the remainder of this section we will proof the following theorem.

Theorem 9. For a tree, a planar drawing that satisfies locally consistent angle and distance constraints while representing edges as continuously differentiable curves consisting of at most two cubic B´ezier curves and a straight line segment, can be determined in linear time.

Even if the polylines of two edges are not intersecting, the hulls of the corre-sponding B´ezier curves can intersect. Three borders of a curve’s hull are the line segments of the corresponding polyline. When determining the control segment lengths we avoided most intersections, but in case of a clockwise or counterclock-wise sheering, we must split an edge’s curve by adding control segments.

Let i and i+ 1 be counterclockwise sheering. When all the control segment lengths in the tree are determined, we split a curveci. Letqi be the intersection point of the linesvpi+1 andpip0i. The splitting pointmi must lie onpip0i between the pointqi andpi. Rooted atmiwe add two diametral opposed control segments sm1i and sm2i on pip0i, with sm1i pointing towards pi and sm2i pointing towards p0i.

Figure 3.24: Splitting a curve

(See Fig. 3.24 for illustration.) Now we can describe ci with two B´ezier curves smoothly attached (continuously differentiable, because the angle at mi is π), one bysi and sm1i and one bys0i and sm2i . When we later focus on wi, we might have to split ci to avoid intersections with curves incident to wi. If then the splitting point may not lie between qi and pi, we will add a second splitting point on pip0i and ci (still continuously differentiable) will consist of two B´ezier curves incident to v and wi and a straight line segment on pip0i. Otherwise one splitting point will be sufficient.

Lemma 13. The resulting tree layout is planar.

Proof. For any vertex v, the curve or polyline of an edge ei+1 incident tov can cause problems if the hullHi+1 is intersecting with the wedge of another neighbor ofv. With the strategy presented previously we made sure that Hi and Hi+1 are not intersecting.

By determining the length of si+1 in (3.27), we made it impossible for Hi+1 to intersect with the circle containing the control segments incident to wi (or the circle for any other neighborwj withi+ 1 and j counterclockwise sheering).

Hence Hi+1 cannot intersect with any wedge or control segment of one of wi’s neighbors different fromv since the vertices of disjoint subtrees are contained in disjoint wedges. With this, Hi+1 cannot intersect with any line from a point in wi’s circle to a point in the wedge of one of wi’s neighbors different fromv, thus Hi+1 cannot intersect with any hull of a curve incident to wi or any vertex in the subtreeTv(wi). See Fig. 3.25 for illustration. HullHi+1 intersecting with the

Figure 3.25: Hi+1

wedge of the neighbor wi+2 is the mirrored case. Hi+1 does not intersect with any curve in Twi+1(v). As we also focus on Hi+1 when considering wi+1 and its neighbors, Hi+1 cannot intersect with any curve inTv(wi+1) as well.

(a) random rotation

(b) polylines

(c) curves

Figure 3.26: Drawings of a tree with fixed vertices and angles

Chapter 4 Ordering

In several scenarios, a graph drawing algorithm receives as input not only a graph, but also an initial (possibly partial) drawing. The task is to redraw the graph while maintaining selected features of the input drawing. Examples of this kind are embedding-constrained graph layouts, shape simplification, sketch-based drawing, and dynamic graph layouts.

A cartographic application of particular interest is the simplification of lines.

Given a polygonal path, the task is to generate a simpler representation of the path, for instance by omitting vertices (see Douglas and Peucker, 1973; Imai and Iri, 1986) (level of detail) or by restricting the allowable types of segments (see Neyer, 1999; Merrick and Gudmundsson, 2007) (schematization). Maintaining a user’s mental map by preserving the orthogonal ordering (Misue, Eades, Lai, and Sugiyama, 1995) of stations and landmarks seems particularly appropriate in this scenario and has been tried, e.g., by Dwyer, Koren, and Marriott (2006).

For layout stability (B¨ohringer and Paulisch, 1990) and similarity (Bridgeman and Tamassia, 1998) the relative position of vertices, strongly related to the orthogonal ordering, is considered, used (Lee, Lin, and Yen, 2006) and tested (Bridgeman and Tamassia, 2002) helpful. Alternative constraints include preser-vation of the cyclic ordering of neighbors (N¨ollenburg and Wolff, 2006) and dis-tance from original positions using various metrics (Neyer, 1999; Merrick and Gudmundsson, 2007).

For orthogonal-order preserving graph drawing, even the decision problems in the rectilinear, the octilinear model and the equal edge length, are N P -hard. Hardness in the rectilinear implies, e.g., that bend-minimum orthogonal layout is hard under ordering constraints. The octilinear drawing problem is of special interest for drawing metro maps. Our result is in contrast to the direction-restricted models studied by Neyer (1999) and Merrick and Gudmunds-son (2007), where paths or vertices must be within a given distance (according to the Fr´echet or Euclidean metric) of the original and the number of bends can

(a) eipullsejhorizontally andej

pushes ei vertically

(b) eipullsej vertically andej

pushesei horizontally Figure 4.1: Dependency of edges

be minimized in polynomial time. The algorithm introduced by Delling, Gemsa, N¨ollenburg, and Pajor (2010) preserves the orthogonal ordering of vertices at least for each monotone subpath of a path. The equal edge length model is in-teresting, since drawing with given edge lengths is hard for general graphs (Eades and Wormald, 1990), but easy for trees (see Sect. 3.2).

We use reductions from MONOTONE 3-SAT for the hardness proofs. We treat the rectilinear case in Sect. 4.1, the octilinear case in Sect. 4.2 and the equal edge length case in Sect. 4.3.

Im Dokument Constrained Graph Drawing (Seite 60-66)