Drawing Graphs with Vertices at Specified Positions and Crossings at Large Angles

Point-set embeddings and large-angle crossings are two areas of graph drawing that independently have received a lot of attention in the past few years. In this paper, we consider problems in the intersection of these two areas. Given the point-set-e…

Authors: Martin Fink, Jan-Henrik Haunert, Tamara Mchedlidze

Drawing Graphs with Vertices at Specified Positions and Crossings at   Large Angles
Dra wing Graphs with V ertices at Sp ecified P ositions and Crossings at Large Angles Martin Fink 1 , Jan-Henrik Haunert 1 , T amara Mc hedlidze 2 , Joac him Sp o erhase 1 , and Alexander W olff 1 1 Lehrstuhl f ¨ ur Informatik I, Universit¨ at W ¨ urzburg, Germany . http://www1.informatik.uni-wuerzburg.de 2 Departmen t of Mathematics, National T ec hnical Universit y of Athens, Greece. mchet@math.ntua.gr Abstract. P oint-set em b eddings and large-angle crossings are tw o ar- eas of graph dra wing that indep enden tly hav e received a lot of attention in the past few years. In this pap er, we consider problems in the inter- section of these tw o areas. Given the p oin t-set-embedding scenario, we are interested in how muc h we gain in terms of computational complex- it y , curve complexity , and generality if we allow large-angle crossings as compared to the planar case. W e in vestigate tw o drawing styles where only b ends or b oth b ends and edges must b e drawn on an underlying grid. W e present v arious results for dra wings with one, tw o, and three b ends p er edge. 1 In tro duction In p oin t-set-embeddability problems one is giv en not just a graph that is to b e dra wn, but also a set of p oints in the plane that sp ecify where the vertices of the graph can b e placed. The problem class was introduced by Gritzmann et al. [8] tw en ty years ago. They show ed that any n -vertex outerplanar graph can b e embedded on any set of n p oints in the plane (in general p osition) such that edges are represen ted by straight-line segments connecting the resp ective p oin ts and no t w o edge representations cross. Later on, the p oint-set-em beddability question was also raised for other dra wing styles, for example, by Pac h and W enger [13] and b y Kaufmann and Wiese [11] for dra wings with polygonal edges, so-called p olyline dr awings . In these and most other w orks, how ever, planarity of the output dra wing was an essential requirement. Recen t exp erimen ts on the readability of drawings [9] show ed that p olyline dra wings with angles at edge crossings close to 90 ◦ and a small num ber of b ends p er edge are just as readable as planar drawings. Motiv ated by these findings, Didimo et al. [4] recently defined RAC dra wings where pairs of crossing edges m ust form a righ t angle and, more generally , α AC dra wings (for α ∈ (0 , 90 ◦ ]) where the crossing angle must b e at least α . As usual, edges may not ov erlap and ma y not go through vertices. In this pap er, we inv estigate the in tersection of the tw o areas, p oin t-set em- b eddabilit y (PSE) and RAC/ α A C. Sp ecifically , w e consider the following prob- lems. 2 M. Fink et al. Pr oblems RAC PSE and α A C PSE. Given an n -vertex graph G = ( V , E ) and a set S of n p oin ts in the plane, determine whether there exists a bijection µ b et w een V and S , and a p olyline drawing of G so that each vertex v is mapp ed to µ ( v ) and the drawing is RAC (or α A C). If such a drawing exists and the largest num b er of b ends p er edge in the drawing is b , we say that G admits a RA C b (or an α AC b ) emb e dding on S . If we insist on straigh t-line edges, the dra wing is completely determined once w e hav e fixed a bijection b et ween vertex and p oint set. If we allow b ends, how- ev er, PSE is also in teresting with mapping , that is, if w e are given a bijection µ b et w een vertex and p oin t set. W e call an embedding using µ as the mapping µ - r esp e cting . The maxim um num b er of b ends ov er all edges in a p olyline drawing is the curve c omplexity of the dra wing. W e now list three results that motiv ate the study of RAC and α AC point-set em b eddings—ev en for planar graphs. – Rendl and W oeginger [16] hav e already considered a special case of the ques- tion we inv estigate in this pap er, that is, the interpla y b etw een planarity and RAC in PSE. They show ed that, given a set S of n p oin ts in the plane, one can test in O ( n log n ) time whether a p erfect matching admits a RA C 0 em b edding on S . They required that edges are drawn as axis-aligned line segmen ts. They also show ed that if one additionally insists on planarity , the problem b ecomes NP-hard. – P ach and W enger [13] sho w ed for the polyline dra wing scenario with mapping that, if one insists on planarit y , Ω ( n ) bends p er edge are sometimes necessary ev en for the class of paths and for p oints in con vex p osition. – Cab ello [2] prov ed that deciding whether a graph admits a planar straight- line embedding on a given point set is NP-hard even for 2-outerplanar graphs. In this pap er, we concen trate on RA C PSE. In order to measure the size of our drawings, we assume that the given p oin t set S lies on a grid of size n × n where n = | S | . W e further assume that the p oin ts in S are in gener al p osition , that is, no tw o p oin ts lie on the same horizontal or v ertical line. W e call S an n × n grid p oint set . W e require that, in our output drawings, b ends lie on grid p oin ts. W e concentrate on tw o v ariants of the problem. W e either restrict the edges, which are dra wn as p olygonal lines, to grid lines or we don’t. W e refer to the restricted version of the problem as r estricte d RAC/ α A C PSE. W e treat the restricted version in Section 2 and the unrestricted version in Section 3. The graphs w e study are alwa ys undirected. Our results concerning restricted RA C and α AC PSE are as follows. – Ev ery n -v ertex binary tree admits a restricted RA C 1 em b edding on an y n × n grid p oin t set (Theorem 1). This is not kno wn for the planar case—see our list of op en problems in Section 4. W e sligh tly extend this result to graphs of maxim um degree 3 that arise when replacing the vertices of a binary tree by cycles. In the case of a single cycle, the statement even holds if the mapping is prescrib ed. This is not true in the planar case: tak e the 4-vertex cycle and the four p oin ts (2 , 2) , (4 , 4) , (1 , 1) , (3 , 3), in this order. V ertices at Sp ecified Positions and Crossings at Large Angles 3 – Giv en a graph, a p oint set on the grid, and a mapping µ , we can test in linear time whether the graph admits a µ -resp ecting restricted RAC 1 p oin t- set embedding (Theorem 3). The same simple 2-SA T based test works in the planar case but of course fails more often. – Ev ery n -v ertex graph of maximum degree 3 admits a restricted RAC 2 em- b edding on an y n × n grid p oin t set even if the mapping is prescrib ed (Theo- rem 4). Giv en a matc hing with n vertices, a set of n p oin ts on the y -axis, and a mapping µ , we can compute, in O ( n 2 ) time, a µ -resp ecting restricted RA C 2 em b edding of minim um area (to the right of the y -axis, see Theorem 5). Concerning unrestricted RAC and α A C PSE, we sho w the following results which all hold ev en if the mapping is prescrib ed. – Ev ery graph with n vertices and m edges admits a RAC 3 em b edding on any n × n grid p oin t set within area O  ( n + m ) 2  (Theorem 6). T o RAC draw arbitrary graphs, curve complexity 3 is needed—even without PSE [1]. In the planar case (with mapping), the curve complexity for PSE is Ω ( n ) [13]. – F or any ε > 0, we get a ( π / 2 − ε )AC 2 dra wing within area O ( nm ) (The- orem 7). On a grid refined by a factor of O (1 /ε 2 ), we get a ( π / 2 − ε )AC 1 dra wing within area O ( n 2 ) (Theorem 8), which is optimal [6]. In the planar case, it is NP-hard to decide the existence of a 1-bend point-set embedding— b oth with [7] and without [11] prescrib ed mapping. R elate d work. Besides the ab o ve-men tioned work of Rendl and W o eginger [16], the study of PSE has primarily fo cussed on the planar case, in connection with the drawing conv en tions straight-line and p olyline. A sp ecial case of the p oly- line drawings are Manhattan-ge o desic drawings which require that the edges are dra wn as monotone chains of axis-parallel line segments. This conv ention was recen tly introduced b y Katz et al. [10]. They prov ed that Manhattan-geo desic PSE is NP-hard (even for sub divisions of cubic graphs). On the other hand, they provided an O ( n log n ) decision algorithm for the n -vertex cycle. They also sho wed that Manhattan-geodesic PSE with mapping is NP-hard ev en for p erfect matc hings—if edges are restricted to the grid. Although RAC and α AC dra wings hav e b een introduced very recen tly , there is already a large b ody of literature on the problem. Regarding the area of RA C dra wings, Didimo et al. [4] prov ed that an unrestricted RAC 3 dra wing of an n -v ertex graph uses area Ω ( n 2 ) ∩ O ( m 2 ). Di Giacomo et al. [6] show ed that, for RAC 4 dra wings, area O ( n 3 ) suffices and that, for any ε > 0, every n -vertex graph admits a ( π / 2 − ε )A C 1 dra wing w ithin area Θ ( n 2 ). Our results for RAC 3 and AC 1 dra wings (in Theorems 6 and 8) match the ones cited here, in spite of the fact that v ertex p ositions are prescrib ed in our case. 2 Restricted RA C P oin t-Set Embeddings In this section, we study restricted RA C p oin t-set embeddings. It is clear that only graphs with maximum degree 4 may admit a restricted RAC em b edding on a p oin t set. W e start with the study of RAC 1 dra wings. 4 M. Fink et al. 2.1 Restricted RAC 1 p oin t-set embeddings The follo wing result was indep enden tly achiev ed by Di Giacomo et al. [3]. Theorem 1. Every binary tr e e has a r estricte d RAC 1 emb e dding on every n × n grid p oint set. Pr o of. Let S b e an n × n grid p oin t set, let T b e a binary tree ro oted at an arbitrary vertex r , and let v 1 , . . . , v n b e a n umbering of the v ertices of T giv en b y a breadth-first-searc h trav ersal starting from r , i.e., v 1 = r . F or i = 1 , . . . , n , let T i b e the subtree of T ro oted at vertex v i . Let p 1 b e the point in S such that the v ertical line ` 1 through p 1 splits S 1 = S according to T 1 = T , that is, we split S 1 in to a set S 2 of | T 2 | p oin ts on its left and a set S 3 of | T 3 | p oin ts on its righ t; see Fig. 1(a). Then we recursiv ely pick p oin ts p 2 and p 3 and lines ` 2 and ` 3 that partition S 2 and S 3 according to | T 2 | and | T 3 | . W e contin ue until we arriv e at the leav es of T . This pro cess determines p oin ts p 1 , . . . , p n and lines ` 1 , . . . , ` n suc h that for i = 1 , . . . , n p oin t p i lies on ` i . W e simply map v ertex v i to p oin t p i for i = 1 , . . . , n . Consider an index i ∈ { 1 , . . . , n } . Our mapping mak es sure that one subtree of T i is dra wn on the left of ` i and the other on the righ t of ` i . Let v j and v j +1 b e the children of v i . W e draw the edges ( v i , v j ) and ( v i , v j +1 ) such that their horizon tal segments are b oth incident to v i , see Fig. 1(b). The resulting drawing is clearly a RAC drawing since all edges are restricted to the grid. Since S is in general p osition, no tw o edges can ov erlap except if they are incident to the same v ertex. If w e direct the edges of T aw ay from the ro ot, then, by our drawing rule, in any vertex v i of T the incoming edge arrives in p i with a vertical segment and the outgoing edges leav e p i with horizontal segmen ts in opp osite directions. u t W e can, of course, also find a restricted RA C 1 em b edding for paths as sp ecial binary trees. Actually , we can em b ed every n -vertex path or cycle on any n × n grid p oin t set, even with mapping: we simply leav e each p oin t horizontally and en ter the next one vertically in the order prescrib ed b y the mapping. It would, of course, b e nice to generalize these embeddability results for binary trees and cycles (without giv en mapping) to larger classes of graphs, e.g., outerplanar graphs of maximum degree 3. This seems, how ever, to b e quite difficult. A class of graphs that we can embed are maxdeg-3 cactus graphs that are constructed from binary trees b y replacing vertices by cycles. W e can embed graphs of this type on any n × n grid p oint set by adjusting the embedding algorithm for binary trees. The basic idea is to treat eac h cycle similarly to a single tree v ertex. W e do this by reserving the adequate num b er of consecutiv e columns for the vertices of the cycle in the middle of the dra wing area for the current subtree. W e connect the cycle to the left subtree by leaving the leftmost reserv ed p oin t to the left. W e deal with the righ t subtree symmetrically . One of the p oin ts reserved for the cycle—sa y , z —must be connected to the parent v ertex (or cycle). The difficulty is to make a cycle from the reserv ed p oin ts in suc h a wa y that z can b e entered vertic al ly from its parent, which has b een V ertices at Sp ecified Positions and Crossings at Large Angles 5 p oin ts ` 1 ` 2 | T 2 | p oin ts | T 5 | p oin ts | T 4 | z }| { | T 3 | p oin ts z }| { p 3 p 1 p 2 ` 3 (a) P artition of the p oint set ` i ` j ` j +1 v j v j +1 v i (b) Dra wing of the edges Fig. 1: Illustrations for the pro of of Theorem 1. Fig. 2: A binary tree without restricted RA C 1 dra wing. em b edded b efore. This is p ossible but the pro of is technical, and, hence, left for the app endix. Summing up, we get the following result. Theorem 2. L et G b e an n -vertex gr aph of maximum de gr e e 3 that arises when r eplacing the vertic es of a binary tr e e by cycles and let S b e an n × n grid p oint set. Then G admits a r estricte d RA C 1 emb e dding on S . In the pro ofs of the previous theorems we exploited the fact that we could c ho ose the vertex–point mapping as needed. Figure 2 shows a 6-vertex binary tree that do es not hav e a restricted RAC 1 dra wing on the given p oin t set if the v ertex–p oin t mapping is fixed as indicated by the edges. Hence, w e turn to the corresp onding decision problem. W e characterize situations when a restricted RA C 1 p oin t-set em b edding with mapping exists. Theorem 3. L et G b e an n -vertex gr aph of maximum de gr e e 4 , let S b e an n × n grid p oint set, and let µ b e a vertex–p oint mapping. We c an test in O ( n ) time whether G admits a µ -r esp e cting r estricte d RAC 1 emb e dding on S and, if yes, c onstruct such an emb e dding within the same time b ound. Pr o of. W e use a 2-SA T enco ding to solve the problem. A similar approach was used by Raghav an et al. [15] to deal with the planar case. W e asso ciate each edge uv of G with a Bo olean v ariable x uv . The tw o p ossible drawings of edge uv corresp ond to the tw o literals x uv and ¬ x uv . Due to the fact that S is in general p osition, only dra wings of edges inciden t to the same v ertex can possibly o verlap. No w we construct a 2-SA T formula φ as follows. Consider a pair of drawings of edges uv and uw that ov erlap. Assume that x uv and ¬ x v w are the literals corresp onding to the tw o edge drawings. Then we add the clause ¬ ( x uv ∧¬ x uw ) = ¬ x uv ∨ x uw to φ . It is clear that φ is satisfiable if and only if G has a µ -resp ecting RAC 1 em b edding on S without ov erlapping edges. Recall that the maximum degree of G is 4. Hence, φ contains at most n ·  4 2  · 4 clauses. Since the satisfiability of a 2-SA T form ula can b e decided in time linear in the n umber of clauses [5], the testing can b e done in O ( n ) time. u t 6 M. Fink et al. 2.2 Restricted RAC 2 p oin t-set embeddings As in the previous subsection, it is clear that only graphs of maximum degree 4 can b e drawn with the grid restriction. Consider, for a moment, a sp ecialized restricted RAC 2 dra wing conv ention that requires the first and the last (of the three) segments of an edge to go in the same direction—a br acket dra wing. If w e do not restrict the dra wing area, then the problem of brack et embedding a graph G on an n × n grid p oin t set is equiv alent to 4-edge coloring G . The idea is that the four colors enco de the direction of the first and last edge segmen t (going up, down, left, or right) and that the second edge segment is dra wn sufficien tly far aw ay . The edge coloring makes sure that no tw o edges inciden t to the same vertex ov erlap. It is known that any graph of maximum degree 3 is 4-edge colorable and that such a coloring can b e found in linear time [17]. Let us summarize. Theorem 4. Every gr aph G of maximum de gr e e 3 admits a r estricte d RAC 2 emb e dding on any n × n grid p oint set with any vertex–p oint mapping. Note that there are graphs of maxim um degree 4 that do not admit a 4-edge coloring, but do admit a restricted RAC 2 em b edding at least for some grid p oin t sets (see Figure 18 in the app endix for such an embedding of K 5 ). No w w e turn to the problem of minimizing the drawing area. Observe that there are examples of a graph G , a grid p oint set S , and a mapping µ such that G do es not admit a restricted RAC 2 p oin t-set embedding on S with mapping µ if w e insist that the drawing lies within the b ounding b o x of S , see Fig. 3. Fig. 3: Counter- example. W e conjecture that restricted RA C 2 PSE is NP-hard. Therefore, w e consider the sp ecial case where S is one- dimensional. More precisely , w e are lo oking for a one-p age RA C 2 b o ok emb e dding with given mapping. Recall that, gen- erally , a k -page b o ok embedding asks for a mapping of the v ertices to p oints on a line, the spine of the b ook, and a map- ping of the edges to the pages of the b ook (that is, half-planes inciden t to the spine) such that, for eac h page, the edges on that page can b e drawn without crossings. Clearly , in this setting, eac h v ertex can only hav e degree 1, hence the given graph must b e a (p erfect) matching. Given these restrictions, w e can minimize the area of the drawing. Theorem 5. L et S b e a set of n p oints on the y -axis, let G b e a matching c onsisting of n/ 2 e dges, and let µ b e a vertex–p oint mapping. A minimum-ar e a µ - r esp e cting r estricte d RAC 2 dr awing of G to the right of the y -axis c an b e c ompute d in O ( n 2 ) time. Pr o of. If S contains pairs of neighboring p oin ts that corresp ond to edges of the giv en matc hing, we connect eac h of them by a (vertical) straight-line segment. T o dra w an y of the remaining edges of the matching in a restricted RAC 2 fashion, w e must connect its endp oint s by tw o horizontal segments leaving the y -axis to the righ t and a vertical segment that joins the horizon tal segments. As G is a V ertices at Sp ecified Positions and Crossings at Large Angles 7 matc hing, only v ertical segments can ov erlap. In order to minimize the drawing area, we, thus, hav e to minimize the num ber of vertical lines, the layers , needed to dra w the vertical segments of all edges without ov erlap. Let G 0 = ( V 0 , E 0 ) with V 0 = E and an edge connecting eac h pair of edges of G that cannot use the same lay er. Clearly , assigning the edges of G to the minim um num b er of lay ers is the same as coloring the vertices of G 0 with the minim um num b er χ 0 of colors. Graph G 0 is an interv al graph: for edge uv of G —a vertex of G 0 —the inter- v al is [ µ ( u ) , µ ( v )]. Hence, a coloring of G 0 using χ 0 colors can b e computed in O ( | V 0 | + | E 0 | ) = O ( n 2 ) time [12]. This coloring yields an assignment of the edges to the minim um num b er of la y ers, which in turn corresponds to a minimum-area restricted RA C 2 dra wing: we simply use the first χ 0 v ertical grid lines immedi- ately to the right of the y -axis for the lay ers of the vertical edge segments. u t If we are not giv en a pres cribed mapping, then the problem b ecomes easy for all graphs of maximum degree 2. W e simply dra w the connected comp onen ts of G , which are paths or cycles, one after the other using the p oin ts in S from top to b ottom. This can b e done using only the y -axis for paths and using only one column righ t of the y -axis for cycles. If we abandon the restriction to draw edges on the grid and relax the con- strain t on the crossing angle, we can find, for any graph, an α A C 2 em b edding on any point set on the y -axis with an arbitrary mapping, see the comment after the pro of of Theorem 7. 3 Unrestricted RA C and α A C Poin t-Set Em b eddings Didimo et al. [4] hav e sho wn that an y graph with n vertices and m edges admits a RA C 3 -dra wing within area O ( m 2 ). Their pro of uses an algorithm of Papak ostas and T ollis [14] for dra wing graphs suc h that eac h v ertex is represented b y an axis- aligned rectangle and each edge by an L-shap e , that is, an axis-aligned 1-b end p olyline. Didimo et al. turn such a drawing into a RAC 3 -dra wing b y replacing eac h rectangle with a p oin t. In order to mak e the edges terminate at these points, they add at most tw o b ends p er edge. W e no w show how to compute a RAC 3 - dra wing of the same size (assuming n ∈ O ( m ))—although w e are restricted to the giv en p oin t set. Note that curv e complexity 3 is actually necessary for RAC dra wing arbitrary graphs—ev en without a prescrib ed point set: Arikushi et al. [1] show ed that RA C 2 dra wings only exist for graphs with a linear num b er of edges. Theorem 6. L et G b e a gr aph with n vertic es and m e dges and let S b e an n × n grid p oint set. Then G admits a RAC 3 -dr awing on S (with or without given vertex–p oint mapping) within ar e a O  ( n + m ) 2  . Pr o of. If the vertex–point mapping µ is not given, let µ b e an arbitrary mapping. Let v 1 , . . . , v n b e an ordering of V so that p i := µ ( v i ) has x -co ordinate i . W e construct a RAC 3 -dra wing as follows. Each edge has—after insertion of “virtual” 8 M. Fink et al. ( ( ( 2 3 2 i − 1 i + 1 i Fig. 4: Construction of a RAC 3 dra wing. Fig. 5: RAC 3 -dra wing of K 4 as in the pro of of Theorem 6. F or the sake of clar- it y , we replaced some straight-line segmen ts by circular arcs. b ends—exactly three b ends and four straight-line segments. W e ensure that in tersections inv olve only the “middle” segmen ts of edges, and that these middle segmen ts hav e only slop e +1 or − 1. F or an edge uv , we call the b end directly connected to u a u -b end , the b end directly connected to v a v -b end , and the remaining b end the midd le b end . W e start constructing the drawing b y placing the v -b ends for eac h vertex v , starting with v n . W e set the y -co ordinate y n of the first v n -b end to 0. Then, for i = n, n − 1 , . . . , 1, observe that there are exactly deg v i man y v i -b ends, which we place in column i + 1 starting at y -co ordinate y i b elo w the n × n grid using p ositions { ( i + 1 , y i ) , ( i + 1 , y i − 2) , ( i + 1 , y i − 4) , . . . , ( i + 1 , y i − 2 · (deg v i − 1) } , see Figure 4. W e connect each vertex with its asso ciated b ends without introducing an y intersection since we stay inside the area b et ween columns i and i + 1. W e set y i − 1 = y i − 2 · (deg v i − 1) − 3. If v i has degree 0, we do not place b ends but set y j − 1 = y j − 3 to av oid ov erlaps and crossings. Then we con tinue with v i − 1 . Since w e place the b ends from righ t to left and from top to bottom b y mo ving our “p oin ter” by L 1 - (or Manhattan) distances 2 or 4, eac h pair of these b ends has even Manhattan distance. T o draw an edge uv , we first select a “free” u - b end p osition and a free v -bend p osition. F or the tw o middle segments, we use slop es +1 and − 1 suc h that the middle bend is to the right of the u - and v -b end. Since u - and v -b end ha ve ev en Manhattan distance, the middle b end has integer co ordinates. Let u and v b e tw o v ertices with u -b end b u and v -b end b v , resp ectiv ely . The segmen ts ub u and v b v cannot intersect; we wan t to see that the middle segment starting at b u also cannot intersect v b v . Such an intersection can only o ccur if V ertices at Sp ecified Positions and Crossings at Large Angles 9 i j ( i + 1 , y ) ( j + 1 , y ) Fig. 6: Constructing a 2-b end drawing with large crossing angles. u 1 π 2 − δ ≥ k + d cot ε e δ                        e k Fig. 7: Angles in the 2-b end drawing. u lies to the left of v .By our construction, b v lies, in this case, ab ov e b u with a y -distance that is greater than their x -distance. As all middle segments hav e a slop e of at most +1, b v lies abov e the relev ant middle segment, whic h can, hence, not in tersect v b v . It remains to show the space limitation. Clearly , the drawing of any edge requires not more horizontal than vertical space. On the other hand, for any v ertex v , we need at most 2 · deg v + 3 rows b elo w the grid, resulting in a total v ertical space requirement of O ( n + m ). This completes the pro of. u t In the remainder of this section we fo cus on α A C p oint-set embeddings. W e sho w that b oth area and curve complexity can b e significantly improv ed if we soften the restriction on the crossing angles. Our results hold for b oth scenarios, with and without v ertex–p oin t mapping. Theorem 7. L et G b e a gr aph with n vertic es and m e dges, let S b e a n × n grid p oint set, and let 0 < ε < π 2 . Then G admits a ( π 2 − ε ) AC 2 emb e dding on S (with or without given vertex–p oint mapping) within ar e a O ( n ( m + cot ε )) = O ( n ( m + 1 /ε 2 )) . Pr o of. If the vertex–point mapping µ is not given, let µ b e arbitrary . Let v 1 , . . . , v n b e an ordering of V so that p i := µ ( v i ) has x -co ordinate i . Eac h edge e = uv has exactly tw o b ends, a u -b end and a v -bend (with the obvious meanings). F or i = 1 , . . . , n , we place all v i -b ends in column i + 1. W e make all middle seg- men ts of edges horizontal. Th us, the b ends for an edge e = v i v j are at p ositions ( i + 1 , y ) and ( j + 1 , y ) in some row y < 0 b elo w the original grid, see Figure 6. By using a dedicated ro w for each edge, w e achiev e that no tw o middle segments in tersect. By construction, no tw o first or last edge segments intersect. Hence, crossings o ccur only b etw een the horizontal middle segments and first or last segmen ts. By making the y -coordinates of the middle segments small enough, w e will achiev e that all crossing angles are at least π / 2 − ε . 10 M. Fink et al. Let { e 1 , . . . , e m } b e the set of edges of G , and let uv := e k b e one of these edges. W e set the y -co ordinates of the middle segment of e k to − k − d cot ε e . Let e k 0 b e an edge whose horizontal segment intersects the first segment of e k . The crossing angle is π / 2 − δ , where δ is the angle b et w een the vertical line through the u -b end and the first segment of uv , see Figure 7. W e hav e δ ≤ arccot( k + d cot ε e ) ≤ ε . Thus, the crossing angle is at least π / 2 − ε . Note that cot ε ∈ O (1 /ε 2 ). u t W e used only the fact that no tw o p oints lie in the same column. Hence, the statemen t of the theorem do es not c hange if w e allo w the p oin ts to lie on a single horizon tal (or, by rotation, vertical) line as in Section 2.2. In Theorem 7, we required the b ends to lie on p oin ts of the given grid. The follo wing result shows that we need only one bend p er edge if w e allow the bends to lie on p oin ts of a r efine d grid. F or fixed  > 0, our new drawings need less area than those of Theorem 7; ev en in terms of the refined grid. Theorem 8. L et G b e a gr aph with n vertic es, let S b e an n × n grid p oint set, and let 0 < ε < π 2 . Then G admits a ( π 2 − ε ) AC 1 emb e dding on S (with or without given vertex–p oint mapping) on a grid that is finer than the original grid by a factor of λ ∈ O (cot ε ) = O (1 /ε 2 ) . Pr o of. If the mapping µ is not given, let µ b e an arbitrary mapping. The idea of our construction is as follows. F or each edge, we first choose one of the tw o p ossible dra wings on the grid lines with one b end. This gives us a drawing of the graph with many ov erlaps of edges. Then, we slightly twist each edge such that its horizontal segment b ecomes almost horizontal , meaning it gets a negative slop e close to 0. At the same time, we mak e the vertical segment almost vertic al , meaning it gets a v ery large p ositiv e slop e, see Figure 8. As w e wan t all b ends to b e on grid points, w e first refine the grid b y an integral factor of λ = d 1 + cot ε e . W e do this by inserting, at equal distances, λ − 1 new ro ws or columns b et ween tw o consecutive grid rows or columns, resp ectiv ely . No w, a p oin t s = ( a, b ) ∈ S lies at ( λa, λb ) w.r.t. the new λn × λn grid. Let e b e an edge and let ( e x , e y ) b e the original p osition of the b end of e w.r.t. the new grid. W e choose the new p osition of the b end to b e the unique grid p oin t diagonally next to ( e x , e y ) such that the horizon tal and vertical segments of e b ecome almost horizontal and almost vertical, resp ectiv ely . If w e apply this construction to all edges, w e get a drawing in which none of the almost horizon tal and almost vertical segments b elonging to some vertex v can o verlap. Moreov er, t wo almost horizontal or tw o almost vertical segments b elonging to differen t v ertices neither ov erlap nor intersect due to S b eing in general p osition. Thus, eac h crossing inv olves an almost horizontal and an almost vertical segmen t. Let e 1 and e 2 b e tw o crossing edges suc h that the almost horizontal segment in volv ed in the crossing b elongs to e 1 . W e can assume that the smaller angle of the crossing o ccurs to the top left of the crossing; the other case is symmetric b y a rotation of the plane. Let δ − b e the angle formed by the almost horizontal segmen t of e 1 and a horizontal line, and let δ + b e the angle formed b y the almost v ertical segmen t of e 1 and a vertical line, see Figure 9. Then the crossing angle V ertices at Sp ecified Positions and Crossings at Large Angles 11 Fig. 8: Drawing of K 4 on a grid refined b y factor λ = 8. α δ + δ − 1        | {z } δ − l ≥ λ − 1 e 1 e 2 Fig. 9: Angles in the 2-b end-dra wing. of e 1 and e 2 is α = π / 2 − δ − + δ + ≥ π / 2 − δ − . F or δ − to b e maximal, the horizon tal length l of the almost horizontal segment has to b e minimal. As this length cannot b e less than λ − 1, we get δ + ≤ arccot( λ − 1) ≤ ε . Hence, the crossing angle α is at least π / 2 − ε . u t Note that w e leav e the original grid by at most one row or column of the refined grid in eac h direction. Hence, the area requirement is O (( n · cot ε ) 2 ) in terms of the finer grid. W e argue that our area b ounds are quite reasonable: for a minimum crossing angle of 70 ◦ , the drawings pro vided by Theorems 7 and 8 use grids of sizes at most n ( m + 3) and (3 n ) 2 , resp ectiv ely . 4 Op en Problems In this pap er, we hav e op ened an interesting new area: the intersection of p oin t- set embeddability and drawings with crossings at large angles. W e hav e done a few first steps, but we leav e op en a large num b er of questions. W e start with the restricted case where v ertices, b ends, and edges must lie on the grid. 1. Do es every n -no de binary tree hav e a restricted planar 1-b end embedding on an y n × n grid p oin t set? 2. Do es ev ery n -no de ternary tree hav e a restricted RAC 1 em b edding on any n × n grid p oint set? 3. What ab out outerplanar graphs? 4. Can we efficiently test whether a given graph has a restricted RA C 1 em b ed- ding on a giv en n × n grid p oin t set? 5. What ab out RAC 2 ? Recall that in the unrestricted case w e don’t require edges to lie on the grid. 6. Can w e efficiently test whether a given graph has a RAC 2 em b edding on a giv en n × n grid p oin t set? If yes, can we minimize its area? 7. Di Giacomo et al. [6] ha v e shown that any graph with n v ertices and m edges admits a RA C 4 -dra wing that uses area O ( n 3 ). Can w e achiev e the same in our PSE setting? 12 M. Fink et al. Ac knowledgmen ts. W e thank Bepp e Liotta for suggesting the idea b ehind Theorem 8 to us. References 1. K. Arikushi, R. F ulek, B. Keszegh, F. Mori ´ c, and C. T´ oth. Graphs that admit righ t angle crossing drawings. In D. Thilikos, editor, Pr o c. 36th Int. Workshop Gr aph The or etic Conc epts Comput. Sci. (WG’10) , volume 6410 of LNCS , pages 135–146. Springer-V erlag, 2010. 2. S. Cab ello. Planar embeddability of the vertices of a graph using a fixed p oint set is NP-hard. J. Gr aph Alg. Appl. , 10(2):353–366, 2006. 3. E. Di Giacomo, F. F rati, R. F ulek, L. Grilli, and M. Krug. Personal communication, 2011. 4. W. Didimo, P . Eades, and G. Liotta. Drawing graphs with right angle crossings. In F. K. Dehne, M. L. Gavrilo v a, J.-R. Sack, and C. D. T´ oth, editors, Pr o c. 11th Int. Workshop Algorithms Data Struct. (W ADS’09) , volume 5664 of LNCS , pages 206–217. Springer-V erlag, 2009. 5. S. Even, A. Itai, and A. Shamir. On the complexity of timetable and multicom- mo dit y flo w problems. SIAM J. Comput. , 5(4):691–703, 1976. 6. E. D. Giacomo, W. Didimo, G. Liotta, and H. Meijer. Area, curve complexit y , and crossing resolution of non-planar graph drawings. The ory Comput. Syst. , pages 1–11, 2010. 7. X. Goao c, J. Krato ch v ´ ıl, Y. Ok amoto, C.-S. Shin, A. Spillner, and A. W olff. Un- tangling a planar graph. Discrete Comput. Geom. , 42(4):542–569, 2009. 8. P . Gritzmann, B. Mohar, J. Pac h, and R. Pollac k. Embedding a planar triangula- tion with vertic es at sp ecified p ositions. Amer. Math. Mon. , 98:165–166, 1991. 9. W. Huang, S.-H. Hong, and P . Eades. Effects of crossing angles. In Pr o c. 7th Int. IEEE Asia-Pacific Symp. Inform. Visual. (APVIS’08) , pages 41–46, 2008. 10. B. Katz, M. Krug, I. Rutter, and A. W olff. Manhattan-geo desic embedding of planar graphs. In D. Eppstein and E. R. Gansner, editors, Pro c. 17th Int. Symp. Gr aph Dr awing (GD’09) , volume 5849 of LNCS , pages 207–218. Springer-V erlag, 2010. 11. M. Kaufmann and R. Wiese. Embedding vertices at p oin ts: F ew b ends suffice for planar graphs. J. Gr aph Alg. Appl. , 6(1):115–129, 2002. 12. S. Olariu. An optimal greedy heuristic to color interv al graphs. Inform. Pr o c ess. L ett. , 37(1):21–25, 1991. 13. J. Pac h and R. W enger. Embedding planar graphs at fixed v ertex locations. Gr aphs Combin. , 17(4):717–728, 2001. 14. A. Papak ostas and I. G. T ollis. Efficient orthogonal dra wings of high degree graphs. Algorithmic a , 26:100–125, 2000. 15. R. Ragha v an, J. Coho on, and S. Sahni. Single bend wiring. J. Algorithms , 7(2):232– 257, 1986. 16. F. Rendl and G. W oeginger. Reconstructing sets of orthogonal line segments in the plane. Discrete Math. , 119:167–174, 1993. 17. S. Skulrattanakulchai. 4-edge-coloring graphs of maximum degree 3 in linear time. Inform. Pro c ess. L ett. , 81(4):191–195, 2002. V ertices at Sp ecified Positions and Crossings at Large Angles 13 App endix Theorem 2. L et G b e an n -vertex gr aph of maximum de gr e e 3 that arises when r eplacing the vertic es of a binary tr e e by cycles and let S b e an n × n grid p oint set. Then G admits a r estricte d RA C 1 emb e dding on S . Pr o of. W e adjust the em b edding algorithm for binary trees to w ork with the new graph class. The basic idea is to treat each cycle similar to a single vertex of a binary tree. W e do this by reserving the adequate n umber of consecutive columns for the no des of the cycle in the middle of the drawing area for the current subtree when splitting into the drawing areas for the subtrees. The subtrees are connected to the cycle by leaving one p oin t to the right, and one p oin t to the left, resp ectively . The most difficult part is to connect the reserved no des to a cycle in such a wa y that the p oin t represen ting the vertex that is the connector to the parent vertex (or cycle, resp ectiv ely), which was em b edded b efore, can b e connected by entering the no de with a v ertical segmen t such that the connections to the left and the righ t are p ossible. Let C with k := | C | ≥ 3 b e the cycle representing the ro ot of the current subtree with vertices u and v connecting the cycle to the ro ots r l and r r of its left and right subtrees, resp ectiv ely , and a vertex z connecting C to its parent r . Let S 0 = { p 1 , . . . , p k } b e the set of p oints reserved for C in consecutive columns ordered from left to righ t. The edge connecting C to the left and right subtree en ter the p oin ts representing u and v from left and right, resp ectiv ely , while the edge connecting z to r en ters z from ab ov e or b elo w, dep ending on the y - co ordinate of the p oin t chosen to represent z . Let y r b e the y -co ordinate of r . W e analyze the differen t cases. 1. V ertex z has a neighbor w 6 = u, v in C and k ≥ 5: Set µ ( u ) = p 1 and µ ( v ) = p k . Either ab o ve or b elo w the line y = y r w e find t wo p oin ts p, p 0 ∈ S 0 \ { p 1 , p k } . Let p b e the one closer to the line y = y r . W e set µ ( p ) = z , µ ( p 0 ) = w and dra w the edge w z such that p is en tered v ertically . Then we can complete the cycle such that each p oin t is incident to a horizontal and a vertical segment, see Figure 10. It is easy to see that the connections to r , r l and r r can no w b e dra wn without ov erlap. 2. V ertex z has a neighbor w 6 = u, v in C and k = 4: Let C = ( u, w , z , v ) the other case b eing symmetric. If p 2 and p 3 b oth lie either b elo w or ab o ve y = y r w e can pro ceed as in case 1. If p 2 lies ab o ve r and p 3 b elo w w e hav e tw o sub cases dep ending on where p 4 is: – p 4 lies ab o v e p 3 : W e can dra w C as shown in Figure 11. – p 4 lies b elo w p 3 : W e can dra w C as shown in Figure 12. If p 3 is ab o v e r and p 2 b elo w the cases are symmetric. 3. The tw o neighbors of z are u and v . If there is one p oin t p ∈ S 0 \ { p 1 , p k } that is vertically b etw een p 1 and p k , then we set µ ( u ) = p 1 , µ ( v ) = p k and µ ( z ) = p and draw C as in Figure 13, where the second path connecting u and v can b e drawn by having a vertical and a horizon tal segment incident to eac h p oin t. In the remaining cases, there is no such p oin t v ertically b et ween p 1 and p k . 14 M. Fink et al. y = y r w /p 0 z /p v /p k u/p 1 Fig. 10: Drawing of C with at least 5 ver- tices and a neighbor w of z . y = y r w /p 1 z /p 2 v /p 4 u/p 3 ( v /p 4 ) Fig. 11: Drawing of C with k = 4 and p 4 ab o v e p 3 . y = y r u/p 1 w /p 2 v /p 4 z /p 3 Fig. 12: Drawing of C with k = 4 and p 4 b elo w p 3 . y = y r u/p 1 v /p k z /p Fig. 13: Drawing of C with u, v as neigh- b ors of z and one p oin t vertically b et w een p 1 and p k . – If k ≥ 5 we find, similar to case 1, tw o p oin ts p, p 0 ∈ S 0 \ { p 1 , p k } b oth b elo w or ab ov e r such that p is the one closer to the line y = y r . Again w e set µ ( z ) = p ; if p 0 is left of p we set µ ( u ) = p 0 and µ ( v ) = p k , see Figure 14, and otherwise we symmetrically set µ ( v ) = p 0 and µ ( u ) = p 1 . No w we can draw the cycle without ov erlap suc h that each point is inciden t to a vertical and a horizontal segment. – If k = 4, we ha ve C = ( u, z , v , w ). If p 2 and p 3 lie b oth ab o ve or b elow r w e can pro ceed as in the previous case. Otherwise w e know that b oth p oin ts are on different sides of y = y r , and that p 1 and p 4 are b oth v ertically b et ween, b elo w, or ab ov e p 2 and p 3 . In the first case, we set µ ( u ) = p 1 , µ ( v ) = p 4 , µ ( z ) = p 2 and µ ( w ) = p 3 and create the dra wing of C as in Figure 15. As ab o ve and b elow are symmetric, the other tw o cases can b e handled as shown in Figure 16. – Finally , if k = 3, we set µ ( u ) = p 1 , µ ( v ) = p 3 and µ ( z ) = p 2 , and simply dra w as shown in Figure 17. u t V ertices at Sp ecified Positions and Crossings at Large Angles 15 y = y r v /p k u/p 0 z /p Fig. 14: Drawing of C with u, v as neigh- b ors of z and k ≥ 4. y = y r v /p 4 u/p 1 z /p 2 w /p 3 Fig. 15: Drawing of C with u, v as neigh- b ors of z , k = 4, and p 1 , p 4 v er- tically b et w een p 2 and p 3 . y = y r u/p 1 w /p 2 v /p 4 z /p 3 Fig. 16: Drawing of C with u, v as neigh- b ors of z , k = 4, and p 1 , p 4 v er- tically b elo w p 2 and p 3 . y = y r v u z Fig. 17: Drawing of C with u, v as neigh- b ors of z and k = 3. Fig. 18: Restricted RAC 2 dra wing of K 5 on a diagonal p oin t set.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment