2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS)

Planar Graphs have Bounded Queue-Number

Vida Dujmovic´∗, Gwenaël Joret†, Piotr Micek‡, Pat Morin§, Torsten Ueckerdt¶, David R. Wood ∗ School of Computer Science and Electrical Eng., University of Ottawa, Canada ([email protected]) † Département d’Informatique, Université Libre de Bruxelles, Brussels, Belgium ([email protected]) ‡ Faculty of Mathematics and Computer Science, Jagiellonian University, Poland ([email protected]) § School of Computer Science, Carleton University, Ottawa, Canada ([email protected]) ¶ Institute of Theoretical Informatics, Karlsruhe Institute of Technology, Germany ([email protected])  School of Mathematics, Monash University, Melbourne, Australia ([email protected])

Abstract—We show that planar graphs have bounded queue- open whether every graph has stack-number bounded by a number, thus proving a conjecture of Heath, Leighton and function of its queue-number, or whether every graph has Rosenberg from 1992. The key to the proof is a new structural queue-number bounded by a function of its stack-number tool called layered partitions, and the result that every has a vertex-partition and a layering, such that each [1,2]. part has a bounded number of vertices in each layer, and the Planar graphs are the simplest class of graphs where it is quotient graph has bounded . This result generalises unknown whether both stack and queue-number are bounded. for graphs of bounded Euler genus. Moreover, we prove that In particular, Buss and Shor [3] first proved that planar every graph in a minor-closed class has such a layered partition graphs have bounded stack-number; the best known upper if and only if the class excludes some apex graph. Building on this work and using the graph minor structure theorem, bound is 4 due to Yannakakis [4]. However, for the last we prove that every proper minor-closed class of graphs has 27 years of research on this topic, the most important open bounded queue-number. Layered partitions can be interpreted question in this field has been whether planar graphs have in terms of strong products. We show that every planar graph bounded queue-number. This question was first proposed is a subgraph of the strong product of a path with some graph by Heath, Leighton and Rosenberg [1] who conjectured of bounded treewidth. Similar statements hold for all proper minor-closed classes. that planar graphs have bounded queue-number. This paper proves this conjecture. Moreover, we generalise this result Keywords -graph theory, queue layout, queue-number, planar for graphs of bounded Euler genus, and for every proper graph, treewidth, layered partition, strong product, Euler 1 genus, graph minor, minor-closed class of graphs. First we define the stack-number and queue-number of a I. INTRODUCTION graph G. Let V (G) and E(G) respectively denote the vertex and edge set of G. Consider disjoint edges vw, xy ∈ E(G) Stacks and queues are fundamental data structures in in a linear ordering  of V (G). Without loss of generality, computer science. But what is more powerful, a stack or v ≺ w and x ≺ y and v ≺ x. Then vw and xy are a queue? In 1992, Heath, Leighton and Rosenberg [1] said to cross if v ≺ x ≺ w ≺ y and are said to nest developed a graph-theoretic formulation of this question, if v ≺ x ≺ y ≺ w.Astack (with respect to )is where they defined the graph parameters stack-number and a set of pairwise non-crossing edges, and a queue (with queue-number which respectively measure the power of respect to ) is a set of pairwise non-nested edges. Stacks stacks and queues to represent a given graph. Intuitively resemble the stack data structure in the following sense. speaking, if some class of graphs has bounded stack-number In a stack, traverse the vertex ordering left-to-right. When and unbounded queue-number, then we would consider visiting vertex v, because of the non-crossing property, if stacks to be more powerful than queues for that class (and x1,...,x are the neighbours of v to the left of v in left-to- vice versa). It is known that the stack-number of a graph d right order, then the edges x v, x −1v,...,x1v will be on may be much larger than the queue-number. For example, d d Heath, Leighton and Rosenberg [1] proved that the n-vertex 1The Euler genus of the orientable surface with h handles is 2h. The ternary has queue-number at most O(log n) Euler genus of the non-orientable surface with c cross-caps is c. The Euler 1/9− genus of a graph G is the minimum integer k such that G embeds in a and stack-number at least Ω(n ). Nevertheless, it is surface of Euler genus k. Of course, a graph is planar if and only if it has Euler genus 0; see [5] for more about graph embeddings in surfaces. Research of Dujmovic´ and Morin is supported by NSERC and the A graph H is a minor of a graph G if a graph isomorphic to H can be Ontario Ministry of Research and Innovation. Research of Joret is supported obtained from a subgraph of G by contracting edges. A class G of graphs by an ARC grant from the Wallonia-Brussels Federation of Belgium. is minor-closed if for every graph G ∈G, every minor of G is in G.A Research of Micek is partially supported by the Polish National Science minor-closed class is proper if it is not the class of all graphs. For example, Center grant (SONATA BIS 5; UMO-2015/18/E/ST6/00299). Research of for fixed g  0, the class of graphs with Euler genus at most g is a proper Wood is supported by the Australian Research Council. minor-closed class.

2575-8454/19/$31.00 ©2019 IEEE 862 DOI 10.1109/FOCS.2019.00056 top of the stack in this order. Pop these edges off the stack. Morin and Wood [18] proved that the algorithm of Bekos 2 Then if y1,...,yd are the neighbours of v to the right of et al. [15] in fact produces a O(Δ )-queue layout. This was 2 v in left-to-right order, then push vyd ,vyd−1,...,vy1 onto the state of the art prior to the current work. the stack in this order. In this way, a stack of edges with respect to a linear ordering resembles a stack data structure. A. Main Results Analogously, the non-nesting condition in the definition of a The fundamental contribution of this paper is to prove the queue implies that a queue of edges with respect to a linear conjecture of Heath, Leighton and Rosenberg [1] that planar ordering resembles a queue data structure. graphs have bounded queue-number. For an integer k  0,ak-stack layout of a graph G  Theorem 1. The queue-number of planar graphs is consists of a linear ordering of V (G) and a partition bounded. E1,E2,...,Ek of E(G) into stacks with respect to . Similarly, a k-queue layout of G consists of a linear ordering The best upper bound that we obtain for the queue-number  of V (G) and a partition E1,E2,...,Ek of E(G) into of planar graphs is 49. queues with respect to . The stack-number of G, denoted We extend Theorem 1 by showing that graphs with by sn(G), is the minimum integer k such that G has a bounded Euler genus have bounded queue-number. k-stack layout. The queue-number of a graph G, denoted Theorem 2. Every graph with Euler genus g has queue- by qn(G), is the minimum integer k such that G has a k- number at most O(g). queue layout. Note that k-stack layouts are equivalent to k-page book embeddings, and stack-number is also called We generalise further to show the following: page-number, book thickness, or fixed outer-thickness. Theorem 3. Every proper minor-closed class of graphs has As mentioned above, Heath, Leighton and Rosenberg [1] bounded queue-number. conjectured that planar graphs have bounded queue-number. This conjecture has remained open despite much research on These results are obtained through the introduction of queue layouts [1,2,6–16]. We now review progress on this a new tool, layered partitions, that have applications well conjecture. beyond queue layouts. Loosely speaking, a layered partition Pemmaraju [8] studied queue layouts and wrote that he of a graph G consists of a partition P of V (G) along with “suspects” that a particular planar graph with n vertices a layering of G, such that each part in P has a bounded has queue-number Θ(log n). The example he proposed had number of vertices in each layer (called the layered width), treewidth 3; see Section II-B for the definition of treewidth. and the quotient graph G/P has certain desirable properties, Dujmovic,´ Morin and Wood [10] proved that graphs of typically bounded treewidth. Layered partitions are the key bounded treewidth have bounded queue-number. So Pem- tool for proving the above theorems. Subsequent to the initial maraju’s example in fact has bounded queue-number. release of this paper, layered partitions and the results in The first o(n) bound on the queue-number of planar this paper have been used to solve other problems [20–23]. graphs with n vertices was proved by Heath, Leighton, and For example, our results for layered partitions were used by Rosenberg√ [1], who observed that every graph with m edges Dujmovic,´ Esperet, Joret, Walczak and Wood [23] to prove has a O( m)-queue layout using a random vertex ordering. that planar graphs have bounded nonrepetitive chromatic Thus√ every planar graph with n vertices has queue-number number, thus solving a well-known open problem. As above, O( n), which can also be proved using the Lipton-Tarjan this result generalises for any proper minor-closed class. separator theorem. Di Battista, Frati and Pach [16] proved II. TOOLS the first breakthrough on this topic, by showing that every 2 planar graph with n vertices has queue-number O(log n). In this abbreviated version of the paper, we focus on the Dujmovic´ [17] improved this bound to O(log n) with a proof for planar graphs. Omitted proofs can be found in simpler proof. Building on this work, Dujmovic,´ Morin and the full version [24]. Undefined terms and notation can be Wood [13] established (poly-)logarithmic bounds for more found in Diestel’s−→ text [25]. Throughout the paper, we use general classes of graphs. For example, they proved that the notation X to refer to a particular linear ordering of a every graph with n vertices and Euler genus g has queue- set X. number O(g +logn), and that every graph with n vertices (1) A. Layerings excluding a fixed minor has queue-number logO n. Recently, Bekos, Förster, Gronemann, Mchedlidze, Mon- The following well-known definitions are key concepts tecchiani, Raftopoulou and Ueckerdt [15] proved a second in our proofs, and that of several other papers on queue breakthrough result, by showing that planar graphs with layouts [10,11,13,15,18]. A layering of a graph G is an bounded maximum degree have bounded queue-number. In 2Wang [19] claimed to prove that planar graphs have bounded queue- particular, every planar graph with maximum degree Δ number, but despite several attempts, we have not been able to understand 6 has queue-number at most O(Δ ). Subsequently, Dujmovic,´ the claimed proof.

863 ordered partition (V0,V1,...) of V (G) such that for every [13,30], graph drawing [13,31], book embeddings [32], and edge vw ∈ E(G),ifv ∈ Vi and w ∈ Vj, then |i − j|  1. intersection graph theory [28]. The related notion of layered If i = j then vw is an intra-level edge. If |i − j| =1then has also been studied [29,31]. Most relevant to vw is an inter-level edge. If r is a vertex in a connected this paper, Dujmovic´ et al. [13] proved that every graph graph G and Vi := {v ∈ V (G):distG(r, v)=i} for with n vertices and layered treewidth k has queue-number all i  0, then (V0,V1,...) is called a BFS layering of at most O(k log n). They then proved that planar graphs G. Associated with a BFS layering is a BFS spanning have layered treewidth at most 3, that graphs of Euler genus T obtained by choosing, for each vertex v ∈ Vi with g have layered treewidth at most 2g +3, and more generally i  1, a neighbour w in Vi−1, and adding the edge vw that a minor-closed class has bounded layered treewidth 3 to T . Thus distT (r, v)=distG(r, v) for each vertex v of if and only if it excludes some apex graph. This implies G. We consider T to be rooted at r. These notions extend O(log n) bounds on the queue-number for all these graphs, O(1) to disconnected graphs. If G1,...,Gc are the components and was the basis for the log n bound for proper minor- ∈{ } of G, and rj is a vertex in Gj for j 1,...,c , and closed classes mentioned in Section I. c { ∈ }  Vi := j=1 v V (Gj):distGj (rj,v)=i for all i 0, then (V0,V1,...) is called a BFS layering of G. C. Partitions and Layered Partitions The following definitions are central notions in this paper. B. Treewidth and Layered Treewidth A vertex-partition, or simply partition, of a graph G is a set First we introduce the notion of H-decomposition P of non-empty sets of vertices in G such that each vertex and tree-decomposition. For graphs H and G,anH- of G is in exactly one element of P. Each element of P is ⊆ decomposition of G consists of a collection (Bx V (G): called a part. The quotient (sometimes called the touching x ∈ V (H)) of subsets of V (G), called bags, indexed by the pattern)ofP is the graph, denoted by G/P, with vertex set vertices of H, and with the following properties: P where distinct parts A, B ∈Pare adjacent in G/P if and { ∈ ∈ } • for every vertex v of G, the set x V (H):v Bx only if some vertex in A is adjacent in G to some vertex in induces a non-empty connected subgraph of H, and B. • for every edge vw of G, there is a vertex x ∈ V (H) A partition of G is connected if the subgraph induced ∈ for which v, w Bx. by each part is connected. In this case, the quotient is the {| | ∈ The width of such an H-decomposition is max Bx : x minor of G obtained by contracting each part into a single V (H)}−1. The elements of V (H) are called nodes, while vertex. Our results for queue layouts do not depend on the elements of V (G) are called vertices. the connectivity of partitions. But we consider it to be of A tree-decomposition is a T -decomposition for some tree independent interest that many of the partitions constructed T . The treewidth of a graph G is the minimum width of a in this paper are connected. Then the quotient is a minor of tree-decomposition of G. Treewidth measures how similar the original graph. a given graph is to a tree. It is particularly important in A partition P of a graph G is called an H-partition if H structural and algorithmic graph theory; see [26,27]. is a graph that contains a spanning subgraph isomorphic to As mentioned in Section I, Dujmovic´ et al. [10] first the quotient G/P. Alternatively, an H-partition of a graph proved that graphs of bounded treewidth have bounded G is a partition (Ax : x ∈ V (H)) of V (G) indexed by the queue-number. Their bound on the queue-number was dou- vertices of H, such that for every edge vw ∈ E(G),ifv ∈ bly exponential in the treewidth. Wiechert [6] improved this Ax and w ∈ Ay then x = y (and vw is called an intra-bag bound to singly exponential. edge) or xy ∈ E(H) (and vw is called an inter-bag edge). {| | ∈ } Lemma 4 ([6]). Every graph with treewidth k has queue- The width of such an H-partition is max Ax : x V (H) . number at most 2k − 1. Note that a layering is equivalent to a path-partition. A tree-partition is a T -partition for some tree T . Tree- Graphs with bounded treewidth provide important exam- partitions are well studied with several applications. For ples of minor-closed classes. However, planar graphs have example, every graph with treewidth k and maximum degree unbounded treewidth. For example, the n × n planar grid Δ has a tree-partition of width O(kΔ); see [33,34]. This graph has treewidth n. So the above results do not resolve easily leads to a O(kΔ) upper bound on the queue-number the question of whether planar graphs have bounded queue- [10]. However, dependence on Δ seems unavoidable when number. studying tree-partitions [33], so we instead consider H- Dujmovic´ et al. [13] and Shahrokhi [28] independently partitions where H has bounded treewidth greater than 1. introduced the following concept. The layered treewidth of A key innovation of this paper is to consider a layered a graph G is the minimum integer k such that G has a tree- variant of partitions (analogous to layered treewidth being a ∈ decomposition (Bx : x V (T )) and a layering (V0,V1,...) layered variant of treewidth). The layered width of a partition such that |Bx ∩ Vi|  k for every bag Bx and layer Vi. Applications of layered treewidth include graph colouring 3A graph G is apex if G − v is planar for some vertex v.

864 P of a graph G is the minimum integer such that for some H by an -clique Xv and replacing each edge vw of H by layering (V0,V1,...) of G, each part in P has at most a complete K, between Xv and Xw.For ∈ ∪{ ∈ } vertices in each layer Vi. each x V (T ), let Bx := Xv : v Bx . Observe that ∈ Throughout this paper we consider partitions with (Bx : x V (T )) is a tree-decomposition of H of width at bounded layered width such that the quotient has bounded most (k +1) − 1. For each vertex v of H, and layer Vi, treewidth. We therefore introduce the following definition. A there are at most vertices in Av ∩ Vi. Assign each vertex class G of graphs is said to admit bounded layered partitions in Av ∩ Vi to a distinct element of Xv. We obtain an H - if there exist k, ∈ N such that every graph G ∈Ghas a partition of G with layered width 1, and the treewidth of H partition P with layered width at most such that G/P is at most (k +1) − 1. has treewidth at most k. We first show that this property immediately implies bounded layered treewidth. D. Queue Layouts via Layered Partitions The next lemma is at the heart of all our results about Lemma 5. If a graph G has an H-partition with layered queue layouts. width at most such that H has treewidth at most k, then G has layered treewidth at most (k +1). Lemma 7. For all graphs H and G,ifH has a k-queue layout and G has an H-partition of layered width , then G Proof: Let (Bx : x ∈ V (T )) be a tree-decomposition 3 has a (3k + 2 )-queue layout. In particular, of H with bags of size at most k +1. Replace each instance   3 of a vertex v of H in a bag Bx by the part corresponding qn(G)  3 qn(H)+ 2 . to v in the H-partition. Keep the same layering of G. Since We postpone the proof of Lemma 7 until Section VI. |Bx|  k +1, we obtain a tree-decomposition of G with layered width at most (k +1). Lemmas 4 and 7 imply that a graph class that admits Lemma 5 means that any property that holds for graph bounded layered partitions has bounded queue-number. In classes with bounded layered treewidth also holds for graph particular: classes that admit bounded layered partitions. For exam- Corollary 8. If a graph G has a partition P of layered ple, Norin proved that every -vertex graph with layered n √ width such that G/P has treewidth at most k, then G has treewidth at most k has treewidth less than 2 kn (see [13]). k 3 queue-number at most 3(2 − 1) + 2 . With Lemma 5, this implies that if an n-vertex graph G has a partition with layered width such that the quotient III. PLANAR GRAPHS graph has treewidth at most k, then G has√ treewidth at Our proof that planar graphs have bounded queue-number most 2 (k +1)n. This in turn leads to O( n) balanced employs Corollary 8. Thus our goal is to show that planar separator theorems for such graphs. graphs admit bounded layered partitions, which is achieved Lemma 5 suggests that having a partition of bounded in the following key contribution of the paper. layered width, whose quotient has bounded treewidth, seems to be a more stringent requirement than having bounded Theorem 9. Every planar graph G has a connected parti- layered treewidth. Indeed the former structure leads to O(1) tion P with layered width 1 such that G/P has treewidth bounds on the queue-number, instead of O(log n) bounds at most 8. Moreover, there is such a partition for every BFS obtained via layered treewidth. That said, it is open whether layering of G. graphs of bounded layered treewidth have bounded queue- This theorem and Corollary 8 imply that planar graphs number. It is even possible that graphs of bounded layered have bounded queue-number  (Theorem 1) with an upper treewidth admit bounded layered partitions. 8 3 bound of 3(2 − 1) + 2 3 = 766. Before continuing, we show that if one does not care We now set out to prove Theorem 9. The proof is inspired about the exact treewidth bound, then it suffices to consider by the following elegant result of Pilipczuk and Siebertz [35]: partitions with layered width 1. Every planar graph G has a partition P into geodesics such Lemma 6. If a graph G has an H-partition of layered width that G/P has treewidth at most 8. Here, a geodesic is a path with respect to a layering (V0,V1,...), for some graph H of minimum length between its endpoints. We consider the of treewidth at most k, then G has an H-partition of layered following particular type of geodesic. If T is a tree rooted width 1 with respect to the same layering, for some graph at a vertex r, then a non-empty path (x0,...,xp) in T is H of treewidth at most (k +1) − 1. vertical if for some d  0 for all i ∈{0,...,p} we have distT (xi,r)=d + i. The vertex x1 is called the upper Proof: Let (Av : v ∈ V (H)) be an H-partition of G endpoint of the path and xp is its lower endpoint. Note that of layered width with respect to (V0,V1,...), for some every vertical path in a BFS spanning tree is a geodesic. graph H of treewidth at most k. Let (Bx : x ∈ V (T )) be a Thus the next theorem strengthens the result of Pilipczuk tree-decomposition of H with width at most k. Let H be and Siebertz [35]. the graph obtained from H by replacing each vertex v of

865 Theorem 10. Let T be a rooted spanning tree in a connected n = |V (G)|.Ifn =3, then G is a 3-cycle and k  3. The planar graph G. Then G has a partition P into vertical paths partition into vertical paths is P = {P1,...,Pk}. The tree- in T such that G/P has treewidth at most 8. decomposition of H consists of a single bag that contains the k  3 vertices corresponding to P1,...,P . Proof of Theorem 9 assuming Theorem 10: We may k For n>3 we wish to make use of Sperner’s Lemma assume that G is connected (since if each component of G on some 3-colouring of the vertices of G. We begin by has the desired partition, then so does G). Let T be a BFS colouring the vertices of F , as illustrated in Figure 1. There spanning tree of G. By Theorem 10, G has a partition P are three cases to consider: into vertical paths in T such that G/P has treewidth at most 1) If k =1then, since F is a cycle, P1 has at least three 8. Each path in P is connected and has at most one vertex in vertices, so P1 =[v, P1,w] for two distinct vertices v each BFS layer corresponding to T . Hence P is connected and w.WesetR1 := v, R2 := P1 and R3 := w. and has layered width 1. 2) If k =2then we may assume without loss of generality The proof of Theorem 10 is an inductive proof of a that P1 has at least two vertices so P1 =[v, P1].We stronger statement given in Lemma 11 below. A plane graph set R1 := v, R2 := P1 and R3 := P2. is a graph embedded in the plane with no crossings. A near- 3) If k ∈{3, 4, 5, 6} then we group consecutive triangulation is a plane graph, where the outer-face is a paths by taking R1 := [P1,...,P 3], R2 := simple cycle, and every internal face is a triangle. For a cycle k/ [Pk/3+1,...,P2k/3] and R3 := [P2k/3+1,...,Pk]. C, we write C =[P1,...,Pk] if P1,...,Pk are pairwise Note that in this case each Ri consists of one or two disjoint non-empty paths in C, and the endpoints of each of 1 . ∈ P ,...,Pk path Pi can be labelled xi and yi so that yixi+1 E(C) For ∈{ }, colour each vertex in by .Now,for ∈{ } i 1, 2, 3 Ri i for i 1,...,k , where xk+1 means x1. This implies that k each remaining vertex v in G, consider the path Pv from V (C)= =1 V (Pi). + i v to the root of T . Since r is on the outer-face of G , Pv + Lemma 11. Let G be a plane triangulation, let T contains a vertex of F . If the first vertex of Pv that belongs + be a spanning tree of G rooted at some vertex r on to F is in Ri then assign the colour i to v. In this way + the outer-face of G , and let P1,...,Pk for some k ∈ we obtain a 3-colouring of the vertices of G that satisfies {1, 2,...,6}, be pairwise disjoint vertical paths in T such the conditions of Sperner’s Lemma. Therefore there exists a + 1 2 3 that F =[P1,...,Pk] is a cycle in G . Let G be the near- triangular face τ = v v v of G whose vertices are coloured triangulation consisting of all the edges and vertices of G+ 1, 2, 3 respectively. ∈{ } contained in and the interior of . For each i 1, 2, 3 , let Qi be the path in T from vi F F Then G has a connected partition P into paths in G that to the first ancestor vi of vi in T that is contained in F . Observe that Q1, Q2, and Q3 are disjoint since Q consists are vertical in T , such that P1,...,Pk ∈Pand the quotient i P only of vertices coloured i. Note that Qi may consist of the H := G/ has a tree-decomposition in which every bag has size at most 9 and some bag contains all the vertices of H single vertex vi = vi. Let Qi be Qi minus its final vertex vi. Imagine for a moment that the cycle F is oriented clockwise, corresponding to P1,...,Pk. − which defines an orientation of R1, R2 and R3. Let Ri Proof of Theorem 10 assuming Lemma 11: The result be the subpath of Ri that contains v and all vertices that + i is trivial if |V (G)| < 3. Now assume |V (G)|  3. Let r be precede it, and let R be the subpath of R that contains v + i i i the root of T . Let G be a plane triangulation containing G and all vertices that succeed it. as a spanning subgraph with r on the outer-face of G. The Consider the subgraph of G that consists of the edges three vertices on the outer-face of G are vertical (singleton) and vertices of F , the edges and vertices of τ, and the + paths in T . Thus G satisfies the assumptions of Lemma 11, edges and vertices of Q1 ∪ Q2 ∪ Q3. This graph has an + which implies that G has a partition P into vertical paths outer-face, an inner face τ, and up to three more inner faces + P + − in T such that G / has treewidth at most 8. Note that F1,F2,F3 where Fi =[Q ,R ,R +1,Q +1], where we use P + P P i i i i G/ is a subgraph of G / . Hence G/ has treewidth at the convention that Q4 = Q1 and R4 = R1. Note that Fi most 8. + − may be degenerate in the sense that [Qi,Ri ,Ri+1,Qi+1] Our proof of Lemma 11 employs the following well- may consist only of a single edge vivi+1. known variation of Sperner’s Lemma (see [36]): + − Consider any non-degenerate Fi =[Qi,Ri ,Ri+1,Qi+1]. Note that these four paths are pairwise disjoint, and thus Lemma 12 (Sperner’s Lemma). Let G be a near- Fi is a cycle. If Q and Q +1 are non-empty, then each is triangulation whose vertices are (possibly improperly) i i − + a vertical path in T . Furthermore, each of R and R +1 coloured 1, 2, 3, with the outer-face F =[P1,P2,P3] where i i consists of at most two vertical paths in T . Thus, F is the each vertex in P is coloured i. Then G contains an internal i i concatenation of at most six vertical paths in T . Let G be face whose vertices are coloured 1, 2, 3. i the near-triangulation consisting of all the edges and vertices + Proof of Lemma 11: The proof is by induction on of G contained in Fi and the interior of Fi. Observe that Gi

866 r r

P4 R3 P1 R1

P3 τ

P2 R2

(a) (b) r

R3 R1 Q1 G3 τ G1 Q2

Q3

G2 R2

(c) (d)

Figure 1. The inductive proof of Lemma 11: (a) the spanning tree T and the paths P1,...,P4; (b) the paths R1, R2, R3, and the Sperner triangle τ;    (c) the paths Q1, Q2 and Q3; (d) the near-triangulations G1, G2, and G3, with the vertical paths of T on F1, F2, and F3.

contains vi and vi+1 but not the third vertex of τ. Therefore Now for each non-degenerate Fi, each path in Pi is either an Fi satisfies the conditions of the lemma and has fewer than external path (that is, fully contained in Fi)orisaninternal n vertices. So we may apply induction on Fi to obtain a path with none of its vertices in Fi. Add all the internal paths partition Pi of Gi into vertical paths in T , such that Hi := of Pi to P. By construction, P partitions V (G) into vertical P i ∈ P Gi/ i has a tree-decomposition (Bx : x V (Ji)) in which paths in T and contains P1,...,Pk. i every bag has size at most 9, and some bag Bui contains Let H := G/P. Next we exhibit the desired tree- the vertices of Hi corresponding to the at most six vertical decomposition (B : x ∈ V (J)) of H. Let J be the paths that form Fi. We do this for each non-degenerate Fi. x tree obtained from the disjoint union of Ji, taken over the We now construct the desired partition P of G. Initialise i ∈{1, 2, 3} such that Fi is non-degenarate, by adding one P { } P := P1,...,Pk . Then add each non-empty Qi to . new node u adjacent to each ui. (Recall that ui is the

867 i stronger than Theorem 13 in that the partition is connected node of Ji for which the bag Bui contains the vertices of Hi corresponding to the paths that form Fi.) Let the and the layered width is smaller. Also note that Theorem 13 bag Bu contain all the vertices of H corresponding to is tight in terms of the treewidth of H: For every , there P P1,...,Pk,Q1,Q2,Q3. For each non-degenerate Fi, and exists a planar graph G such that, if G has a partition of ∈ i P for each node x V (Ji), initialise Bx := Bx. Recall that layered width , then G/ has treewidth at least 3, see the vertices of Hi correspond to contracted paths in Pi. Each full version of the paper [24]. internal path in Pi also lies in P. Each external path P in Pi While Theorem 10 partitions the vertices of a planar graph is a subpath of Pj for some j ∈{1,...,k} or is one of the into vertical paths, to prove Theorem 13 we instead partition + paths among Q1,Q2,Q3. For each such path P , for every the vertices of a triangulation G into parts each of which is x ∈ V (J), in bag Bx, replace each instance of the vertex a union of up to three vertical paths. Formally, in a spanning of Hi corresponding to P by the vertex of H corresponding tree T of a graph G,atripod consists of up to three pairwise to the path among P1,...,Pk,Q1,...,Q3 that contains P . disjoint vertical paths in T whose lower endpoints form a This completes the description of (Bx : x ∈ V (J)).By clique in G. Theorem 13 quickly follows from the next result construction, |Bx|  9 for every x ∈ V (J). which we prove in the full version of the paper [24]. First we show that for each vertex a in H, the set Theorem 14. Let be a rooted spanning tree in a plane { ∈ ∈ } T X := x V (J):a Bx forms a subtree of J.Ifa P triangulation G. Then G has a partition into tripods in corresponds to a path distinct from P1,...,Pk,Q1,Q2,Q3 T such that G/P has treewidth at most 3. then X is fully contained in Ji for some i ∈{1, 2, 3}. Thus, by induction X is non-empty and connected in Ji,soit IV. BOUNDED-GENUS GRAPHS is in J.Ifa corresponds to P which is one of the paths As was the case for planar graphs, our proof that bounded ∈ among P1,...,Pk,Q1,Q2,Q3 then u X and whenever genus graphs have bounded queue-number employs Corol- X contains a vertex of Ji it is because some external path lary 8. Thus the goal of this section is to show that our P of i was replaced by P . In particular, we would have construction of bounded layered partitions for planar graphs ∈ ∩ ui X in that case. Again by induction each X Ji can be generalised for graphs of bounded Euler genus. is connected and since uui ∈ E(T ), we conclude that X induces a (connected) subtree of J. Theorem 15. Every graph G of Euler genus g has a con- Finally we show that, for every edge ab of H, there is a nected partition P with layered width at most max{2g, 1} P bag Bx that contains a and b.Ifa and b are both obtained by such that G/ has treewidth at most 9. Moreover, there is contracting any of P1,...,Pk,Q1,Q2,Q3, then a and b both such a partition for every BFS layering of G. ∈{ } appear in Bu.Ifa and b are both in Hi for some i 1, 2, 3 , This theorem and Corollary 8 imply that graphs of Euler then some bag Bi contains both a and b. Finally, when a x genus g have bounded queue-number (Theorem 2) with an is obtained by contracting a path Pa in Gi − V (Fi) and b is 9 3 upper bound of 3 · 2g · (2 − 1) + 2 2g = O(g). obtained by contracting a path Pb not in Gi, then the cycle Note that Theorem 15 is best possible in the following Fi separates Pa from Pb so the edge ab is not present in sense. Suppose that every graph G of Euler genus g has a ∈ H. This concludes the proof that (Bx : x V (J)) is the partition P with layered width at most such that G/P has desired tree-decomposition of H. treewidth at most k. By Lemma 5, G has layered treewidth A. Reducing the Bound O(k). Dujmovic´ et al. [13] showed that the maximum layered treewidth of graphs with Euler genus g is Θ(g). Thus We now set out to reduce the constant in Theorem 1 from k  Ω(g). 766 to 49. This is achieved by proving the following variant The next lemma is the key to the proof of Theorem 15. of Theorem 9. Many similar results are known in the literature (for example, Theorem 13. Every planar graph G has a partition P with [37, Lemma 8] or [5, Section 4.2.4]), but none prove exactly layered width 3 such that G/P is planar with treewidth at what we need. most 3. Moreover, there is such a partition for every BFS Lemma 16. Let G be a connected graph with Euler genus g. layering of G. For every BFS spanning tree T of G with corresponding BFS Theorem 13 and Lemma 7, and a result of Alam, Bekos, layering (V0,V1,...), there is a subgraph Z ⊆ G with at Gronemann, Kaufmann and Pupyrev [14], who proved that most 2g vertices in each layer Vi, such that Z is connected every planar graph with treewidth at most 3 has queue- and G − V (Z) is planar. Moreover, there is a connected + number at most 5, imply that planar graphs have bounded planar graph G containing G − V (Z) as a subgraph, and + + queue-number  (Theorem 1) with an upper bound of 3 · 3 · there is a BFS spanning tree T of G with corresponding 3 + ∩ \ 5+ 2 · 3 =49. BFS layering (W0,W1,...) of G , such that Wi (V (G) Note that Theorem 13 is stronger than Theorem 9 in V (Z)) = Vi \ V (Z) for all i  0, and P ∩ (V (G) \ V (Z)) + that the treewidth bound is smaller, whereas Theorem 9 is is a vertical path in T for every vertical path P in T .

868 Proof of Theorem 15 assuming Lemma 16: We may there are graphs G0,G1,...,Gs for some s ∈{0,...,p} assume that G is connected (since if each component of such that: G has the desired partition, then so does G). Let T be a • G − A = G0 ∪ G1 ∪···∪Gs, BFS spanning tree of G with corresponding BFS layering • G1,...,Gs are pairwise vertex-disjoint; (V0,V1,...). By Lemma 16, there is a subgraph Z ⊆ G • G0 is embedded in a surface of Euler genus at most g, with at most 2g vertices in each layer Vi, a connected planar • there are s pairwise vertex-disjoint facial cycles + graph G containing G − V (Z) as a subgraph, and a BFS F1,...,Fs of G0, and + + spanning tree T of G with corresponding BFS layering • for i ∈{1,...,s}, there is an Fi-vortex (Bx ⊆ V (Gi): (W0,W1,...), such that Wi ∩ V (G) \ V (Z)=Vi \ V (Z) x ∈ V (Fi)) of Gi of width at most k. for all i  0, and P ∩ V (G) \ V (Z) is a vertical path in T The vertices in A are called apex vertices. They can be for every vertical path P in T +. adjacent to any vertex in G. By Theorem 10, G+ has a partition P+ into vertical paths A graph is k-almost-embeddable if it is (k, k, k, k)-almost- in T + such that G+/P+ has treewidth at most 8. Let P := embeddable. + {P ∩ V (G) \ V (Z):P ∈P }∪{V (Z)}. Thus P is a Let C1 = {v1,...,vk} be a k-clique in a graph G1. Let partition of G. Since P ∩ V (G) \ V (Z) is a vertical path in C2 = {w1,...,wk} be a k-clique in a graph G2. Let G be T and Z is a connected subgraph of G, P is a connected the graph obtained from the disjoint union of G1 and G2 partition. Note that the quotient G/P is obtained from a by identifying vi and wi for i ∈{1,...,k}, and possibly + + subgraph of G /P by adding one vertex corresponding to deleting some edges in C1 (= C2). Then G is a clique-sum Z. Thus G/P has treewidth at most 9. Since P ∩ V (G) \ of G1 and G2. V (Z) is a vertical path in T , it has at most one vertex in The following graph minor structure theorem by Robert- each layer Vi. Thus each part of P has at most max{2g, 1} son and Seymour [38] is at the heart of graph minor theory. vertices in each layer V . Hence P has layered width at most i Theorem 18 ([38]). For every proper minor-closed class G, max{2g, 1}. there is a constant k such that every graph in G is obtained The same proof in conjunction with Theorem 14 instead by clique-sums of k-almost-embeddable graphs. of Theorem 10 shows the following. We now show that graphs that satisfy the ingredients of the Theorem 17. Every graph of Euler genus g has a partition graph minor structure theorem have bounded queue-number. P with layered width at most max{2g, 3} such that G/P Building on Theorem 15, we prove the following result in has treewidth at most 4. the case of no apex vertices. Note that Theorem 17 is stronger than Theorem 15 in Lemma 19. Every (g, p, k, 0)-almost embeddable graph G that the treewidth bound is smaller, whereas Theorem 15 is has a connected partition P with layered width at most stronger than Theorem 17 in that the partition is connected max{2g +4p − 4, 1} such that G/P has treewidth at most (and the layered width is smaller for g ∈{0, 1}). Both 11k +10. Theorems 15 and 17 (with Lemma 7) imply that graphs with Euler genus g have O(g) queue-number, but better constants Lemmas 7 and 19 imply the following result, where the are obtained by a more direct argument that uses Lemma 16 edges incident to each apex vertex are put in their own and Theorem 1 to circumvent the use of Theorem 15 and queue: prove that the queue-number of graphs with Euler genus g Lemma 20. Every k-almost embeddable graph has queue- is at most 4g +49. number less than 9k · 211(k+1). V. E XCLUDED MINORS Theorem 3, which says that every proper minor-closed This section first introduces the graph minor structure class has bounded queue-number, follows from Lemma 20 theorem of Robertson and Seymour, which shows that every and some general-purpose machinery of Dujmovic´ et al. [13] graph in a proper minor-closed class can be constructed for performing clique-sums. using four ingredients: graphs on surfaces, vortices, apex vertices, and clique-sums. We then use this theorem to prove A. Characterisation that every proper minor-closed class has bounded queue- Bounded layered partitions are the key structure in this pa- number (Theorem 3). per. So it is natural to ask which minor-closed classes admit Let G0 be a graph embedded in a surface Σ. Let F be bounded layered partitions. The following definition leads to a facial cycle of G0 (thought of as a subgraph of G0). An the answer to this question. A graph G is strongly (g, p, k, a)- F -vortex is an F -decomposition (Bx ⊆ V (H):x ∈ V (F )) almost-embeddable if it is (g, p, k, a)-almost-embeddable of a graph H such that V (G0 ∩H)=V (F ) and x ∈ Bx for and (using the notation in the definition of (g, p, k, a)-almost- each x ∈ V (F ).Forg, p, a, k  0, a graph G is (g, p, k, a)- embeddable) there is no edge between an apex vertex and a almost-embeddable if for some set A ⊆ V (G) with |A|  a, vertex in G0 − (G1 ∪···∪Gs). That is, each apex vertex

869 is only adjacent to other apex vertices or vertices in the Observation 22. For every graph H, a graph G has an vortices. A graph is strongly k-almost-embeddable if it is H-partition of layered width at most if and only if G is a strongly (k, k, k, k)-almost-embeddable. subgraph of H  P  K for some path P . The following is the main result of this section. See Note that a general result about the queue-number of [13,39,40] for the definition of (linear) local treewidth. strong products by Wood [44] implies that qn(H  P )  Theorem 21. The following are equivalent for a minor- 3qn(H)+1. It is easily shown that qn(QK)  ·qn(Q)+ G closed class of graphs : 2 . Together these results say that qn(H  P  K)  ∈ N ∈G (1) there exists k, such that every graph G has (3 qn(H) + 1) + 2 , which proves Lemma 7. a partition P with layered width at most , such that The results in this section show that every graph in G/P has treewidth at most k. certain minor-closed classes is a subgraph of a particular (2) there exists k ∈ N such that every graph G ∈Ghas graph product, such as a subgraph of H  P for some a partition P with layered width at most 1, such that bounded treewidth graph H and path P . First note that G/P has treewidth at most k. Observation 22 and Theorems 9 and 13 imply the following (3) there exists k ∈ N such that every graph in G has layered result conjectured by Wood [45].4 treewidth at most k, (4) G has linear local treewidth, Theorem 23. Every planar graph is a subgraph of:  (5) G has bounded local treewidth, (a) H P for some graph H with treewidth at most 8 and (6) there exists an apex graph not in G, some path P .   (7) there exists k ∈ N such that every graph in G (b) H P K3 for some graph H with treewidth at most is obtained from clique-sums of strongly k-almost- 3 and some path P . embeddable graphs. Observation 22 and Theorems 15 and 17 imply the fol- Proof: Lemma 6 says that (1) implies (2). Lemma 5 lowing generalisation of Theorem 23 for graphs of bounded says that (2) implies (3). Dujmovic´ et al. [13] proved that Euler genus. (3) implies (4), which implies (5) by definition. Eppstein [39] Theorem 24. Every graph of Euler genus g is a subgraph proved that (5) and (6) are equivalent; see [41] for an of: alternative proof. Dvorákˇ and Thomas [42] proved that   (a) H P Kmax{2g,1} for some graph H with treewidth (6) implies (7). Building on Lemma 19, we prove that at most 9 and for some path P . every graph obtained from clique-sums of strongly k-almost   (b) H P Kmax{2g,3} for some graph H with treewidth embeddable graphs has a partition of layered width 12k such at most 4 and for some path P . that the quotient has treewidth at most 020k +1 . This says that (7) implies (1). Lemma 19 and Observation 22 imply the following further Note that Demaine and Hajiaghayi [40] previously proved generalisation, where A + B is the complete join of graphs that (3) and (4) are equivalent. Also note that the assumption A and B. of a minor-closed class in Theorem 21 is essential: Duj- Theorem 25. Every (g, p, k, a)-almost embeddable graph movic,´ Eppstein and Wood [43] proved that the n × n × n is a subgraph of (H  P  Kmax{2 +4 1})+K for some grid G has bounded local treewidth but has unbounded, g p, a n graph H with treewidth at most 11k +10 and some path P . indeed Ω(n), layered treewidth. By Lemma 5, if Gn has a partition with layered width such that the quotient has Theorems 18 and 25 imply the following result for any treewidth at most k, then k  Ω(n). That said, it is open proper minor-closed class. whether (1), (2) and (3) are equivalent in a subgraph-closed G class. Theorem 26. For every proper minor-closed class there are integers k and a such that every graph G ∈Gcan be VI. STRONG PRODUCTS obtained by clique-sums of graphs G1,...,Gn such that for ∈{ } This section provides an alternative and helpful perspec- i 1,...,n , for some graph Hi with treewidth at most k ⊆  tive on layered partitions. The strong product of graphs and some path Pi, we have Gi (Hi Pi)+Ka.  A and B, denoted by A B, is the graph with vertex Note that it is easily seen that in all of the above results, × ∈ set V (A) V (B), where distinct vertices (v, x), (w, y) the graph H and the path P have at most |V (G)| vertices. V (A) × V (B) are adjacent if: • ∈ v = w and xy E(B),or 4To be precise, Wood [45] conjectured that for every planar graph G there • x = y and vw ∈ E(A),or are graphs X and Y , such that both X and Y have bounded treewidth, Y • vw ∈ E(A) and xy ∈ E(B). has bounded maximum degree, and G is a minor of X  Y , such that the preimage of each vertex of G has bounded radius in X Y . Theorem 23(a) The next observation follows immediately from the defini- is stronger than this conjecture since it has a subgraph rather than a shallow tions. minor, and Y is a path.

870 We can interpret these results as saying that strong prod- vertex. Then G is called a (g, d)-map graph.A(0,d)-map ucts and complete joins form universal graphs for the above graph is called a (plane) d-map graph; such graphs have classes. For all n and k there is a graph Hn,k with treewidth been extensively studied [48,49]. The (g, 3)-map graphs are k that contains every graph with n vertices and treewidth k precisely the graphs of Euler genus at most g (see [43]). So as a subgraph (take the disjoint union of all such graphs). (g, d)-map graphs provide a natural generalisation of graphs The proof of Theorem 23 then shows that Hn,8Pn contains embedded in a surface. An easy application of Lemma 27 every planar graph with n vertices. There is a substantial shows the following: literature on universal graphs for planar graphs and other Proposition 29. Every (g, d)-map graph G has queue- classes. For example, Babai, Chung, Erdos,˝ Graham and  3 Spencer [46] constructed a graph on O(n3/2) edges that number at most 2 8g + 98)(d +1) . contains every planar graph on n vertices as a subgraph. A string graph is the intersection graph of a set of curves 3/2 While Hn,8  Pn contains much more than O(n ) edges, in the plane with no three curves meeting at a single point it has the advantage of being highly structured and with [50–54]. For an integer k  2, if each curve is in at most k bounded average degree. Taking this argument one step intersections with other curves, then the corresponding string T further, there is an infinite graph k with treewidth k that graph is called a k-string graph.A(g, k)-string graph is contains every (finite) graph with treewidth k as a subgraph. defined analogously for curves on a surface of Euler genus Similarly, the infinite path Q contains every (finite) path as at most g. An easy application of Lemma 27 shows the a subgraph. Thus our results imply that T8  Q contains following: every planar graph. Analogous statements can be made for the other classes above. Proposition 30. Every (g, k)-string graph has queue- number at most 2(40g + 490)2k+1. VII. NON-MINOR-CLOSED CLASSES VIII. APPLICATIONS AND CONNECTIONS This section gives three examples of non-minor-closed classes of graphs that have bounded queue-number. The In this section, we discuss implications of our results following elementary lemma will be helpful. such as resolving open problems about 3-dimensional graph drawings. Lemma 27. Let G0 be a graph with a k-queue layout. Fix integers c  1 and Δ  2. Let G be the graph with V (G):= A. Track Layouts V (G0) where vw ∈ E(G) whenever there is a vw-path P Track layout are a type of graph layout closely related in G0 of length at most c, such that every internal vertex on to queue layouts. A vertex k-colouring of a graph G is a P has degree at most Δ. Then partition {V1,...,Vk} of V (G) into independent sets; that ∈ ∈ ∈ c+1 is, for every edge vw E(G),ifv Vi and w Vj then qn(G) < 2(2k(Δ + 1)) . i = j.Atrack in G is an independent−→ −→ set equipped with { } Our result for graphs of bounded Euler genus generalises a linear ordering. A partition V1,...,Vk of V (G) into k ∈{ } to allow for a bounded number of crossings per edge. A tracks is a k-track layout if for distinct−→ i,−→ j 1,...,k no graph is (g, k)-planar if it has a drawing in a surface of two edges of G cross between Vi and Vj. That is, for all ∈ ∈ ∈ Euler genus g with at most k crossings per edge and with distinct edges−→vw, xy E(G) with−→v, x Vi and w, y Vj, no three edges crossing at the same point. A (0,k)-planar if v ≺ x in Vi then w  y in Vj. The minimum k such graph is called k-planar; see [47] for a survey about 1-planar that G has a k-track layout is called the track-number of G, graphs. Even in the simplest case, there are 1-planar graphs denoted by tn(G). The following lemmas show that queue- that contain arbitrarily large minors [43]. number and track-number are tied. Nevertheless, such graphs have bounded queue-number. An Lemma 31 ([10]). For every graph G, qn(G)  tn(G)−1. easy application of Lemma 27 shows the following lemma, which can also be concluded from a result of Dujmovic´ and Lemma 32 ([12]). There is a function f such that tn(G)  Wood [2] in conjunction with Theorem 2. f(qn(G)) for every graph G. In particular, every graph with queue-number at most k has track-number at most Proposition 28. Every (g, k)-planar graph G has queue- k+2 (2 −1)(4 −1) number at most 2(40g + 490) . 4k · 4k k k . Map graphs are defined as follows. Start with a graph The following lemma often gives better bounds on the G0 embedded in a surface of Euler genus g, with each track-number than Lemma 32. A proper graph colouring is face labelled a ‘nation’ or a ‘lake’, where each vertex of acyclic if every cycle gets at least three colours. The acyclic G0 is incident with at most d nations. Let G be the graph chromatic number of a graph G is the minimum integer c whose vertices are the nations of G0, where two vertices such that G has an acyclic c-colouring. are adjacent in G if the corresponding faces in G0 share a

871 Lemma 33 ([10]). Every graph G with acyclic chromatic Lemma 37 is the foundation for all of the following number at most c and queue-number at most k has track- results. Dujmovic´ and Wood [60] proved that every graph number at most c(2k)c−1. with bounded maximum degree has a 3-dimensional grid drawing with volume O(n3/2), and the same bound holds Borodin [55] proved that planar graphs have acyclic for graphs from a proper minor-closed class. In fact, every chromatic number at most 5, which with Lemma 33 and The- graph with bounded degeneracy has a 3-dimensional grid orem 1 implies: 3 2 drawing with O(n / ) volume [61]. Dujmovi’c et al. [10] Theorem 34. Every planar graph has track-number at most proved that every graph with bounded treewidth has a 3- 5(2 · 49)4 = 461, 184, 080. dimensional grid drawing with volume O(n). Prior to this work, whether planar graphs have 3- Note that the best lower bound on the track-number of dimensional grid drawings with O(n) volume was a major planar graphs is 7, due to Dujmovic´ et al. [12]. open problem, due to Felsner, Liotta, and Wismath [62]. The Heawood [56] and Alon, Mohar and Sanders [57] re- previous best known bound on the volume of 3-dimensional spectively proved that every graph with Euler genus g has grid drawings of planar graphs was O(n log n) by Duj- chromatic number O(g1/2) and acyclic chromatic number movic´ [17]. Lemma 37 and Theorem 34 together resolve O(g4/7). Lemma 33 and Theorem 2 then imply: the open problem of Felsner et al. [62]. Theorem 35. Every graph with Euler genus g has track- 4/7 Theorem 38. Every planar graph with n vertices has a 3- number at most gO(g ). dimensional grid drawing with O(n) volume. For proper minor-closed classes, Lemma 32 and Theo- Lemma 37 and Theorems 35 and 36 imply the following rem 3 imply: strengthenings of Theorem 38. Theorem 36. Every proper minor-closed class has bounded Theorem 39. Every graph with Euler genus g and n vertices track-number. ( 4/7) has a 3-dimensional grid drawing with gO g n volume. It follows from Lemma 33 and the work of Van den Theorem 40. For every proper minor-closed class G, every Heuvel and Wood [30] connecting layered treewidth and graph in G with n vertices has a 3-dimensional grid drawing r-strong colouring number, along with bounds on layered with O(n) volume. treewidth for (g, k)-planar graphs, (g, d)-map graphs and (g, k)-string graphs [43] that such graphs have bounded As shown in Section VIII-A, (g, k)-planar graphs, (g, d)- track-number. map graphs and (g, k)-string graphs have bounded track- number (for fixed g, k, d). By Lemma 37, such graphs have B. Three-Dimensional Graph Drawing 3-dimensional grid drawings with O(n) volume. Further motivation for studying queue and track layouts is their connection with 3-dimensional graph drawing. A 3- IX. OPEN PROBLEMS dimensional grid drawing of a graph G represents the ver- 1) What is the maximum queue-number of planar graphs? tices of G by distinct grid points in Z3 and represents each We can tweak our proof of Theorem 1 to show that edge of G by the open segment between its endpoints so that every planar graph has queue-number at most 48, but no two edges intersect. The volume of a 3-dimensional grid it seems new ideas are required to obtain a significant drawing is the number of grid points in the smallest axis- improvement. The best lower bound on the maximum aligned grid-box that encloses the drawing. For example, queue-number of planar graphs is 4, due to Alam Cohen, Eades, Lin and Ruskey [58] proved that the complete et al. [14]. graph Kn has a 3-dimensional grid drawing with volume More generally, does every graph with Euler genus g 3 O(n ) and this bound is optimal. Pach, Thiele and Tóth [59] have√ o(g) queue-number? Complete graphs provide a proved that every graph with bounded chromatic number has Θ( g) lower bound.√ Note that every graph with Euler a 3-dimensional grid drawing with volume O(n2), and this genus g has O( g) stack-number [63]. bound is optimal for Kn/2,n/2. 2) Is there a polynomial function f such that every graph Track layouts and 3-dimensional graph drawings are con- with treewidth k has queue-number at most f(k)? The nected by the following lemma. best lower and upper bounds on f(k) are k +1 and k − Lemma 37 ([10,60]). If a c-colourable n-vertex graph 2 1, both due to Wiechert [6]. G has a t-track layout, then G has 3-dimensional grid 3) As discussed in Section I it is open whether there is a drawings with O(t2n) volume and with O(c7tn) volume. function f such that sn(G)  f(qn(G)) for every graph Conversely, if a graph G has a 3-dimensional grid drawing G. Heath, Leighton and Rosenberg [1] proved that every with A × B × C bounding box, then G has track-number at 1-queue graph has stack-number at most 2. Dujmovic´ most 2AB. and Wood [2] showed that there is such a function f

872 if and only if every 2-queue graph has bounded stack- graph into BFS layers, such that the problem can number. be solved optimally on each layer (since the induced Similarly, it is open whether there is a function f subgraph has bounded treewidth), and then combines such that qn(G)  f(sn(G)) for every graph G. the solutions from each layer. Our results (Theorem 9) Heath, Leighton and Rosenberg [1] proved that every 1- give a more precise description of the layered structure stack graph has queue-number at most 2. Since 2-stack of planar graphs (and other more general classes). It graphs are planar, this paper solves the first open case is conceivable that this extra structural information is of this question. Dujmovic´ and Wood [2] showed that useful when designing algorithms. there is such a function f if and only if every 3-stack Note that all our proofs lead to polynomial-time algo- graph has bounded queue-number. rithms for computing the desired decomposition and 4) Is there a proof of Theorem 3 that does not use the queue layout. Pilipczuk and Siebertz [35] claim O(n2) graph minor structure theorem and with more reason- for their decomposition. The same is able bounds? true for Lemma 11: Given the colours of the vertices on 5) Queue layouts naturally extend to posets. The cover F , we can walk down the BFS tree T in linear time and colour every vertex. Another linear-time enumeration of graph GP of a poset P is the undirected graph with the faces contained in F finds the trichromatic triangle. vertex set P , where vw ∈ E(G) if v

0, such that every n-vertex graph in G [5] B. Mohar and C. Thomassen, Graphs on surfaces. Johns Hopkins University Press, 2001. has a balanced separator of order cn1−β. Already the 1 [6] V. Wiechert, “On the queue-number of graphs with bounded β = 2 case looks challenging, since this would imply tree-width,” Electron. J. Combin., vol. 24, no. 1, p. 1.65, 2017. Theorem 3. https://www.combinatorics.org/v24i1p65 7) Do the results in the present paper have algorithmic [7] L. S. Heath and A. L. Rosenberg, “Laying out graphs using queues,” SIAM J. Comput., vol. 21, no. 5, pp. 927–958, 1992. applications? Consider the method of Baker [67] for [8] S. V. Pemmaraju, “Exploring the powers of stacks and queues designing polynomial-time approximation schemes for via graph layouts,” Ph.D. dissertation, Virginia Polytechnic problems on planar graphs. This method partitions the Institute and State University, U.S.A., 1992.

873 [9] S. Rengarajan and C. E. Veni Madhavan, “Stack and queue “Minor-closed graph classes with bounded layered pathwidth,” number of 2-trees,” in Proc. 1st Annual International Conf. 2018. https://arxiv.org/abs/1810.08314. on Computing and Combinatorics (COCOON ’95), D.-Z. Du [30] J. van den Heuvel and D. R. Wood, “Improper colourings and M. Li, Eds., Lecture Notes in Comput. Sci., vol. 959. inspired by Hadwiger’s conjecture,” J. London Math. Soc., Springer, 1995, pp. 203–212. vol. 98, no. 1, pp. 129–148, 2018. See arXiv: 1704.06536. [10] V. Dujmovic,´ P. Morin, and D. R. Wood, “Layout of graphs [31] M. J. Bannister, W. E. Devanny, V. Dujmovic,´ D. Eppstein, with bounded tree-width,” SIAM J. Comput., vol. 34, no. 3, and D. R. Wood, “Track layouts, layered path decompositions, pp. 553–579, 2005. and leveled planarity,” Algorithmica, vol. 81, no. 4, pp. 1561– [11] V. Dujmovic´ and D. R. Wood, “On linear layouts of graphs,” 1583, 2019. Discrete Math. Theor. Comput. Sci., vol. 6, no. 2, pp. [32] V. Dujmovic´ and F. Frati, “Stack and queue layouts via 339–358, 2004. http://dmtcs.episciences.org/317 layered separators,” J. Graph Algorithms Appl., vol. 22, no. 1, [12] V. Dujmovic,´ A. Pór, and D. R. Wood, “Track layouts of pp. 89–99, 2018. graphs,” Discrete Math. Theor. Comput. Sci., vol. 6, no. 2, [33] D. R. Wood, “On tree-partition-width,” European J. Combin., pp. 497–522, 2004. http://dmtcs.episciences.org/315 vol. 30, no. 5, pp. 1245–1253, 2009. [13] V. Dujmovic,´ P. Morin, and D. R. Wood, “Layered separators [34] G. Ding and B. Oporowski, “Some results on tree decomposi- in minor-closed graph classes with applications,” J. Combin. tion of graphs,” J. Graph Theory, vol. 20, no. 4, pp. 481–499, Theory Ser. B, vol. 127, pp. 111–147, 2017. 1995. [14] J. M. Alam, M. A. Bekos, M. Gronemann, M. Kaufmann, and [35] M. Pilipczuk and S. Siebertz, “Polynomial bounds for cen- S. Pupyrev, “Queue layouts of planar 3-trees,” in Proc. 26th tered colorings on proper minor-closed graph classes,” in Proc. International Symposium on Graph Drawing and Network 30th Annual ACM-SIAM Symposium on Discrete Algorithms, Visualization (GD 2018), T. C. Biedl and A. Kerren, Eds., 2019, pp. 1501–1520, arXiv: 1807.03683. Lecture Notes in Computer Science, vol. 11282. Springer, [36] M. Aigner and G. M. Ziegler, Proofs from The Book, 4th ed. 2018, pp. 213–226. Springer, 2010. [15] M. A. Bekos, H. Förster, M. Gronemann, T. Mchedlidze, [37] S. Cabello, É. C. de Verdière, and F. Lazarus, “Algorithms F. Montecchiani, C. N. Raftopoulou, and T. Ueckerdt, “Planar for the edge-width of an embedded graph,” Comput. Geom., graphs of bounded degree have constant queue number,” in vol. 45, no. 5-6, pp. 215–224, 2012. Proc 51st Annual Symposium on Theory of Computing (STOC [38] N. Robertson and P. Seymour, “Graph minors. XVI. Exclud- ’19), 2019, pp. 176–184, arXiv: 1811.00816. ing a non-planar graph,” J. Combin. Theory Ser. B, vol. 89, [16] G. Di Battista, F. Frati, and J. Pach, “On the queue number no. 1, pp. 43–76, 2003. of planar graphs,” SIAM J. Comput., vol. 42, no. 6, pp. 2243– [39] D. Eppstein, “Diameter and treewidth in minor-closed graph 2285, 2013. families,” Algorithmica, vol. 27, no. 3-4, pp. 275–291, 2000. [17] V. Dujmovic,´ “Graph layouts via layered separators,” J. Com- [40] E. D. Demaine and M. Hajiaghayi, “Equivalence of local bin. Theory Series B., vol. 110, pp. 79–89, 2015. treewidth and linear local treewidth and its algorithmic ap- [18] V. Dujmovic,´ P. Morin, and D. R. Wood, “Queue layouts plications,” in Proc. 15th Annual ACM-SIAM Symposium on of graphs with bounded degree and bounded genus,” 2019, Discrete Algorithms (SODA ’04). SIAM, 2004, pp. 840–849. arXiv: 1901.05594. [41] ——, “Diameter and treewidth in minor-closed graph families, [19] J. Wang, “Layouts for plane graphs on constant number of revisited,” Algorithmica, vol. 40, no. 3, pp. 211–215, 2004. tracks,” 2017, arXiv: 1708.02114. [42] Z. Dvorákˇ and R. Thomas, “List-coloring apex-minor-free [20] Z. Dvorákˇ and J.-S. Sereni, “On fractional fragility rates of graphs,” 2014, arXiv: 1401.1399. graph classes,” 2019, arXiv: 1907.12634. [43] V. Dujmovic,´ D. Eppstein, and D. R. Wood, “Structure of [21] M. Bonamy, C. Gavoille, and M. Pilipczuk, “Shorter labeling graphs with locally restricted crossings,” SIAM J. Discrete schemes for planar graphs,” 2019, arXiv: 1908.03341. Math. , vol. 31, no. 2, pp. 805–824, 2017. [22] M. D˛ebski,S. Felsner, P. Micek, and F. Schröder, “Improved [44] D. R. Wood, “Queue layouts of graph products and powers,” bounds for centered colorings,” 2019, arXiv: 1907.04586. Discrete Math. Theor. Comput. Sci., vol. 7, no. 1, pp. 255–268, [23] V. Dujmovic,´ L. Esperet, G. Joret, B. Walczak, and D. R. 2005. http://dmtcs.episciences.org/352 Wood, “Planar graphs have bounded nonrepetitive chromatic [45] ——, “The structure of cartesian products,” 2008. https: number,” 2019, arXiv: 1904.05269. //www.birs.ca/workshops/2008/08w5079/report08w5079.pdf [24] V. Dujmovic,´ G. Joret, P. Micek, P. Morin, T. Ueckerdt, and [46] L. Babai, F. R. K. Chung, P. Erdos,˝ R. L. Graham, and J. H. D. R. Wood, “Planar graphs have bounded queue-number,” Spencer, “On graphs which contain all sparse graphs,” in 2019, arXiv: 1904.04791. Theory and practice of combinatorics, 1982, North-Holland [25] R. Diestel, Graph theory, 4th ed., Graduate Texts in Mathe- Math. Stud., vol. 60, pp. 21–26. matics. Springer, vol. 173, 2010. [47] S. G. Kobourov, G. Liotta, and F. Montecchiani, “An anno- [26] D. J. Harvey and D. R. Wood, “Parameters tied to treewidth,” tated bibliography on 1-planarity,” Comput. Sci. Rev., vol. 25, J. Graph Theory, vol. 84, no. 4, pp. 364–385, 2017. pp. 49–67, 2017. [27] B. A. Reed, “Tree width and tangles: a new connectivity [48] F. V. Fomin, D. Lokshtanov, and S. Saurabh, “Bidimensional- measure and some applications,” in Surveys in combinatorics, ity and geometric graphs,” in Proc. 23rd Annual ACM-SIAM Cambridge Univ. Press, 1997, London Math. Soc. Lecture Symposium on Discrete Algorithms, 2012, pp. 1563–1575. Note Ser., vol. 241, pp. 87–162. [49] Z.-Z. Chen, M. Grigni, and C. H. Papadimitriou, “Map [28] F. Shahrokhi, “New representation results for planar graphs,” graphs,” J. Assoc. Comput. Mach., vol. 49, no. 2, pp. 127– in 29th European Workshop on Computational Geometry 138, 2002. (EuroCG 2013), 2013, pp. 177–180, arXiv: 1502.06175. [50] J. Pach and G. Tóth, “Recognizing string graphs is decidable,” [29] V. Dujmovic,´ D. Eppstein, G. Joret, P. Morin and D. R. Wood, Discrete Comput. Geom., vol. 28, no. 4, pp. 593–606, 2002.

874 [51] M. Schaefer and D. Štefankovic,ˇ “Decidability of string [61] ——, “Upward three-dimensional grid drawings of graphs,” graphs,” J. Comput. System Sci., vol. 68, no. 2, pp. 319–334, Order, vol. 23, no. 1, pp. 1–20, 2006. 2004. [62] S. Felsner, G. Liotta, and S. K. Wismath, “Straight-line draw- [52] M. Schaefer, E. Sedgwick, and D. Štefankovic,ˇ “Recognizing ings on restricted integer grids in two and three dimensions,” string graphs in NP,” J. Comput. System Sci., vol. 67, no. 2, in Proc. 9th International Symp. on Graph Drawing (GD ’01), pp. 365–380, 2003. P. Mutzel, M. Jünger, and S. Leipert, Eds., Lecture Notes in [53] J. Fox and J. Pach, “A separator theorem for string graphs and Comput. Sci., vol. 2265. Springer, 2002, pp. 328–342.√ its applications,” Combin. Probab. Comput., vol. 19, no. 3, pp. [63] S. M. Malitz, “Genus g graphs have pagenumber O( g),” J. 371–390, 2010. Algorithms, vol. 17, no. 1, pp. 85–109, 1994. [54] ——, “Applications of a new separator theorem for string [64] D. R. Wood, “Bounded-degree graphs have arbitrarily large graphs,” Combin. Probab. Comput., vol. 23, no. 1, pp. 66–74, queue-number,” Discrete Math. Theor. Comput. Sci., vol. 10, 2014. no. 1, pp. 27–34, 2008. http://dmtcs.episciences.org/434 [55] O. V. Borodin, “On acyclic colorings of planar graphs,” [65] K. S. Heath, and S. V. Pemmaraju, “Stack and queue layouts Discrete Mathematics, vol. 25, no. 3, pp. 211–236, 1979. of posets,” SIAM J. Discrete Math., vol. 10, no. 4, pp. 599– [56] P. J. Heawood, “Map colour theorem,” Quart. J. Pure Appl. 625, 1997. Math., vol. 24, pp. 332–338, 1890. [66] K. Knauer, P. Micek, and T. Ueckerdt, “The queue-number of [57] N. Alon, B. Mohar, and D. P. Sanders, “On acyclic colorings posets of bounded width or height,” in Proc. Graph Drawing of graphs on surfaces,” Israel J. Math., vol. 94, pp. 273–283, and Network Visualization (GD ’18), T. Biedl, A. Kerren, 1996. Eds., Lecture Notes in Comput. Sci., vol. 11282, Springer, [58] R. F. Cohen, P. Eades, T. Lin, and F. Ruskey, “Three- 2018, pp. 200–212. dimensional graph drawing,” Algorithmica, vol. 17, no. 2, pp. [67] B. S. Baker, “Approximation algorithms for NP-complete 199–208, 1996. problems on planar graphs,” J. Assoc. Comput. Mach., vol. 41, [59] J. Pach, T. Thiele, and G. Tóth, “Three-dimensional grid no. 1, pp. 153–180, 1994. drawings of graphs,” in Advances in discrete and computa- [68] B. Mohar, “A linear time algorithm for embedding graphs in tional geometry, B. Chazelle, J. E. Goodman, and R. Pollack, an arbitrary surface,” SIAM J. Discrete Math., vol. 12, no. 1, Eds. Amer. Math. Soc., 1999, Contemporary Mathematics, pp. 6–26, 1999. vol. 223, pp. 251–255. [69] E. D. Demaine, M. Hajiaghayi, and K. Kawarabayashi, “Algo- [60] V. Dujmovic´ and D. R. Wood, “Three-dimensional grid rithmic graph minor theory: Decomposition, approximation, drawings with sub-quadratic volume,” in Towards a Theory of and coloring,” in Proc. 46th Annual IEEE Symposium on Geometric Graphs, ser. Contemporary Mathematics, J. Pach, Foundations of Computer Science (FOCS ’05). IEEE, 2005, Ed. Amer. Math. Soc., 2004, vol. 342, pp. 55–66. pp. 637–646.

875