Autorun Organizer For Windows Free 1.0 | 1x04 Bungo Stray Dogs | Stream in HD

Drawing Planar Graphs on 89n2 Area

Drawing Planar Graphs on 89n2 Area

Electronic Notes in Discrete Mathematics 31 (2008) 37–40 www.elsevier.com/locate/endm Drawing Planar Graphs on 89 n2 Area Franz J. Brandenburg Lehrst...

154KB Sizes 0 Downloads 4 Views

Electronic Notes in Discrete Mathematics 31 (2008) 37–40 www.elsevier.com/locate/endm

Drawing Planar Graphs on 89 n2 Area Franz J. Brandenburg Lehrstuhl für Informatik Universität Passau 94030 Passau Germany

Abstract We contribute to an open problem in Graph Drawing [2] and improve the upper bound of the area of straight-line grid drawings of planar graphs to 43 n × 23 n. Our algorithm uses an improved version of the generic shift method [4] with one shift for each good vertex and two shifts for each bad vertex. The key is the handling of “critical vertices”. Our algorithm runs in linear time. The drawing fits into an isosceles triangle with a horizontal base line and sides of slope ±1. Under this constraint the 89 n2 bound is optimal for embedded planar graphs. Keywords: graph drawing, planar graphs, generic shift method

1

Introduction

“Good” drawings of planar graphs is one of the major challenges in graph drawing. A major breakthrough came from the seminal papers of de Fraysseix, Pach, and Pollack [4] and Schnyder [6], who showed that there are straight-line 1

Email: [email protected]

1571-0653/$ – see front matter © 2008 Published by Elsevier B.V. doi:10.1016/j.endm.2008.06.005

38

F.J. Brandenburg / Electronic Notes in Discrete Mathematics 31 (2008) 37–40

planar grid drawings on quadratic area. This bound is asymptotically optimal with the factor c = 1 for the upper bound [6] and c = 49 for the lower bound of embedded planar graphs [4]. Here we reduce the factor for the upper bound to c = 89 . (i) We and assign every vertex a shift of one or two. (ii) We rotate the drawing and choose the proper side as the base line. The best side needs at most 43 n horizontal shifts. (iii) We improve the generic shift method. In general, a new vertex is placed at the intersection of the right and left diagonals through the left and right lower neighbors, or at the intersection of a diagonal and a horizontal line. If this fails we try the nearest grid point below or we have a critical vertex. These need a special treatment. We deal with them either by stretching or by steep edges with a slope of ± h+1 . These cases are complementary h and arise from many and few shifts on an edge.

2

Drawing Planar Graphs

We consider maximal planar graphs G = (V, E) with n ≥ 4 vertices. A planar straight-line drawing of G is an assignment of the vertices of G to grid points and with straight-line edges which do not cross or do not touch other vertices. Our drawing algorithm is a refinement of the generic shift method from [3, 4]. It adds a vertex at a time according to the leftmost canonical ordering [4, 5], and places vertex v above the contour of the previous vertices. The contour C(v) = w1 , w2 , . . . , wr is a polyline of straight lines from w1 = 1 in the lower left corner to wr = 2 in the lower right corner. The lower neighbors of v are a subsequence neigh(v) = wp , . . . , wq of C(v) with wp as the leftmost and wq as the rightmost neighbor. With every vertex we associated a shift, which directly comes from the leftmost canonical ordering and from the realizer [6]. Definition 2.1 Let G be as above with the leftmost canonical ordering. For every vertex v let shift(v) = 1 if v has only two lower neighbors or if v induces a counter clock-wise (ccw) facial cycle with a green, a blue, and a red edge. Such a ccw cycle occurs, if a vertex v with at least three lower neighbors is placed over a blue edge (a, b) with a as the leftmost neighbor of v. Otherwise, let shift(v) = 2. In addition, let shift(1) = 0, shift(2) = 1 and shift(n) = 2. These shifts shall suffice for the drawing. There may be situations where

F.J. Brandenburg / Electronic Notes in Discrete Mathematics 31 (2008) 37–40

39

shifts can be saved, which then results in more compact drawings. In terms of realizers [1, 6] shift(v) = 2 holds for all inner vertices which do not belong to a ccw cycle. Using the formula of Bonichon et al. [1] and the pigeon hole principle we obtain: Lemma 2.2 For every maximal planar graph G there is a leftmost canonical ordering such that width(G) ≤  4n , where width(G) is the number of shifts. 3

3

Placement of vertices

If the algorithm is not in an exception mode after a critical vertex a vertex v is placed according to the generic shift method [3,4]. First, we shift the extreme neighbors and then place v is at or below the intersection of the diagonals through the leftmost and rightmost lower neighbors, or use the horizontal line through the upper of the neighbors and that v is visible from all its lower neighbors. Definition 3.1 A vertex v is critical if the Manhattan distance between its leftmost and rightmost lower neighbors wp and wq is odd, and before the shifts wp , wp+1 , and wp+2 lie on the right diagonal, and wq−2 , wq−1 , and wq lie on the left diagonal. Then we say that the diagonals through wp+1 and wq−1 are occupied. Otherwise, v is simple. If v is simple there is a suitable grid point just below the intersection of the diagonals through the leftmost and rightmost lower neighbors. If v is critical, shift(v) = 2 and v has at least six lower neighbors. Now the common generic shift method fails, since (after the shifts) the diagonals through wp and wq do not intersect in a grid point, and the grid points just below the intersection point are not visible from wp+1 or from wq−1 . Such critical vertices need a special treatment; the algorithm enters the exception mode until this case is resolved. For critical vertices we distinguish two cases: For simplicity we only consider the situation to the right; it is similar to the left. Consider the right edge (v, wq ) from a critical vertex v to its rightmost lower neighbor wq . If the forthcoming vertices impose k more shifts on wq than on v and k is sufficiently large, the edge (v, wq ) is stretched by k units and becomes a flat line. The upper bound for k is less than the height between v and wq . For a while the algorithm introduces a non-planar situation. Place v at the intersection of the diagonals through wp and wq−1 , and let the algorithm proceed. Temporarily, v is not visible from wq−1 and other lower neighbors on

40

F.J. Brandenburg / Electronic Notes in Discrete Mathematics 31 (2008) 37–40

the occupied diagonal. This is resolved in a postprocessing step by some extra shifts for the vertices on the occupied the diagonal and such that thereafter they are visible from v. Otherwise, we introduce a steep edge with slope ± h+1 on one side and use h the opposite diagonal at the other side. The goal now is to remove this steep edge from the contour. This goal can be achieved, since there are only a few vertices which are built over a steep edge. As a consequence we have the following generalized invariant for the shape of the contour: Either the edges are flat and have a slope in the range [−1, +1], or there is a steep edge it occurs at one side of a pinnacle and the edge on the other side of the pinnacle points into the opposite direction. We summarize: Theorem 3.2 Every planar graph admits a planar straight-line drawing on a grid of size at most  4n  ×  2n . 3 3 Consider the nested triangles with the common embedding [4]. Then any drawing needs 2n/3 in each dimension. If the drawing is enclosed by an isosceles triangle with sides of at most 45 degrees, then the drawing needs 4n/3 × 2n/3. This bound is achieved our algorithm.

References [1] Bonichon, N., B. Le Saëc and M. Mosbah, Wagner’s theorem on realizers, in: Proc. ICALP 2002, LNCS 2380, 2002, pp. 1043–1053. [2] Brandenburg, F. J., D. Eppsein, M. T. Goodrich, S. G. Kobourov, G. Liotta and P. Mutzel, Selected open problems in graph drawing, in: Proc. Graph Drawing 2003, LNCS 2912, 2003, pp. 515–529. [3] Chrobak, M. and S. Nakano, Minimum-width grid drawing of plane graphs, Computional Geometry 11 (1998), pp. 29–54. [4] de Fraysseix, H., J. Pach and R. Pollack, How to draw a planar graph on a grid, Combinatorica 10 (1990), pp. 41–51. [5] Kant, G., Drawing planar graphs using the canonical ordering, Algorithmica 16 (1996), pp. 4–32. [6] Schnyder, W., Embedding planar graphs on the grid, in: Proc. ACM-SIAM Symp. on Discrete Algorithms (SODA’90), 1990, pp. 138–147.