A Sublinear Bound on the Page Number of Upward Planar Graphs

The page number of a directed acyclic graph $G$ is the minimum $k$ for which there is a topological ordering of $G$ and a $k$-coloring of the edges such that no two edges of the same color cross, i.e., have alternating endpoints along the topological ordering. We address the long-standing open problem asking for the largest page number among all upward planar graphs. We improve the best known lower bound to $5$ and present the first asymptotic improvement over the trivial $O(n)$ upper bound, where $n$ denotes the number of vertices in $G$. Specifically, we first prove that the page number of every upward planar graph is bounded in terms of its width, as well as its height. We then combine both approaches to show that every $n$-vertex upward planar graph has page number $O(n^{2/3} \log(n)^{2/3})$.


Introduction
In an upward planar drawing of a directed acyclic graph G = (V, E), every vertex v ∈ V is a point in the Euclidean plane, and every edge (u, v) ∈ E is a strictly y-monotone curve 1 with lower endpoint u and upper endpoint v that is disjoint from other points and curves, except in its endpoints. A directed acyclic graph admitting such a drawing is called upward planar.
In other words, a directed graph is upward planar if it allows a planar drawing with all edges "going strictly upwards". In Figure 1 we have an upward planar graph G on the left, while the planar directed acyclic graph G k on the right is not upward planar. In a book embedding of a directed acyclic graph G = (V, E), the vertex set V is endowed with a topological ordering <, called the spine ordering, and the edge set E is partitioned into so-called pages with the property that no page contains two edges (u 1 , v 1 ), (u 2 , v 2 ) that cross with respect to <, i.e., u 1 < u 2 < v 1 < v 2 or u 2 < u 1 < v 2 < v 1 . Then the page number pn(G) of a directed acyclic graph G is the minimum k for which it admits a book embedding with k pages. In other words, pn(G) k if the vertices can be ordered along the (horizontal) spine with all "edges going right" and there exists a k-edge coloring so that any two edges with alternating endpoints along the spine have distinct colors.
In Figure 2 we have book embeddings of the directed acyclic graphs G and G k in Figure 1 with three pages (left) and k pages (right), respectively. This shows that pn(G) 3 and pn(G k ) k. In fact, observe that G k admits only one topological ordering <, as there is a directed Hamiltonian path 1 , . . . , k , r 1 , . . . , r k in G k . As the edges ( 1 , r 1 ), . . . , ( k , r k ) * A preliminary version of this paper is published in the Proceedings of the 2022 Annual acm-siam Symposium on Discrete Algorithms (soda) [25] 1 Equivalently, straightline segments may be used [13]. k r 1 r 2 r 3 r k · · · · · · · · · · · · Figure 2 Book embeddings of the graphs in Figure 1.
are pairwise crossing w.r.t. <, it follows that pn(G k ) = k. (Recall that G k from the right of Figure 1 is not upward planar.) It is easy to see (as observed for example in [10]) that for any directed graph G we have pn(G) 2 if and only if G is a spanning subgraph of an upward planar graph with a directed Hamiltonian path. It thus follows that pn(G) = 3 for the graph G in the left of Figure 1. The page number of undirected graphs (where the spine ordering may be any vertex ordering) was introduced by Bernhart and Kainen in 1979 [8], building upon the suggested notion of Ollmann [31]. Their conjecture that the page number of planar graphs is unbounded was quickly disproven [11,20], with Yannakakis [33] giving the best upper bound of 4, which was just very recently shown to be best-possible [7,34].
Book embeddings of directed graphs were first considered by Nowakowski and Parker [29] in 1989. They introduce the page number of a poset P by considering its cover graph G(P ) and restricting the spine ordering to be a topological ordering of G(P ), or equivalently, a linear extension of P . They then ask whether posets with a planar order diagram have bounded page number -equivalently, whether upward planar and transitively reduced graphs have bounded page number. Despite significant effort on posets [1-3, 21-24, 32] and upward planar graphs [4,6,9,10,15,17,18,27,30], this question is still open. In fact, the question was not only asked for upward planar graphs but also for several subclasses thereof. Apart from planar posets, these include upward outerplanar graphs [9,30], upward planar 2-trees [16,30], and planar lattices [29]. For all these graph classes, the asymptotically best known upper bound is linear in n, the number of vertices, which can be obtained by simply putting each edge on a separate page.
In this paper, we provide the first upper bound for any upward planar graph that is sublinear in the number of vertices. Specifically, we prove that n-vertex upward planar graphs have page number O(n 2/3 log 2/3 (n)). We do so by bounding the page number of any upward planar graph first in terms of its width, then in terms of its height, and finally combining both approaches to achieve the desired bound in terms of its number of vertices. [29] (and independently Heath et al. [23]) show that directed forests have page number 1. Alzohairi and Rival [2] (see also [15]) show that series-parallel digraphs have page number 2, which was later generalized to N -free upward planar graphs by Mchedlidze and Symvonis [27].

Related Work. Nowakowski and Parker
The best known upper bounds for the page number of upward planar graphs are due to Frati et al. [17], who prove that every n-vertex upward planar triangulation with o(n/ log n) diameter has o(n) page number and that every n-vertex upward planar triangulation has page number o(n) if that is true for those with maximum degree O( √ n). They further prove that any n-vertex upward planar triangulation has page number at most min{O(k log n), O(2 k )}, where k is the maximum page number among its 4-connected subgraphs. This bound is improved by a result by Davies [12] to O(k log k). According to the authors of [17] "Determining whether every n-vertex upward planar DAG has o(n) page number [. . . ] remains among the most important problems in the theory of linear graph layouts." For lower bounds, Nowakowski and Parker [29] present a planar poset with page number 3, while Hung [24] presents a planar poset with page number 4. For general upward planar graphs one can also easily derive the same lower bound of 4 from one of the undirected planar graphs of page number 4 [7,34]. As nothing better is known here, we also present in this paper upward planar graphs with page number at least 5.

Preliminaries.
We denote the directed reachability of a vertex v from another vertex u in a directed acyclic graph G by u ≺ G v (omitting the index if it is clear from the context), and write u v if u ≺ v or u = v. This way we obtain the reachability poset P G = (V, ≺) of G as the vertices of G partially ordered by their directed reachability. Transferring these notions from posets to directed acyclic graphs, we say that u and v are comparable if u v or v u; otherwise u and v are incomparable. Consequently, the height h(G) and width w(G) of a directed acyclic graph G is the largest number of pairwise comparable, respectively incomparable, vertices in G. Equivalently, h(G) is the number of vertices in a longest directed path in G, while w(G) is the largest number of vertices in G with no directed reachabilities among them. See the left and middle of Figure 1 for some example. Let us also define for a subset X of vertices of G its height h(X) and width w(X) as the maximum number of vertices in X that are pairwise comparable, respectively incomparable, in G.
An upward planar graph G = (V, E) is an st-graph if there is a (unique) vertex s with s v for all v ∈ V and a (unique) vertex t with v t for all v ∈ V . An st-path in G is a directed path from s to t in G. In particular, the height of an st-graph is the length of a longest st-path. It is known [26] that every upward planar graph G (on at least three vertices) is a spanning subgraph of some st-graph G whose faces are all bounded by triangles. Note that this augmentation might not be unique. As pn(G) pn(G) whenever G ⊆ G, we may restrict ourselves to st-graphs when proving upper bounds on the page number of upward planar graphs in terms of their number of vertices. (Note however that this is not true when working in terms of height.) Let us also remark that if G is an st-graph, its reachability poset P G is called a planar lattice in order theory [5].
A notion closely related to the page number is the twist number tn(G), which is defined as the smallest k for which there exists a topological ordering < of G with no (k + 1)-twist, i.e., no k + 1 edges that are pairwise crossing w.r.t. <. Clearly, tn(G) pn(G), as the k edges of a k-twist must be assigned to pairwise distinct pages. Indeed, having already decided on a spine ordering with no (k + 1)-twist, assigning the edges to pages is equivalent to coloring the vertices of a corresponding circle graph H with no (k + 1)-clique. Since circle graphs are χ-bounded [19], one can actually bound the number of pages in terms of the largest twist size. The currently best result due to Davies [12] states that χ(H) 2ω(H) log 2 ω(H) + 2ω(H) log 2 log 2 ω(H) + 10ω(H) 14ω(H) log 2 ω(H) for every circle graph H (where ω(H) is the clique number of H), which gives the following.

Observation 1.
For every directed acyclic graph G we have pn(G) 14 tn(G) log 2 tn(G). Moreover, the bound can be certified by a book embedding using any vertex ordering with maximum twist size tn(G).
In fact, we shall often times bound the twist number of the considered upward planar graph G and then conclude for its page number via Observation 1.
All graphs considered in this paper are directed and in most figures we omit the arrows indicating an edge's direction. If not explicitly drawn otherwise, all edges are oriented upwards.
Our Results. First, we bound the page number of upward planar graphs G in terms of their width.

Theorem 2.
Every upward planar graph G of width w has pn(G) 14w.
Then, we bound the page number of st-graphs in terms of their height. In fact, we show that tn(G) 4h(G), improving on the tn(G) O(h(G) log(n)) bound for every n-vertex st-graph G due to Frati et al. [17]. 2 Together with Observation 1 this gives the following.  Finally, we improve the best known lower bound on the maximum twist number and page number among upward planar graphs to 5.

Theorem 5.
There is an upward planar graph G with pn(G) tn(G) 5.

Bounded Width
Recall that the width w(X) of a subset X ⊆ V (G) of the vertex set of an st-graph G is the largest number of vertices in X that are pairwise incomparable in G. In this section we prove that the page number is bounded by a linear function of the width. In fact, we show a more general statement: Given a subset X ⊆ V (G), we embed all edges of G[X] in O(w(X)) pages such that the book embedding of G[X] can be extended to a book embedding of G, where G[X] denotes the subgraph of G induced by X. In particular, the vertex ordering of G[X] is a subsequence of a topological vertex ordering of G. This generalization will be used in Section 4, where we combine it with the results from Section 3. Theorem 2 will follow by setting X = V (G).
The main lemma of this section (Lemma 6) takes as input an st-graph G and a subset X ⊆ V (G) of the vertices. It describes how to assign all edges in G[X] to few pages. Additionally, the lemma constructs a new st-graph G that is used in Section 4 to handle the remaining edges, namely those with at most one endpoint in X. We construct G so that it is a supergraph of a subdivision of G. In particular, we have V (G) ⊆ V (G ) and for every two vertices u, v ∈ V (G), whenever u ≺ G v, then also u ≺ G v. Therefore every topological ordering of G (restricted to the vertex set of G) yields a topological ordering of G. Note that for some u and v, we might have u ≺ G v but u ≺ G v. These additional comparabilities restrict the possible vertex orderings, making sure that the already assigned edges remain crossing-free on their respective pages, no matter which topological ordering of G is chosen in later steps. We remark that the subdivisions are needed to introduce comparabilities between vertices that cannot be connected by an edge in an upward planar way. All edges in E(G)−E(G ) that are removed due to the subdivisions while constructing G are accounted for by Lemma 6 as well.
So consider the st-graph G and a set X ⊆ V (G). All vertices in X can be covered by a set P of st-paths, where |P| = w(X). To see this, consider the directed acyclic graph H with vertex set X and an edge from u ∈ X to v ∈ X if and only if u ≺ G v. Its reachability poset P H has width w(P H ) = w(X). By Dilworth's Theorem, P H can be decomposed into w(X) chains, i.e. subsets of pairwise comparable elements. Each of these chains can be extended to an st-path in G. Given an upward planar embedding of G, we can define what it means for two of these paths to cross: Let P, Q ∈ P be two paths and v be the last vertex on the longest shared subpath beginning at s (the case v = s is possible). Without loss of generality the next edge of P precedes the next edge of Q in the clockwise order of v's outgoing edges. We say that P and Q cross at another common vertex w if the next edge of P succeeds the next edge of Q in the clockwise order of w's outgoing edges. Note that this definition allows P and Q to have common vertices and edges, even if they do not cross. In the following we always assume P to be non-crossing, meaning there is a left-to-right ordering P 1 , . . . , P w(X) of the st-paths in P such that no two consecutive paths cross. This assumption is justified, as a crossing between two paths P and Q at vertex w can be removed by swapping their subpaths starting at w. Thus, any set of crossing paths can be made non-crossing in every upward planar embedding (see for example the blue, yellow and red path in Figure 3, which cross in the left but not in the right subfigure).
For two consecutive paths P i , P i+1 ∈ P, a lens L between P i and P i+1 is a subgraph of G enclosed by two subpaths P i ⊆ P i and P i+1 ⊆ P i+1 such that their endpoints coincide and they do not share any inner vertices. A lens L has a unique source s L and a unique sink t L with s L , t L ∈ V (P i ) ∩ V (P i+1 ) and s L ≺ G t L . As any two paths in P share the global source s and sink t, there is at least one lens between any two consecutive paths in P. Given the st-paths in P, we distinguish two kinds of edges of G[P], where G[P] is the subgraph of G induced by all vertices covered by P: We call an edge e having both endpoints contained in the same path in P an intra-path-edge (e can be an edge of the path or a transitive edge). In contrast, an inter-path-edge e has its two endpoints in two different paths in P. We note that if P i and P i+1 share some vertices and edges, it is technically possible for an edge to be an intra-path-edge and an inter-path-edge at the same time. In this case, we consider it to be an intra-path-edge. See Figure 3 for a visualization of the terminology.

Lemma 6. Let G be an st-graph and let X ⊆ V (G) be a subset of its vertices of width w. Then there is an
Proof. We start by initially setting G = G. As we go on, we add additional edges to G and subdivide existing ones. Thus at the end G is a supergraph of a subdivision of G and all reachabilities of G are maintained. All edges of G not in G (exactly the ones that are subdivided) form the set E ∆ .
As X has width w, there is a set P = {P 1 , . . . , P w } of non-crossing st-paths in G covering all vertices of X. Note that whenever we subdivide an edge on some path P ∈ P, the new subdivision vertex and its two incident edges are added to P (replacing the subdivided edge). This way, the subgraph G [P] induced by the paths in P is well-defined at every step. Let the paths be numbered such that P i is to the left of P j whenever i < j. Let P i , P i+1 ∈ P be two consecutive paths in the left-to-right ordering and let L 1 , L 2 be two lenses between them. For j = 1, 2, let s j and t j denote the source, respectively the sink, of L j . By definition, s j and t j are the only vertices bounding L j common to both P i and P i+1 . Thus we can assume without loss of generality that s 1 ≺ G t 1 G s 2 ≺ G t 2 . We conclude that in every topological ordering of G two edges from different lenses of P i , P i+1 do not cross, allowing us to deal with each lens separately and to reuse the same set of pages for all lenses between P i and P i+1 .
For a single lens L between P i and P i+1 we partition the inter-path-edges in L into − → E L (oriented from P i to P i+1 ) and ← − E L (oriented from P i+1 to P i ). From the planarity of G we obtain a bottom-to-top ordering e 1 , . . . , e of the inter-path-edges, i.e., we order them by their endpoints along P i , using the endpoints on P i+1 as a tie-breaker.
Before we actually assign the edges to pages, let us give a short overview of the strategy: We will consider the inter-path-edges in − → E L and ← − E L separately, distributing their edges (and all edges that are subdivided in the process) to six pages each. This results in a total of twelve pages for all lenses between two consecutive paths P i and P i+1 . We will finish the proof by observing that each path itself (possibly with its subdivided edges) requires just two more pages. As there are w paths, this adds up to 2w + 12(w − 1) 14w pages.
In the following we only consider the inter-path-edges in − → E L , the case for ← − E L works symmetrically. Some of these edges may be transitive in G [P]. We observe that for every transitive edge e there is a non-transitive edge f = (v j , w j ) such that e is either incident to v j and above f , or incident to w j and below f (above and below refer to the bottom-to-top ordering of the inter-path-edges). See on the left of Figure 4 for some examples of transitive and non-transitive inter-path-edges.
Let (v 1 , w 1 ), . . . , (v k , w k ) be the subset of all inter-path-edges in − → E L that are non-transitive in G [P] ordered from bottom to top. We observe that these edges form a matching, as otherwise at least one of them would be transitive. Now subdivide each e j = (v j , w j ) with j ∈ {1, . . . , k} in G and call the subdivision vertex u j . Further subdivide the edge of Figure 4 Left: Several inter-path-edges between Pi and Pi+1. Only the solid ones are non-transitive in G [P]. Right: The comparability between w j and v j was achieved by adding a w j -v j -path. To preserve that G is a planar st-graph, all intersected edges are subdivided at the intersections. Further the comparability wj+1 ≺ G vj+3 is highlighted. Note that the dashed edges may have only one endpoint in Pi or Pi+1.
outgoing from v j and the edge of P i+1 incoming to w j in G calling the subdivision vertices v j and w j , respectively. Note that while dealing with − → E L , no edge of ← − E L is subdivided (and vice versa). By upward planarity, v j ≺ G w j and thus adding a directed path from w j to v j in G (which we shall do next) maintains the acyclicity of G . Additionally we ensure that G remains a planar st-graph (and thus upward planar) with this new directed path (see the right of Figure 4): Call E w,j the set of edges incoming to w j in clockwise order between (w j , w j ) and (u j , w j ). Subdivide each edge in E w,j once and add a path from w j to u j through the subdivision vertices in clockwise order. Analogously, E v,j contains the edges outgoing from v j between (v j , u j ) and (v j , v j ) in counterclockwise order. We subdivide all edges in E v,j and extend the new path from u j to v j through all subdivision vertices in counterclockwise order. Now w j ≺ G v j , as desired. Note that E ∆ consists of all edges that were subdivided in G. This includes all inter-path-edges and additionally some intra-path-edges and those edges incident to v j or w j with only one endpoint in P.
We now assign the edges in G [P] and E ∆ to pages. Note that all edges of G [P] ∪ E ∆ are inter-path-edges or intra-path-edges as both their endpoints are in P. The edges in E v,j ∪{e j } form a star centered at v j , so they can all be assigned to the same page in any topological ordering. Further, all of these edges have v j as their lower endpoint. In an upward planar drawing of G , all edges in E v,j are inside the subregion of L enclosed by P i and P i+1 to the sides and the subdivided e j and e j+1 to the bottom and top. Thus in every topological ordering of G they end at w j+1 or earlier and thus before v j+3 (because w j+1 ≺ G w j+2 ≺ G v j+2 ≺ G v j+3 , see the red path in the right of Figure 4). Therefore the star centered at v j can be embedded on the same page as the star centered at v j+3 . Generalizing this observation, where r is the remainder of j divided by 3. With a symmetric argument all edges in E w,j can be assigned to three more pages Q r i+1,i .
The intra-path-edges are left to be embedded. Each path P ∈ P (including the added subdivision vertices) induces a planar directed Hamiltonian graph H P ⊆ G . The edges lost while subdividing can be added to H P such that it remains planar and Hamiltonian. Therefore all intra-path-edges (of G and G ) can be assigned to two further pages Q 1 i and Q 2 i in any topological ordering of G [10]. Let us recap, that we use twelve pages for the inter-path-edges between any two consecutive paths in P and two pages per path for the intra-path-edges. In total we get that 2w + 12(w − 1) 14w pages suffice for every topological ordering of G .
As mentioned above, Theorem 2 now follows as a direct corollary from Lemma 6 by choosing X = V (G). Let us remark that a more careful argumentation leads to a slightly better result. We are able to show that for every st-graph G we have pn(G) 4w(G) − 2 by using a different strategy to embed the inter-path-edges. However we were not able to show the more general statement of Lemma 6 (which we need in Section 4) with this approach and hence omit this improvement of Theorem 2 here.

Bounded Height
In this section, we prove Theorem 3, which bounds the page number of any st-graph in terms of its height. Recall that the height h(X) of a subset X ⊆ V (G) of the vertex set of an st-graph G is the largest number of vertices in X that are pairwise comparable in G.
In combination with Lemma 6 from the previous section, the following lemma is central in the proof of our sublinear bound on the page number of upward planar graphs in terms of the number of vertices. As in Lemma 6, we prove a stronger statement than Theorem 3 by considering arbitrary subsets X of vertices of the graph.

Lemma 7.
Let G be an st-graph and let X ⊆ V (G) be a subset of its vertices of height h. Then G admits a topological vertex ordering such that the size of every twist consisting of edges with at least one endpoint in X is at most 4h.
Proof. Di Battista, Tamassia, and Tollis [14] showed that for every st-graph, there is a dominance drawing: This is a planar drawing such that between any two vertices u and v, there is a path from u to v if and only if x(u) < x(v) and y(u) < y(v), where x(w) and y(w) denote the x-coordinate and y-coordinate of a vertex w, respectively (see Figure 5). Let < x and < y denote the vertex ordering that is given by increasing x-coordinates, respectively y-coordinates. We also write v > x u and v > y u instead of u < x v and u < y v, respectively. Most importantly, we observe that Now we take < x as the linear vertex ordering for G and consider a largest twist a 1 < x · · · < x a k < x b 1 < x · · · < x b k consisting of edges in G with at least one endpoint in X. That is, (a i , b i ) ∈ E(G) and we have a i ∈ X or b i ∈ X for i = 1, . . . , k. We assume for the sake of contradiction that k > 4h. By pigeonhole principle, more than k/2 of the a i 's are in X or more than k/2 of the b i 's are in X. Assume the first, the latter case works symmetrically. In the following we refer to Figure 6 (left), whereas the symmetric case is shown in Figure 6 (right). Without loss of generality, we have a 1 , . . . , a k ∈ X, where k > 2h. Consider a 1 , . . . , a k and their ordering with respect to < y . As k > 2h, by the Erdős-Szekeres theorem there exists at least one of the following: A sequence i 1 < · · · < i h+1 of indices with a i1 < y · · · < y a i h+1 .
a i2 lies in this quadrant Figure 6 The situation for the final contradiction in the proof of Lemma 7, where ai 1 >y ai 2 >y ai 3 (left), respectively bi 1 >y bi 2 >y bi 3 (right, symmetric case with b1, . . . , b k ∈ X), by Erdős-Szekeres.
A sequence i 1 < i 2 < i 3 of indices with a i1 > y a i2 > y a i3 . The first case would give together with (1) that a i1 ≺ · · · ≺ a i h+1 , i.e., h + 1 pairwise comparable vertices in X, a contradiction. Thus, we have the second case: Three vertices a i1 , a i2 , a i3 with opposing ordering with respect to < x and < y , as illustrated in Figure 6 (left). Together we have that a i2 < x a i3 < x b i1 < x b i2 and a i3 < y a i2 < y a i1 < y b i1 . On one hand, this implies with (1) that a i3 ≺ b i1 and hence there is a path P in G from a i3 to b i1 that is monotone in x-and y-coordinates, i.e., in the dominance drawing P lies entirely inside the axis-aligned rectangle R spanned by the elements a i3 and b i1 , see Figure 6 (left). On the other hand, the edge e = (a i2 , b i2 ) crosses through the rectangle R from left to right. Note that edge e indeed lies below b i1 as it does not cross the edge (a i1 , b i1 ). We conclude that edge e crosses path P , which contradicts the planarity of the drawing.
Choosing X = V (G), Lemma 7 gives a topological ordering of any st-graph G whose maximum twist size is linear in its height. Together with Observation 1, this proves Theorem 3. We remark that for X = V (G) we can strenghten the analysis above to tn(G) 2h: As all edges have both endpoints in X, we do not need to apply the pigeonhole principle to get that at least half the twisting edges have their lower (or equally their upper) endpoint in X, thus saving a factor of 2.

Bound in Terms of the Number of Vertices
In this section we combine our approaches of bounding the page number in terms of width and height and obtain the first sublinear upper bound on the page number of upward planar graphs and planar posets. We prove Theorem 4 which states that the page number of n-vertex upward planar graphs is O(n 2/3 log 2/3 (n)).

Proof of Theorem 4.
Let G be an n-vertex upward planar graph. Without loss of generality we may assume that G is an st-graph [26]. We first identify vertices that can be covered by few long directed paths and use Lemma 6 to embed the subgraph induced by these paths. We then apply Lemma 7 to the remaining vertices to find a topological ordering that admits an assignment of the remaining edges to few pages. However, as Lemma 6 introduces new directed reachabilities to the graph, we have to pick the first vertex set in a sequential way. We construct a sequence G 0 , G 1 , . . . of graphs and a sequence L 0 ⊆ L 1 ⊆ . . . of sets containing the vertices of "long" directed paths in the respective graphs, starting with G 0 = G and L 0 = ∅. We thereby ensure that V (G i ) ⊆ V (G i+1 ) and that the width of L i in G i is at most i for each i 0. Let = n 2/3 / log 1/3 (n); we use this threshold to decide which paths are considered long paths. For ease of notation, let E ∆ (i, i + 1) = E(G i ) − E(G i+1 ) denote the set of edges of G i that is removed when defining the next graph G i+1 . We write G[X] for the subgraph of G that is induced by X ∩ V (G), where X is a set of vertices of G i which may include vertices that are not in G.
Assume that G i and L i are already defined and that there is an st-path P in G i that contains at least vertices of G that are not contained in L i . We include the vertices of P in the next set L i+1 . That is, we define L i+1 = L i ∪ V (P ). Note that adding the vertex set of a directed path to a set of vertices increases the width by at most 1. Hence, the width of L i+1 in G i is at most i + 1. Now apply Lemma 6 to G i and L i+1 and obtain an st-graph G i+1 with V (G i ) ⊆ V (G i+1 ). By Lemma 6, every topological ordering of G i+1 admits an assignment of E(G i+1 [L i+1 ]) ∪ E ∆ (i, i + 1) to 14(i + 1) pages. As L i+1 can be covered by i + 1 paths in G i , the same holds in G i+1 as the reachabilities are preserved. Thus, the width of L i+1 in G i+1 is at most i + 1. We remark that Lemma 6 does not give any guarantees on the size of G i+1 . However, the number of pages the lemma uses is bounded in terms of the width, which increases only by 1 in each step.
Let t denote the largest i for which G i and L i are defined, i.e., there is no path in G t that contains at least vertices of the initial graph G that are not covered by L t . Note that t n/ = n 1/3 log 1/3 (n), because we add at least vertices of G in each round. We claim that every topological ordering of G t restricted to V (G) admits an assignment of the edges of G[L t ] to O(t 2 ) pages. To this end, fix an arbitrary topological ordering < t of G t and consider the restriction < of < t to the vertex set of G. Observe that < is a topological ordering of G as directed reachabilities in G are maintained in G t . For i = 0, . . . , t − 1, let Q i,i+1 denote the set of 14(i + 1) pages used by Lemma 6 when applied to G i . We restrict the pages to contain only edges of G. Observe that the edges in E ∆ (i, i + 1) ∩ E(G) are embedded in some page of Q i,i+1 for each i = 0, . . . , t − 1. Now, let E t denote the remaining edges of G[L t ]. Note that these edges are contained in G t [L t ] and thus are embedded in some page of Q t−1,t by Lemma 6. We conclude that the union of all Q i,i+1 covers all edges of G[L t ] with It is left to embed the set E S of edges in G that are also contained in G t and have at most one endpoint in L t , i.e., at least one endpoint in S = V (G) − L t . Note that there are two types of edges in G having exactly one endpoint in L t : First, edges that are subdivided by Lemma 6 and thus are not contained in G t . These edges are already embedded by Lemma 6.
And second, edges that are not touched by Lemma 6 and thus belong to G t . These edges, together with edges having no endpoint in L t , are handled by Lemma 7 as follows. Recall that there is no path in G t with at least vertices of G that are not contained in L t , i.e., the height of S in G t is less than . Applying Lemma 7 to S and G t yields a topological ordering < t of G t such that the edges in E S form twists of size at most 4 . By Observation 1, the same vertex ordering admits an assignment of the edges in E S to O( log( )) = O( log(n)) pages. Restricting < t to G and combining the page assignment of E S with the page assignment of G[L t ], we obtain a book embedding of G with O( log(n) + t 2 ) = O(n 2/3 log 2/3 (n)) pages (recall that = n 2/3 / log 1/3 (n) and t n/ = n 1/3 log 1/3 (n)).
In view of Lemma 7 which bounds the twist number instead of the page number, the question arises whether our bound in terms of the number of vertices can be decreased by improving this step. We also remark that by choosing = n 2/3 , we obtain that every upward planar graph admits a topological vertex ordering whose maximum twist size is O(n 2/3 ). That is, any improvement in bounding the page number of upward planar graphs in terms of their twist number also improves our result. Such an improvement, however, needs to make use of the structure of the graph and the constructed vertex ordering as Davies' result is asymptotically tight.

Lower Bound
Recall that the twist number tn(G) of a directed acyclic graph G is the maximum k for which every topological ordering of G contains k pairwise crossing edges. In this section, we construct an upward planar graph whose twist number, and therefore in particular its page number, is at least 5. This improves on the previously best known bound of an upward planar graph that requires four pages (but has twist number 3) by Hung [24]. We remark that the second author [28] improved on our upward planar graph by transforming it into a planar poset whose twist number and page number are at least 5.
We identify a structure that can lead to large twists if the spine ordering is not chosen carefully. By adding additional edges, any topological ordering of the augmented graph avoids these twists. For k 2, a k-fence (from v 1 to w k ) consists of 2k distinct vertices v 1 ≺ · · · ≺ v k and w 1 ≺ · · · ≺ w k together with the edges (w i , v i ) for each i = 1, . . . , k. The edges (w i , v i ) are called fence edges. If k is not important, we simply say fence. Figure 7 (left) shows a 4-fence. Observe that v 1 and w k are not necessarily comparable. However, we show that v 1 must preceed w k in every spine ordering that has no k-twist. By transitivity, every v v 1 must therefore also preceed every w w k . Observation 8. Every topological ordering < of a k-fence from v 1 to w k in which w k < v 1 has a k-twist. Proof. Assuming w k < v 1 , we obtain w 1 < · · · < w k < v 1 < · · · < v k as the unique topological ordering. Hence, the fence edges form a k-twist. See Figure 7 (right) for an illustration.
Given an upward planar graph G, we augment it with additional edges that indicate how to avoid the k-twists that otherwise are present in k-fences. Let k 2 and consider a k-fence from v 1 to w k in G such that v 1 ≺ w k . We add a new edge (v 1 , w k ) forcing v 1 < w k , as every topological ordering with w k < v 1 yields a k-twist (Observation 8). Since adding edges increases the set of reachabilities in G, new fences might emerge with each newly added edge. Here we consider only fences for which the fence edges (v i , w i ) for i = 1, . . . , k are edges of the original graph G, whereas the reachabilities along the two paths v 1 ≺ · · · ≺ v k and w 1 ≺ · · · ≺ w k might consist (partly) of new edges. We continue adding new edges to each current and future k-fence. This process terminates, as there is only a finite number of possible comparabilities between the unchanged number of vertices. The resulting graph is denoted by G * k and contains no k-fence from v 1 to w k with v 1 ≺ w k . Let us refer to Figure 8 for some illustrative examples. Note that even if G is upward planar, then G * k is not necessarily upward planar; possibly not planar, nor even acyclic. We emphasize that the new edges in G * k are not part of E(G), and as such, need not be assigned to any page in a book embedding. Their sole purpose is to restrict the set of possible topological orderings of G to those of G * k . Observation 8 shows that a topological ordering of G which is not a topological ordering of G * k+1 yields a (k + 1)-twist. In particular, G * k+1 being acyclic is a necessary condition for G admitting a k-page book embedding.

Corollary 9.
Every book embedding of a directed acylic graph G without a (k + 1)-twist (in particular every k-page book embedding) uses a topological ordering of G * k+1 as spine ordering.
However, using a topological ordering of G * k as a spine ordering is not sufficient to avoid k-twists; see e.g., the right of Figure 8. Quite the contrary, we find that for some small k, the augmented graph G * k might be cyclic and therefore not have any topological ordering at all. And even if G * k is acyclic, choosing any topological ordering of G * k can inescapably lead to arbitrarily large twists (which are not due to fences) even if the graph admits a book embedding with few (but more than k) pages. We shall force such a situation in our construction of an upward planar graph with twist number at least 5, which then proves Theorem 5.
For any integer n > 0, we define an n × n upward grid Grid n as follows (see Figure 9). The vertices of Grid n are the tuples ( , r) of integers with 1 , r n. The vertices are partitioned into levels, where level L h contains the vertices ( , r) with + r = h. The edge set of Grid n consists of three subsets. There are left edges of the form ( , r), ( + 1, r) for each  Based on an n × n upward grid, we define an n × n N-grid, which we denote by N n , for any integer n > 0. We shall show in this section that every n × n N-grid has a 5-twist in every topological ordering, provided n is large enough. The n × n N-grid N n contains an n × n upward grid Grid n as an induced subgraph and an additional vertex in each inner face of Grid n . The additional vertices are called N-vertices, whereas the vertices that belong to Grid n are called grid vertices. See Figure 10 for an illustration. Consider two triangles in Grid n that share a vertical edge. That is, they consist of vertices ( , r), ( + 1, r), ( , r + 1), and ( + 1, r + 1) as shown in Figure 10. If − r is even, then we insert a vertex a = a ,r into the left triangle and add edges ( , r), a , a, ( + 1, r) , and a, ( + 1, r + 1) . In addition, we insert a vertex b = b ,r together with the edges ( , r), b , ( , r + 1), b , and b, ( + 1, r + 1) into the right triangle in this case. If − r is odd, then we insert vertices c = c ,r and d = d ,r into the right, respectively left, triangle and add edges ( , r), c , c, ( , r + 1) , c, ( + 1, r + 1) , ( , r), d , ( + 1, r), d , and d, ( + 1, r + 1) . The definitions of levels and upper vertices remain as in Grid n , the N-vertices do not belong to any level. Observe that every N-grid is upward planar. Whenever we refer to an embedding of an N-grid, we assume the upward grid induced by the grid vertices to be embedded in the canonical way shown in Figure 9 and the N-vertices to be placed in the respective triangular inner faces as shown in Figure 10.
The rest of this section is devoted to proving that every topological ordering of a sufficiently large N-grid yields a 5-twist. For this, we consider the graph N * n,5 that results from augmenting N n via 5-fences as described above. By Corollary 9, every topological ordering of N n that is not a topological ordering of N * n,5 yields a 5-twist. Hence, we only need to consider topological orderings of N * n, 5 . We say that two levels L i , L j (2 i < j 2n) are separated by a topological ordering <, if for all grid vertices ( i , r i ) ∈ L i and ( j , r j ) ∈ L j we have ( i , r i ) < ( j , r j ). We write L i < L j in this case. We call a topological ordering < of an N-grid level-separating if it separates every two consecutive levels, i.e., we have L 2 < · · · < L 2n . We also say that < separates the levels of the N-grid in this case. The next lemma shows that we can assume the levels of N n to be separated if the vertex ordering is a topological ordering of N * n,5 . Lemma 10. For every n > 0, there is an n n such that for every topological ordering < of N * n ,5 we find a copy of N n ⊆ N n whose levels are separated by <. Proof. We choose n = n + 2(n − 1) and use induction on i = 1, . . . , n. For each i, we identify a set of vertices V i ⊆ V (N * n ,5 ) such that each grid vertex in V i has an outgoing edge to all its j-th upper vertices that are contained in V i for each j = 1, . . . , i. We thereby ensure V i ⊆ V i−1 for i > 1 and that V i induces a copy of N n+2(n−i) in N n . Finally we show that in N * n ,5 [V n ] every grid vertex reaches every vertex of V n in the subsequent level, and thus V n induces the desired copy of N n in N n .
For 5 ). Observe that in each N-grid, every grid vertex is adjacent to its first left upper vertex via a left edge and to its first right upper vertex via a right edge, which settles the base case. Now let i > 1 and assume that all grid vertices in V i−1 reach all j-th upper vertices also contained in V i−1 for each j i − 1. Consider the subgraph N n of N * n ,5 on the same vertex set but without the augmenting edges. To obtain V i from V i−1 , we drop all grid vertices incident to the outer face of N n [V i−1 ] and then remove all N-vertices that are now incident to the outer face. Refer to Figure 11 to see how V i lies in V i−1 . Note that every grid vertex in N n [V i ] has an incoming vertical edge and an outgoing vertical edge in N n [V i−1 ]. Also observe that V i induces an N-grid whose size is reduced by 2 in both directions compared to the N-grid N n [V i−1 ]. We next find a 5-fence from each grid vertex of V i to its i-th upper vertices in V i . Consider a grid vertex v = ( v , r v ) ∈ V i . Without loss of generality, we assume that v − r v is even. Swap left and right otherwise. Let w = ( w , r w ) ∈ V i denote the i-th right upper vertex of v (if it exists). By definition of an i-th right upper vertex, we have r w = r v + i. As the two vertices are in consecutive levels, we have v + r v = h and w + r w = h + 1, where L h is the level of ( v , r v ). It follows that w = v − i + 1. Now, consider the vertices , and See Figure 12 for an illustration. These five vertices form the lower part of the desired w3 Figure 11 An inner N-grid N n [Vi] (darkblue) inside an outer N-grid N n [Vi−1] (lightblue). Observe that the shown 5-fence has vertices w1 to v5 outside N n [Vi], but the yellow edge is inside.

Figure 12
A 5-fence from v = v1 to w = w5, where w is the second/third right upper vertex of v. The blue edges (v4, v5) and (w4, w5) exist by induction. 5-fence. Note that w 1 is not necessarily in V i but is connected to v by a vertical edge in N n [V i−1 ] and thus is contained in V i−1 (see again Figure 11, where v = v 1 ). We next observe that w 1 , . . . , w 5 are pairwise comparable. The first four vertices induce a path in N n . The edge (w 4 , w 5 ) exists in N * n ,5 [V i−1 ] by the induction hypothesis since w 5 is an (i − 1)-th upper vertex of w 4 . To see this, observe that w 4 and w 5 are in consecutive levels as ( v − i + 1 + r v + i) − ( v − 1 + r v + 1) = 1 and their r-coordinates differ by exactly i − 1.
Now, consider the vertices These five vertices serve as the upper part of the 5-fence from v to w. Again, we find that there is a path connecting the five vertices in N * n ,5 [V i−1 ]. First, the edges (v 1 , v 2 ) and (v 2 , v 3 ) exist by construction of an N-grid. The edge (v 3 , v 4 ) is a right edge in N n . We again remark that v 5 is not necessarily in V i but is connected to w via a vertical edge and thus is contained in V i−1 . We obtain the remaining edge (v 4 , v 5 ) by induction as v 5 is an (i − 1)-th right upper vertex of v 4 . Thus, we find a 5-fence from v to w using (v 1 , w 1 ), . . . , (v 5 , w 5 ) as fence edges.
The proof for the i-th left upper vertex works nearly symmetrically. In contrast to the right upper vertex, we first use the edges obtained by the induction hypothesis and then the edges of N n to find the two paths of the 5-fence.
We find a 5-fence from v to w using the vertices w 4 = a w −1,rw , and for the lower part, while the upper part is formed by the vertices We refer to Figure 13 for an illustration. Note that the coordinates of w 3 have an even difference as which means that the claimed a-and b-vertices indeed exist. The edges (w 1 , w 2 ) and (v 1 , v 2 ) exist by induction as their upper endpoints are (i − 1)-th left upper vertices of the lower endpoints. The other vertices are connected by two paths using only edges of N n . We again obtain a 5-fence using the edges (v 1 , w 1 ), . . . , (v 5 , w 5 ) as fence edges.
To conclude the proof, recall that V n induces a copy of N n in N n . Observe that in N n , no vertex has an i-th upper vertex for i > n. Thus by the induction above, we have that in N * n ,5 [V n ] every grid vertex reaches all its upper vertices that are contained in V n , i.e., all vertices of the subsequent level of N n . Therefore, the levels of N * n ,5 [V n ] are separated by every topological ordering of N * n ,5 .
Having Lemma 10, we know that we may assume the levels of an N-grid N n to be separated when we try to avoid 5-twists, i.e., when we consider topological orderings of N * n,5 . The next lemma, however, shows that separated levels imply not only 5-twists but arbitrarily large twists, finishing the proof of Theorem 5.
Lemma 11. For every p 0, there is an n such that every level-separating topological ordering < of N n yields a (p + 1)-twist. In particular, < does not admit a p-page book embedding.
Proof. Let r = p 3 + 1 and n = r + 1. We identify r triangles in N n , each of which has exactly one vertex in each of the three levels L n , L n+1 and L n+2 . Observe that each of these levels has at least r vertices. For i = 1, . . . , r, we define the triangle T i consisting of the vertices x i = (n − i, i) ∈ L n , y i = (n − i, i + 1) ∈ L n+1 , and z i = (n − i + 1, i + 1) ∈ L n+2 . See Figure 14 for an example. By our assumption we have L n < L n+1 < L n+2 .
We now define an ordering < T on the triangles and use it to find a (p + 1)-twist. We define T i < T T j if and only if x i < x j . A subsequence y i1 , . . . , y is of y 1 , . . . , y r is increasing if its ordering corresponds to < T , that is if T i1 < T · · · < T T is . Similarly, a subsequence y i1 , . . . , y is of y 1 , . . . , y r is called decreasing if their reverse ordering corresponds to < T , that is if T i1 > T · · · > T T is . Increasing and decreasing subsequences of z 1 , . . . , z r in level L n+2 are defined analogously.
We now only consider the subgraph of N n that is given by the triangles T 1 , . . . , T r . That is, a neighbor of a vertex v refers to a vertex in the same triangle as v. If there is an increasing subsequence of y 1 , . . . , y r or of z 1 , . . . , z r of length p+1, then we have a (p+1)-twist between these vertices and their neighbors in L n . Hence, the longest increasing subsequences of y 1 , . . . , y r and z 1 , . . . , z r have length at most p. By the Erdős-Szekeres theorem, there exists a decreasing subsequence y i1 , . . . , y is of y 1 , . . . , y r of length s = p 2 + 1. Again by the Erdős-Szekeres theorem, there exists a decreasing subsequence z i 1 , . . . , z i t of z i1 , . . . , z is of length t = p + 1. But then y i t < · · · < y i 1 < z i t < · · · < z i 1 form a (p + 1)-twist as L n+1 < L n+2 .
We conclude by Lemma 11 that for p = 4 and n = p 3 + 2 = 66 every level-separating topological ordering of N n contains a 5-twist. Further, by Lemma 10, there is an n n such that every topological ordering < of N * n ,5 contains a copy of N n whose levels are separated by < (i.e., n = n+2(n−1) = 192 as in the proof). Together this yields pn(N n ) tn(N n ) 5, proving Theorem 5.
Finally, we remark that N-grids have bounded page number but it is not obvious whether five pages suffice for all N-grids. However, separating the levels of N-grids works only with 5-fences, which is why new ideas are needed for any significant improvement.

Conclusions
In this paper, we improve both the lower and the upper bound on the maximum page number among upward planar graphs. Concerning the lower bound, we remark that Lemma 11 does not depend on the size of the twist to be enforced but yields arbitrarily large twists. That is, for pushing the lower bound further it suffices to find a large enough upward planar graph whose vertices can be partitioned into levels, i.e., into sets of vertices that are separated by any topological ordering with no large twist. However, it is crucial that there are edges connecting non-consecutive levels. We also expect the concept of fences to prove useful for improving the lower bound further as we only need to consider topological orderings that respect the augmented edges.
The main contribution of this paper is the first sublinear upper bound on the page number of upward planar graphs in terms of their number of vertices. We remark that when applying Lemma 6 repeatedly, many edges are embedded multiple times. In fact, we only need the edges of G [X] in the last application of the lemma, whereas we use the embedding of the edges in E ∆ in all rounds. In light of this observation, we see potential improvements in reducing the number of pages needed for E ∆ (at the expense of the number of pages needed for G [X]) or in reducing the number of applications of Lemma 6 (e.g., by covering the edges of E ∆ with Lemma 7). Both would lead to an upper bound of O( n log(n)). To improve the bound beyond that, we think that new approaches are necessary.
In addition to the sublinear upper bound, we attack the problem of bounding the page number of upward planar graphs by showing that families of upward planar graphs with bounded width or bounded height have bounded page number. However, the initial question by Nowakowski and Parker [29] whether planar posets, and more generally upward planar graphs, have bounded page number, still remains open.