1 Introduction

Let G be a graph with maximum vertex degree \(\varDelta \). The k-bend planar slope number of G is the minimum number of slopes for the edge segments needed to construct a k-bend planar drawing of G, i.e., a planar drawing where each edge is a polyline with at most \(k \ge 0\) bends. Since no more than two edge segments incident to the same vertex can use the same slope, \(\lceil \varDelta /2 \rceil \) is a trivial lower bound for the k-bend planar slope number of G, irrespectively of k. Besides their theoretical interest, k-bend planar drawings with small slope number form a natural extension of two well-established graph drawing models: The orthogonal [5, 23, 25, 44] and the octilinear drawing models [2, 3, 6, 40], both having several applications, such as in VLSI and floor-planning [38, 45], and in metro-maps and map-schematization [15, 30, 41, 43], respectively. Orthogonal drawings use only two slopes for the edge segments (the horizontal one and the vertical one), while octilinear drawings use no more than four slopes (the horizontal, the vertical, and the two diagonal slopes). Consequently, they are limited to graphs with \(\varDelta \le 4\) and \(\varDelta \le 8\), respectively.

These two drawing models have been generalized to graphs with arbitrary maximum vertex degree \(\varDelta \) in [21, 22]. Concerning planar graphs, Keszegh, Pach and Pálvölgyi [33] prove that every such a graph admits a 2-bend planar drawing using a set of \(\lceil \varDelta /2 \rceil \) equispaced slopes. (Intuitively, a set of slopes is equispaced if the angles formed by pairs of adjacent edges using consecutive slopes in this set are all the same; see also Sect. 2 for a formal definition.) As a witness of the tight connection between the two problems, the result by Keszegh et al. is built upon an older result for orthogonal drawings of degree-4 planar graphs by Biedl and Kant [5]. In the same paper, Keszegh et al. also study the 1-bend planar slope number and show an upper bound of \(2 \varDelta \) and a lower bound of \(\frac{3}{4}(\varDelta - 1)\) for this parameter. The upper bound has been progressively improved. Initially, Durocher and Mondal [24] establish \(\frac{2}{3}\varDelta \) and \(\varDelta \) as upper bounds for the 1-bend planar slope number of 2-trees and of planar 3-trees, respectively. Later, the upper bound for general planar graphs has been set to \(\frac{3}{2}(\varDelta - 1)\) by Knauer and Walczak [36] and subsequently to \(\varDelta -1\) by Angelini et al. [1]. Angelini et al. actually prove a stronger result: Given any set \(\mathcal {S}\) of \(\varDelta -1\) slopes, every planar graph with maximum vertex degree \(\varDelta \) admits a 1-bend planar drawing whose edge segments use only slopes in \(\mathcal {S}\). Any such slope set is hence called universal for 1-bend planar drawings. This result simultaneously establishes the best-known upper bound on the 1-bend planar slope number of planar graphs and the best-known lower bound on the angular resolution of 1-bend planar drawings, i.e., on the minimum angle between any two edge segments incident to the same vertex. The second implication follows from the fact that if the slopes in \(\mathcal {S}\) are equispaced, the resulting drawings have angular resolution of at least \(\frac{\pi }{\varDelta -1}\). For the case \(k=0\), the best-known upper bound is \(2^{O(\varDelta )}\), while the corresponding best-known lower bound is \(3\varDelta - 6\) [33]. The large gap between these bounds on the (0-bend) planar slope number motivated an array of results for subclasses of planar graphs, namely improved upper bounds (which are polynomial in \(\varDelta \)) have been proved for nested pseudo-trees [8], planar partial 3-trees [17, 31], partial 2-trees [39], outerplanar graphs [37], while the planar slope number of planar graphs of maximum degree three is four [18].

In this paper we study slope sets that are universal for k-bend upward planar drawings of directed graphs (or digraphs for short). A drawing of a digraph G is upward if every oriented edge (uv) is drawn as a y-monotone non-decreasing curve from u to v, while it is strictly upward, if (uv) is a y-monotone increasing curve. It is known that G admits an upward planar drawing if and only if it is a subgraph of a planar st-graph [16, 32]. Since such drawings are common for representing planar digraphs, they have been extensively studied in the literature (see, e.g., [4, 9, 20, 25, 29]). A preliminary result for this setting is due to Di Giacomo et al. [19], who prove that every series-parallel digraph (a subclass of the directed partial 2-trees) with maximum vertex degree \(\varDelta \) admits a 1-bend (not necessarily strictly) upward planar drawing that uses at most \(\varDelta \) slopes, and this bound on the number of slopes is worst-case optimal. Notably, their construction gives rise to drawings with optimal angular resolution \(\frac{\pi }{\varDelta }\) (but it uses a predefined set of slopes). For the case \(k=0\), Czyzowicz [12] and Czyzowicz et al. [13] study 0-bend strictly upward drawings of posets with few slopes. Moreover, Klawitter and Mchedlidze [34] and Klawitter and Zink [35] have recently investigated the complexity of testing for the existence of a 0-bend upward planar drawing with the minimum number of slopes.

Fig. 1
figure 1

a A 1-bend upward planar drawing of a bitonic st-graph, and b a 2-bend upward planar drawing of a planar st-graph, both defined on the same set of four slopes, that is, the horizontal, the vertical, and the two diagonal ones

Contribution The focus of this paper is on the k-bend upward planar slope number of planar st-graphs, for the cases \(k=1\) and \(k=2\). A key ingredient of the presented techniques is a linear ordering of the vertices of a planar digraph introduced by Gronemann [27], called bitonic st-ordering (formally defined in Sect. 2), which is a special type of an st-ordering. Our contribution is twofold and can be summarized as follows.

  • We show that any set \(\mathcal {S}\) of \(\varDelta \) slopes containing the horizontal slope is universal for 1-bend upward planar drawings of degree-\(\varDelta \) planar digraphs having a bitonic st-ordering. Such graphs represent a notable subclass of planar st-graphs; for instance, they are exactly the graphs admitting a so-called upward planar L-drawing [7], and they have been used to obtain the best-known upper bound on the number of total bends for 1-bend upward planar drawings [27]. Furthermore, we remark that the size of \(\mathcal {S}\) is worst-case optimal [19] and, if the slopes of \(\mathcal {S}\) are chosen to be equispaced, the angular resolution of the resulting drawing is at least \(\frac{\pi }{\varDelta }\) (that is, optimal); see Fig. 1a for an illustration.

  • We then extend our construction to all planar st-graphs by using two bends on a restricted number of edges. More precisely, we show that, given a set \(\mathcal {S}\) of \(\varDelta \) slopes containing the horizontal slope, every n-vertex upward planar digraph with maximum vertex degree \(\varDelta \) has a 2-bend upward planar drawing that uses only slopes in \(\mathcal {S}\) and has at most \(4n-9\) bends in total (that is, linearly many edges have less than two bends); see Fig. 1b for an illustration.

We note that, in the literature, the strictly upward planar and non-strictly upward planar models are usually not distinguished, because if a digraph admits an upward drawing, then it also admits a strictly upward drawing. However, our drawing technique makes use of the horizontal slope and hence leads to upward drawings that are not strict. On the positive side, it is always possible to make these drawings strictly upward by increasing the number of slopes by only one unit (see Corollaries 2 and 3).

Comparison with Previous Work Before entering into the technical details of our contribution, it is worth remarking some important differences and similarities with previous work. Angelini et al. [1] prove that any given set of \(\varDelta -1\) slopes is universal for 1-bend planar drawings of undirected graphs. One of the key intuitions in [1] lies in the fact that, in an incremental construction of the drawing, there exists a set of horizontal edges whose removal disconnects the drawing into two pieces. This set of edges can be used to modify the horizontal distance of the vertices along the drawing boundary, which in turn makes it possible to use any given set of slopes to draw the edges attached to such vertices. This intuition is exploited also in our work, in particular, Lemmas 3 and 4 mirror Lemmas 1 and 2 in [1], although they require adjusted proofs to deal with the upward setting. Besides this very useful tool borrowed from [1], our layout algorithm requires additional new ingredients, such as an enriched set of geometric invariants, the notion of upward canonical ordering and suitable augmentation techniques that yield such an ordering, the introduction of “fake” slopes to deal with those dummy edges added to augment the graph. Notably, this last idea of augmenting the graph and using “fake” slopes to draw the inserted edges avoids the usage of more complex data structures, such as SPQR-trees, which are instead used in [1], thus resulting in a simpler and more elegant algorithm.

Another paper linked to ours is the one of Keszegh et al. [33]. Recall that, among other results, they prove that planar graphs admit 2-bend planar drawings with \(\lceil \varDelta /2 \rceil \) equispaced slopes. In particular, their technique draws the vertices incrementally following an st-ordering (see Sect. 2 for definitions) computed on the undirected planar graph in input. Since each vertex is drawn above its predecessors in the ordering, the technique has the potential to produce upward drawings. However, the main objective of the technique in [33] is to minimize the number of slopes and consequently, some edges are not drawn as y-monotone curves. Nevertheless, it is not difficult to see that a simple adjustment would solve this issue, essentially providing \(\varDelta \) slopes to be used rather than \(\lceil \varDelta /2 \rceil \). Thus, the algorithm in [33] yields 2-bend upward planar drawings of planar st-graphs using at most \(\varDelta \) slopes. On the other hand, the algorithm that we propose has two main advantages: (i) it computes drawings with \(4n-9\) bends in total, whereas the technique of Keszegh et al. may lead to drawings with \(5n-11\) bends, and (ii) it can use any set of \(\varDelta \) slopes with the horizontal one, whereas the technique of Keszegh et al. uses a fixed set of \(\varDelta \) slopes.

Paper Structure Section 2 contains basic definitions and notation. In Sect. 3 and in Sect. 4, we study universal slope sets for 1-bend and 2-bend upward planar drawings, respectively. Conclusions and open problems are in Sect. 5.

2 Preliminaries

We assume familiarity with basic graph-theoretic notions; for standard definitions, we point the reader to [28]. In this section, we give preliminary notions and notation that are used throughout this paper.

2.1 Drawings and Embeddings

We only consider simple graphs, i.e., graphs with neither loops nor multiple edges. A directed graph (or digraph for short) is a graph whose edges are oriented. A drawing \(\varGamma \) of a graph G is a mapping of the vertices of G to distinct points of the plane, and of the edges of G to Jordan arcs connecting their corresponding endpoints but not passing through any other vertex. A drawing is planar if no two edges intersect, except possibly at a common endpoint. A planar graph is a graph that admits a planar drawing. A planar drawing subdivides the plane into topologically connected regions, called faces. The infinite region is called the outer face; any other face is an inner face. A planar embedding of a planar graph is an equivalence class of topologically equivalent (i.e., isotopic) planar drawings of G. A planar embedding of a connected planar graph can be described by the clockwise circular order of the edges around each vertex together with the choice of the outer face. A planar graph with a given planar embedding is a plane graph. A plane graph is maximal (or triangulated) if the boundary of each face contains exactly three vertices.

An upward drawing of a digraph G is a drawing such that each edge of G is drawn as a curve monotonically non-decreasing in the y-direction from its source to its target. A drawing is strictly upward if its edges are monotonically increasing. It is easy to see that if a digraph admits an upward drawing, then it also admits a strictly upward drawing. A digraph is upward planar if it admits a drawing that is both upward and planar.

A plane acyclic digraph G with a single source s and a single sink t, such that s and t belong to the boundary of the outer face and the edge (st) belongs to G, is called planar st-graph [16] (note that, other works do not explicitly require the edge (st) to be part of G; see, e.g., [27]). It is well-known that a digraph is upward planar if and only if it is a subgraph of a planar st-graph [16].

The slope of a line \(\ell \) is commonly defined as the angle \(\alpha \) by which a horizontal line must be rotated counter-clockwise in order to make it overlap with \(\ell \).Footnote 1 If \(\alpha =0\), we say that the slope of \(\ell \) is horizontal. The slope of a segment is the slope of the line containing it. Let \(\mathcal {S}=\{\alpha _1,\dots ,\alpha _h\}\) be a set of h slopes such that \(\alpha _i < \alpha _{i+1}\). The slope set \(\mathcal {S}\) is equispaced if \(\alpha _{i+1} - \alpha _i = \frac{\pi }{h}\), for \(i=1,\dots ,h-1\).

Consider a k-bend planar drawing \(\varGamma \) of a graph G, i.e., a planar drawing in which every edge is mapped to a polyline containing at most \(k+1\) segments. For a vertex v in \(\varGamma \) each line through v and having slope \(\alpha \) defines two different rays that emanate from v. We say that these two rays have slope \(\alpha \). If \(\alpha \) is horizontal, these rays are called left horizontal ray and right horizontal ray. Otherwise, one of them is the top and the other one is the bottom ray of v. We say that a ray \(r_v\) of a vertex v is free if there is no edge incident to v through \(r_v\) in \(\varGamma \). We also say that \(r_v\) is outer if it is free and the first face encountered when moving from v along \(r_v\) is the outer face of \(\varGamma \) (note that, in general, there might exist several faces intersecting \(r_v\)).

The slope number of a k-bend drawing \(\varGamma \) is the number of distinct slopes used for the edge segments of \(\varGamma \). The k-bend upward planar slope number of an upward planar digraph G is the minimum slope number over all k-bend upward planar drawings of G.

2.2 Orderings

An st-ordering of an n-vertex planar st-graph \(G=(V,E)\) is a linear ordering \(\sigma =(v_1,v_2,\dots ,v_n)\) of V such that for each edge \((u,v) \in E\), vertex u precedes vertex v in \(\sigma \), that is \(\sigma (u) < \sigma (v)\). In particular, any st-ordering of G is a linear extension of the partial order defined by the edges of G, and therefore it holds that \(s=v_1\) and \(t=v_n\). Every planar st-graph has an st-ordering, which can be computed in O(n) time (see, e.g., [11]). If u and v are two adjacent vertices of G such that \(\sigma (u) < \sigma (v)\), we say that v is a successor of u, and u is a predecessor of v.

Let e be an outgoing edge of a vertex u of G, let \(e'\) and \(e''\) be the next edges incident to u going counter-clockwise and clockwise around u from e, respectively (the circular order of the edges around u is defined by the planar embedding of G). We say that e is the leftmost outgoing edge of u if either e and \(e'\) are both edges of the outer face or \(e'\) is an incoming edge. Similarly, e is the rightmost outgoing edge of u if either e and \(e''\) are both edges of the outer face or \(e''\) is an incoming edge. Also, observe that if u has only one outgoing edge, then such an edge is both leftmost and rightmost. Denote by \(S(u) = (u_1,u_2,\dots ,u_q)\) the sequence of successors of u such that, in the planar embedding of G, we have that: (i) edge \((u,u_1)\) is the leftmost outgoing edge of u, and (ii) edge \((u,u_i)\) precedes \((u,u_{i+1})\) (for \(i=1,\dots , q-1\)) scanning the edges around u clockwise. The sequence S(u) is bitonic if there exists an integer \(1 \le h \le q\) such that \(\sigma (u_1)< \dots< \sigma (u_{h-1}) < \sigma (u_h)> \sigma (u_{h+1})> \dots > \sigma (u_q)\); see Fig. 2a for an illustration. Notice that when \(h=1\) or \(h=q\), S(u) is actually a monotonic decreasing or increasing sequence (which is a special case of a bitonic sequence). A bitonic st-ordering of G is an st-ordering such that, for every vertex \(u \in V\), S(u) is bitonic [26]. A planar st-graph G is a bitonic st-graph if it admits a bitonic st-ordering. Deciding whether G is bitonic can be done in linear time in both cases when we assume that a planar embedding is given as part of the input [27] and when we do not have such information and hence we search over all possible planar embeddings of G [7].

A sequence of successors S(u) of a vertex u forms a forbidden configuration if there exist two indices i and j, with \(i<j\), such that \(\sigma (u_i) > \sigma (u_{i+1})\) and \(\sigma (u_j) < \sigma (u_{j+1})\), i.e. there is a path from \(u_{i+1}\) to \(u_i\) and a path from \(u_j\) to \(u_{j+1}\); see Fig. 2b. If G is not bitonic, every st-ordering \(\sigma \) of G contains a forbidden configuration [27].

Fig. 2
figure 2

Illustration of a bitonic sequence, and of b a forbidden configuration

Let \(G=(V,E)\) be an n-vertex triangulated plane graph with vertices u, v, and w on the boundary of the outer face. A canonical ordering [14] of G is a linear ordering \(\chi =(v_1,v_2,\dots ,v_n)\) of V, such that \(u=v_1\), \(v=v_2\), \(w=v_n\), and for every \(3 \le i \le n\):

C1::

The subgraph \(G_i\) induced by \(v_1,v_2,\dots ,v_i\) is 2-connected and internally triangulated, while the boundary of its outer face \(C_i\) is a simple cycle containing \((v_1,v_2)\);

C2::

If \(i+1\le n\), \(v_{i+1}\) belongs to \(C_{i+1}\) and its neighbors in \(G_{i}\) form a subpath of the path obtained by removing \((v_1,v_2)\) from \(C_i\).

Computing a canonical ordering \(\chi \) of G can be done in O(n) time [14]. When G is a digraph, a canonical ordering \(\chi \) of G is called an upward canonical ordering if for every edge (uv) of G, vertex u precedes vertex v in \(\chi \). It is worth observing that \(\chi \) is a special st-ordering of G and hence a particular linear extension of the partial order defined by the edges of G.

3 1-Bend Upward Planar Drawings

Overview In this section, we first describe a constructive algorithm to compute 1-bend upward planar drawings of bitonic st-graphs with maximum vertex degree \(\varDelta \) using any set of \(\varDelta \) slopes that includes the horizontal one (Theorem 1). The section is concluded by discussing some interesting implications of this result (Corollaries 1 and 2 , and Theorem 2).

An overview of our strategy to prove Theorem 1 is as follows. We first define a suitable augmentation technique for the input graph G, which leads to a triangulated planar st-graph \(\widehat{G}\) having an upward canonical ordering \(\chi \) (Lemmas 1 and 2 ). We then describe a layout algorithm that takes \(\widehat{G}\) as input and computes the desired drawing. The algorithm incrementally adds a vertex per step according to \(\chi \), while maintaining a set of geometric invariants that guarantee the desired properties of the drawing (Lemmas 37).

The Augmentation Technique Let \(G=(V,E)\) be an n-vertex planar st-graph with a bitonic st-ordering \(\sigma =(v_1,v_2,\dots ,v_n)\); see, e.g., Fig. 3a. We describe how to “transform” \(\sigma \) into an upward canonical ordering of a suitable supergraph \(\widehat{G}\) of G. We start from a result by Gronemann [27], whose properties are summarized in the following lemma; for an illustration refer to Fig. 3b.

Lemma 1

(Gronemann [27]) Let \(G=(V,E)\) be an n-vertex planar st-graph that admits a bitonic st-ordering \(\sigma =(v_1,v_2,\dots ,v_n)\). It is possible to compute in O(n) time a planar st-graph \(G'=(V',E')\) where \(V' =V \cup \{v_L, v_R\}\), \(E'\) is a superset of E that includes edge \((v_L,v_R)\), and there exists an st-ordering \(\chi =(v_L,v_R,v_1,v_2,\dots ,v_n)\) of \(G'\) such that:

  1. (i)

    vertices \(v_L\) and \(v_R\) are on the boundary of the outer face of \(G'\), and

  2. (ii)

    every vertex of G with less than two predecessors in \(\sigma \) has exactly two predecessors in \(\chi \).

We call \(G'\) a canonical augmentation of G. Observe that \(G'\) always contains the edges \((v_L,v_1)\) and \((v_R,v_1)\) because of Property (ii) of Lemma 1. We proceed by inserting the edge \((v_L,v_n)\), which is required according to our definition of planar st-graph; this addition is always possible because \(v_L\) and \(v_n\) are both on the boundary of the outer face. The next lemma shows that any planar st-graph obtained by triangulating \(G'\) admits an upward canonical ordering; for an illustration refer to Fig. 3c. We anticipate that, in order to construct a drawing of G, we will use a different set of “fake” slopes for the edges inserted by the triangulation procedure; such edges will be anyway removed at the end of the construction.

Fig. 3
figure 3

a A planar st-graph G with a bitonic st-ordering \(\sigma =(v_1,\dots ,v_8)\), b a canonical augmentation \(G'\) of G with an st-ordering \(\chi =(v_L,v_R,v_1,\dots ,v_8)\), and c a planar st-graph \(\widehat{G}\) obtained by triangulating \(G'\), such that \(\chi \) is an upward canonical ordering of \(\widehat{G}\)

Lemma 2

Let \(G'\) be a canonical augmentation of an n-vertex bitonic st-graph G and let \(\chi =(v_L,v_R,v_1,v_2,\dots ,v_n)\) be an st-ordering of \(G'\). Every triangulated planar st-graph \(\widehat{G}\) obtained by adding only edges to \(G'\) has the following properties:

  1. (a)

    graph \(\widehat{G}\) has no parallel edges, and

  2. (b)

    ordering \(\chi \) is an upward canonical ordering.

Proof

Concerning Property (a), suppose for a contradiction that \(\widehat{G}\) has two parallel edges \(e_1\) and \(e_2\) connecting u with v. Let \(\mathcal {C}\) be the 2-cycle formed by \(e_1\) and \(e_2\) and let \(V_\mathcal {C}\) be the set of vertices distinct from u and v that are inside the topological region bounded by \({\mathcal {C}}\) in the embedding of \(\widehat{G}\). Without loss of generality, we shall assume that \(\mathcal {C}\) contains no further edge connecting u and v. Set \(V_\mathcal {C}\) is not empty, as otherwise \({\mathcal {C}}\) would be a non-triangular face of \(\widehat{G}\) contradicting either the fact that \(G'\) is simple or the fact that \(\widehat{G}\) is obtained by triangulating \(G'\). Let w be the vertex with the lowest number in \(\chi \) among those in \(V_\mathcal {C}\). Since \(\widehat{G}\) is planar (in particular \(e_1\) and \(e_2\) are not crossed) and has a single source, it contains a directed path from u to every vertex in \(V_\mathcal {C}\). Hence, \(\widehat{G}\) has an edge from u to w. Also, by assumption, there is no vertex z in \(V_\mathcal {C}\) such that \(\chi (z) < \chi (w)\), which implies that either u is the only predecessor of w in \(\chi \), or u and v are the only two predecessors of w in \(\chi \). The first case contradicts Property (ii) of Lemma 1. The second case implies the existence of a sink inside \(\mathcal {C}\), which contradicts the fact that \(G'\) (and hence \(\widehat{G}\)) is an st-graph. It follows that graph \(\widehat{G}\) has no parallel edges.

Concerning Property (b), we first observe that if \(\chi \) is a canonical ordering of \(\widehat{G}\), then \(\chi \) is actually an upward canonical ordering because it is also an st-ordering. To see that \(\chi \) is a canonical ordering, observe first that vertices \(v_L\), \(v_R\) and \(v_n\) are on the boundary of the outer face of \(\widehat{G}\) by construction. In the following, we prove that \(\chi \) satisfies Conditions C.1 and C.2 of canonical ordering.

Denote by \(\widehat{G}_i\) the subgraph of \(\widehat{G}\) induced by \(v_L,v_R,v_1,\dots ,v_i\) and let \(\widehat{C}_i\) be the boundary of its outer face. We first prove by induction on i that \(\widehat{G}_i\) is 2-connected (for \(i=1,2,\dots ,n\)). In the base case \(i=1\), graph \(\widehat{G}_1\) is a 3-cycle and therefore it is 2-connected. In the case \(i>1\), graph \(\widehat{G}_{i-1}\) is 2-connected by induction and \(v_{i}\) has at least two predecessors in \(\widehat{G}_{i-1}\) by Property (ii) of Lemma 1, thus \(\widehat{G}_{i}\) is 2-connected. We now prove that for each \(i=1,2,\dots ,n\), graph \(\widehat{G}_i\) is internally triangulated, which concludes the proof of Condition C.1 of canonical ordering. Suppose, for a contradiction, that there exists an inner face f of \(\widehat{G}_i\) that is not a triangle. Since \(\widehat{G}\) is triangulated, there exists a vertex \(v_j\), with \(j > i\), that is embedded inside f in \(\widehat{G}_j\). We show that this is not possible. Namely, since \(\chi \) is an st-ordering, there is no directed path from \(v_{j}\) to any vertex of f. On the other hand, either \(v_{j}=v_n\) holds or there is a directed path from \(v_{j}\) to \(v_n\). Both cases contradict the fact that \(v_n\) belongs to the boundary of the outer face of \(\widehat{G}\).

It remains to prove Condition C.2. Since we already proved that \(\widehat{G}_{i}\) is triangulated, it suffices to show that \(v_{i}\) belongs to \(\widehat{C}_{i}\), for \(i=2,\dots ,n\). By the planarity of \(\widehat{G}_i\), there is a face f in \(\widehat{G}_{i-1}\) such that all the neighbors of \(v_{i}\) in \(\widehat{G}_{i-1}\) belong to the boundary of f. Such a face is the outer face of \(\widehat{G}_{i}\). Indeed, if f were an inner face, then \(v_{i}\) would be embedded inside f in \(\widehat{G}_{i}\) and, as we proved above, this is not possible. \(\square \)

The Layout Algorithm Let G be an n-vertex bitonic st-graph with maximum vertex degree \(\varDelta \); see Fig. 3a. We show that any set \(\mathcal {S}\) of \(\varDelta \) slopes that contains the horizontal slope can be used to construct a 1-bend upward planar drawing of G. The algorithm first computes a triangulated canonical augmentation \(\widehat{G}\) of G; see Fig. 3b, c. An edge is dummy if it belongs to \(\widehat{G}\) but not to G and it is real otherwise. By Lemma 2, graph \(\widehat{G}\) admits an upward canonical ordering \(\chi =(v_L,v_R,v_1,v_2,\dots ,v_n)\), where \(\chi \) is an st-ordering such that each vertex distinct from \(v_L\) and \(v_R\) has at least two predecessors. Let \(\mathcal {S}=\{\rho _1,\dots ,\rho _\varDelta \}\) be any set of \(\varDelta \) slopes, which we call real slopes. Let \(\rho ^*\) be the smallest angle between any two slopes in \(\mathcal {S}\) and let \(\varDelta ^*\) be the maximum number of dummy edges incident to a vertex of \(\widehat{G}\). For each slope \(\rho _i\) (\(1 \le i \le \varDelta )\), we introduce \(\varDelta ^*\) dummy slopes \(\delta ^i_1,\dots ,\delta ^i_{\varDelta ^*}\) such that:

$$\begin{aligned} \delta ^i_j = \rho _i + j \cdot \frac{\rho ^*}{\varDelta ^*+1}, \quad \text { for } j=1,2,\dots , \varDelta ^*. \end{aligned}$$

It follows that there are \(\varDelta ^*\) dummy slopes between any two consecutive real slopes. A ray emanating from a vertex is called real or dummy if its slope is real or dummy, respectively. We will use the real slopes to represent the real edges and the dummy slopes for the dummy edges of \(\widehat{G}\).

Fig. 4
figure 4

Illustration for Invariants I.3–I.5; real rays are dashed, dummy rays are dotted

Let \(\widehat{G}_i\) be the subgraph of \(\widehat{G}\) induced by \(v_L,v_R,v_1,v_2,\dots ,v_i\). Note that \(\widehat{G}_2\) contains a path P that is either the (non-oriented) path \(\langle v_L, v_1, v_2, v_R \rangle \) or the (non-oriented) path \(\langle v_L, v_2, v_1, v_R \rangle \). In both cases, we denote by \(\widehat{G}^-_i\) the digraph obtained from \(\widehat{G}_i\) by removing all the edges of \(\widehat{G}_2\) that are not part of P. The algorithm constructs a drawing \(\widehat{\varGamma }_i\) of \(\widehat{G}^-_i\) by incrementally adding the vertices according to \(\chi \), similarly as in the shift-method by de Fraysseix et al. [14] (the details about the actual construction will be given soon). Let \(\widehat{C}_i\) be the boundary of the outer face of \(\widehat{G}_i\), and let \(\widehat{P}_i\) be the path obtained by removing \((v_L,v_R)\) from \(\widehat{C}_i\). For a vertex v of \(\widehat{P}_i\), we denote by \(m^r(v,i)\) and by \(m^d(v,i)\) the number of real or dummy edges incident to v that are not in \(\widehat{G}_{i}\), respectively. We also denote by \(\overset{\curvearrowright }{\rho _{j}}(v,i)\) (resp. \(\overset{\curvearrowleft }{\rho _{j}}(v,i)\)) the j-th outer real top ray in \(\widehat{\varGamma }_{i}\) encountered in clockwise (resp. counterclockwise) order around v starting from the left (resp. right) horizontal ray. For dummy top rays, we define analogously \(\overset{\curvearrowright }{\eta _{j}}(v,i)\) and \(\overset{\curvearrowleft }{\eta _{j}}(v,i)\). Drawing \(\widehat{\varGamma }_i\), for \(i=2,4,\dots ,n-1\), will satisfy the following invariants:

  1. I.1:

    \(\widehat{\varGamma }_i\) is a 1-bend upward planar drawing whose real edges use only slopes in \(\mathcal {S}\).

  2. I.2:

    For every \(j=2,\dots ,i\), each edge of \(\widehat{P}_j\) contains a horizontal segment.

  3. I.3:

    Every vertex v of \(\widehat{P}_i\) has at least \(m^r(v,i)\) outer real top rays; see Fig. 4a.

  4. I.4:

    Every vertex v of \(\widehat{P}_i\) has at least \(m^d(v,i)\) outer dummy top rays between \(\overset{\curvearrowright }{\eta _{1}}(v,i)\) and \(\overset{\curvearrowright }{\rho _{1}}(v,i)\) including \(\overset{\curvearrowright }{\eta _{1}}(v,i)\), and at least \(m^d(v,i)\) outer dummy top rays between \(\overset{\curvearrowleft }{\eta _{1}}(v,i)\) and \(\overset{\curvearrowleft }{\rho _{1}}(v,i)\) including \(\overset{\curvearrowleft }{\eta _{1}}(v,i)\); see Fig. 4b.

  5. I.5:

    For every \(j=2,\dots ,i\), let \(\ell \) be any horizontal line and let p and \(p'\) be any two intersection points between \(\ell \) and the polyline representing \(\widehat{P}_j\) in \(\widehat{\varGamma }_{j}\). Walking along \(\ell \) from left to right, p and \(p'\) are encountered in the same order as when walking along \(\widehat{P}_j\) from \(v_L\) to \(v_R\); see Fig. 4b.

For \(i=n\), the final drawing \(\widehat{\varGamma }_{n}\), obtained after the addition of the last vertex \(v_n\) to \(\widehat{\varGamma }_{n-1}\), will only satisfy Invariant I.1.

The next two lemmas state important properties of any 1-bend upward planar drawing satisfying Invariants I.1–I.5.

Lemma 3

Let \(\widehat{\varGamma }_i\) be a drawing of \(\widehat{G}^-_i\) that satisfies Invariants I.1–I.5. Let (uv) be any edge of \(\widehat{P}_i\) such that u is encountered before v along \(\widehat{P}_i\) when going from \(v_L\) to \(v_R\), and let \(\lambda \) be a positive number. There exists a drawing \(\widehat{\varGamma }'_i\) of \(\widehat{G}^-_i\) that satisfies Invariants I.1–I.5 and such that:

  1. (i)

    the horizontal distance between u and v is increased by \(\lambda \), and

  2. (ii)

    the horizontal distance between any two other consecutive vertices along \(\widehat{P}_i\) is the same as in \(\widehat{\varGamma }_i\).

Proof

We prove by induction on i that there exists a cut \((L_i(u,v),R_i(u,v))\) in \(\widehat{\varGamma }_i\) with the following two properties; see Fig. 5a for an illustration: (P.1) the vertices of the subpath of \(\widehat{P}_{i}\) from \(v_L\) to u belong to \(L_i(u,v)\), while the vertices of the subpath of \(\widehat{P}_{i}\) from v to \(v_R\) belong to \(R_i(u,v)\), and (P.2) every edge that crosses the cut has a horizontal segment.

Fig. 5
figure 5

Illustration for Lemma 3: a Properties (P.1) and (P.2). b The case in which \(\langle u_1, u_2,\dots , u_q \rangle \) all belong to \(L_{i-1}(u,v)\). c The case in which (uv) does not belong to \(\widehat{P}_{i-1}\) and it coincides with \((u_1,v_i)\)

When \(i=2\), Property (P.1) clearly holds and (P.2) follows from Invariant I.2. Assume that Properties (P.1) and (P.2) hold for \(\widehat{\varGamma }_{i-1}\) by induction (\(i > 2\)). Let \(u_1,u_2,\dots ,u_q\) be the neighbors of \(v_i\) in \(\widehat{P}_{i-1}\); observe that \(\widehat{P}_i\) is obtained from \(\widehat{P}_{i-1}\) by replacing the subpath \(\langle u_1, u_2,\dots , u_q \rangle \) with \(\langle u_1, v_i, u_q \rangle \). Consider an edge (uv) of \(\widehat{P}_{i}\). If (uv) also belongs to \(\widehat{P}_{i-1}\), then \(\langle u_1, u_2,\dots , u_q \rangle \) all belong to either \(L_{i-1}(u,v)\) or to \(R_{i-1}(u,v)\), say to \(L_{i-1}(u,v)\); see also Fig. 5b. This implies that the cut \((L_{i}(u,v),R_i(u,v))\) with \(L_{i}(u,v)=L_{i-1}(u,v) \cup \{v_i\}\) and \(R_i(u,v)=R_{i-1}(u,v)\) satisfies Property (P.1), while (P.2) holds by induction (because the edges that cross the cut are the same as in \(\widehat{\varGamma }_{i-1}\)). If (uv) does not belong to \(\widehat{P}_{i-1}\), then (uv) is either \((u_1,v_i)\) or \((v_i,u_q)\); see Fig. 5c. Suppose it is \((u_1,v_i)\) (the other case is similar). Consider the cut \((L_{i-1}(u_1,u_2),R_{i-1}(u_1,u_2))\). The cut \((L_{i}(u,v),R_i(u,v))\) with \(L_{i}(u,v)=L_{i-1}(u_1,u_2)\) and \(R_i(u,v)=R_{i-1}(u_1,u_2) \cup \{v_i\}\) satisfies Property (P.1). On the other hand, there is a face of \(\widehat{\varGamma }_{i}\) that contains both \((u_1,u_2)\) and \((u_1,v_i)\). Thus there exists a cut that is crossed by the edges that cross the cut \((L_{i-1}(u_1,u_2)\), \(R_{i-1}(u_1,u_2))\) and by edge \((u_1,v_i)\). The edges in the first set have a horizontal segment by induction, while edge \((u_1,v_i)\) contains a horizontal segment by Invariant I.2. Hence (P.2) holds.

We construct the drawing \(\widehat{\varGamma }'_i\) from \(\widehat{\varGamma }_i\) by increasing the length of the edges that cross the cut \((L_i(u,v),R_i(u,v))\) by \(\lambda \) units. In other words, we increase by \(\lambda \) units the x-coordinate of all vertices in \(R_i(u,v)\) without changing the y-coordinate of any vertex. It is immediate to verify that \(\widehat{\varGamma }'_{i}\) is a 1-bend upward drawing whose real edges use only slopes in \(\mathcal {S}\) and that \(\widehat{\varGamma }'_{i}\) satisfies Invariants I.2–I.4.

In order to show that Invariant I.1 holds for \(\widehat{\varGamma }'_{i}\), it remains to prove that \(\widehat{\varGamma }'_{i}\) is planar, that is, the operation of translating the subdrawing induced by \(R_i(u,v)\) does not violate planarity. Suppose for a contradiction that \(\widehat{\varGamma }'_{i}\) is not planar. Then there exist two non-adjacent edges \(e_L\) and \(e_R\) of \(\widehat{P}_i\) that intersect in a point p. Since \(e_L\) and \(e_R\) did not cross in \(\widehat{\varGamma }_i\), point p belongs to only one of the two edges in \(\widehat{\varGamma }_i\), say \(e_L\), and there exists a point \(p'\) of \(e_R\) in \(\widehat{\varGamma }_{i}\) that has been translated to p when transforming \(\widehat{\varGamma }_i\) into \(\widehat{\varGamma }'_i\). This means that \(p'\) is encountered before p when walking from left to right along the horizontal line \(\ell \) passing through p and \(p'\). Since \(p'\) has been translated and p has not, point \(p'\) belongs to the subpath of \(\widehat{P}_i\) that goes from v to \(v_R\), while p belongs to the subpath of \(\widehat{P}_i\) from \(v_L\) to v. In other words, when walking along \(\widehat{P}_i\) from \(v_L\) to \(v_R\), p is encountered before \(p'\). But this contradicts Invariant I.5 for \(\widehat{\varGamma }_i\), which means that \(\widehat{\varGamma }'_{i}\) is in fact planar.

We finally prove that Invariant I.5 holds for \(\widehat{\varGamma }'_{i}\). Let \(\ell \) be any horizontal line and let p and \(p'\) be any two intersection points between \(\ell \) and the polyline representing \(\widehat{P}_i\) in \(\widehat{\varGamma }_{i}\), with p to the left of \(p'\) along \(\ell \). If, in \(\widehat{\varGamma }'_{i}\), the order of p and \(p'\) along \(\ell \) is reversed or p and \(p'\) coincide, then p has been translated while \(p'\) has been not. On the other hand, since Invariant I.5 holds for \(\widehat{\varGamma }_{i}\), p precedes \(p'\) when walking along \(\widehat{P}_{i}\) from \(v_L\) to \(v_R\) and therefore if p is translated, \(p'\) is also translated. Thus, Invariant I.5 holds for \(\widehat{\varGamma }'_{i}\). This completes the proof of the lemma. \(\square \)

Lemma 4

Let \(\widehat{\varGamma }_i\) be a drawing of \(\widehat{G}^-_i\) that satisfies Invariants I.1–I.5. Let u be a vertex of \(\widehat{P}_i\), and let \(t_u\) be any outer top ray of u that crosses an edge of \(\widehat{G}^-_i\) in \(\widehat{\varGamma }_i\). There exists a drawing \(\widehat{\varGamma }'_i\) of \(\widehat{G}^-_i\) that satisfies Invariants I.1–I.5 in which \(t_u\) does not cross any edge of \(\widehat{G}^-_i\).

Proof

The ray \(t_u\) can cross the subpath of \(\widehat{P}_i\) from \(v_L\) to u and/or the subpath of \(\widehat{P}_i\) from u to \(v_R\). Let v and w be the vertices that are encountered before and after u along \(\widehat{P}_{i}\) when going from \(v_L\) to \(v_R\), respectively. To remove the crossing(s) it is sufficient to apply Lemma 3 to (vu) and/or to (uw) for a sufficiently large \(\lambda \); see Fig. 6a, b for an illustration. \(\square \)

Fig. 6
figure 6

Illustration for Lemma 4

We now describe our drawing algorithm starting with the computation of \(\widehat{\varGamma }_2\). Recall that \(\widehat{G}^-_2\) is either the path \(\langle v_L, v_1, v_2, v_R \rangle \) or the path \(\langle v_L, v_2, v_1, v_R \rangle \). We draw such a path along a horizontal segment. Clearly, drawing \(\widehat{\varGamma }_2\) satisfies Invariants I.1, I.2, and I.:5. Since \(m^r(v_L,2)=m^r(v_R,2)=0\), Invariant I.3 trivially holds for \(v_L\) and \(v_R\) in \(\widehat{\varGamma }_2\). Vertices \(v_1\) and \(v_2\) are connected by a real edge in \(\widehat{\varGamma }_2\) and therefore each of them has at most \(\varDelta -1\) real incident edges that are not in \(\widehat{G}_2\). Since there are \(\varDelta -1\) real top rays and they are all outer, Invariant I.3 holds also for \(v_1\) and \(v_2\) in \(\widehat{\varGamma }_2\). Finally, Invariant I.4 holds because all dummy top rays are outer. Hence, we can conclude that drawing \(\widehat{\varGamma }_2\) satisfies Invariants I.1–I.5. We can summarize this discussion as follows.

Observation 1

Drawing \(\widehat{\varGamma }_2\) satisfies Invariants I.1–I.5.

Assume now that we have constructed drawing \(\widehat{\varGamma }_{i-1}\) of \(\widehat{G}^-_{i-1}\) satisfying Invariants I.1–I.5 for some \(3 \le i < n\). Let \(u_1,\dots ,u_q\) be the neighbors of the next vertex \(v_i\) along \(\widehat{P}_{i-1}\). Let \(t_{1}\) be either \(\overset{\curvearrowleft }{\rho _{1}}(u_1,i-1)\), if \((u_1,v_i)\) is real, or \(\overset{\curvearrowleft }{\eta _{1}}(u_1,i-1)\), if \((u_1,v_i)\) is dummy. Symmetrically, let \(t_{q}\) be either \(\overset{\curvearrowright }{\rho _{1}}(u_q,i-1)\), if \((u_q,v_i)\) is real, or \(\overset{\curvearrowright }{\eta _{1}}(u_q,i-1)\), if \((u_q,v_i)\) is dummy. Let \(t_{j}\) (for \(1< j < q\)) be any outer real (resp. dummy) top ray emanating from \(u_j\), if \((u_j,v_i)\) is real (resp. dummy). By Invariants I.3 and  I.4 all such top rays exist and by Lemma 4 we can assume that none of them crosses \(\widehat{\varGamma }_{i-1}\).

Fig. 7
figure 7

a, b Application of Lemma 3 to guarantee that all the intersection points along \(\ell \) appear in the desired order, in the extreme case in which the initial order of the intersection points is reversed with respect to the desired order

Let \(\ell \) be a horizontal line above the topmost point of \(\widehat{\varGamma }_{i-1}\). For \(j=1,2,\dots ,q\), let \(p_j\) be the intersection point of \(t_{j}\) and \(\ell \). We can assume that, for \(j=1,2,\dots ,q-1\), point \(p_j\) is to the left of \(p_{j+1}\). If this is not the case, we can increase the distance between \(u_j\) and \(u_{j+1}\) so to guarantee that \(p_j\) and \(p_{j+1}\) appear in the desired order along \(\ell \); this can be done by applying Lemma 3 to each edge \((u_j,u_{j+1})\) for a suitable choice of \(\lambda \); see Fig. 7a, b for an illustration and also Fig. 8a, b for a complete running example.

Fig. 8
figure 8

Addition of vertex \(v_i\). a, b Application of Lemma 3 to guarantee that all the intersection points along \(\ell \) appear in the desired order. c Placing \(v_i\) on a point p based on the ray \(t_1\). d Application of Lemma 3 to translate each intersection point \(p_j\) to the corresponding point \(p'_j\). e Drawing of the edges incident to \(v_i\)

We will place \(v_i\) above \(\ell \) using \(q-2\) bottom rays \(b_2,b_3,\dots ,b_{q-1}\) of \(v_i\) for the segments of the edges \((u_j,v_i)\) (\(j=2,3,\dots ,q-1\)) incident to \(v_i\) such that: (i) \(b_j\) (\(1<j < q\)) is real (resp. dummy) if \((u_j,v_i)\) is real (resp. dummy), and (ii) \(b_j\) precedes \(b_{j+1}\) in the counterclockwise order around \(v_i\) starting from \(b_2\).

This choice is possible for the real rays because \(v_i\) has \(\varDelta -1\) real bottom rays and it has at least one incident real edge not in \(\widehat{G}_{i}\) (otherwise it would be a sink of G, which is not possible because \(i < n\)). Concerning the dummy rays, we have at most \(\varDelta ^*\) dummy edges incident to \(v_i\) and \(\varDelta ^*\) dummy bottom rays between any two consecutive real rays.

Consider the ray \(t_{1}\) and choose a point p to the right of \(t_{1}\) and above \(\ell \) such that placing \(v_i\) on p guarantees that the following relationship holds

$$\begin{aligned} \min _{j=1 \dots q-2}\left\{ x(p'_{j+1})-x(p'_j)\right\} > x(p_q)-x(p_1), \end{aligned}$$

where \(p'_1=p_1\) and \(p'_2,p'_3,\dots ,p'_{q-1}\) are the intersection points of the rays \(b_2,b_3,\dots ,b_{q-1}\) with the line \(\ell \); refer to Fig. 8c for an illustration.

Note that for a sufficiently large y-coordinate, point p can always be found. We now apply Lemma 3 to each of the edges \((u_1,u_2)\), \((u_2,u_3)\), \(\dots \), \((u_{q-2},u_{q-1})\), in this order, choosing \(\lambda \ge 0\) so that each \(p_j\) is translated to \(p'_j\) (for \(j=2,3,\dots ,q-1\)). We finally apply again the same procedure to \((u_{q-1},u_q)\) so that the intersection point between \(t_{q}\) and the horizontal line \(\ell _H\) passing through \(v_i\) is to the right of \(v_i\); see Fig. 8d. After this translation procedure, we can draw the edge \((u_1,v_i)\) (resp. \((u_q,v_i)\)) with a bend at the intersection point between \(t_{1}\) (resp. \(t_{q}\)) and \(\ell _H\) and therefore using the slope of \(t_{1}\) (resp. \(t_{q}\)) and the horizontal slope; see Fig. 8e. The edges \((u_j,v_i)\), for \(j=2,3,\dots ,q-1\), are drawn with a bend point at \(p_j=p'_j\) and therefore using the slopes of \(t_{j}\) and \(b_j\). In the following lemma, we formally prove that the obtained drawing \(\widehat{\varGamma }_i\) satisfies Invariants I.1–I.5.

Lemma 5

For \(i=3,4,\dots ,n-1\), drawing \(\widehat{\varGamma }_i\) satisfies Invariants I.1–I.5.

Proof

The proof is by induction on \(i \ge 3\). By Observation 1, drawing \(\widehat{\varGamma }_{i-1}\) satisfies Invariants I.1–I.5 when \(i=3\). By induction we assume that, for some \(3< i < n-1\), drawing \(\widehat{\varGamma }_{i-1}\) satisfies Invariants I.1–I.5 and in the following we prove that drawing \(\widehat{\varGamma }_i\) satisfies Invariants I.1–I.5, as well.

Invariant I.1::

By construction, each edge \((u_j,v_i)\) (\(j=1,2,\dots ,q\)) is drawn as a chain of at most two segments that use real and dummy slopes. In particular, if \((u_j,v_i)\) is real, then it uses real slopes, i.e., slopes in \(\mathcal {S}\). By the choice of \(\ell \), the bend point of \((u_j,v_i)\) has y-coordinate strictly greater than that of \(u_j\) and smaller than or equal to that of \(v_i\). Since each \((u_j,v_i)\) is oriented from \(u_j\) to \(v_i\) (as \(\chi \) is an upward canonical ordering), the drawing is upward. Concerning planarity, we first observe that \(\widehat{\varGamma }_{i-1}\) is planar and it remains planar each time we apply Lemma 3. Also, by Lemma 4 each edge \((u_j,v_i)\), for \(j=1,2,\dots ,q\), does not intersect \(\widehat{\varGamma }_{i-1}\) (except at \(u_j\)). Further, the order of the bend points along \(\ell \) guarantees that the edges incident to \(v_i\) do not cross each other.

Invariant I.2::

The invariant holds for \(\widehat{P}_{i-1}\). The only edges of \(\widehat{P}_i\) that are not in \(\widehat{P}_{i-1}\) are \((u_1,v_i)\) and \((u_q,v_i)\). For both these edges the segment incident to \(v_i\) is horizontal by construction.

Invariant I.3::

For each vertex of \(\widehat{P}_i\) distinct from \(u_1\), \(u_q\) and \(v_i\), Invariant I.3 holds by induction. Invariant I.3 also holds for \(v_i\) because \(m^r(v_i,i) \le \varDelta -1\) (as otherwise \(v_i\) would be a source of G, which is not possible because \(i>1\)) and all the real top rays of \(v_i\), which are \(\varDelta -1\), are outer. Consider now vertex \(u_1\) (a symmetric argument applies to \(u_q\)). If \((u_1,v_i)\) is real, then \(m^r(u_1,i)=m^r(u_1,i-1)-1\); in this case \(t_{1}=\overset{\curvearrowleft }{\rho _{1}}(u_1,i-1)\) and therefore all the other \(m^r(u_1,i-1)-1\) outer real top rays of \(u_1\) in \(\widehat{\varGamma }_{i-1}\) remain outer in \(\widehat{\varGamma }_{i}\). If \((u_1,v_i)\) is dummy, then \(m^r(u_1,i)=m^r(u_1,i-1)\); in this case \(t_{1}=\overset{\curvearrowleft }{\eta _{1}}(u_1,i-1)\) and therefore all the \(m^r(u_1,i-1)\) outer real top rays of \(u_1\) in \(\widehat{\varGamma }_{i-1}\) remain outer in \(\widehat{\varGamma }_{i}\).

Invariant I.4::

For each vertex of \(\widehat{P}_i\) distinct from \(u_1\), \(u_q\) and \(v_i\), Invariant I.4 holds by induction. Invariant I.4 also holds for \(v_i\) because \(m^d(v_i,i) \le \varDelta ^*\) and there are \(\varDelta ^*\) dummy top rays between \(\overset{\curvearrowright }{\eta _{1}}(v_i,i)\) and \(\overset{\curvearrowright }{\rho _{1}}(v_i,i)\) including \(\overset{\curvearrowright }{\eta _{1}}(v_i,i)\) (all the top rays of \(v_i\) are outer). Analogously, there are \(\varDelta ^*\) outer dummy top rays between \(\overset{\curvearrowleft }{\eta _{1}}(v_i,i)\) and \(\overset{\curvearrowleft }{\rho _{1}}(v_i,i)\) including \(\overset{\curvearrowleft }{\eta _{1}}(v_i,i)\). Consider now \(u_1\) (a symmetric argument applies to \(u_q\)). If \((u_1,v_i)\) is real, then \(m^d(u_1,i)=m^d(u_1,i-1)\); in this case \(t_{1}=\overset{\curvearrowleft }{\rho _{1}}(u_1,i-1)\) and there are \(\varDelta ^*\) outer dummy top rays between \(\overset{\curvearrowleft }{\eta _{1}}(u_1,i)\) and \(\overset{\curvearrowleft }{\rho _{1}}(u_1,i)\) including \(\overset{\curvearrowleft }{\eta _{1}}(u_1,i)\) (namely, all those between \(t_{1}=\overset{\curvearrowleft }{\rho _{1}}(u_1,i-1)\) and \(\overset{\curvearrowleft }{\rho _{2}}(u_1,i-1)\)). If \((u_1,v_i)\) is dummy, then \(m^d(u_1,i)=m^d(u_1,i-1)-1\); in this case \(t_{1}=\overset{\curvearrowleft }{\eta _{1}}(u_1,i-1)\) and therefore all the other \(m^d(u_1,i-1)-1\) outer dummy top rays of \(u_1\), which by induction were between \(\overset{\curvearrowleft }{\eta _{1}}(u_1,i-1)\) and \(\overset{\curvearrowleft }{\rho _{1}}(u_1,i-1)\), remain outer in \(\widehat{\varGamma }_{i}\).

Invariant I.5::

Notice that the various applications of Lemma 3 to \(\widehat{\varGamma }_{i-1}\) preserve Invariant I.5. Let p and \(p'\) be any two intersection points between a horizontal line \(\ell \) and the polyline representing \(\widehat{P}_i\) in \(\widehat{\varGamma }_{i}\), with p to the left of \(p'\) along \(\ell \). If p and \(p'\) belong to \(\widehat{P}_{i-1}\), Invariant I.5 holds by induction. If both p and \(p'\) belong to the path \(\langle u_1, v_i, u_q \rangle \), Invariant I.5 holds by construction. If p belongs to \(\widehat{P}_{i-1}\) and \(p'\) belongs to \(\langle u_1, v_i, u_q \rangle \), then p belongs to the subpath of \(\widehat{P}_{i-1}\) that goes from \(v_L\) to \(u_1\) because the subpath from \(u_q\) to \(v_R\) is completely to the right of \(t_{q}\), hence Invariant I.5 holds also in this case. If p belongs to \(\langle u_1, v_i, u_q \rangle \) and \(p'\) belongs to \(\widehat{P}_{i-1}\), the proof is symmetric.\(\square \)

We now describe how to add the last vertex \(v_n\) to the drawing \(\widehat{\varGamma }_{n-1}\) such that the obtained drawing is a 1-bend upward planar drawing \(\widehat{\varGamma }_{n}\) of \(\widehat{G}^-_n\) that uses only slopes in \(\mathcal {S}\) (recall that G is a subgraph of \(\widehat{G}^-_n\)).

Lemma 6

Graph G admits a 1-bend upward planar drawing \(\varGamma \) using only slopes in \(\mathcal {S}\).

Proof

By Lemma 5, drawing \(\widehat{\varGamma }_{n-1}\) satisfies Invariants I.1–I.5. We explain how to add the last vertex \(v_n\) to obtain a drawing that satisfies Invariant I.1. Let \(u_1,\dots ,u_q\) be the predecessors of \(v_n\) on \(\widehat{P}_{n-1}\). Notice that, in this case \(u_1=v_L\) and \(u_q=v_R\). Vertex \(v_n\) is added to the drawing similarly to all the other vertices added in the previous steps of the algorithm. The only difference is that the number of real incoming edges incident to \(v_n\) in \(\widehat{\varGamma }_{n-1}\) can be up to \(\varDelta \). If this is the case, since the real bottom rays are \(\varDelta -1\), they are not enough to draw all the real edges incident to \(v_n\). Let h be the smallest index such that \((u_h,v_n)\) is a real edge. We ignore all the dummy edges \((u_j,v_n)\), for \(j=1,2,\dots ,h-1\), and apply the construction used in the previous steps considering only \(u_h,u_{h+1},\dots ,u_q\) as predecessors of \(v_n\) (notice that such predecessors are at least two because \(v_n\) has at least two incident real edges). By ignoring these dummy edges, the segment of the real edge \((u_h,v_n)\) incident to \(v_n\) will be drawn using the left horizontal slope. Denote by \(\widehat{\varGamma }_{n}\) the resulting drawing. As in the proof of Lemma 5, we can prove that Invariant I.1 holds for \(\widehat{\varGamma }_{n}\) and therefore \(\widehat{\varGamma }_{n}\) is a 1-bend upward planar drawing whose real edges use only slopes in \(\mathcal {S}\). The drawing \(\varGamma \) of G is obtained from \(\widehat{\varGamma }_{n}\) by removing all its dummy edges and the two dummy vertices \(v_L\) and \(v_R\). \(\square \)

The next lemma establishes an upper bound for the time complexity of our algorithm. Similar ideas are used in [10], where a linear-time implementation of the algorithm by de Fraysseix et al. [14] is presented. On the other hand, differently from the result by de Fraysseix et al., the coordinates of the vertices of \(\varGamma \) may not be whole numbers and may be superpolynomial. To cope with the potential need for real numbers we adopt the real RAM model of computation, which is a standard model frequently used in computational geometry. To properly account for the cost of operations on large numbers we express the time complexity of our algorithm as a function of n and of the maximum number of bits \(b_\varGamma \) required to store the coordinates of a vertexFootnote 2.

Lemma 7

Drawing \(\varGamma \) can be computed in \(O(n \, b_\varGamma )\) time.

Proof

We first show that a straightforward implementation of our algorithm requires \(O(n^2)\) operations and hence \(O(n^2 \, b_\varGamma )\) time complexity. Indeed, a bitonic st-ordering \(\sigma \) of G can be computed in O(n) time in both the fixed [27] and the variable [7] embedding setting. The same time complexity suffices to compute a canonical augmentation \(G'\) of G by Lemma 1. A triangulated planar st-graph \(\widehat{G}\) can be obtained in O(n) time by augmenting \(G'\) as follows. For every non-triangular face f of \(G'\), let \(t_f\) be the (unique) sink in f. For each vertex u of face f different from \(t_f\) we add the edge \((u,t_f)\) inside f, unless this edge already belongs to the boundary of f. Clearly, the newly-added edges do not violate planarity and each face of the resulting digraph is triangular. By construction, for any edge (uv) added to triangulate \(G'\) there exists a directed path from u to v in \(G'\). Thus edge (uv) does not create any directed cycle and \(\widehat{G}\) has a single source (namely, vertex \(v_L\)) and a single sink (namely, vertex \(v_n\)) that are the same as in \(G'\). Therefore, the triangulated digraph \(\widehat{G}\) is a planar st-graph. The construction of \(\widehat{\varGamma }_i\) from \(\widehat{\varGamma }_{i-1}\), for \(i=3,4,\dots ,n\), requires \(O(deg(v_i))\) applications of Lemma 3, where \(deg(v_i)\) is the degree of \(v_i\) in \(\widehat{G}^-_i\). Since a straightforward implementation of the technique of Lemma 3 takes \(O(n \, b_\varGamma )\) time, and since \(\sum _{i=3}^nO(deg(v_i))=O(n)\), the overall time complexity would be \(O(n^2 \, b_\varGamma )\).

To reduce the number of operations to linear, the algorithm can be implemented to work in two phases. In the first phase, the exact coordinates of the vertices are not computed, but we only store information on the edges to reconstruct these coordinates in the second phase. More precisely, in the first phase, we consider each vertex \(v_i\) according to \(\chi \) and assign to each edge \(e=(u,v)\) that is in \(\widehat{G}^-_i\) but not in \(\widehat{G}^-_{i-1}\) two pairs of numbers (s(eu), l(eu)) and (s(ev), l(ev)). For each \(i=2,3,\dots ,n\), we aim at guaranteeing the following properties once vertex \(v_i\) has been considered:

  1. P.1:

    s(eu) (resp. s(ev)) represents the slope of the segment of e incident to u (resp. v) in \(\widehat{\varGamma }_i\).

  2. P.2:

    l(eu) (resp. l(ev)) represents the length of the segment of e incident to u (resp. v) in \(\widehat{\varGamma }_i\) if at least one of the following two conditions apply: (a) e is on the boundary of \(\widehat{P}_i\), or (b) \(s(e,u) \ne 0\) (resp. \(s(e,v) \ne 0\)), i.e., the segment does not use the horizontal slope.

For each edge \(e=(u,v)\) in \(\widehat{\varGamma }_2\), we set \(s(e,u)=s(e,v)=0\) and \(l(e,u)=l(e,v)=1\). It is immediate to verify that Properties P.1 and P.2 hold. Assume, by induction, that Properties P.1 and P.2 hold once vertex \(v_{i-1}\) has been considered and let \(v_i\) be the next vertex, for some \(i>2\). Let \(u_1,u_2,\dots ,u_q\) be the neighbors of \(v_i\) along \(\widehat{P}_{i-1}\). Consider any edge \(e_j=(u_j,v_i)\), for \(j=1,\dots ,q\). We choose the slopes for the two segments of \(e_j\) as explained above and set \(s(e_j,u_j)\) and \(s(e_j,v_i)\) accordingly (the choice of the slopes can be done in O(1) time). In order to compute \(l(e_j,u_j)\) and \(l(e_j,v_i)\), it is sufficient to compute the positions of \(u_1,u_2,\dots ,u_q\) relative to \(u_1\). This can be done in \(O(deg(v_i) \, b_\varGamma )\) time, because, by Properties P.1 and P.2, we know both the slope and the length of each edge segment along \(\widehat{P}_{i-1}\) from \(u_1\) to \(u_q\). We can then calculate, again in \(O(deg(v_i) \, b_\varGamma )\) time, the (relative coordinates of) the intersection points \(p_1,p_2,\dots ,p_q\). Afterwards, we may need to (repeatedly) apply Lemma 3. Note that the application of this lemma does not modify the slope of any edge segment, and thus it preserves Property P.1 for all the edges of \(\widehat{\varGamma }_{i-1}\). Instead, it changes the length of some horizontal segments. However, all the involved horizontal segments do not belong to \(\widehat{P}_{i}\). Finally, in order to set \(l(e_j,u_j)\) and \(l(e_j,v_i)\), it suffices to know the values of \(\lambda \) used in all the applications of Lemma 3, which can be computed by only looking at the intersection points \(p_1,p_2,\dots ,p_q\). It follows that Properties P.1 and P.2 hold.

Once \(v_n\) has been considered, we have information on all the edges of \(\widehat{\varGamma }_n=\widehat{\varGamma }\). In particular, by Properties P.1 and P.2, we know the slope and the length in \(\widehat{\varGamma }\) of all the edges that do not contain any horizontal segment. These edges form a treeFootnote 3 rooted at \(v_n\) spanning the graph obtained by removing \(v_L\) and \(v_R\) from \(\widehat{G}\). To see this, observe that, for \(j=1,2,\dots ,n-1\), each vertex \(v_j\) has been connected exactly once to a vertex \(v_z\), with \(j < z\), with an edge that does not contain any horizontal segment, as otherwise \(v_j\) would belong to the outer face of \(\widehat{\varGamma }\). Hence, \(v_z\) is the (only) parent of \(v_j\) in the spanning tree. Furthermore, vertex \(v_n\) is incident to at least one of these edges since it has degree at least three and exactly two of its edges contain a horizontal segment. Therefore, an assignment of valid coordinates to the vertices of G can be obtained through a pre-order visit of this spanning tree (recall that for all the edges of the spanning tree we know the slope and length of its two segments). Finally, all edges that contain a horizontal segment (including those that are incident to \(v_L\) and \(v_R\)) can be drawn as we know the slopes of both segments and the y-coordinate of the bend point. \(\square \)

Lemmas 6 and 7 are summarized by Theorem 1.

Theorem 1

Let \(\mathcal {S}\) be any set of \(\varDelta \ge 2\) slopes including the horizontal slope and let G be an n-vertex bitonic planar st-graph with maximum vertex degree \(\varDelta \). Graph G has a 1-bend upward planar drawing \(\varGamma \) using only slopes in \(\mathcal {S}\), which can be computed in \(O(n \, b_\varGamma )\) time.

Fig. 9
figure 9

a A graph that requires \(\varDelta \) slopes and angular resolution at most \(\frac{\pi }{\varDelta }\) in every 1-bend upward planar drawing. b Illustration for the proof of Theorem 2

Implications and Extensions We now discuss some consequences of Theorem 1. We start with Corollary 1, which follows from Theorem 1 and from a result in [19].

Corollary 1

Every bitonic st-graph with maximum vertex degree \(\varDelta \ge 2\) has 1-bend upward planar slope number at most \(\varDelta \), which is worst-case optimal.

Proof

Every bitonic st-graph has 1-bend upward planar slope number at most \(\varDelta \) by Theorem 1. Also, for every \(\varDelta \ge 2\) there is a bitonic st-graph (shown in Fig. 9a) that requires at least \(\varDelta \) slopes in any 1-bend upward planar drawing [19]. \(\square \)

If \(\mathcal {S}\) is equispaced, Theorem 1 implies a lower bound of \(\frac{\pi }{\varDelta }\) on the angular resolution of the computed drawing, which is worst-case optimal [19]. Furthermore, we observe that an upward drawing constructed by the algorithm of Theorem 1 can be transformed into a strictly upward drawing that uses \(\varDelta +1\) slopes rather than \(\varDelta \). It suffices to replace every horizontal segment oriented from its leftmost (rightmost) endpoint to its rightmost (leftmost) one with a segment having slope \(\varepsilon \) (\(-\varepsilon \)), for a sufficiently small value of \(\varepsilon >0\). Thus, the next corollary follows.

Corollary 2

Every bitonic st-graph with maximum vertex degree \(\varDelta \ge 2\) has 1-bend strictly upward planar slope number at most \(\varDelta +1\).

Finally, Theorem 1 can be extended to planar st-graphs with \(\varDelta \le 3\), as any such digraph can be made bitonic by only rerouting the edge (st).

Theorem 2

Every planar st-graph with maximum vertex degree 3 has 1-bend upward planar slope number at most 3.

Proof

Let G be a planar st-graph with maximum vertex degree 3. By Theorem 1, if G has a bitonic st-ordering, then the statement follows. If G is not bitonic, it contains a forbidden configuration (see Sect. 2). Recall that a forbidden configuration consists of at least three outgoing edges incident to the same vertex. Since the only vertex of G with three outgoing edges is the source vertex s of G, it follows that G contains exactly one forbidden configuration, which involves s and the edge (st). We can remove this forbidden configuration by mirroring the embedding of the subgraph obtained by removing (st) from G (see Fig. 9b for an illustration). \(\square \)

4 2-Bend Upward Planar Drawings

We now extend the result of Theorem 1 to non-bitonic planar st-graphs. Let G be an n-vertex non-bitonic planar st-graph. It is known that all forbidden configurations of G can be eliminated in linear time by subdividing at most \(n-3\) edges of G [27]. Let \(G_b\) be the resulting bitonic st-graph, called a bitonic subdivision of G. Let \(\langle u,d,v \rangle \) be a directed path of \(G_b\) obtained by subdividing the edge (uv) of G with the dummy vertex d. We call (ud) the lower stub, and (dv) the upper stub of (uv). We prove the existence of an augmentation technique similar to that of Lemma 1, but with an additional property on the upper stubs. Note that a direct application of the algorithm of Theorem 1 to the graph in output from the next lemma would lead to a 3-bend drawing of G (by interpreting subdivision vertices as bends). Hence, the challenge will be to derive a drawing with at most 2 bends per edge (and \(4n-9\) bends in total).

Lemma 8

Let \(G=(V,E)\) be an n-vertex planar st-graph that is not bitonic. Let \(G_b=(V_b,E_b)\) be an N-vertex bitonic subdivision of G, with a bitonic st-ordering \(\sigma =(v_1,v_2,\dots ,v_N)\). It is possible to compute in O(n) time a planar st-graph \(G'=(V',E')\) where \(V' =V_b \cup \{v_L, v_R\}\), \(E'\) is a superset of \(E_b\) that includes edge \((v_L,v_R)\), and there exists an st-ordering \(\chi =(v_L,v_R,v_1,v_2,\dots ,v_N)\) of \(G'\) such that:

  1. (i)

    vertices \(v_L\) and \(v_R\) are on the boundary of the outer face of \(G'\), and

  2. (ii)

    every vertex of \(G_b\) with less than two predecessors in \(\sigma \) has exactly two predecessors in \(\chi \), and

  3. (iii)

    every vertex of \(G'\) is such that neither its leftmost nor its rightmost incoming edge is an upper stub.

Proof

We construct \(G'\) together with its embedding by adding a vertex per step according to \(\chi \). We start with the 3-cycle whose edges are \((v_L,v_R)\), \((v_L,v_1)\), and \((v_R,v_1)\) embedded so that, starting from the outer face, the edge \((v_L,v_R)\) is the first edge in the clockwise circular order of the edges around \(v_R\). Let \(G'_i\) be the plane digraph induced by \(v_L,v_R,v_1,\dots ,v_i\). The neighbors of \(v_i\) that are in \(G'_{i-1}\) all belong to the boundary of the outer face (because \(\sigma \) is an st-ordering of \(G_b\)). Thus \(v_i\) can be planarly connected to its neighbors in \(G'_{i-1}\). In order to guarantee Properties (i) and (ii) we may add dummy edges connecting \(v_i\) to some vertex of the outer face of \(G'_{i-1}\) that is not adjacent to \(v_i\) in \(G_b\).

Suppose first that \(v_i\) has only one predecessor u in \(\chi \). We claim that all the edges connecting u to vertices that are after \(v_i\) in \(\chi \) appear consecutively either in clockwise or in counterclockwise order around u starting from \((u,v_i)\) in the embedding of \(G_b\). If this were not the case, then there would exist two vertices \(v_j\) and \(v_h\), with \(i < j\) and \(i < h\), such that \(v_j\) precedes \(v_i\) and \(v_h\) follows \(v_i\) in the circular order around u. But this would imply that the vertices \(v_j\), \(v_i\) and \(v_k\) form a forbidden configuration for \(G_b\), which would contradict the fact that \(G_b\) is bitonic. If all these edges appear after \(v_i\) in clockwise (resp. counterclockwise) order, then we can add the edge \((v_i,w)\), where w is the vertex preceding (resp. following) u when walking clockwise along the boundary of \(G'_{i-1}\); see Fig. 10a for an illustration.

Fig. 10
figure 10

Addition of dummy edges to guarantee Properties (ii) and (iii) of Lemma 8. Illustration of the cases in which a \(v_i\) has a single predecessor, and b \(v_i\) has a leftmost incoming edge that is an upper stub (the squared vertex is a dummy vertex)

Suppose now that \(v_i\) has more than one predecessor in \(\chi \), but its leftmost (resp. rightmost) incoming edge \((u,v_i)\) is an upper stub. This means that u is a dummy vertex and therefore it has no successor in \(\sigma '\) other than \(v_i\). Then we can add the edge \((v_i,w)\), where w is the vertex preceding (resp. following) u when walking clockwise along the boundary of \(G'_{i-1}\); see Fig. 10b for an illustration. Since \(G'\) has O(n) vertices and edges, the above procedure can be implemented to run in O(n) time as claimed, which completes the proof of this lemma. \(\square \)

We are now ready to prove the main theorem of this section.

Theorem 3

Let \(\mathcal {S}\) be any set of \(\varDelta \ge 2\) slopes including the horizontal slope and let G be an n-vertex planar st-graph with maximum vertex degree \(\varDelta \). Graph G has a 2-bend upward planar drawing \(\varGamma \) using only slopes in \(\mathcal {S}\), which has at most \(4n-9\) bends in total and which can be computed in \(O(n \, b_\varGamma )\) time.

Proof

We compute a triangulated canonical augmentation \(\widehat{G}\) of G by applying Lemma 8 and by triangulating the resulting digraph. By Lemma 2, graph \(\widehat{G}\) has an upward canonical ordering \(\chi \). As already mentioned, a direct application of the algorithm of Theorem 1 to \(\widehat{G}\) would lead to a 3-bend drawing of G (by interpreting subdivision vertices as bends). We explain how to modify it in order to construct a drawing \(\widehat{\varGamma }\) of \(\widehat{G}\) with at most 2 bends per edge and \(4n-9\) bends in total.

Let \(v_i\) the next vertex to be added according to \(\chi \) and let \(u_1,u_2,\dots ,u_q\) its neighbors in \(\widehat{P}_{i-1}\). Suppose that \(u_j\) is a dummy vertex and that \((u_j,v_i)\) is an upper stub. To save one bend along the edge subdivided by \(u_j\), we draw \((u_j,v_i)\) without bends. By Property (iii) of Lemma 8, we have that \(1< j < q\). The ray \(t_{j}\) used to draw the segment of \((u_j,v_i)\) incident to \(u_j\) can be any outer real top ray; we choose the ray with same slope as the real bottom ray \(b_j\) used to draw the segment of \((u_j,v_i)\) incident to \(v_i\); see Fig. 11. This is possible because all real top rays of \(u_j\) are outer (since \((u_j,v_i)\) is the only real outgoing edge of \(u_j\)). Hence, edge \((u_j,v_i)\) has no bends.

Fig. 11
figure 11

Illustration for the proof of Theorem 3: Vertices \(u_2\) and \(u_3\) correspond to dummy vertices; thus, the edges \((u_2,v_i)\) and \((u_3,v_i)\) are drawn bendless

The drawing \(\varGamma \) of G is obtained from \(\widehat{\varGamma }\) by removing dummy edges and by replacing dummy vertices (except \(v_L\) and \(v_R\), which are removed) with bends. Since the upper stubs of subdivided edges have zero bends, each edge of \(\varGamma \) has at most 2 bends. Since, in the worst case, each edge in \(\varGamma \) can have at least one bend, the total number of bends is upper bounded by the total number of edges of G (which is at most \(3n-6\)) plus the corresponding number of edges with exactly two bends (which is at most \(n-3\)). Hence, in total \(\varGamma \) has at most \(4n-9\) bends, as desired.

To complete the proof, we remark that, by Lemma 8, graph \(\widehat{G}\) can be computed in O(n) time and the modified drawing algorithm still runs in time \((n \, b_\varGamma )\). Hence, the proof of the theorem follows. \(\square \)

A planar st-graph with a source or a sink of degree \(\varDelta \) requires at least \(\varDelta -1\) slopes in any upward planar drawing; thus the gap with Theorem 3 is one unit. Similarly to Theorem 1, Theorem 3 implies a lower bound of \(\frac{\pi }{\varDelta }\) on the angular resolution of \(\varGamma \); an upper bound of \(\frac{\pi }{\varDelta -1}\) can be proven with the same digraph used for the lower bound on the slope number.

The next theorem extends the result of Theorem 3 to every upward planar graph using one additional slope.

Theorem 4

Let \(\mathcal {S}\) be any set of \(\varDelta +1\) slopes including the horizontal slope and let G be an upward planar graph with maximum vertex degree \(\varDelta \ge 2\). Graph G has a 2-bend upward planar drawing using only slopes in \(\mathcal {S}\).

Proof

Since G is upward planar, it is possible to augment G with dummy edges to a planar st-graph \(G_{st}\); see, e.g., [16]. Let \(\varDelta _{st}\) be the maximum vertex degree of \(G_{st}\). If we apply the algorithm of Theorem 3 to \(G_{st}\), we obtain a 2-bend upward planar drawing using any set of \(\varDelta _{st}\) slopes including the horizontal one. However, it is not immediate to augment G so that \(\varDelta _{st} \le \varDelta +1\). On the other hand, the algorithm can be applied so to draw the dummy edges of \(G_{st}\) using dummy slopes. In this case we should take into account the fact that a vertex v that is a source (resp. a sink) in G and not in \(G_{st}\) may have \(\varDelta \) outgoing (resp. incoming) real edges. To cope with this issue it suffices to use any set of \(\varDelta +1\) real slopes that includes the horizontal one. \(\square \)

Similarly to Corollary 2, we can observe that any non-strictly upward drawing obtained by applying either Theorem 3 or Theorem 4 can be made strict by replacing the horizontal segments with nearly horizontal ones of the same slope. Hence, we conclude with the following corollary.

Corollary 3

The 2-bend strictly upward planar slope number of an upward planar graph G with maximum vertex degree \(\varDelta \ge 2\) is at most \(\varDelta +1\) if G is a planar st-graph, and it is at most \(\varDelta +2\) otherwise.

5 Conclusions and Open Problems

In this paper we extended the study of universal sets of slopes to upward planar drawings, and presented the first constructive technique that works for all planar st-graphs. One of the main ingredients of our algorithms was the recently introduced bitonic st-ordering. Using this new approach, we proved that any set \(\mathcal {S}\) of \(\varDelta \) slopes containing the horizontal is universal for 1-bend upward planar drawings of planar st-graphs admitting such an ordering. This result implies a tight bound for the 1-bend upward planar slope number of bitonic st-graphs and gives rise to drawings with worst-case optimal angular resolution. We then extended the technique to prove that any such \(\mathcal {S}\) is universal for 2-bend upward planar drawings of planar st-graphs.

Our research gives rise to interesting questions, among them:

  • Our technique exploits the existence of a bitonic st-ordering in order to augment the input graph to an st-planar triangulation that admits an upward canonical ordering. The upward canonical ordering is then utilized to compute the 1-bend upward planar drawing. A natural question is hence whether the existence of a bitonic st-ordering is a necessary condition to obtain an upward canonical ordering or it is only a sufficient condition.

  • More in general, the most intriguing question is whether every planar st-graph can be drawn with at most one bend per edge (or with at most two bends per edge and less than \(4n-9\) bends in total) and \(\varDelta \) slopes.

  • Moreover, it remains open whether the 2-bend upward planar slope number of planar st-graphs is \(\varDelta \) or \(\varDelta -1\).

  • Our drawing technique produces drawings with large area, possibly super-polynomial; it would be interesting to derive lower bounds for the area requirement of 1-bend upward planar drawings with few slopes and good angular resolution.

  • Finally, the study of the 0-bend upward planar slope number of upward planar digraphs is also a challenging research direction.