Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

An emerging research line in Graph Drawing studies families of non-planar graphs that can be drawn so that crossing edges verify some desired properties. This topic is informally recognized as “beyond planarity”. Different types of properties give rise to different families of beyond planar graphs. Among them, particular attention has been devoted to 1-planar graphs (see, e.g., [1, 2, 7,8,9, 17, 23, 24, 29, 31, 35]) and to RAC (Right Angle Crossing) graphs (see, e.g., [4, 6, 13,14,15, 18,19,20,21, 27, 30]). A graph is 1-planar if it has a drawing where each edge is crossed at most once, while it is RAC if it has a polyline drawing where the edges cross only at right angles. From an application point of view, the study of these two families is motivated by several cognitive experiments, suggesting that the readability of a layout is negatively correlated to the number of crossings [33, 34, 38] and that user task performances are not affected too much if edges cross at large angles [25, 26, 28]. Also, users often prefer straight-line drawings or layouts whose edges have few bends [32], and several algorithms optimize this aesthetic criterion [11]. Note that, every graph admits a polyline RAC drawing with at most three bends per edge [18].

For the reasons above, it is interesting to study what graphs can be drawn with at most one crossing per edge, right angle crossings, and few bends per edge at the same time. We recall that n-vertex 1-planar graphs have at most \(4n-8\) edges [31] and that straight-line 1-planar drawings have at most \(4n-9\) edges [17]. Also, straight-line RAC graphs have at most \(4n-10\) edges [18], while RAC drawings with at most one bend per edge or two bends per edge, have at most \(6.5n-13\) and 74.2n edges, respectively [5]. These results immediately imply that there are 1-planar graphs not admitting 1-planar drawings with straight-line edges and 1-planar graphs not admitting straight-line drawings with right angle crossings. Also, there exist straight-line RAC drawable graphs that are not 1-planar [22]. In this scenario, one of the main questions still open is whether every 1-plane graph admits a RAC drawing with at most one bend per edge. This paper positively answers this question, by proving the following result.

Theorem 1

Let G be an n-vertex 1-planar graph. Then G admits a 1-planar RAC drawing \(\varGamma \) with at most one bend per edge. Also, if a 1-planar embedding of G is given as part of the input, \(\varGamma \) can be computed in O(n) time.

We remark that a characterization of the 1-planar graphs that can be drawn with straight-line edges was given by Thomassen in 1988 [37]. The characterization is described in terms of the existence of a 1-planar embedding that does not contain two primitive forbidden configurations. This result immediately implies that every 1-planar graph admits a 1-planar drawing with at most one bend per edge (which is not necessarily RAC); it is sufficient to subdivide each crossing edge of any given 1-planar embedding with a dummy vertex, so to remove any possible forbidden configuration. Dummy vertices will correspond to bends in the final drawing. Moreover, Alam et al. [2], proved that every 3-connected 1-plane graph can be drawn with straight-line edges, except for at most one edge that may require one bend. We also remark that straight-line RAC drawings always exist for IC-planar graphs [9], a subclass of 1-planar graphs.

Some proofs and technicalities are omitted and can be found in [16].

2 Preliminaries

We assume familiarity with basic terminology of graph drawing [11]. In the following we only consider simple drawings of graphs, i.e., drawings where two edges have at most one point in common (which is either a common endpoint or a common interior point where the two edges properly cross each other). A k-bend drawing of a graph is a drawing where each edge is represented as a polyline with at most \(k > 0\) bends. A graph G is planar if it admits a planar (i.e., crossing-free) drawing. Such a drawing subdivides the plane into topologically connected regions, called faces. The infinite region is the outer face. The number of vertices encountered in the closed walk along the boundary of a face f is the degree of f. If G is not 2-connected a vertex may be encountered more than once, thus contributing with more than one unit to the degree of f. A planar embedding of G is an equivalence class of planar drawings of G having the same set of faces. A plane graph is a planar graph with a given planar embedding.

The concept of planar embedding can be extended to non-planar drawings. Given a non-planar drawing \(\varGamma \), interpret every crossing as a vertex. The resulting planarized drawing has a planar embedding. An embedding of a (non-planar) graph G is an equivalence class of drawings whose planarized versions have the same planar embedding. A 1-plane graph is a 1-planar graph with a given 1-planar embedding, i.e., an embedding where each edge is crossed at most once. Each face of a 1-planar embedding is composed of both vertices and/or crossings, and its degree is the number of vertices or crossings encountered in the closed walk along its boundary. A kite K is a 1-plane graph isomorphic to \(K_4\) with an embedding such that all the vertices are on the boundary of the outer face, the four edges on the boundary are crossing-free, and the remaining two edges cross each other. Given a 1-plane graph G and a kite \(K=\{a,b,c,d\}\), such that \(K \subseteq G\), we say that K is empty if it does not contain any vertex of G inside the 4-cycle \(\{a,b,c,d\}\) (it contains only the crossing point). A pair of crossing edges of G forms an empty kite if their four end-vertices induce an empty kite. A 1-plane graph G, possibly containing parallel edges, is triangulated if each face is a triangle, formed by either three vertices or by one crossing and two vertices. Clearly, a triangulated 1-plane graph is 2-connected. The next observation follows from the definition of a triangulated 1-plane graph.

Observation 1

Let G be a triangulated 1-plane graph. Every pair of crossing edges of G forms an empty kite, except for at most one pair of crossing edges if their crossing point is on the outer face of G.

3 1-Bend RAC Drawings of 1-Planar Graphs

To prove Theorem 1 we give an algorithm that takes as input a simple 1-plane graph G with n vertices (see, e.g., Fig. 1(a)), and computes a 1-bend 1-planar RAC drawing \(\varGamma \) of G in O(n) time. We assume that G is connected, as otherwise we can draw independently each connected component. The high-level idea is as follows. Augment G and modify its embedding to get a triangulated 1-plane graph, possibly containing parallel edges. Execute a suitable decomposition of the triangulated 1-plane graph and apply a recursive technique that computes a 1-bend 1-planar RAC drawing. Remove dummy vertices and edges.

Fig. 1.
figure 1

Illustration for the augmentation step.

Augmentation. The first step of the algorithm transforms G into a triangulated 1-plane graph \(G^+\) by adding edges and vertices. The 1-planar embedding of \(G^+\) may be different from that of G for the common part. Let (ac) and (bd) be two edges of G that cross in a point p. Let \(\{a,b,c,d\}\) be the circular order of the vertices around p. For each such pair of crossing edges, we add an edge (ab), and drawFootnote 1 it such that it follows the curves (ap) and (pb). Similarly, we draw the three edges (bc), (cd) and (da). This operation ensures that each pair of crossing edges forms an empty kite. Also, this operation does not introduce edge crossings but it may create parallel edges. We denote by \(G_1\) the resulting (multi)graph. For each pair of parallel edges e and \(e'\) of \(G_1\), such that \(e \in G\) and \(e' \in G_1\), we remove e from \(G_1\). This immediately implies that no parallel edge is crossed in \(G_1\). We then remove one edge for each pair of parallel edges \(e_1\) and \(e_2\) such that the curve \(e_1 \cup e_2\) does not contain any vertex in its interior. We let \(G_2\) be the resulting graph, which can be easily computed in O(n) time, since G has O(n) crossings (see, e.g., [36]). Figure 1(b) shows the graph \(G_2\) obtained from the graph G of Fig. 1(a). We remark that a similar operation has been used by Alam et al. [2] in order to compute a straight-line drawable 1-planar embedding of a 3-connected 1-planar graph. However, only 3-connected graphs are considered by Alam et al., and in this case the augmented graph does not contain parallel edges [2]. We do not have any restriction on the connectivity of G, which poses additional issues in the construction and in the drawing of a suitable 1-planar embedding. We transform \(G_2\) into a triangulated 1-plane graph. Note that a face of degree two consists of two parallel edges, thus only the outer face of \(G_2\) can have degree two. In this case, each of the two parallel edges is part of an empty kite. Thus, we remove one of these two edges to make the degree of the outer face equal to three (it will be formed by two vertices and one crossing). Let f be an inner face of \(G_2\) that is not a triangle. Such a face contains no crossings on its boundary, since each crossing is shared by exactly four triangular faces by the empty kite property. We add an extra vertex \(v_f\) inside f and connect it to all vertices (with multiplicity) on the boundary of f. Figure 1(c) shows the graph \(G^+\) obtained from the graph \(G_2\) in Fig. 1(b), extra vertices are drawn as squares. Since \(G_2\) has O(n) faces, \(G^+\) has O(n) vertices and edges, and it is computed in O(n) time. The next lemma follows from the above discussion.

Lemma 1

Graph \(G^+\) is a triangulated 1-plane (multi)graph.

Decomposition. We define a decomposition of \(G^+\) inspired by SPQR-trees [12], but simpler and more direct for our purposes. The next lemma can be proved.

Lemma 2

Let G be a triangulated 1-plane (multi)graph and let \(\{u,v\}\) be a separation pair of G. There exist two parallel edges \(e, e'\) incident to u and v such that \(\{u,v\}\) is not a separation pair for the graph obtained by removing from G all vertices inside the cycle \(\{e, u, e', v\}\).

Fig. 2.
figure 2

Illustration for the decomposition step. Thick edges are thicker (and red). (Color figure online)

By Lemma 2, for each separation pair \(\{u,v\}\) of \(G^+\), there exist \(k>1\) parallel edges \(\{e_1, \dots , e_k\}\) between u and v, such that the cycle \(\{u, e_1, v, e_k\}\) encloses all other copies in its interior. We call the inner graph of (uv) the subgraph \(G_{uv}\) of \(G^+\) whose outer face is \(\{u, e_1, v, e_k\}\), and an inner component of (uv) each subgraph \(C^i_{uv}\) of \(G_{uv}\) whose outer face is \(\{u, e_i, v, e_{i+1}\}\), for \(i=1,\dots ,k-1\). Let \(G_{uv}\) be an inner graph of \(G^+\) that does not contain any inner graph as a subgraph. Replace \(G_{uv}\) with an edge between u and v, called thick edge; the resulting graph is still a triangulated 1-plane graph. Iterate this procedure until there are no more inner graphs to be replaced. This is done in O(n) time and results in a simple triangulated 1-plane graph \(G^*\), which is 3-connected by Lemma 2. Figure 2(c) shows the graph \(G^*\) obtained from the graph \(G^+\) in Fig. 2(a), through the intermediate step in Fig. 2(b). The next lemma follows.

Lemma 3

Graph \(G^*\) is a simple 3-connected triangulated 1-plane graph.

Drawing. The overview of the drawing algorithm is as follows. Start with a 1-bend 1-planar RAC drawing of \(G^*\), and then recursively replace thick edges with a 1-bend 1-planar RAC drawing of the corresponding inner graphs. Deleting the edges and vertices added by the augmentation step we get a 1-bend 1-planar RAC drawing of G. To compute a 1-bend 1-planar RAC drawing of \(G^*\), first remove from \(G^*\) all pairs of crossing edges and denote by \(H^*\) the resulting plane graph (see Fig. 3(a)). Note that thick edges are never crossed by construction, and all faces of \(H^*\) have either degree 3 or degree 4. We can prove the following.

Lemma 4

Graph \(H^*\) is 3-connected.

Compute a planar straight-line drawing \(\gamma ^*\) of \(H^*\) where all faces are strictly convex and the outer face is a prescribed polygon P; this can be done by applying the linear-time algorithm by Chiba et al. [10] (see Fig. 3(b)). If the outer face of \(H^*\) has degree four, we let P be a trapezoid, else P is a triangle. Since all faces are either triangles or quadrangles, we can avoid three collinear vertices by slight perturbations (which cannot cause a face to become non convex). To reinsert the crossing edges, we distinguish between the inner faces and the outer face of \(H^*\). Two crossing edges can be easily reinserted in an inner face, just drawing one of the two with no bend and the other with one bend, such that they cross at right angles (see, e.g., [3] and Fig. 3(c)). To reinsert two crossing edges \(e_1, e_2\) in the outer face of \(H^*\) so that they form a right angle, we can draw \(e_1\) and \(e_2\) with one bend each. Namely, P is a trapezoid by construction. Assume that the minor base m and the greater base M of P are aligned with the horizontal axis. The first segment of \(e_1\) is such that its rightmost endpoint \(p_1\) coincides with the rightmost endpoint of m, and its leftmost endpoint \(q_1\) is b units above the leftmost endpoint of m, where b is equal to the length of m. The second segment of \(e_1\) has \(q_1\) as rightmost endpoint, and its leftmost endpoint \(r_1\) coincides with the leftmost endpoint of M. Edge \(e_2\) is drawn symmetrically.

Fig. 3.
figure 3

Illustration for the drawing step. (Color figure online)

Consider now a thick edge (uv) of \(G^*\) and its inner graph \(G_{uv}\). Recall that \(G_{uv}\) consists of \(k-1 \ge 1\) inner components \(C_1,\dots ,C_{k-1}\). Each \(C_i\) (\(i=1,\dots ,k-1\)) has two parallel edges \(e_i\), \(e_{i+1}\) as outer face. Also, analogously to \(G^*\), \(C^-_i = C_i \setminus \{e_{i+1}\}\) is a simple 3-connected triangulated 1-plane graph (it is a subgraph of \(G^+\) and all its inner graphs have been replaced by thick edges). Remove all crossing edges of \(C^-_{k-1}\) and let \(H^-_{k-1}\) be the resulting 3-connected plane graph. Compute a planar straight-line drawing \(\gamma _{k-1}\) of \(H^-_{k-1}\) such that all faces are strictly convex polygons and the outer face is a prescribed polygon P. If the outer face of \(H^-_{k-1}\) has degree three, P is a triangle whose side with corners u and v has length equal to the length of the thick edge (uv) in \(\varGamma ^*\), and its height is small enough so that the thick edge (uv) can be replaced with P without introducing crossings. If the outer face of \(H^-_{k-1}\) has degree four, P is a trapezoid such that its greater base has u and v as corners and the same length as the thick edge (uv) in \(\varGamma ^*\). The height of P is such that the thick edge (uv) can be replaced with P without introducing crossings. Also, the minor base of P is sufficiently short so that the pair of crossing edges on the outer face of \(H^-_{k-1}\) can be reinserted without introducing crossings in \(\varGamma ^*\), as described for \(H^*\) (see Fig. 3(d)). By the same argument used for \(H^*\), all pairs of crossing edges can be reinserted so as to form right angle crossings and have at most one bend each (see Fig. 3(e)). If \(k-1>1\), we iterate this procedure and compute a drawing \(\varGamma ^-_i\) for each \(C^-_i\), for \(i=k-2,\dots ,1\). The polygon representing the outer face of each \(\varGamma _i\) can be suitably chosen so to fit inside the face containing edge \(e_{i+1}\) of drawing of \(\varGamma _{i+1}\). The union of all such drawings is a 1-bend 1-planar RAC drawing \(\varGamma _{uv}\) of \(G_{uv}\) (see Figs. 3(f) and 3(g)), with the exception of some parallel edges. Namely, the parallel edges \(e_1,\dots ,e_k\) are represented by overlapping segments between u and v, and for our needs all of them but one can be removed from the drawing.

Repeat this procedure for each thick edge of \(G^*\), and recursively apply the same technique for each inner graph of \(G^*\); see Figs. 3(h) and 3(i) for a complete illustration. The resulting drawing \(\varGamma \) is a 1-bend 1-planar RAC drawing of \(G^+\) (except for some parallel edges). Removing dummy vertices and edges, we get the desired drawing of G. In terms of time complexity, each planar straight-line drawing with (strictly) convex faces is computed in linear time in the size of the input graph [10], and in linear time we can reinsert the crossing edges. Thus the whole procedure takes O(n) time. This concludes the proof of Theorem 1.

4 Conclusions and Open Problems

We proved that every 1-planar graph admits a 1-planar RAC drawing with at most one bend per edge. The proof is constructive and based on a drawing algorithm, which may produce 1-bend 1-planar RAC drawings with exponential area: Is this area requirement necessary for some 1-planar graphs? Also, our algorithm may change the embedding of the input graph: Are there 1-planar embeddings that are not realizable as 1-bend RAC drawings? Characterizing straight-line 1-planar RAC drawable graphs is also an interesting problem.