1 Introduction

Orthogonal graph drawing is an intensively studied and well established model for drawing graphs. As a result, several efficient algorithms providing good aesthetics and good readability have been proposed over the years, see e.g., [8, 18, 29, 35]. In such drawings, each vertex corresponds to a point on the Euclidean plane and each edge is drawn as a sequence of axis-aligned line segments; see Fig. 1.

Several research directions build upon this successful model. We focus on two models that have recently received attention: (i) the smooth orthogonal [5], in which every edge is a sequence of axis-aligned segments and circular arc segments with common axis-aligned tangents (i.e., quarter, half or three-quarter arc segments), and (ii) the octilinear [3], in which every edge is a sequence of axis-aligned and diagonal (at \(\pm 45^\circ \)) segments.

Observe that both models extend the orthogonal by allowing one more type of edge-segments. The former was introduced with the aim of combining the artistic appeal of Lombardi drawings [13, 15] with the clarity of the orthogonal drawings. The latter, on the other hand, is primarily motivated by metro-map and map schematization applications (see, e.g., [25, 31, 32, 34]). Note that in the orthogonal and in the smooth orthogonal models, each edge may enter a vertex using one out of four available (axis-aligned) directions, called ports. Thus both models support graphs of max-degree 4. In the octilinear model, each vertex has eight available ports and therefore one can draw graphs of max-degree 8.

For readability purposes, usually in such drawings one seeks to minimize the edge complexity [11, 27], i.e., the maximum number of segments used for representing any edge. Also, when the input is a planar graph, one seeks for a corresponding planar drawing. Note that drawings with edge complexity 1 are also called bendless. We refer to drawings with edge complexity k as k-drawings; thus, by definition, orthogonal k-drawings have at most \(k-1\) bends per edge.

Fig. 1.
figure 1

Different drawings of a planar graph of max-degree 4: (a) straight-line, (b) orthogonal 3-drawing, (c) octilinear 2-drawing, and (d) smooth orthogonal 2-drawing.

Known results. There exists a plethora of results for each of the aforementioned models; here we list existing results for drawings with low edge complexity.

  • All planar graphs of max-degree 4, except for the octahedron, admit orthogonal 3-drawings; the octahedron is orthogonal 4-drawable [8, 29]. Minimizing the number of bends over all embeddings of a planar graph of max-degree 4 is \(\mathcal {NP}\)-hard [22]. For a given planar embedding, however, finding a planar orthogonal drawing with minimum number of bends can be done in polynomial time by an approach, called topology-shape-metrics [35], that is based on min-cost flow computations and works in three phases. Initially, a planar embedding is computed if not specified by the input. In the next phase, the angles and the bends of the drawing are computed, yielding an orthogonal representation. In the last phase, the actual coordinates for the vertices and bends are computed.

  • All planar graphs of max-degree 4 (including the octahedron) admit smooth orthogonal 2-drawings. Note that not all planar graphs of max-degree 4 allow for bendless smooth orthogonal drawings [5], and that such drawings may require exponential area [1]. Bendless smooth orthogonal drawings are possible only for subclasses, e.g., for planar graphs of max-degree 3 [4] and for outerplanar graphs of max-degree 4 [1]. It is worth mentioning that the complexity of the problem, whether a planar graph of max-degree 4 admits a bendless smooth orthogonal drawing, has not been settled (it is conjectured to be \(\mathcal {NP}\)-hard [1]).

  • All planar graphs of max-degree 8 admit octilinear 3-drawings [28], while planar graphs of max-degree 4 or 5 allow for octilinear 2-drawings [3]. Bendless octilinear drawings are always possible for planar graphs of max-degree 3 [23]. Note that deciding whether an embedded planar graph of max-degree 8 admits a bendless octilinear drawing is \(\mathcal {NP}\)-hard [31]. It is not, however, known whether this negative result applies for planar graphs of max-degree 4 or whether these graphs allow for a decision algorithm (in fact, there exist planar graphs of max-degree 4 that do not admit bendless octilinear drawings [6]).

Our contribution. Motivated by the fact that usually one can “easily” convert an octilinear drawing of a planar graph of max-degree 4 to a corresponding smooth orthogonal one (e.g., by replacing diagonal edge segments with quarter circular arc segments; see Figs. 1c and d for an example), and vice versa, we study in Sect. 2 inclusion-relationships between the graph-classes that admit such drawings. In Sect. 3, we show that it is \(\mathcal {NP}\)-hard to decide whether an embedded planar graph of max-degree 4 admits a bendless smooth orthogonal or a bendless octilinear drawing, in the case where the angles between any two edges incident to a common vertex and the shapes of all edges are specified as part of the input (e.g., as in the last step of the topology-shape-metrics approach [35]). Our proof is a step towards settling the complexities of both decision problems in their general form. Inspired from the Kandinsky model (see, e.g., [7, 10, 18]) for drawing planar graphs of arbitrary degree in an orthogonal style, we present in Sect. 4 two drawing algorithms that yield bi-monotone smooth orthogonal drawings of good quality. The first yields drawings of smaller area, which can also be transformed to octilinear with bends at \(135^\circ \). The second yields larger drawings but guarantees that at most \(2n-5\) edges are drawn with two segments. We conclude in Sect. 5 with open problems.

Fig. 2.
figure 2

Different inclusion-relationships: For \(k \ge 1\), \(SC_k\) and \(8C_k\) correspond to the classes of graphs admitting smooth orthogonal and octilinear k-drawings, respectively.

Preliminaries. For graph theoretic notions refer to [24]. For definitions on planar graphs, we point the reader to [11, 27]. We also assume familiarity with standard graph drawing techniques, such as the canonical ordering [19, 26] and the shift-method by de Fraysseix et al. [19]; see [2] for more details.

2 Relationships Between Graph Classes

In this section, we consider relationships between the classes of graphs that admit smooth orthogonal k-drawings and octilinear k-drawings, \(k \ge 1\), denoted as \(SC_k\) and \(8C_k\), respectively. Our findings are also summarized in Fig. 2.

By definition, \(SC_1 \subseteq SC_2\) and \(8C_1 \subseteq 8C_2 \subseteq 8C_3\) hold. Since each planar graph of max-degree 8 admits an octilinear 3-drawing [28], class \(8C_3\) coincides with the class of planar graphs of max-degree 8. Similarly, class \(SC_2\) coincides with the class of planar graph of max-degree 4, as these graphs admit smooth orthogonal 2-drawings [1]. This also implies that \(SC_2 \subseteq 8C_2\), since each planar graph of max-degree 4 admits an octilinear 2-drawing [3]. The relationship \(8C_2 \ne 8C_3\) follows from [3], where it was proven that there exist planar graphs of max-degree 6 that do not admit octilinear 2-drawings. The relationship \(SC_2 \ne 8C_2\) follows from [6], where it was shown that there exist planar graphs of max-degree 5 that admit octilinear 2-drawings and no octilinear 1-drawings, and the fact that planar graphs of max-degree 5 cannot be drawn in the smooth orthogonal model. The octahedron graph admits neither a bendless smooth orthogonal drawing [5] nor a bendless octilinear drawing [6]. However, since it is of max-degree 4, it admits 2-drawings in both models [1, 3]. Hence, it belongs to \(8C_2 \cap SC_2 \setminus (8C_1 \cup SC_1)\). To prove that \(8C_1 \setminus SC_2 \ne \emptyset \), observe that a caterpillar whose spine vertices are of degree 8 clearly admits an octilinear 1-drawing, however, due to its degree it does not admit a smooth orthogonal.

To complete the discussion of the relationships of Fig. 2, we have to show that \(SC_1\) and \(8C_1\) are incomparable. This is the most interesting part of our proof, as usually one can “easily” convert a bendless octilinear drawing of a planar graph of max-degree 4 to a corresponding bendless smooth orthogonal one (e.g., by replacing diagonal segments with quarter circular arcs), and vice versa; see, e.g., Figs. 1c and d. Since the endpoints of each edge of a bendless smooth orthogonal or octilinear drawing are along a line with slope 0, 1, \(-1\) or \(\infty \), such conversions are in principle possible. Two difficulties that might arise are to preserve planarity and to guarantee that no two edges enter a vertex using the same port. Clearly, however, there exist infinitely many (even 4-regular) planar graphs that admit both drawings in both models; see Fig. 3 and [2] for more details.

Fig. 3.
figure 3

Illustrations for the proof of Theorem 1.

Theorem 1

There is an infinitely large family of 4-regular planar graphs that admit both bendless smooth orthogonal and bendless octilinear drawings.

In the next two theorems we show that \(SC_1\) and \(8C_1\) are incomparable.

Theorem 2

There is an infinitely large family of 4-regular planar graphs that admit bendless smooth orthogonal drawings but no bendless octilinear drawings.

Proof

Consider the planar graph C of Fig. 4a, which is drawn bendless smooth orthogonal. We claim that C admits no bendless octilinear drawing. If one substitutes its degree-2 vertex (denoted by c in Fig. 4a) by an edge connecting its two neighbors, then the resulting graph is triconnected, which admits an unique embedding (up to the choice of its outerface; see Figs. 4a and b). Now, observe that the outerface of any octilinear drawing of graph C (if any) has length at most 5 (Constraint 1). In addition, each vertex of this outerface (except for c, which is of degree 2) must have two ports pointing in the interior of this drawing, because every vertex of C is of degree 4 except for c. This implies that the angle formed by any two consecutive edges of this outerface is at most \(225^\circ \), except for the pair of edges incident to c (Constraint 2). But if we want to satisfy both constraints, then at least one edge of this outerface must be drawn with a bend; see Fig. 4c. Hence, graph C does not admit a bendless octilinear drawing.

Fig. 4.
figure 4

Illustrations for the proof of Theorem 2.

Based on graph C, for each \(k \in \mathbb {N}_0\) we construct a 4-regular planar graph \(G_k\) consisting of \(k + 2\) biconnected components \(C_1,\ldots ,C_{k+2}\) arranged in a chain; see Fig. 4d for the case \(k=1\). Clearly, \(G_k\) admits a bendless smooth orthogonal drawing for any k. Since the end-components of the chain (i.e., \(C_1\) and \(C_{k+2}\)) are isomorphic to C, \(G_k\) does not admit a bendless octilinear drawing for any k.   \(\square \)

Theorem 3

There is an infinitely large family of 4-regular planar graphs that admit bendless octilinear drawings but no bendless smooth orthogonal drawings.

Proof

(sketch). Consider the planar graph B of Fig. 5a, which is drawn bendless octilinear. Graph B has two separation pairs (i.e., \(\{t_1,t_2\}\) and \(\{p_1,p_2\}\) in Fig. 5a).

Fig. 5.
figure 5

Illustrations for the proof of Theorem 3.

Based on graph B, for each \(k \in \mathbb {N}_0\) we construct a 4-regular planar graph \(G_k\) consisting of \(2k + 4\) copies of B arranged in a cycle; see Fig. 5b where each copy of B is drawn as a gray-shaded parallelogram. By construction, \(G_k\) admits a bendless octilinear drawing for any k. By planarity at least one copy of graph B must be embedded with the outerface of Fig. 5a. However, if we require the outerface of B to be the one of Fig. 5a, then all possible planar embeddings of B are isomorphic to the one of Fig. 5a. We exploit this property in [2] to show that B does not admit a bendless smooth orthogonal drawing with this outerface. The detailed proof is based on an exhaustive consideration of all bendless smooth orthogonal drawings of subgraphs of B, which we incrementally augment by adding more vertices to them. Thus, for any k, graph \(G_k\) does not admit a bendless smooth orthogonal drawing.   \(\square \)

3 \(\mathcal {NP}\)-hardness Results

In this section, we study the complexity of the bendless smooth orthogonal and octilinear drawing problems. As a first step towards addressing the complexity of both problems for planar graphs of max-degree 4 in general, here we make an additional assumption. We assume that the input, apart from an embedding, also specifies a smooth orthogonal or an octilinear representation, which are defined analogously to the orthogonal ones: (i) the angles between consecutive edges incident to a common vertex in the cyclic order around it (given by the planar embedding) are specified, and (ii) the shape of each edge (e.g., straight-line, or quarter-circular arc) is also specified. In other words, we assume that our input is analogous to the one of the last step of the topology-shape-metrics approach [35].

Theorem 4

Given a planar graph G of max-degree 4 and a smooth orthogonal representation \(\mathcal {R}\), it is \(\mathcal {NP}\)-hard to decide whether G admits a bendless smooth orthogonal drawing preserving \(\mathcal {R}\).

Proof

Our reduction is from the well-known 3-SAT problem [21]. Given a formula \(\varphi \) in conjunctive normal form, we construct a graph \(G_\varphi \) and a smooth orthogonal representation \(\mathcal {R}_\varphi \), such that \(G_\varphi \) admits a bendless smooth orthogonal drawing \(\varGamma _\varphi \) preserving \(\mathcal {R}_\varphi \) if and only if \(\varphi \) is satisfiable; see also Fig. 6.

The main ideas of our construction are: (i) specific straight-line edges in \(\varGamma _\varphi \) transport information encoded in their length, (ii) rectangular faces of \(\varGamma _\varphi \) propagate the edge length of one side to its opposite, and (iii) for a face composed of two straight-line edges and a quarter circle arc, the straight-line edges are of same length, which allows us to change the direction in which the information “flows”.

Fig. 6.
figure 6

Drawing \(\varGamma _\varphi \) for \(\varphi = (a \vee b \vee c) \wedge (\overline{a} \vee \overline{b} \vee c)\) and the assignment \(a = \texttt {false}\) and \(b = c = \texttt {true}\).

Variable gadget. For each variable x of \(\varphi \), we introduce a gadget; see Figs. 7a and b. The bold-drawn quarter circle arc ensures that the sum of the edge lengths to its left is the same as the sum of the edge lengths to its bottom (refer to the edges with gray endvertices). As “input” the gadget gets three edges of unit length \(\ell (u)\). This ensures that \(\ell (x) + \ell (\overline{x}) = 3 \cdot \ell (u)\) holds for the “output literals” x and \(\overline{x}\), where \(\ell (x)\) and \(\ell (\overline{x})\) denote the lengths of two edges representing x and \(\overline{x}\).

Fig. 7.
figure 7

In Figures (a) and (b) the variable gadget is illustrated. In Figures (c) and (d) the parity gadget is illustrated; gray-colored arrows show the information “flow”.

To introduce our concept, assume that the lengths of all straight-line edges are integral and at least 1. If we could require \(\ell (u) = 1\), then \(\ell (x), \ell (\overline{x}) \in \{1,2\}\). This would allow us to encode the assignment \(x=\mathtt {true}\) with \(\ell (x) = 2\) and \(\ell (\overline{x}) = 1\), and the assignment \(x=\mathtt {false}\) with \(\ell (x) = 1\) and \(\ell (\overline{x}) = 2\). However, if we cannot avoid, e.g., that \(\ell (u) = 2\), then the variable gadget would not prevent us from setting \(\ell (x) = \ell (\overline{x}) = 3\), which means that x and \(\overline{x}\) are “half-true”. We solve this issue by the so-called parity gadget, that allows us to relax the integral constraint and to ensure that \(\ell (x), \ell (\overline{x}) \in \{\ell (u) + \varepsilon , 2 \ell (u) - \varepsilon \}\), for \(0< \varepsilon<< \ell (u)\).

Parity gadget. For each variable x of \(\varphi \), \(G_\varphi \) has a gadget (see Figs. 7c and d), which results in overlaps in \(\varGamma _\varphi \), if the values of \(\ell (x)\) and \(\ell (\overline{x})\) do not differ significantly. The central part of this gadget is a “vertical gap” of width \(3 \cdot \ell (u)\) (shaded in gray in Figs. 7c and d) with two blocks of vertices (triangular- and square-shaped in Figs. 7c and d) pointing inside the gap. Each block defines two square-shaped faces and three faces of length 3, each formed by two straight-line edges and a quarter circle arc. Depending on the choice of \(\ell (x)\) and \(\ell (\overline{x})\), one of the blocks may be located above the other. If \(\ell (x) \approx \ell (\overline{x})\), however, we can observe that the two blocks are not far enough apart from each other, which leads to overlaps. Using elementary geometry, we prove in [2] that overlaps can be avoided if and only if \(|\ell (\overline{x}) - \ell (x)|> \sqrt{3}/2 \cdot \ell (u)\approx 0.866 \cdot \ell (u)\), which implies: that \(\ell (x), \ell (\overline{x}) \in (0,~1.067 \cdot \ell (u)] \cup [1.933 \cdot \ell (u),~3)\text {, i.e., }\varepsilon < 0.067 \cdot \ell (u)\).

Clause gadget. For each clause of \(\varphi \) with literals a, b and c, we introduce a gadget, which is illustrated in Fig. 8a. The bold-drawn quarter circle arc of Fig. 8a compares two sums of information. From the righthand side, four edges of unit length “enter” the arc. Observe that there is also a free edge (marked with an asterisk in Fig. 8a), which also contributes to the sum but can be stretched independently of any other edge. Hence, the sum of edge lengths on the righthand side of this arc is >4 \(\cdot \ell (u)\). The three literals “enter” at the bottom; the sum here is \(\ell (a) + \ell (b) + \ell (c)\). Combining both, we obtain that \(\ell (a) + \ell (b) + \ell (c) > 4 \cdot \ell (u)\) must hold. This implies that not all a, b and c can be \(\texttt {false}\), since in this case \(\ell (a) + \ell (b) + \ell (c) = 3 \cdot (\ell (u)+\varepsilon ) < 4 \cdot \ell (u)\).

Fig. 8.
figure 8

Different gadgets; gray-colored arrows show the information “flow”.

Auxiliary gadgets. The crossing gadget just consists of a rectangle and is used to allow two flows of information to cross each other; see Fig. 8b. The copy gadget takes an information and creates three copies of this information; see Fig. 8c. This is because both quarter circular arcs of the copy gadget must have the same radius in the presence of the half circular arc of the copy gadget. Finally, the unit length gadget is a single edge, which we assume to be of length \(\ell (u)\).

We now describe our construction; see Fig. 6: \(G_\varphi \) contains one unit length gadget, which is copied several times using the copy gadget (the number of copies depends linearly on the number of variables \(\nu \) and clauses \(\mu \) of \(\varphi \)). For each variable of \(\varphi \), \(G_\varphi \) has a variable gadget and a parity gadget, each of which is connected to different copies of the unit length gadget. For each clause of \(\varphi \), \(G_\varphi \) has a clause gadget, which has four connections to different copies of the unit length gadget. We compute \(\mathcal {R}_\varphi \) as follows. We place the variable gadget of each variable x above and to the left of its parity gadget and we connect the output literals of the variable gadget of x with its parity gadget through a copy gadget. We place the variable and the parity gadgets of the i-th variable below and to the right of the corresponding ones of the \((i-1)\)-th variable. We place each clause gadget to the right of the sketch constructed so far, so that the gadget of the i-th clause is to the right of the \((i-1)\)-th clause. This allows us to connect copies of the output literals of the variable gadget of each variable with the clause gadgets that contain it, so that all possible crossings (which are resolved using the crossing gadget) appear above the clause gadgets. More precisely, if a clause contains a literal of the i-th variable, we have a crossing with the literals of all variables with indices \((i+1)\) to \(\nu \). Hence, for each clause we add \(O(\nu )\) crossing and three copy gadgets. Note that all copy gadgets of the unit length gadget lie below all variable, parity, and clause gadgets. The obtained representation \(\mathcal {R}_\varphi \) conforms with the one of Fig. 6. The construction can be done in \(O(\nu \mu )\) time.

To complete the proof, assume that \(G_\varphi \) admits a bendless smooth orthogonal drawing \(\varGamma _\varphi \) preserving \(\mathcal {R}_\varphi \). For each variable x of \(\varphi \), we set x to \(\texttt {true}\) if and only if \(\ell (x) \ge 1.933 \cdot \ell (u)\). Since for each clause \((a \vee b \vee c)\) of \(\varphi \) we have that \(\ell (a) + \ell (b) + \ell (c) > 4 \cdot \ell (u)\), at least one of a, b and c must be \(\texttt {true}\). Hence, \(\varphi \) admits a truth assignment. For the opposite direction, based on a truth assignment of \(\varphi \), we can set, e.g., \(\ell (x)=1.95\) and \(\ell (\overline{x})=1.05\) for each variable x, assuming that \(\ell (u)=1\). Then, arranging the variable and the clause gadgets of \(G_\varphi \) as in Fig. 6 yields a bendless smooth orthogonal drawing \(\varGamma _\varphi \) preserving \(\mathcal {R}_\varphi \).   \(\square \)

Remark 1

The special case of our problem, in which circular arcs are not present, is known as HV-rectilinear planarity testing [30]. As opposed to our problem, HV-rectilinear planarity testing is polynomial-time solvable in the fixed embedding setting [14] (and becomes \(\mathcal {NP}\)-hard in the variable embedding setting [12]).

Theorem 5

Given a planar graph G of max-degree 4 and an octilinear representation \(\mathcal {R}\), it is \(\mathcal {NP}\)-hard to decide whether G admits a bendless octilinear drawing preserving \(\mathcal {R}\).

Proof

(sketch). Except for the parity gadget, we can adjust to the octilinear model simply by replacing arcs with diagonal segments; for details see [2]. In this case the parity gadget guarantees \(|\ell (x)-\ell (\overline{x})| > {5}/{6} \cdot \ell (u) \approx 0.833 \cdot \ell (u)\), which implies that \(\varepsilon < 0.084 \cdot \ell (u)\).   \(\square \)

4 Bi-monotone Drawings

In this section, we study variants of the Kandinsky drawing model [7, 10, 18], which forms an extension of the orthogonal model to graphs of degree greater than 4. In this model, the vertices are represented as squares, placed on a coarse grid, with multiple edges attached to each side of them aligned on a finer grid.

The Kandinsky model allows for natural extensions to both smooth orthogonal and octilinear models. We are aware of only one preliminary result in this direction: A linear time drawing algorithm is presented in [5] for the production of smooth orthogonal 2-drawings for planar graphs of arbitrary degree in quadratic area, in which all vertices are on a line \(\ell \) and the edges are drawn either as half circles (above or below \(\ell \)), or as two consecutive half circles one above and one below \(\ell \) (i.e., the latter ones are of complexity 2, but they are at most \(n-2\)).

For an input maximal planar graph G (of arbitrary degree), our goal is to construct a smooth orthogonal (or an octilinear) 2-drawing for G with the following aesthetic benefits over the aforementioned drawing algorithm: (i) the vertices are distributed evenly over the drawing area, and (ii) each edge is bi-monotone [20], i.e., xy-monotone. We achieve our goal at the cost of slightly more edges drawn with complexity 2 or at the cost of increased drawing area (but still polynomial).

Our first approach is a modification of the shift-method [19]. Based on a canonical order \(\pi =(v_1,\ldots ,v_n)\) of G, we construct a planar smooth orthogonal 2-drawing \(\varGamma \) of G in the Kandinsky model, as follows. We place \(v_1\), \(v_2\) and \(v_3\) at (0, 0), (2, 0) and (1, 1). Hence, we can draw \((v_1,v_2)\) as a horizontal segment, and each of \((v_1,v_3)\) and \((v_2,v_3)\) as a quarter circular arc. We also color \((v_1,v_3)\) blue and \((v_2,v_3)\) green. For \(k=4,\ldots ,n\), assume that a smooth orthogonal 2-drawing \(\varGamma _{k-1}\) of the subgraph \(G_{k-1}\) of G induced by \(v_1,\ldots ,v_{k-1}\) has been constructed, in which each edge of the outerface \(C_{k-1}\) of \(\varGamma _{k-1}\) is drawn as a quarter circular arc, whose endvertices are on a line with slope \(\pm 1\), except for edge \((v_1,v_2)\), which is drawn as a horizontal segment (called contour condition in the shift-method; see Fig. 9). Each of \(v_1,\ldots ,v_{k-1}\) is also associated with a so-called shift-set, which for \(v_1\), \(v_2\) and \(v_3\) are singletons containing only themselves.

Let \(w_1,\ldots ,w_p\) be the vertices of \(C_{k-1}\) from left to right in \(\varGamma _{k-1}\), where \(w_1=v_1\) and \(w_p=v_2\). Let \((w_\ell ,\ldots ,w_r)\), \(1 \le \ell < r \le p\), be the neighbors of \(v_k\) from left to right along \(C_{k-1}\) in \(\varGamma _{k-1}\). As in the shift-method, our algorithm first translates each vertex in \(\cup _{i=1}^{\ell } S(w_i)\) one unit to the left and each vertex in \(\cup _{i=r}^{p} S(w_i)\) one unit to the right, where S(v) is the shift-set of \(v \in V\). During this translation, \((w_{\ell },w_{\ell +1})\) and \((w_{r-1},w_r)\) acquire a horizontal segment each (see the bold edges of Fig. 9). We place \(v_k\) at the intersection of line \(L_\ell \) with slope \(+1\) through \(w_\ell \) with line \(L_r\) with slope \(-1\) through \(w_r\) (dotted in Fig. 9) and we set the shift-set of \(v_k\) to \(\{v_k\} \cup _{i=\ell +1}^{r-1}S(w_i)\), as in the shift-method. We draw each of \((w_\ell ,v_k)\) and \((v_k,w_r)\) as a quarter circular arc. For \(i=\ell +1,\ldots ,r-1\), \((w_i,v_k)\) has a vertical line-segment that starts from \(w_i\) and ends either at \(L_\ell \) or \(L_r\) and a quarter circle arc from the end of the previous segment to \(v_k\). Hence, the contour condition is satisfied. We color \((w_\ell ,v_k)\) blue, \((v_k,w_r)\) green and the remaining edges of \(v_k\) red; see also [16, 33]. Observe that each blue and green edge consists of a quarter circular arc and a horizontal segment (that may have zero length), while a red edge consists of a vertical segment and a quarter circular arc (that may have zero radius). We are now ready to state our first theorem; the analogous of Theorem 6 for the octilinear model is shown in [2].

Fig. 9.
figure 9

Illustration of the contour condition (left) and the placement of \(v_k\) (right).

Theorem 6

A maximal planar n-vertex graph admits a bi-monotone planar smooth orthogonal 2-drawing in the Kandinsky model, which requires \(O(n^2)\) area and can be computed in O(n) time.

Proof

Bi-monotonicity follows by construction. The time complexity follows from [9]. Planarity is proven by induction. Drawing \(\varGamma _3\) is planar by construction. Assuming that \(\varGamma _{k-1}\) is planar, we observe that no two edges incident to \(v_k\) cross in \(\varGamma _k\). Also, these edges do not cross edges of \(\varGamma _{k-1}\). Since the radii of the arcs of the edges incident to vertices that are shifted remain unchanged and since edges incident to vertices in the shift-sets retain their shape, drawing \(\varGamma _k\) is planar.   \(\square \)

We reduce the number of edges drawn with complexity 2 in two steps.  (S.1) We stretch the drawing horizontally (by employing appropriate vertical cuts; see, e.g., [17]) to eliminate the vertical segments of all red edges with a circular arc segment of non-zero radius. (S.2) We stretch the drawing vertically, to guarantee that the edges of a spanning tree (i.e., \(n-1\)) are drawn with complexity 1.

For Step 1, we assume that each blue and green edge has a horizontal segment (that may be of zero length). Consider a red edge (uv) with a vertical segment of length \(\delta \) and assume w.l.o.g. that u is to the right and above v. If we shift u by \(\delta \) units to the right, then (uv) can be drawn as a quarter circular arc. If the shift is by more than \(\delta \) units, then a horizontal segment is needed. Since all edges incident to u that are drawn below u enter u from its left or from its right side, the shift of u cannot introduce crossings between them.

We eliminate the vertical segments of all red edges with a circular arc segment of non-zero radius, as follows. As long as there exist such edges, we choose the one, call it (uv), whose vertical segment has the largest length \(\delta \), and assume that u is to the right and above v. We eliminate the vertical segment of (uv) using a vertical cut L at \(x(u)- \varepsilon \), for small \(\varepsilon >0\). Since L crosses several edges, shifting all vertices to the right of L by \(\delta \) to the right has the following effects. By the choice of (uv), the vertical segments of all red edges crossed by L are eliminated; note that this may introduce new horizontal segments. The horizontal segment of each blue and green edge crossed by L is elongated by \(\delta \). Both imply that no edge crossings are introduced. Hence, by the termination of our algorithm all edges with vertical segments are of complexity 1.

Step 1 ensures that the x-distance of adjacent vertices is at least as large as their y-distance (unless they are connected by vertical edges). Based on this property, in Step 2 we compute new y-coordinates for the vertices in the sequence of the canonical ordering \(\pi \), keeping their x-coordinates unchanged. First, we set \(y(v_1) = y(v_2) = 0\). For each \(k=3,\ldots ,n\), we set \(y(v_k) = \max _{w\in \{w_\ell ,\ldots ,w_r\}}\{y(w) + \max \{\varDelta _x(v_k, w),1\} \}\), where \(w_\ell ,\ldots ,w_r\) are the neighbors of \(v_k\) in \(\varGamma _{k-1}\), i.e., \(v_k\) is placed above \(w_\ell ,\ldots ,w_r\) in \(\varGamma _{k-1}\), such that one of its edges (the one of the maximum; call it \((v_k,w^*)\)) is drawn with complexity 1; as a quarter circle arc or as a vertical edge depending on whether the x- distance of \(v_k\) and \(w^*\) is non-zero or not. Since \((v_k,w^*)\) is the edge that must be stretched the most in order to ensure that it is drawn with complexity 1, for all other edges incident to \(v_k\) in \(G_k\), the y-distance of their endpoints is at least as large as their corresponding x-distance. Hence, they are drawn as vertical segments followed by quarter circular arcs (that may have zero radius). We are now ready to state our second theorem.

Theorem 7

A maximal planar n-vertex graph admits a bi-monotone planar smooth orthogonal 2-drawing with at least \(n-1\) edges with complexity 1 in the Kandinsky model, which requires \(O(n^4)\) area and can be computed in \(O(n^2)\) time.

Proof

(sketch). For \(k=3,\ldots ,n\), vertex \(v_k\) is incident to an edge drawn with complexity 1 in Step 2. Since \((v_1,v_2)\) is drawn as a horizontal segment, at least \(n-1\) edges have complexity 1. Planarity is proven by induction; the main invariant is that all edges on \(C_k \setminus \{(v_1,v_2)\}\) have a quarter circular arc and possibly a vertical segment. Time and area requirements are shown in [2].   \(\square \)

5 Conclusions

In this paper, we continued the study on smooth orthogonal and octilinear drawings. Our \(\mathcal {NP}\)-hardness proofs are a first step towards settling the complexity of both drawing problems. We conjecture that the former is \(\mathcal {NP}\)-hard, even in the case where only the planar embedding is specified by the input. For the latter, it is of interest to know if it remains \(\mathcal {NP}\)-hard even for planar graphs of max-degree 4 or if these graphs allow for a decision algorithm. Our drawing algorithms guarantee bi-monotone 2-drawings with a certain number of complexity-1 edges for maximal planar graphs. Improvements on this number or generalizations to triconnected or simply connected planar graphs are of importance.