On Turn-Regular Orthogonal Representations
Michael A. Bekos, Carla Binucci, Giuseppe Di Battista, Walter Didimo, Martin Gronemann, Karsten Klein, Maurizio Patrignani, Ignaz Rutter
OOn Turn-Regular Orthogonal Representations (cid:63)
Michael A. Bekos , Carla Binucci , Giuseppe Di Battista , Walter Didimo ,Martin Gronemann , Karsten Klein , Maurizio Patrignani , and Ignaz Rutter Department of Computer Science, University of T¨ubingen, T¨ubingen, Germany [email protected] Department of Engineering, University of Perugia, Perugia, Italy [email protected] , [email protected] Department of Engineering, Roma Tre University, Italy [email protected] , [email protected] Theoretical Computer Science, Osnabr¨uck University, Osnabr¨uck, Germany [email protected] Department of Computer and Information Science, University of Konstanz,Konstanz, Germany [email protected] Department of Computer Science and Mathematics, University of Passau, Germany [email protected]
Abstract.
An interesting class of orthogonal representations consists ofthe so-called turn-regular ones, i.e., those that do not contain any pairof reflex corners that “point to each other” inside a face. For such a rep-resentation H it is possible to compute in linear time a minimum-areadrawing, i.e., a drawing of minimum area over all possible assignments ofvertex and bend coordinates of H . In contrast, finding a minimum-areadrawing of H is NP-hard if H is non-turn-regular. This scenario natu-rally motivates the study of which graphs admit turn-regular orthogonalrepresentations. In this paper we identify notable classes of biconnectedplanar graphs that always admit such representations, which can be com-puted in linear time. We also describe a linear-time testing algorithm fortrees and provide a polynomial-time algorithm that tests whether a bi-connected plane graph with “small” faces has a turn-regular orthogonalrepresentation without bends. Keywords:
Orthogonal Drawings · Turn-regularity · Compaction.
Computing orthogonal drawings of graphs is among the most studied problemsin graph drawing [8,12,19,23], because of its direct application to several do-mains, such as software engineering, information systems, and circuit design (cid:63)
Work partially supported by DFG grants Ka 812/17-1 and Ru 1903/3-1; by MIURProject “MODE” under PRIN 20157EFM5C; by MIUR Project “AHeAD” underPRIN 20174LF3T8; and by Roma Tre University Azione 4 Project “GeoView”. Thiswork started at the Bertinoro Workshop on Graph Drawing BWGD 2019. Appearsin the Proceedings of the 28th International Symposium on Graph Drawing andNetwork Visualization (GD 2020) a r X i v : . [ c s . C G ] A ug M. A. Bekos et al. (e.g., [2,10,13,18,21]). In an orthogonal drawing, the vertices of the graph aremapped to distinct points of the plane and each edge is represented as an al-ternating sequence of horizontal and vertical segments between its end-vertices.A point in which two segments of an edge meet is called a bend . An orthogonaldrawing is a grid drawing if its vertices and bends have integer coordinates.One of the most popular and effective strategies to compute a readable or-thogonal grid drawing of a graph G is the so-called topology-shape-metrics (or TSM , for short) approach [25], which consists of three steps: (i) compute a planarembedding of G by possibly adding dummy vertices to replace edge crossingsif G is not planar; (ii) obtain an orthogonal representation H of G from thepreviously determined planar embedding; H describes the “shape” of the finaldrawing in terms of angles around the vertices and sequences of left/right bendsalong the edges; (iii) assign integer coordinates to vertices and bends of H toobtain the final non-crossing orthogonal grid drawing Γ of G .If G is planar, the TSM approach computes a planar orthogonal grid draw-ing Γ of G . Such a planar drawing exists if and only if G is a , i.e., ofmaximum vertex-degree at most four. To increase the readability of Γ , a typ-ical optimization goal of Step (ii) is the minimization of the number of bends.In Step (iii) the goal is to minimize the area or the total edge length of Γ ; aproblem referred to as orthogonal compaction . Unfortunately, while the compu-tation of an embedding-preserving bend-minimum orthogonal representation H of a plane 4-graph is polynomial-time solvable [7,25], the orthogonal compactionproblem for a planar orthogonal representation H is NP-complete in the generalcase [24]. Nevertheless, Bridgeman et al. [5] showed that the compaction problemfor the area requirement can be solved optimally in linear time for a subclass oforthogonal representations called turn-regular . A similar polynomial-time resultfor the minimization of the total edge length in this case is proved by Klau andMutzel [20]. Esser showed that these two approaches are equivalent [14].Informally speaking, a face of a planar orthogonal representation H is turn-regular if it does not contain a pair of reflex corners (i.e., turns of 270 ◦ ) thatpoint to each other (see Section 2 for the formal definition); H is turn-regular ifall its faces are turn-regular. For a turn-regular representation H , every pair ofvertices or bends has a unique orthogonal relation (left/right or above/below)in any planar drawing of H . Conversely, different orthogonal relations are pos-sible for a pair of opposing reflex corners, which makes it computationally hardto optimally compact non-turn-regular representations. For example, Figs. 1(a)and 1(b) show two different drawings of a non-turn-regular orthogonal represen-tation; the drawing in Fig. 1(b) has minimum area. Fig. 1(c) depicts a minimum-area drawing of a turn-regular orthogonal representation of the same graph.The aforementioned scenario naturally motivates the problem of computingorthogonal representations that are turn-regular, so to support their subsequentcompaction. To the best of our knowledge, this problem has not been studiedso far (a related problem is studied for upward planar drawings only [4,9,11]).Heuristics have been described to make any given orthogonal representation H n Turn-Regular Orthogonal Representations 3 vu (a) uv (b) uv (c) Fig. 1. (a) Drawing of a non-turn-regular orthogonal representation H ; vertices u and v point to each other in the gray face. (b) Another drawing of H with smaller area. (c)Drawing of a turn-regular orthogonal representation of the same graph. turn-regular, by adding a minimal set of dummy edges [5,17]; however, suchedges impose constraints that may yield a drawing of sub-optimal area for H .Our contribution is as follows:( i ) We identify notable classes of planar graphs that always admit turn-regularorthogonal representations. We prove that biconnected planar 3-graphs and pla-nar Hamiltonian 4-graphs (which include planar 4-connected 4-graphs [22]) ad-mit turn-regular representations with at most two bends per edge and at mostthree bends per edge, respectively. For these graphs, a turn-regular represen-tation can be constructed in linear time. We also prove that every biconnectedplanar graph admits an orthogonal representation that is internally turn-regular,i.e., its internal faces are turn-regular (Section 3). We leave open the questionwhether every biconnected planar 4-graph admits a turn-regular representation.( ii ) For 1-connected planar graphs, including trees, there exist infinitely manyinstances for which a turn-regular representation does not exist. Motivated bythis scenario, and since the orthogonal compaction problem remains NP-hardeven for orthogonal representations of paths [15], we study and characterizethe class of trees that admit turn-regular representations. We then describe acorresponding linear-time testing algorithm, which in the positive case computesa turn-regular drawing without bends (Section 4). Finally, we prove that suchdrawings are “convex” (i.e., all edges incident to leaves can be extended to infinitecrossing-free rays). We remark that a linear-time algorithm to compute planarstraight-line convex drawings of trees is described by Carlson and Eppstein [6].However, in general, the drawings they compute are not orthogonal.( iii ) We address the problem of testing whether a given biconnected plane graphadmits a turn-regular rectilinear representation, i.e., a representation withoutbends. For this problem we give a polynomial-time algorithm for plane graphswith “small” faces, namely faces of degree at most eight (Section 5). We consider connected graphs and assume familiarity with basic concepts oforthogonal graph drawing and planarity [8] (see Appendix A). Let G be a plane4-graph and H be an orthogonal representation of G . If H has no bends, then it M. A. Bekos et al. v v v v (a) f f f f (b) Fig. 2.
Illustration of (a) convex, flat and reflex corners, and (b) kitty corners. is called rectilinear . W.l.o.g., we assume that H comes with a given orientation,i.e., for each edge segment pq of H (where p and q are vertices or bends), it is fixedif p is to the left, to the right, above, or below q in every (orthogonal) drawingof H . Let f be a face of H . We assume that the boundary of f is traversedcounterclockwise (clockwise) if f is internal (external). The rectilinear image of H is the orthogonal representation H obtained from H by replacing each bendwith a degree-2 vertex. For any face f of H , let f denote the corresponding faceof H . For each occurrence of a vertex v of H on the boundary of f , let prec( v ) andsucc( v ) be the edges preceding and following v , respectively, on the boundary of f (prec( v ) = succ( v ) if deg( v ) = 1). Let α be the value of the angle internal to f between prec( v ) and succ( v ). We associate with v one or two corners based onthe following cases: If α = 90 ◦ , associate with v one convex corner; if α = 180 ◦ ,associate with v one flat corner; if α = 270 ◦ , associate with v one reflex corner; if α = 360 ◦ , associate with v an ordered pair of reflex corners. For example, in the(internal) face of Fig. 2(a), a convex corner is associated with v , a flat cornerwith v , a reflex corner with v , and an ordered pair of reflex corners with v .Based on the definition above, there is a circular sequence of corners associ-ated with (the boundary) of f . For a corner c of f , we define: turn( c ) = 1 if c isconvex; turn( c ) = 0 if c is flat; turn( c ) = − c is reflex. For any ordered pair( c i , c j ) of corners of f , we define the following function: rot( c i , c j ) = (cid:80) c turn( c )for all corners c along the boundary of f from c i (included) to c j (excluded).For example, in Fig. 2(a) let c , c , and c be the corners associated with v , v , and v , respectively, and let ( c , c (cid:48) ) be the ordered pair of reflex cornersassociated with v . We have rot( c , c ) = 3, rot( c , c ) = 1, rot( c , c (cid:48) ) = 0, androt( c , c ) = −
3. The properties below are consequences of results in [25,26].
Property 1.
For each face f of H and for each corner c i of f , we have rot( c i , c i ) =4 if f is internal and rot( c i , c i ) = − f is external. Property 2.
For each ordered triplet of corners ( c i , c j , c k ) of a face of H , we haverot( c i , c k ) = rot( c i , c j ) + rot( c j , c k ). Property 3.
Let c i and c j be two corners of f . If f is internal then rot( c i , c j ) = 2 ⇐⇒ rot( c j , c i ) = 2. If f is external then rot( c i , c j ) = 2 ⇐⇒ rot( c j , c i ) = − c be a reflex corner of H associated with either a degree-2 vertex or abend of H . Let s h and s v be the horizontal and vertical segments incident to c n Turn-Regular Orthogonal Representations 5 c (a) c (b) c (c) c (d) c (e) c (f) c (g) c (h) Fig. 3.
Directions of a reflex corner associated with a degree-2 vertex or with a bend:(a) up-left; (b) up-right; (c) down-left; (d) down-right. Directions of a degree-1 vertex:(e) upward; (f) downward; (g) leftward; (h) rightward. and let (cid:96) h and (cid:96) v be the lines containing s h and s v , respectively. We say that c (or equivalently its associated vertex/bend of H ) points up-left , if s h is to theright of (cid:96) v and s v is below (cid:96) h . The definitions of c that points up-right , down-left ,and down-right are symmetric (see Figs. 3(a)-3(d)). If v is a degree-1 vertex in H , then it has two associated reflex corners in H . In this case, v points upward ( downward ) if its incident segment is vertical and below (above) the horizontalline passing through v . The definitions of a degree-1 vertex that points leftward or rightward are symmetric (see Figs. 3(e)-3(h)).Two reflex corners c i and c j of a face of H are called kitty corners if rot( c i , c j ) =2 or rot( c j , c i ) = 2. A face f of an orthogonal representation H is turn-regular ,if the corresponding face f of H has no kitty corners. If every face of H isturn-regular, then H is turn-regular . For example, the orthogonal representationin Fig. 2(b) is not turn-regular as the faces f and f are turn-regular, whilethe internal face f and the external face f are not turn-regular (the pairs ofkitty corners in each face are highlighted with dotted arrows). A graph G is turn-regular , if it admits a turn-regular orthogonal representation. If G admitsa turn-regular rectilinear representation, then G is rectilinear turn-regular . Thenext lemma (whose proof can be found in Appendix A), provides a sufficientcondition for the existence of a kitty-corner pair in the external face. Lemma 1.
Let H be the rectilinear image of an orthogonal representation H of a plane graph G . Let ( c , c ) be two corners of the external face such thatrot ( c , c ) ≥ or c is a reflex corner and rot ( c , c ) ≥ . Then, the externalface contains a pair of kitty corners. Corollary 1.
Let H be an orthogonal representation of a plane graph G . If theexternal face of H has three consecutive convex corners, H is not turn-regular. The theorems in this section can be proven by modifying a well-known linear-time algorithm by Biedl and Kant [3] that produces an orthogonal drawing Γ with at most two bends per edge of a biconnected planar 4-graph G with a fixedembedding E . Such an algorithm exploits an st -ordering s = v , v , . . . , v n = t of the vertices of G , where s and t are two distinct vertices on the external faceof E . We recall that an st -ordering s = v , v , . . . , v n = t is a linear ordering M. A. Bekos et al. v v v v v v v v v v (a) v v v v (b) v v v v v v (c) v v v v v v v v (d) v v v v v v v v (e) Fig. 4.
The first four steps of the algorithm in the proof of Theorem 1 for the con-struction of a turn-regular orthogonal drawing of the biconnected planar 3-graph shownin (a) (the following steps are illustrated in Fig. 10 in Appendix B). of the vertices of G such that any vertex v i distinct from s and t has at leasttwo neighbors v j and v k in G with j < i < k [16]. The orthogonal drawing Γ isconstructed incrementally by adding vertex v k , for k = 1 , . . . , n , into the drawing Γ k − of { v , . . . , v k − } , while preserving the embedding E . Some invariants aremaintained when vertex v k is placed above Γ k − : (i) vertex v k is attached to Γ k − with at least one edge incident to v k from the bottom; (ii) after v k is addedto Γ k − , some extra columns are introduced into Γ k to ensure that each edge( v i , v j ), such that i ≤ k < j has a dedicated column in Γ k that is reachable from v i with at most one bend and without introducing crossings. Theorem 1.
Every biconnected planar 3-graph admits a turn-regular represen-tation with at most two bends per edge, which can be computed in linear time.Proof.
Let G be a biconnected planar 3-graph and let E be any planar embeddingof G . Let s and t be two distinct vertices on the external face of E . As in [3],based on an st -ordering of G , we incrementally construct an orthogonal drawing Γ of G by adding v k into the drawing Γ k − of graph G k − , for k = 1 , . . . , n .Besides the invariants (i) and (ii) described above, we additionally maintain theinvariant (iii): each reflex corner introduced in the drawing points either down-right or up-right with the possible exception of the reflex corners of the edgeson the external face that are incident to s or t . Drawing Γ consists of the singlevertex v . Since deg( v ) ≤
3, the columns assigned to its three incident edgesare the column where v lies and the two columns immediately on its left andon its right (see Fig. 4(b)). These columns are assigned to the edges incident to v in the order they appear in E . Now, suppose you have to add vertex v k to Γ k − . Observe that, since G has maximum degree three, v k has a maximum ofthree edges ( v k , v h ), ( v k , v i ), and ( v k , v j ), where we may assume, without loss ofgenerality, that h < i < j . To complete the proof, we consider three cases: Case 1 ( h < k < i ): We place v k on the first empty row above Γ k − and on thecolumn assigned to ( v k , v h ). Also, to preserve the invariant (ii), we introduce anextra column immediately to the right of v k and we assign the column of v k andthe newly added extra column to ( v k , v i ) and ( v k , v j ) in the order that is given n Turn-Regular Orthogonal Representations 7 by E . For example, Fig. 4(c) shows the placement of v directly above v , withone extra column inserted to the right of v and assigned to the edge ( v , v ). Case 2 ( i < k < j ): We place v k on the first empty row above Γ k − and on theleftmost column between the columns assigned to ( v k , v h ) and ( v k , v i ). Also, weassign the column of v k to ( v k , v j ), e.g., Fig. 4(e) shows the placement of v onthe leftmost column assigned to its incoming edges ( v , v ) and ( v , v ). Case 3 ( j < k ): Here, v k is t . We place v k on the first empty row above Γ k − andon the middle column among those assigned to ( v k , v h ), ( v k , v i ), and ( v k , v j ).The discussion in [3] suffices to prove that Γ is a planar orthogonal drawing of G with at most two bends per edge. We claim that Γ is also turn-regular. In fact,the invariant (iii) guarantees that all internal faces have reflex corners pointingeither down-right or up-right and, hence, are turn-regular. On the external facewe may have reflex corners pointing down-left (from the leftmost edge of v ) orup-left (from the leftmost edge of v n ). However, since there is a y -monotonicpath leading from s to any other vertex of G , such corners correspond to bendslying on the bottom or on the top row of any drawing with the same orthogonalrepresentation as Γ and, therefore, they cannot form a kitty corner. (cid:117)(cid:116) The proofs of the next two theorems exploit a similar technique as in Theo-rem 1. The full proof of Theorem 2 can be found in Appendix B.
Theorem 2.
Every planar Hamiltonian 4-graph G admits a turn-regular repre-sentation H with at most bends per edge, and such that only one edge of H gets bends and only if G is 4-regular. Given the Hamiltonian cycle, H can becomputed in linear time.Sketch of proof. We use as st -ordering for the Biedl and Kant approach [3] theordering given by the Hamiltonian cycle. We choose a suitable vertex v fromwhich we start the construction. The construction rules are given in Fig. 5. Afull example is provided in Fig. 11 in Appendix B. If G has a vertex of degreeless than four, then we choose such a vertex as v . Otherwise, G is 4-regularand we prove that G has at least one vertex such that the configuration of v v (a) v v (b) v v Ruled out configuration (c) v n v n (d) v n v n (e) v n v n (f) v k (g) v k (h) v k (i) v k (j) v k (k) v k (l) v k (m) v k (n) v k (o) Fig. 5.
Drawing rules for the algorithm in the proof of Theorem 2. The Hamiltonianpath is drawn red and thick. Figs. (g)–(j) are to be intended up to a horizontal flip. M. A. Bekos et al. v v (a) v k v k (b) v k v k (c) v k v k (d) v k v k (e) v k v k (f) v n v n (g) Fig. 6.
The construction rules for the algorithm in the proof of Theorem 3.
Fig. 5(c) is ruled out by the embedding E . We maintain the invariant that allthe reflex corners introduced in the drawing point (i) down-left or up-left, if theyare contained in a face that is on the left side of the portion of the Hamiltoniancycle traversing Γ k , and (ii) down-right or up-right, if they are contained in aface that is on the right side. Possible exceptions are the reflex corners on theexternal face and that occur on edges incident to v or to v n . (cid:117)(cid:116) Theorem 3.
Every biconnected planar 4-graph has a representation with O ( n ) bends per edge that is internally turn-regular and that is computed in O ( n ) time.Proof. We modify the algorithm of Biedl and Kant [3] again, where instead ofthe standard bottom-up construction, we adopt a spiraling one. The vertices areinserted in the drawing according to an st -ordering, based on the rules depictedin Fig. 6 (a full example of the algorithm is in Fig. 12 in Appendix B). For aninternal face f let s ( f ) ( d ( f ), resp.) be the index of the first (last, resp.) insertedvertex incident to f . By construction, f is bounded by two paths P (cid:96) and P r thatgo from v s ( f ) to v d ( f ) , where P (cid:96) precedes P r in the left-to-right list of outgoingedges of v s ( f ) . The construction rules imply that P r has only convex corners.On the other hand, each convex corner of P (cid:96) is always immediately preceded orimmediately followed by a reflex corner. This rules out kitty corners in f . Indeed,consider to reflex corners c i and c j of P (cid:96) and the counter-clockwise path from c i to c j all contained into P (cid:96) . When computing rot( c i , c j ) a positive amount +1is always followed by a negative amount −
1, and the sum is never equal to 2.Since f is an internal face, rot( c i , c j ) + rot( c j , c i ) = 4, and rot( c i , c j ) (cid:54) = 2 impliesrot( c j , c i ) (cid:54) = 2. Note that an edge ( v i , v j ) contains O ( j − i ) bends, which yields O ( n ) bends per edge in the worst case. (cid:117)(cid:116) We give a characterization of the trees that admit turn-regular representations,which we use to derive a corresponding linear-time testing and drawing algo-rithm. For a tree T , let smooth( T ) denote the tree obtained from T by smoothing n Turn-Regular Orthogonal Representations 9 u vc u vc (a) u vcu vc (b) u c c v u vc c (c) Fig. 7.
Illustrations for the proof of Lemma 2. all subdivision vertices, i.e., smooth( T ) is the unique smallest tree that can besubdivided to obtain a tree isomorphic to T . We start with an auxiliary lemmawhich is central in our approach (see Appendix C for details). Lemma 2. T is turn-regular if and only if smooth( T ) is rectilinear turn-regular.Sketch of proof. Suppose that T has a turn-regular representation H (the otherdirection is obvious). We can assume that H has no zig-zag edges. By Corollary 1,the rectilinear image of H has at most two consecutive convex corners, which canbe removed with local transformations as in Fig. 7. This results in a turn-regularrepresentation with only flat corners at degree-2 vertices as desired. (cid:117)(cid:116) Unless otherwise specified, from now on we will assume by Lemma 2 that T isa tree without degree-2 vertices. We will further refer to a tree as turn-regular ifand only if it is rectilinear turn-regular. This implies that the class of turn-regulartrees coincides with the class of trees admitting planar straight-line convex draw-ings , i.e., all edges incident to leaves can be extended to infinite crossing-free rays,whose edges are horizontal or vertical segments. The next property directly fol-lows from Lemma 2 and the absence of degree-2 vertices. Property 4.
Let H be a turn-regular rectilinear representation of a tree T . Then,the reflex corners of H are formed by the leaves of T .While turn-regularity is not a hereditary property in general graphs, the nextlemma, whose proof can be found in Appendix C, shows that it is in fact hered-itary for trees. Lemma 3.
If a tree T is turn-regular, then any subtree of T is turn-regular. A trivial tree is a single edge; otherwise, it is non-trivial . For k ∈ { , } , a k -fork in a tree T consists of a vertex v whose degree is k + 1 and at least k leaves adjacent to it in T .For k ∈ { , } , a k -fork at a vertex v in a tree T consists of vertex v whosedegree is k + 1 and at least k leaves adjacent to it in T . Due to the degreerestriction, a 2-fork is not a 3-fork, and vice versa. Also, notice that by definition K , is a 3-fork. The next lemma follows from [6, Lem. 7]; a simplified proof isgiven in Appendix C. Lemma 4.
A turn-regular tree has (i) at most four -forks and no -fork, or(ii) two -forks and no -fork, or (iii) one -fork and at most two -forks. Fig. 8.
Illustration of (a) a 4-caterpillar, (b) a 4-windmill, (c) a 3-windmill, and (d) adouble-windmill. Possible extensions are highlighted in gray.
Lemma 5.
A non-trivial tree T contains at least one - or -fork.Proof. Since T is non-trivial and contains no vertices of degree two, there existsa non-leaf vertex v with degree either three or four, such that v is adjacent toexactly two or three leaves, respectively. Thus, the claim follows. (cid:117)(cid:116) Corollary 2.
A turn-regular tree has at most four non-trivial disjoint subtrees.
A vertex v of a tree T is a splitter if v is adjacent to at least three non-leaf vertices. Lemma 6.
A turn-regular tree T contains at most two splitters.Proof. Assume to the contrary that T contains at least three splitters v , v and v . We first claim that it is not a loss of generality to assume that v , v and v appear on a path in T . If this is not the case, then there is a vertex, say u , suchthat v , v and v lie in three distinct subtrees rooted at u . Hence, u is a splitterthat lies on the path from v to v . If we choose v to be u , the claim follows.Let P be the path containing v , v and v in T , and assume w.l.o.g. that v and v are the two end-vertices of P . Since v is a splitter, it is adjacent to atleast three vertices that are not leaves and two of them do not belong to P . Let T and T be the subtrees of T rooted at these two vertices, which by definitionare non-trivial and do not contain v and v . By a symmetric argument on v ,we obtain two non-trivial subtrees T and T of T that do not contain v and v .The third splitter v may have only one neighbor that is not a leaf and does notbelong to P . The (non-trivial) subtree T rooted at this vertex contains neither v nor v . Hence, T , . . . , T contradict Corollary 2. (cid:117)(cid:116) By Lemma 6, a turn-regular tree contains either zero or one or two splitters(see Lemmas 7-9). A caterpillar is a tree, whose leaves are within unit distancefrom a path, called spine . For k ∈ { , } , a k -caterpillar is a non-trivial caterpillar(i.e., not a single edge), whose spine vertices have degree at least 3 and at most k . Lemma 7.
A tree T without splitters is a -caterpillar and turn-regular.Proof. In the absence of splitters in T , all inner vertices of T form a path. Hence, T is a 4-caterpillar and thus turn-regular; see Fig. 8(a). (cid:117)(cid:116) A tree with one splitter v is (i) a 4 -windmill , if v is the root of four 3-caterpillars (Fig. 8(b)), (ii) a 3 -windmill , if v is the root of two 3-caterpillars and n Turn-Regular Orthogonal Representations 11 one 4-caterpillar (Fig. 8(c)). Note that in the latter case, v can be adjacent to aleaf if it has degree four. The operation of pruning a rooted tree T at a degree- k vertex v with k ∈ { , } that is not the root of T , removes the k − T rooted at the children of v without removing these children, and yields a newsubtree T (cid:48) of T , in which v and its children form a ( k − T (cid:48) . Lemma 8.
A tree T with one splitter is turn-regular if and only if it is a - or -windmill.Sketch of proof. Every 3- or 4-windmill is turn-regular; see Figs. 8(b)-8(c). Now,let u be the splitter of T . If u has four non-leaf neighbors, then u is the rootof four non-trivial subtrees T , . . . , T , which by Lemma 7 are 4-caterpillars. Weclaim that none of them has a degree-4 vertex. Assume to the contrary that T contains such a vertex v (cid:54) = u . We root T at u and prune at v , resulting in a (turn-regular, by Lemma 3) subtree T (cid:48) of T that contains a 3-fork at v . By Lemma 5,each of the non-trivial trees T , . . . , T contains a fork. By Lemma 4, these threeforks together with the 3-fork formed at v contradict the turn-regularity of T (cid:48) .The case in which u has three non-leaf neighbors can be found in Appendix C. (cid:117)(cid:116) A tree T with exactly two splitters u and v is a double-windmill if (i) the pathfrom u to v in T forms the spine of a 4-caterpillar in T , (ii) each of u and v is theroot of exactly three non-trivial subtrees, and (iii) the two non-trivial subtreesrooted at u ( v ) that do not contain v ( u ) are 3-caterpillars; see Fig. 8(d). Theproof of the next lemma is similar to the one of Lemma 8; see Appendix C. Lemma 9.
A tree T with two splitters is turn-regular if and only if it is adouble-windmill. Lemmas 7-9 imply the next theorem. Note that for the recognition, one can testif a (sub-)tree is a 3- or a 4-caterpillar in linear time (for details, see Appendix C).
Theorem 4.
A tree T is turn-regular if and only if smooth( T ) is (i) a -caterpillar, or (ii) a - or a -windmill, or (iii) a double-windmill. Moreover,recognition and drawing can be done in linear time. Here we focus on rectilinear planar representations and prove the following.
Theorem 5.
Let G be an n -vertex biconnected plane graph with faces of degreeat most eight. There exists an O ( n . ) -time algorithm that decides whether G admits an embedding-preserving turn-regular rectilinear representation and thatcomputes such a representation in the positive case.Proof. We describe a testing algorithm based on a constrained version of Tamas-sia’s flow network N ( G ), which models the space of orthogonal representations of uvw syzrx f (a) ν f
33 3 3 3 333 ν v ν w ν z ν wz ν x ν y ν xy ν r ν s ν rs ν u ν uv (b) Fig. 9. (a) A pair of kitty corners in a face of degree eight. (b) The modification of theflow network around a face-node corresponding to an internal face. The labels on thedirected edge represent capacities. G within its given planar embedding [25]. Let V , E , and F be the set of vertices,edges, and faces of G , respectively. Tamassia’s flow network N ( G ) is a directedmultigraph having a vertex-node ν v for each vertex v ∈ V and a face-node ν f for each face f ∈ F . N ( G ) has two types of edges: ( i ) for each vertex v of a face f , there is a directed edge ( ν v , ν f ) with capacity 3; ( ii ) for each edge e ∈ E ,denoted by f and g the two faces incident to e , there is a directed edge ( ν f , ν g )and a directed edge ( ν g , ν f ), both with infinite capacity.A feasible flow on N ( G ) corresponds to an orthogonal representation of G : aflow value k ∈ { , , } on an edge ( ν v , ν f ) represents an angle of 90 · k degrees at v in f (since G is biconnected, there is no angle larger than 270 ◦ at a vertex); a flowvalue k ≥ ν f , ν g ) represents k bends on the edge of G associatedwith ( ν f , ν g ), and all these bends form an angle of 90 ◦ inside f . Hence, eachvertex-node ν v supplies 4 units of flow in N ( G ), and each face-node ν f in N ( G )demands an amount of flow equal to c f = (2 deg( f ) −
4) if f is internal and to c f = (2 deg( f ) + 4) if f is external. The value c f represents the capacity of f . Itis proved in [25] that the total flow supplied by the vertex-nodes equals the totalflow demanded by the face-nodes; if a face-node ν f cannot consume all the flowsupplied by its adjacent vertex-nodes (because its capacity c f is smaller), it cansend the exceeding flow to an adjacent face-node ν g , through an edge ( ν f , ν g ),thus originating bends.Our algorithm has to test the existence of an orthogonal representation H such that: (a) H has no bend; (b) H is turn-regular. To this aim, we suitablymodify N ( G ) so that the possible feasible flows only model the set of orthogonalrepresentations that verify Properties (a) and (b). To enforce Property (a), wejust remove from N ( G ) the edges between face-nodes. To enforce Property (b),we enhance N ( G ) with additional nodes and edges. Consider first an internalface f of G . By hypothesis deg( f ) ≤
8. It is immediate to see that if deg( f ) ≤ n Turn-Regular Orthogonal Representations 13 then f cannot have a pair of kitty corners. If deg( f ) = 8, a pair { u, v } of kittycorners necessarily requires three vertices along the boundary of f going from u to v (and hence also from v to u ); see Fig. 9(a). Therefore, for such a face f , we locally modify N ( G ) around ν f as shown in Fig. 9(b). Namely, for eachpotential pair { u, v } of kitty corners, we introduce an intermediate node ν uv ;the original edges ( ν u , ν f ) and ( ν v , ν f ) are replaced by the edges ( ν u , ν uv ) and( ν v , ν uv ), respectively (each still having capacity 3); finally, an edge ( ν uv , ν f )with capacity 5 is inserted, which avoids that u and v form a reflex corner inside f at the same time. For the external face f , it can be easily seen that a pairof kitty corners is possible only if the face has degree at least 10. Since we areassuming that deg( f ) ≤
8, we do not need to apply any local modification to N ( G ) for the external face.Hence, a rectilinear turn-regular representation of G corresponds to a feasibleflow in the modified version of N ( G ). Since N ( G ) can be easily transformed intoa sparse unit capacity network, this problem can be solved in O ( n . ) time byapplying a maximum flow algorithm (the value of the maximum flow must beequal to 4 | V | ) [1]. (cid:117)(cid:116) Our work raises several open problems. (i) A natural question is if all biconnectedplanar 4-graphs are turn-regular (not only internally). (ii) While we suspect theexistence of non-turn regular biconnected planar 4-graphs, we conjecture thattriconnected planar 4-graphs are turn-regular. (iii) It would be interesting toextend the result of Theorem 5 to more general classes of plane graphs.
References
1. Ahuja, R.K., Magnanti, T.L., Orlin, J.B.: Network flows - theory, algorithms andapplications. Prentice Hall (1993)2. Batini, C., Talamo, M., Tamassia, R.: Computer aided layout of entity relationshipdiagrams. Journal of Systems and Software 4(2-3), 163–173 (1984)3. Biedl, T.C., Kant, G.: A better heuristic for orthogonal graph drawings. Comput.Geom. 9(3), 159–180 (1998)4. Binucci, C., Di Giacomo, E., Didimo, W., Rextin, A.: Switch-regular upward pla-narity testing of directed trees. J. Graph Algorithms Appl. 15(5), 587–629 (2011)5. Bridgeman, S.S., Di Battista, G., Didimo, W., Liotta, G., Tamassia, R., Vismara,L.: Turn-regularity and optimal area drawings of orthogonal representations. Com-put. Geom. 16(1), 53–93 (2000)6. Carlson, J., Eppstein, D.: Trees with convex faces and optimal angles. In: Kauf-mann, M., Wagner, D. (eds.) GD. LNCS, vol. 4372, pp. 77–88. Springer (2006)7. Cornelsen, S., Karrenbauer, A.: Accelerated bend minimization. J. Graph Algo-rithms Appl. 16(3), 635–650 (2012)8. Di Battista, G., Eades, P., Tamassia, R., Tollis, I.G.: Graph Drawing: Algorithmsfor the Visualization of Graphs. Prentice-Hall (1999)9. Di Battista, G., Liotta, G.: Upward planarity checking: ”faces are more than poly-gons”. In: GD. LNCS, vol. 1547, pp. 72–86. Springer (1998)4 M. A. Bekos et al.10. Didimo, W., Liotta, G.: Mining Graph Data, chap. Graph Visualization and DataMining, pp. 35–64. Wiley (2007)11. Didimo, W.: Upward planar drawings and switch-regularity heuristics. J. GraphAlgorithms Appl. 10(2), 259–285 (2006)12. Duncan, C.A., Goodrich, M.T.: Planar orthogonal and polyline drawing algo-rithms. In: Handbook of Graph Drawing and Visualization, pp. 223–246. Chapmanand Hall/CRC (2013)13. Eiglsperger, M., Gutwenger, C., Kaufmann, M., Kupke, J., J¨unger, M., Leipert, S.,Klein, K., Mutzel, P., Siebenhaller, M.: Automatic layout of UML class diagramsin orthogonal style. Information Visualization 3(3), 189–208 (2004)14. Esser, A.M.: Orthogonal compaction: Turn-regularity, complete extensions, andtheir common concept. In: Cl´audio, A.P., Bouatouch, K., Chessa, M., Paljic, A.,Kerren, A., Hurter, C., Tremeau, A., Farinella, G.M. (eds.) Computer Vision, Imag-ing and Computer Graphics Theory and Applications. pp. 179–202. Springer In-ternational Publishing, Cham (2020)15. Evans, W.S., Fleszar, K., Kindermann, P., Saeedi, N., Shin, C.S., Wolff,A.: Minimum rectilinear polygons for given angle sequences. Tech. ReportarXiv:1606.06940, Cornell University (2020), https://arxiv.org/abs/1606.06940
16. Even, S., Tarjan, R.E.: Corrigendum: Computing an st -numbering. TCS2(1976):339-344. Theor. Comput. Sci. 4(1), 123 (1977)17. Hashemi, S.M., Tahmasbi, M.: A better heuristic for area-compaction of orthogonalrepresentations. App. Math. and Comp. 172(2), 1054–1066 (2006)18. J¨unger, M., Mutzel, P. (eds.): Graph Drawing Software. Springer (2004)19. Kaufmann, M., Wagner, D. (eds.): Drawing Graphs, Methods and Models, LectureNotes in Computer Science, vol. 2025. Springer (2001)20. Klau, G.W., Mutzel, P.: Optimal compaction of orthogonal grid drawings. In:Cornu´ejols, G., Burkard, R.E., Woeginger, G.J. (eds.) IPCO. LNCS, vol. 1610,pp. 304–319. Springer (1999)21. Lengauer, T.: Combinatorial Algorithms for Integrated Circuit Layout. B. G. Teub-ner/Wiley (1990)22. Nishizeki, T., Chiba, N.: Planar Graphs: Theory and Algorithms, chap. 10. Hamil-tonian Cycles, pp. 171–184. Courier Dover Publications (2008)23. Nishizeki, T., Rahman, M.S.: Planar Graph Drawing, Lecture Notes Series onComputing, vol. 12. World Scientific (2004)24. Patrignani, M.: On the complexity of orthogonal compaction. Comput. Geom.19(1), 47–67 (2001)25. Tamassia, R.: On embedding a graph in the grid with the minimum number ofbends. SIAM J. Comput. 16(3), 421–444 (1987)26. Vijayan, G., Wigderson, A.: Rectilinear graphs and their embeddings. SIAM J.Comput. 14(2), 355–372 (1985)n Turn-Regular Orthogonal Representations 15 AppendixA Additional Material for Section 2
Planar Graphs and Embeddings. A k -graph is a graph with vertex-degree atmost k . We denote by deg( v ) the degree of a vertex v . A plane graph is a planargraph with a given planar embedding. Let G be a plane graph and let f be a faceof G . We always assume that the boundary of f is traversed counterclockwise,if f is an internal face, and clockwise, if f is the external face. Note that if G is not biconnected, an edge may occur twice and a vertex may occur multipletimes on the boundary of f . The total number of vertices (or edges), countedwith their multiplicity, is called the degree of f and is denoted as deg( f ). Orthogonal Drawings and Representations.
Let G be a planar 4-graph. Aplanar orthogonal drawing Γ of G is a planar drawing of G that represents eachvertex as a point and each edge as an alternating sequence of horizontal andvertical segments between its end-vertices. A bend in Γ is a point of an edge,in which a horizontal and a vertical segment meet. Informally speaking, an or-thogonal representation of G is an equivalence class of orthogonal drawings of G having the same planar embedding and the same “shape”, i.e., the same se-quences of angles around the vertices ,and of bends along the edges.More formally, if G is plane, and e and e are two (possibly coincident)edges incident to a vertex v of G that are consecutive in the clockwise orderaround v , we say that a = (cid:104) e , v, e (cid:105) is an angle at v of G or simply an angle of G . Let Γ and Γ (cid:48) be two embedding-preserving orthogonal drawings of G . Wesay that Γ and Γ (cid:48) are equivalent if: (i) for any angle a of G , the geometric anglecorresponding to a is the same in Γ and Γ (cid:48) , and (ii) for any edge e = ( u, v ) of G ,the sequence of left and right bends along e moving from u to v is the same in Γ and in Γ (cid:48) . An orthogonal representation H of G is a class of equivalent orthogonaldrawings of G . Representation H is completely described by the embedding of G , by the value α ∈ { ◦ , ◦ , ◦ , ◦ } for each angle a of G ( α defines thegeometric angle associated with a ), and by the ordered sequence of left and rightbends along each edge ( u, v ), moving from u to v ; if we move from v to u thissequence and the direction (left/right) of each bend are reversed. An orthogonalrepresentation without bends is also called rectilinear .W.l.o.g., from now on we assume that an orthogonal representation H comeswith a given orientation, i.e., we shall assume that for each edge segment pq of H (where p and q correspond to vertices or bends), it is fixed if p is to the left,to the right, above, or below q in every orthogonal drawing that preserves H . Lemma 1.
Let H be the rectilinear image of an orthogonal representation H of a plane graph G . Let ( c , c ) be two corners of the external face such thatrot ( c , c ) ≥ or c is a reflex corner and rot ( c , c ) ≥ . Then, the externalface contains a pair of kitty corners.Proof. Let π denote the path from c to c in a clockwise traversal of the externalface. First assume that c is not a reflex corner and rot( c , c ) ≥
3. Let c be the v v v v v v v v (a) v v v v v v v v (b) v v v v v v v v v (c) v v v v v v v v v (d) v v v v v v v v v v v (e) v v v v v v v v v v v v (f) v v v v v v v v v v (g) Fig. 10.
The final steps of the algorithm in the proof of Theorem 1 for the constructionof a turn-regular orthogonal drawing of a biconnected planar 3-graph (see also Fig. 4). corner that precedes c . If c is not a reflex corner, then rot( c, c ) = rot( c , c ) +turn( c ) ≥
3, and if c is a reflex corner, then rot( c, c ) = rot( c , c ) − ≥ π by adding preceding corners untilwe find a reflex corner c such that rot( c , c ) ≥
2. If c is a reflex corner, androt( c , c ) = 2, we have kitty corners by definition. If rot( c , c ) >
2, then, asrot( c , c ) = − π until we find a pair of corners ( c , c (cid:48) ) withrot( c , c (cid:48) ) = 2 such that c (cid:48) is a reflex corner. Similarly, if rot( c , c ) = 2 but c is not a reflex corner, we can extend π to the next reflex corner c (cid:48) on the externalface with rot( c , c (cid:48) ) = 2. Then, ( c , c (cid:48) ) is the claimed pair of kitty corners. (cid:117)(cid:116) B Full Proofs for Section 3
Theorem 2.
Every planar Hamiltonian 4-graph G admits a turn-regular repre-sentation H with at most bends per edge, and such that only one edge of H n Turn-Regular Orthogonal Representations 17 gets bends and only if G is 4-regular. Given the Hamiltonian cycle, H can becomputed in linear time. v v v v v v v v v v (a) v v v v v (b) v v v v v v v v (c) v v v v v v v v v (d) v v v v v v v v v v v v (e) v v v v v v v v v v v v v (f) v v v v v v v v v v v v (g) v v v v v v v v v v v v v v v (h) v v v v v v v v v v v v v v (i) v v v v v v v v v v v v v (j) v v v v v v v v v v (k) Fig. 11.
The drawing produced by the algorithm of the proof of Theorem 2 for theconstruction of a turn-regular orthogonal drawing of a Hamiltonian planar 4-graph.The Hamiltonian cycle is drawn red and thick.
Proof.
We use an iterative construction inspired by the algorithm by Biedl andKant [3] where we replace the st -ordering of the input graph with the orderinggiven by the Hamiltonian cycle. Let G be a Hamiltonian planar 4-graph and let E be a planar embedding of G . If G has some vertices of degree less than four,choose one of these to be v . Otherwise, if G is 4-regular, denote by v a vertexof G such that the two edges of the Hamiltonian path incident to v are not bothon the external face. Such a vertex always exists since if G is 4-regular it cannotbe also outerplanar, as an outerplanar graph has at least a vertex of degree two.We consider the vertices in the order v , v , . . . , v n given by the Hamiltoniancycle of G . We also assume that edge ( v n , v ) is incident to the external face of E (otherwise we could change the external face preserving the rotation schemeof E and avoiding that ( v , v ) is also on the external face). We incrementallyconstruct an orthogonal drawing Γ of G by adding v k , for k = 1 , . . . , n , to thedrawing Γ k − of { v , . . . , v k − } , preserving the embedding of E . In particular,vertex v k is always placed above Γ k − .After v k is added to Γ k − , we introduce some extra columns into Γ k so tomaintain some invariants. Analogously to [3] and to the proof of Theorem 1, wemaintain the invariant that each edge ( v i , v j ) such that i ≤ k < j has a dedicatedcolumn in Γ k that is reachable from v i with at most one bend without introducingcrossings. Observe that, since the vertices are inserted in the order given by theHamiltonian cycle, in the drawing Γ k − a special path can be identified, that wecall the spine , connecting, for i = 1 , . . . , k −
2, vertex v i to v i +1 . We maintain theinvariant that all the reflex corners introduced in the drawing point down-left orup-left if they are contained into a face that is on the left side of the spine andpoint down-right or up-right if they are contained into a face that is containedon the right side of the spine, with the possible exception of the reflex cornerson the external face occurring on edges incident to s or to t .Suppose v has degree 4. Then, its additional two edges may be: (a) both onthe right side of the spine (Fig. 5(a)) or (b) one on the left side and the other onthe right side of the spine (Fig. 5(b)). The case when the additional edges areboth on the left side of the spine, depicted in Fig. 5(c), is ruled out by the choiceof v . In the cases (a) and (b) the drawing of v and the columns reserved for itsoutgoing edges are depicted in Figs. 5(a) and 5(b), respectively. If, instead, v has degree three or two, the drawing of v is obtained from Fig. 5(b) by omittingthe missing edges.For k = 1 , , . . . , n , each vertex v k added to the drawing has one incomingand one outgoing edge of the spine. The drawing of v k follows simple rules thatdepend on the number of additional edges of v k on the left side and on the rightside of the spine in E .Now consider a vertex v k with 1 < k < n . Suppose v k has degree four and thatits additional edges are both on the left side of the spine (Fig. 5(g)). Denote by v i and v j the other endpoints of the additional edges of v k and assume, withoutloss of generality, that v i < v j . There are three cases: v k < v i < v j (Fig. 5(h)),or v i < v k < v j (Fig. 5(i)), or v i < v j < v k (Fig. 5(j)). In all cases the drawingsof v k depicted in Figs. 5(h)-5(j)) guarantee the invariants. If v k has degree twoor three, its drawing is that of Fig. 5(i) where the missing edges are omitted.The case when v k has degree four and its additional edges are both on theright of the spine can be handled analogously, horizontally mirroring the config-urations of Figs. 5(h)-5(j).Suppose now that v k has degree four and that its additional edges are one onthe left side and one on the right side of the spine (Fig. 5(k)). Again, dependingon whether the vertices adjacent to v k precede or follow v k in the ordering givenby the Hamiltonian cycle we can adopt for v k one of the drawings depicted inFigs. 5(l)-5(n). n Turn-Regular Orthogonal Representations 19 v v v v v v v v v v (a) v v v v v (b) v v v v v v v (c) v v v v v v v v v v (d) v v v v v v v v v v v (e) v v v v v v v v v v (f) v v v v v v v v v v v v v (g) v v v v v v v v v v v v (h) v v v v v v v v v v v v v v (i) v v v v v v v v v v v v v (j) v v v v v v v v v v (k) Fig. 12.
Example illustrating the algorithm in the proof of Theorem 3 for the con-struction of an orthogonal drawing with turn-regular internal faces.
Finally, vertex v n is added to the drawing by using one of the configurationsshown in Figs. 5(d), 5(e), and 5(f).Since the configurations in Figs 5(a)-5(n) all respect the invariant that in thefaces on the left side (right side, resp.) of the spine only top-left and bottom-left (top-right and bottom-right, resp.) reflex corners are inserted, the drawing cannot have kitty corners and is turn regular. Also observe that each edge hasa maximum of three bends per edge. (cid:117)(cid:116) C Full Proofs for Section 4
In this section, we provide the detailed proofs of statements omitted in Section 4due to space constraints.
Lemma 2. T is turn-regular if and only if smooth( T ) is rectilinear turn-regular.Proof. Suppose that T is turn-regular, and let H be a turn-regular representationof T (the other direction is obvious). Consider the rectilinear image H of H . Weshow that H can be transformed into a turn-regular representation H (cid:48) with onlyflat corners at degree-2 vertices. Let u and v be two vertices of H such thatdeg( u ) (cid:54) = 2, deg( v ) (cid:54) = 2, and the path π uv connecting u to v in H has only(possibly none) degree-2 vertices. W.l.o.g., we assume that π uv does not containtwo consecutive corners c and c such that turn( c ) = 1 and turn( c ) = − c and c with two flat corners. Hence, we can assume that all non-flatcorners encountered along π uv , while moving from u to v , always turn in thesame direction, say to the right; i.e., all of them are convex corners. Let k bethe number of convex corners along π uv . Since the only face of H is the externalface, by Corollary 1 we may assume that 1 ≤ k ≤
2, which yields two cases.Assume first k = 1. Let c be the convex corner along π uv . W.l.o.g., supposethat c points up-left. Since H is turn-regular, by Corollary 1, either u has noedge segment incident from the right (see Fig. 7(a)) or v has no edge segmentincident from below (see Fig. 7(b)). Hence, we can transform c into a flat cornerby using one of these two directions to reroute π uv around u or around v .Let now k = 2. Let c and c be the two convex corners along π uv . W.l.o.g.,suppose that c points up-left and c points up-right (see Fig. 7(c)). Since H isturn-regular, by Corollary 1, u has no edge segment incident from the right and v has no edge segment incident from the left. Hence, again, we can transform c into a flat corner by using these two directions to reroute π uv around u and v . H (cid:48) is obtained by applying the above transformation to each pair of vertices u and v that have the properties above. (cid:117)(cid:116) Lemma 3.
If a tree T is turn-regular, then any subtree of T is turn-regular.Proof. Let H be a turn-regular rectilinear representation of tree T , and let T (cid:48) be a subtree of T , i.e., T (cid:48) is a connected subgraph of T . If T and T (cid:48) consist of n and n (cid:48) vertices, respectively, then T (cid:48) can be obtained from T by repeatedlyremoving exactly one leaf of it, n − n (cid:48) times. For i = 0 , . . . , n − n (cid:48) , denote by T i the subtree of T that is derived after the removal of the first i leaves, and by H i the restriction of H to tree T i ; clearly, T = T , H = H and T (cid:48) = T n − n (cid:48) hold.For i = 1 . . . , n − n (cid:48) , we will prove that H i is turn-regular, under the assumptionthat H i − is turn-regular. This will imply that T (cid:48) is turn-regular, as desired. Let n Turn-Regular Orthogonal Representations 21 u be the leaf that is removed from H i − to obtain H i . We emphasize that H i − consists of a single face, i.e., the external. Hence, the removal of u from H i − implies the removal of a pair of reflex corners from its external face. We nextfocus on the case, in which the removal of u from H i − introduces a reflex cornerin H i that is not present in H i − , as otherwise H i is clearly turn-regular.Let v be the (unique) neighbor of u in T i − . If v has no neighbor in T i − other than u , then i = n − T i consists of single vertex v and thus isturn-regular. Hence, we may assume that v has a neighbor, say w , in T i − thatis different from v . W.l.o.g., we assume that ( v, w ) is vertical in H i − (and thusin H i ) with v being its top end-vertex. If deg( v ) = 4 in T i − , then the removal of u from T i − yields a flat corner in H i , which implies H i does not contain a reflexcorner that does not exist in H i − ; a contradiction. Hence, deg( v ) ∈ { , } in T i − . We will focus on the case, in which deg( v ) = 2 in T i − ; the case, in whichdeg( v ) = 3 in T i − , is analogous. Note that if ( u, v ) is horizontal in H i − , then( u, v ) and ( v, w ) inevitably form a reflex corner ζ v in H i − .Assume for a contradiction that H i is not turn-regular. If we denote by (cid:104) c v , c (cid:48) v (cid:105) the ordered pair of reflex corners at v in H i , then at least one of c v and c (cid:48) v , saythe former, forms a pair of kitty corners with another corner c of H i (and thus of H i − ). Denote by (cid:104) c u , c (cid:48) u (cid:105) the ordered pair of reflex corners at u in H i − . If ( u, v )is horizontal and u is to the left (right) of v in H i − , then we observe that c and c (cid:48) u ( c and ζ v , respectively) form a pair of kitty corners in H i − . On the otherhand, if ( u, v ) is vertical, then c and c u form a pair of kitty corners in H i − . Inboth cases, we obtain a contradiction to the fact that H i − is turn-regular. (cid:117)(cid:116) Lemma 4.
A turn-regular tree has (i) at most four -forks and no -fork, or(ii) two -forks and no -fork, or (iii) one -fork and at most two -forks.Proof. To prove the lemma, we first state and formally prove two claims.
Claim 1.
Let H be a turn-regular rectilinear representation of a tree T . Let u and v be two leaves associated with two ordered reflex corner-pairs (cid:104) c u , c (cid:48) u (cid:105) and (cid:104) c v , c (cid:48) v (cid:105) . If in a traversal of the external face of T from u to v there is no otherleaf of T , then rot( c (cid:48) u , c v ) ∈ {− , , } (or equivalently rot( c u , c v ) ∈ { , − , − } ). Proof.
By Property 4, it follows that there exist no reflex corners between c (cid:48) u and c v . By Lemma 1, it follows that rot( c (cid:48) u , c v ) <
2, which implies there exist atmost two convex corners between c (cid:48) u and c v . Hence, rot( c (cid:48) u , c v ) ∈ {− , , } . (cid:117)(cid:116) Consider a leaf u of T and assume w.l.o.g. that u is pointing upward in H . Let v be the leaf that follows u in the traversal of the external face of T in H . Letalso (cid:104) c u , c (cid:48) u (cid:105) and (cid:104) c v , c (cid:48) v (cid:105) be the two pairs of ordered reflex corners associatedwith u and v , respectively. By Claim 1, v does not point leftward, as otherwiserot( c u , c v ) = − c u , c v ) = 1. If v is pointing upward (i.e., rot( c u , c v ) = 0),then we say that there exists no change in direction between u and v . Otherwise,we say that there exists a change in direction between u and v , which impliesrot( c u , c v ) < Claim 2.
Let H be a turn-regular rectilinear representation of a tree T . Then,the total number of changes in direction of the leaves of T in H is at most four. Proof.
Assume to the contrary that there exist s ≥ (cid:104) v , v (cid:105) , . . . , (cid:104) v s − , v s (cid:105) in a traversal of the external face of T , where a change indirection occurs. Note that v , v , . . . , v s − , v s are not necessarily distinct. For i = 1 , . . . , s , let (cid:104) c i , c (cid:48) i (cid:105) be the ordered pair of corners associated with v i . Since (cid:104) v i − , v i (cid:105) introduces a change in direction, rot( c i − , c i ) ≤ −
1. Summing upover i , we obtain (cid:80) si =1 rot( c i − , c i ) ≤ −
5. Since the remaining leaves of T donot introduce a change in direction, rot( u, u ) = (cid:80) si =1 rot( c i − , c i ) holds forany leaf u in H , which is a contradiction to Property 1. (cid:117)(cid:116) Since 2- and 3-forks require one and two changes in direction, the proof of lemmafollows directly from Claim 2. (cid:117)(cid:116)
Lemma 8.
A tree T with one splitter is turn-regular if and only if it is a - or -windmill.Proof. Clearly, every 3- and 4-windmill is turn-regular; this can be easily seenlooking at the illustrations in Figs. 8(c) and 8(b), where no pairs of kitty cornersare present. For the other direction, consider a turn-regular tree T and let u bethe unique splitter of T . By definition, u has either four or three neighbors thatare not leaves. In the former case, we will prove that T is a 4-windmill, while inthe latter case that T is a 3-windmill. Note that u may be adjacent to a leaf,only if deg( u ) = 4.We start with the case in which u has four neighbors that are not leaves,which implies that u is the root of exactly four non-trivial subtrees T , . . . , T .Since u is the only splitter in T , by Lemma 7, it follows that each of T , . . . , T is a 4-caterpillar. To show that T is a 4-windmill, it remains to show that eachof T , . . . , T cannot contain a degree-4 vertex. Assume to the contrary that T contains a degree-4 vertex v . Since the deg( u ) = 1 in T , u (cid:54) = v holds. We root T at u and we proceed by pruning T at v , which will result in a subtree T (cid:48) of T that contains a 3-fork at v . Since T is turn-regular, by Lemma 3, T (cid:48) is alsoturn-regular. Since T , . . . , T are non-trivial, by Lemma 5 each of them containsa fork. By Lemma 4, these three forks together with the 3-fork formed at v contradict the fact that T (cid:48) is turn-regular.We now consider the case in which u has three neighbors that are not leaves,that is, u is the root of exactly three non-trivial subtrees T , T and T . Since u is the only splitter in T , we have again that each of these subtrees is a 4-caterpillar. We now claim that two of them must be 3-caterpillars, which alsoimplies that T is a 3-windmill, as desired. Assume to the contrary that T and T are not 3- but 4-caterpillars, that is, there exist vertices v and v in T and T that are of degree 4, respectively. Note that u (cid:54) = v and u (cid:54) = v . We assumethat T is rooted at u and, as in the previous case, we prune T first at v andthen at v . The resulting subtree T (cid:48) contains two 3-forks at v and v and oneadditional fork that is contained in T (by Lemma 5). Hence, by Lemma 4, T (cid:48) is not turn-regular, which is a contradiction to Lemma 5 (since T (cid:48) is a subtreeof the turn-regular tree T ). (cid:117)(cid:116) n Turn-Regular Orthogonal Representations 23 Lemma 9.
A tree T with two splitters is turn-regular if and only if it is adouble-windmill.Proof. Clearly, every double-windmill is turn-regular, as it can be easily seenlooking at the illustration in Fig. 8(d). Now consider a turn-regular tree T andlet u and v be the two splitters of T .To prove that T has Property (i) of a double-windmill, consider the path P from u to v in T , and let w be an internal vertex of P (if any). Since w is aninternal vertex of P , it is adjacent to two non-leaves of T (i.e., its neighbors in P ). Note that w cannot be a splitter, because T has exactly two splitters (thatis, u and v ). Hence, the neighbors of w that are not in P are leaves, which impliesthat Property (i) of a double-windmill holds for T .We now prove that T has Property (ii) of a double-windmill. Assume to thecontrary that u is the root of four non-trivial subtrees. We root T at u andwe denote by T , . . . , T the subtrees of T that are rooted at the four childrenof u . It follows that T , . . . , T are non-trivial and disjoint. W.l.o.g., assumethat T contains v . Since v is a splitter, there exist at least two non-trivialsubtrees of T , say T and T , that are rooted at two children of v . Hence, T , T , T , T and T are disjoint subtrees of T . Since each of these subtrees isnon-trivial, by Corollary 2 we have a contradiction to the turn-regularity of T .Hence, Property (ii) of a double-windmill holds for T .By Property (ii), u has three non-leaf neighbors u , . . . , u in T . We againroot T at u and we denote by T , . . . , T the subtrees of T that are rootedat u , . . . , u . It follows that T , . . . , T are non-trivial and disjoint. As above,we assume w.l.o.g. that T contains v , and we define in the same way the twosubtrees, T and T , of T . We now claim that none of T , T , T and T containsa degree-4 vertex z . Assume to the contrary that one, say T , contains a degree-4vertex z . Since we have assumed T to be rooted at u , we proceed by pruning T at z . The resulting tree T (cid:48) , which is turn-regular by Lemma 3, contains a3-fork at z and three additional forks that lie in the non-trivial trees T , T and T , which contradicts Corollary 2. Hence, our claim follows. In particular, since u and v are the only splitters in T , our claim implies that each of T and T together with u , as well as, each of T and T together with v is a 3-caterpillar,which implies that Property (iii) of a double-windmill holds for T . (cid:117)(cid:116) Theorem 4.
A tree T is turn-regular if and only if smooth( T ) is (i) a -caterpillar, or (ii) a - or a -windmill, or (iii) a double-windmill. Moreover,recognition and drawing can be done in linear time.Proof. Since by Lemma 6 a turn-regular tree has at most two splitters, the cor-rectness of our characterization follows from Lemmas 7, 8 and 9 (recall that wehave assumed w.l.o.g. that T does not have degree-2 vertices). For the recog-nition, we first count how many splitter tree T contains, which can be donein O ( n ) time. If there are more than two splitters, we reject the instance. Ifthere are no splitters, we accept the instance and we report the representationdescribed in Lemma 7. For the remaining cases, we first observe that one cantrivially test whether a (sub-)tree is a 3- or a 4-caterpillar in time linear to its number of vertices. This observation directly implies that in linear time one cantest whether T is turn-regular, when T has exactly one splitter. It remains toconsider the case in which T contains exactly two splitters u and v . It followsthat each internal vertex of the path from u to v is adjacent only to leaves of T .We now argue for vertex u ; symmetric arguments hold for v . Two of the subtreesof T rooted at u that do not contain v have to be 3-caterpillars, while the third(if any) has to be a leaf. Both can be checked in time linear in the size of T ,which completes the description of the proof.,which completes the description of the proof.