Structure of Graphs with Locally Restricted Crossings

† ‡ §

VidaAbstract. Dujmovi´c David Eppstein David R. Wood

Wen consider relations between the size, treewidth, andg local crossingk number p (maximum number of crossingsO( (g per+ 1)( edge)k + 1) ofn graphs) embedded on topologicalO((g + 1) surfaces.k) We show that an -vertex graph embedded on a surface of genus withk at most crossings p nper edge has treewidth O( (k + 1)n) and layered treewidthO(k + 1) , and that these bounds are tight up to a constant factor.O((k As+ a 1) special3/4n1/2) case, the -planar graphs with vertices have treewidth and layered treewidth , which are tight bounds thatg < improve m a previouslym known treewidth bound. Analogousg Oresults((m/( areg + proved1)) log2 forg) map graphs defined with respect to any surface. Finally, we show that for , every -edge graph can be embedded on a surface of genus with Keywords. crossings per edge, which is tight to a polylogarithmic factor.k

treewidth, pathwidth, layered treewidth, local treewidth, 1-planar, -planar, map graph, graph minor, local crossing number, separator, 1 Introduction

This paper studies the structure of graph classes defined by drawings on surfaces in which the crossings are locally restricted in some way.k k-planar k local crossing Thenumber first such example that we considerk are the -planark graphs. A graph is if it can be drawn in the planep × withq × atr most crossings on each edge[p] × [24[q].] × The[r] of the(x, y, graph z)(x + is 1 the, y, zminimum) (x, y, zfor)(x, which y + 1, it z) is (-planarx, y, z)(x, [27 y,, pagesz + 1) 51–53]. An important example is the grid graph, with vertex set and all edges arXiv:1506.04380v2 [math.CO] 20 Feb 2016 of the form or or . A suitable Proc.February 23rd 23, International 2016 Symposium on Graph Drawing and Network Visualization 2015 A preliminary version of this paper entitled “Genus, treewidth, and local crossing number” was published in † , Lecture Notes in [email protected] Science 9411:87–98, Springer, 2015. School of and Electrical Engineering, University of Ottawa, Ottawa, Canada ‡ ( ). Supported by NSERC and the Ministry of [email protected] and Innovation, Government of Ontario, Canada. § Department of Computer Science, University of California, Irvine, California, [email protected] ( ). Supported in part by NSF grant CCF-1228639. School of Mathematical Sciences, Monash University, Melbourne, Australia ( ). Supported by the Australian Research Council.

1 p × q × r (r − 1)

Figure 1: The grid graph is -planar. (r − 1) linear projection from the natural three-dimensional embedding of this graph to the plane gives a -planar drawing, as illustrated in Figure1.

The main way that we describe the structure of a graph is through its treewidth, which is a parameter that measures how similar a graph is to a tree. It is a key measure of the complexity of a graph and is of fundamental importance in algorithmic graph theory and structural graph theory, especially in Robertson and Seymour’s graph minors project. See Section2 for a detailed definition of treewidth. separator

Treewidth is closely related to the size of a smallest , a set of vertices whose removal splits the graph into connected components each with at most half the vertices. Graphs of low treewidth necessarily haven small separators, and graphs in which every √ √ Osubgraph( n) has a small separator have lown treewidth [12, 25]. For example, theO( Lipton-Tarjann) √ separator theorem, whichO( n) says that every -vertex planar graph has a separator of order , can be reformulated as every -vertex planar graph has treewidth . Most of our results provide bounds on the treewidth of particular classes of graphs that generalise planarity. In this sense, our results are generalisations of the Lipton-Tarjan separator theorem, and analogous results for other surfaces. k n The starting point for ourO work(k3/4 isn1 the/2) following question: what is the maximum treewidth of -planar graphs on vertices? Grigoriev and Bodlaender [16] studied this question and Theorem 1. The maximum treewidth of -planar -vertex graphs is proved an upper bound of . Wek improven this and give the following tight bound:  n p o Θ min n, (k + 1)n .

2 (g, k)-planar g k et al. More generally, a graph is if it can1 be drawn in a surface(2, of k) Euler genus at most with at most crossings on each edge . For instance, Guy [19] investigated the local crossing number of toroidal embeddings—in this notation, the -planar graphs. Theorem 2. The maximum treewidth of (g, k)-planar n-vertex graphs is We again determine an optimal bound on the treewidth of such graphs.  n p o Θ min n, (g + 1)(k + 1)n .

k = 0

( ) In both these theorems, the case (withg, k no crossings) is well known [15]. n mOur second contribution is to study theg -planarity of graphs as a functionm of their Ω(minnumber{m of2 edges./g, m2/n For}) (global) crossing number, it is known thatO((m a2 graphlog2 g with)/g) vertices and edges drawn on a surface of genus (sufficiently small withΩ( respectm/g) to ) may require crossings, and it can be drawn with crossings [29]. In particular, the lower bound implies that some graphs require crossings per edge on average, and therefore also in the worst case. We prove a nearly-matching upper bound Theorem 3. For every graph G with m edges, for every integer g 1, there is a drawing which implies the above-mentioned upper bound on the total number> of crossings: of G in the orientable surface with at most g handles and with

m log2 g  O g crossings per edge.

G0 g

Our third contribution concernsG0 map graphs, which ared defined asG follows. Start with a graph embedded in a surfaceG0 of Euler genus , with each face labelledG a ‘nation’ or a

‘lake’, whereG0 each vertex of is incidentG with at most(g, d)-mapnations. graph Let (0be, d the) graph whose vertices are the nationsd-map graph of , where two vertices are adjacent in if the corresponding faces in share a vertex.(g, 3) Then is called a .A -map graph is gcalled a (plane) ; suchg = 0 graphs have been(g, extensively d) studied [14, 3, 6, 4, 2]. It is easily seen that -map graphs are precisely2 theG graphs of Euler genus at most (which is well known in the case [4]) . So -map graphs provide a natural Euler genus h 2h Euler genus generalisation of graphs embedded in a surface. Note that may contain arbitrarily large 1 c c Euler genus G G The of an orientable surface with handles is . The of a non-orientable surface withG cross-caps is . The of a graph is the minimumg EulerM( genusG) of amedial surface in which G

2 embeds (with no crossings).E(G) M(G) Let be a graph embedded in a surface of Euler genus at most . Let be the graph of . This graph has vertex set where two vertices of are adjacent whenever the corresponding

3 g = 0 H d G

Kd cliques even in the case, since if a vertex of is incident with nations then containsG . H G G If is the mapG graph associated with an embedded graph , then considerH the natural vdrawingH of in whichd each vertex of is positioned inside the correspondingv nation, and beachd−2 cd edged−2 e of is drawn as a( curveg, d) through the corresponding(g, b d−2 cd d−2 e) vertex of . If a vertex 2 2 p2 2 of is incident to(g, dnations,) then each edge passingO(d through(g + 1)n)is crossed by at most edges. Thus every -map graph is -planar, and Theorem2 implies that every -map graph has treewidth . We improve on this Theorem 4. The maximum treewidth of ( )-map graphs on vertices is result as follows. g, d n  n p o Θ min n, (g + 1)(d + 1)n .

layered treewidth

(Weg, k prove) our treewidth upper(g, d) bounds by using the concept of [10], which is of independent interest (see Section2). We prove matching lower bounds by finding -planar graphs and -map graphs without small separators and using the known relations between separator size and treewidth. 2 Background and Discussion

 ∈ (0, 1) S G -separator G 1 2 G − S |V (G)|  = 2  = 3 For , a set of vertices in a graph is an of if each of has at most vertices. It is conventional to set or but the precise choice makes no difference to the asymptotic size of a separator.

Several results that follow depend on expanders; see [21] for a survey. The following Lemma 5. For every ∈ (0 1) there exists 0, such that for all 3 and + 1 folklore result provides a property, of expandersβ > that is the key to ourk applications.> n > k (such that n is even if k is odd), there exists a k-regular n-vertex graph H (called an expander) in which every -separator in H has size at least βn.

G G M(G) G M(G) edges in G are consecutive in theM cyclic(G) ordering of edges incident to aG common vertex in the embedding of M.( NoteG) that embeds in theG same surface as , where eachM(G face) of corresponds tovw a vertexG or a face of . Label the faces of thatv correspondw to vertices of as nations, and labelG the faces of that correspondM to(G faces) ofG as lakes.(g, 2) The vertex of corresponding(g, 3) to an edge of is incident to the(g, nations3) corresponding to and (and is incident to no other nations). Thus is isomorphic to the map graph of , and is a -map graph and thus a -map graph. Conversely, it is clear that a -map graph embeds in the same surface as the original graph.

4 tree-decomposition G T

(Bx ⊆ V (G): x ∈ V (T )) G bags A of a graph is given by a tree whose nodes index a collection of sets of vertices in called , such that: • vw G Bx v w

• { ∈ ( ): ∈ } For every edge v ofG , some bagx V Tcontainsv B bothx and , and T For every vertex of , the set induces a non-empty (connected) subtree of . width maxx |Bx| − 1 treewidth tw(G) G G Thepw(G) of a tree-decomposition is , and the of a graph is the minimum width of any tree decomposition of . Path decompositions and pathwidth are defined analogously, except that the underlying tree is required to be a path. Treewidth was introduced (with a different but equivalent definition) by Halin [20] and tree Lemma 6 . Every graph with treewidth k has a 1 -separator of size at most k + 1. decompositions were introduced by Robertson and Seymour2 [26] who proved:

([26])layered tree decompositions

layering G (V0,V1,...,Vt) V (G) Thevw ∈ notionE(G) of v ∈ Vi w ∈ Vj |i −isj| a6 key1 tool in provingVi our mainlayer theorems. A of a graphr is a partition G Vi of such that for everyi edge r (V0,V, if1,... ) and ,G then bfs. layering Each set Gis called a r . Forbfs treeexample,G for a vertexr of a connected graphG , if is the set of verticesv atG distance from

, then v r isG a layering of , called the v r ofT startingv ∈ fromVi .A vr of rootedT at is a spanning tree of such thatVj for every0 6 j vertex6 i of , the distance between and in equals the distance between and in . Thus, if then the ( : ∈ ( )) -pathlayered in widthcontains exactly one vertex fromBx layerx V forT . G ` (V0,V1,...,Vt) G Bx `

The ofV ai tree-decompositionlayered treewidth G of a graph is the minimum integer such that, for someG layering of , each bag contains at most vertices in each layer . The of a graph is the minimum layered width etof aal. tree-decomposition of . Note that if we only consider the trivial layering in which all vertices belong to one layer, then layered3 treewidth equals treewidth plus 1. Dujmovi´c et al. [10] introduced layered treewidth 3 Dujmovi´c [10] introduced layered treewidth asn a tool to prove upper bounds on the track-number, queue-numberO and(log volumen) of 3-dimensionalO(log n straight-line) grid drawings of graphs. In particular, based onO(n earlierlog n) work in [8, 9], they proved that every -vertex graph with bounded layered treewidth has track-number , queue-number , and has a 3-dimensional straight-line grid drawing with volume. All the theorems in this paper giving upper bounds on the layered treewidth of particular graph classes can be combined with the results in [10] to give results for track-number, queue-number, and 3-dimensional straight-line grid drawings for the same graph class. Motivated by other applications, Shahrokhi [28] independently introduced a definition equivalent to layered treewidth. Our results can also be combined with those of Shahrokhi [28]; details omitted.

5 Theorem 7 . Every planar graph has layered treewidth at most 3. More generally, every graph with Euler genus g has layered treewidth at most 2g + 3. ([10])

G bounded local treewidthLayered treewidth is related to localf treewidth, which was firstG introducedG by Eppstein v[13] Gunder the guise of the ‘treewidth-diameter’r > 0 property.G A graph class has r ifv there is a function suchf(r) that for every graph f(inr) , for every vertex of and for everyG integerlinear ,quadratic the subgraphlocal of treewidthinduced by the verticeset al. at distance at most from has treewidth at mostG ; see [17, 5, 7, 13]. If isk a linearG or quadratic function, then hasf(r) 6 kor(2r + 1) − 1/ . Dujmovi´c [10] observed that if every graph in some class has layeredG apex treewidthG − v at most , then has linearv local treewidth with . They also proved the following converse result for minor-closed classes, where a graph is if is planar for some vertex . (Earlier, Eppstein [13] proved that (b) and (d) are equivalent, and Demaine and Hajiaghayi Theorem 8 . The following are equivalent for a minor-closed class G of graphs: [7] proved that (b) and (c) are equivalent.)

(a) G has bounded([10, 7, 13 layered]) treewidth.

(b) G has bounded local treewidth.

(c) G has linear local treewidth.

(d) G excludes some apex graph as a minor.

(g, k) (g, d) g = 0 k = 1 d = 4 This result appliesn × n × for2 neither -planar graphs nor -mapi graphs, since as we now show, thesei are non-minor-closed classes evenKn for , and . For example, the grid graph is 1-planar, and contracting the -th row in(0 the, 4) front grid with the -th column in the back grid gives a minor.Hn Thus 1-planar(2n + 1) graphs× (2n + may 1) contain arbitrarily large minors. Similarly, we now construct -map

Ggraphsn with arbitrarily largeHn completeH graphn minors. Let be the Gn

(0grid, 4) graph in which each internalGn face is2n a× nation,2n and the outer face is a lake. Let 2 be the mapV graph(Gn) of = [1,.2n Since] i ∈is[1 planar, n] withRi maximum degree 4, (1, 2isi − a

1)(2,-map2i)(3, graph.2i − 1) Observe, (4, 2i),..., that(2n −is2, the2i), (2n − 1,grid2i − graph1), (2n, with2i) bothG diagonalsn Ci across each face. Say(2i, 1)(2i − 1, 2)(2i, 3),.(2 Fori − 1, 4),..., (2,i let− 1, 2nbe− 2) the, (2 zig-zagi, 2n − 1) path, (2i − 1, 2n)

Gn Xi Ri ∪ Ci Xi in(2i −,1 let, 2i − 1)be∈ theRi zig-zag path (2i − 1, 2i) ∈ Ci Ri in , and let be the subgraph . Then is connected since is adjacent to . Note that the sum of the coordinates of each vertex in

6 Cj Ri ∩ Cj = ∅

i, j ∈ [n] Ri ∩ Rj = ∅ Ci ∩ Cj = ∅ i, j ∈ [1, n]

Xisi even,∩ Xj and= ∅ the sum of thei, j coordinates∈ [1, n] of eachXi vertex in isX odd.j Thus(2j, 2i) ∈ Ri for all (2j −.1 Clearly, 2i) ∈ Cj X1,...,Xand n for distinct Kn . ThusGn for distinct (0, 4) . Now, is adjacent to since is adjacent to . Thus are the branch sets of a minor in . This example shows that -map graphs may contain arbitrarily large complete graph minors. Lemma 9 . Every -vertex graph with layered treewidth has treewidth Sergey Norin√ established the followingn connection between layered treewidthk and treewidth. at most 2 kn − 1. (Norin; see [10]) √ O( n)

To prove all the treewidth bounds introduced in Section1, we first establish a tight upper bound on the layered treewidth, and then apply Lemma9. One conclusion,et al. therefore, of this paper is that layered treewidth is a useful parameter when studying non-minor-closed graph classes (which is a research direction suggested by Dujmovi´c [10]). In general, layered treewidth is an interesting measure of the structural complexity of a graph in its own right.

We now show that bounded local treewidth∆ doesO((∆ not− imply1)r) bounded layered treewidthr (and thus Theorem8 doesMoore not necessarily hold in non-minor-closed classes).∆ First note that a graph with maximumGn degreen × n ×containsn vertices at distance at most {fromGn : an fixed∈ N} vertex (the bound). Thus graphs with maximum degreeGn have bounded local treewidth. Let be ther grid graph, which has maximumG2r degree 6. Thus has bounded( 2) local{ treewidth.: ∈ } Moreover, the subgraph of induced by the O r Gn n N √ vertices at distance attw( mostG ) from1 n2 a fixedG vertex is a subgraph of k , whichtw(G is easily) 2 seenkn3 n >√6 n n 6 1 2 3 1 to have treewidth 6 n. Thus6 2 kn has quadratick > local144 treewidth.n {G Byn : Corollaryn ∈ N} 18 in Section4 below, . If has layered treewidth , then by Lemma9. Thus , which implies that , and has unbounded layered treewidth. et al.

We conclude this section by mentioning some negative results. Dujmovi´c [11] constructed an infinite family of expander graphs thatΩ(n have) (geometric) thicknessΩ(n 2,) have 3-page book embeddings, have 2-queue layouts, and have 4-track layouts. By Lemma5, Lemma6 and Lemma9, such graphs have treewidth and layered treewidth . This means that our results cannot be extended to bounded thickness, bounded page number, bounded queue number, or bounded track number graphs.

7 3 k-Planar Graphs

Theorem 10. Every -planar graph has layered treewidth at most 6( + 1). The following theoremk is our first contribution.G k

Proof. G k G G0 G Draw in the planeG0 with at most crossingsG per0 edge, and arbitrarily orient each 0 0 0 0 0 edge of . Let be the graph obtainedT fromG by replacingV0 each,V1 ,... crossingG by a new 0 0 0 degree-4 vertex.T Then is planar. By Theorem7, has layeredVi treewidth atv mostG 3. 0 0 ThatTv is, there is a tree decompositionT of , and a layeringv of , such that each bag of contains at most three vertices in each layer . For each vertex of , let T be the subtree of formedG by the bags that contain . x T 0 x T

Let be the decompositionG of obtainedv byG replacingTv each occurrence ofT a dummy vertex 0 0 in a bag of byv the tailsGv of the two edges thatG cross at .v We now show that is a 0 0 tree-decomposition of .v For each vertex ofGv , let be the subgraphTv of formed by the 0 0 0 bags that contain T. Let be the subgraphGv of induced by and theT division vertices 0 on the edges for whichvw isG thex tail. Then is connected.vw Thus , whichw is preciselyTx 0 0 0 Tthew set of bags of Tvthat intersectTx ,T formw a (connected)Tw subtree ofTv . Moreover,Tw for each orientedT edge of , if isG the division vertex of adjacent to , then and intersect. Since contains , and contains , we have that and intersect. 0 0 dist 0 ( ) + 1 ∈ ∈ Thus is a tree-decompositionG v, w 6 k of . vw G v Vi w Vj |i − j| 6 k + 1 V0 k + 1 V (G) V1 Note that k + 1 for each edge ofV (.G Thus,) if and i then> 0 0 0 0 Vi := V (G).∩ Let(V(k+1)bei ∪ theV(k union+1)i+1 of∪ the· · · ∪ firstV(k+1)(i+1)layers−1) restrictedV0,V1,... to , let be theV union(G) of the secondv ∈ Vi layersw ∈ restrictedVj to vw, andG so on. That|i − j is,| 6 for1 , Vlet1,V2,... G . Then is a partition of . Moreover, if and for some edge of , then . Thus + 1 0 0 is a layeringG of . k G G

SinceG each layer in consists of at most layers in , and6(k + each 1) layer in contains at most three vertices in a single bag, each of which are replaced by at most two vertices in , the layered treewidth of this decomposition is at most .

Theorem 11. Every -planar -vertex graph has treewidth at most 2p6( + 1) . Lemma9 and Theoremk 10 implyn the upper bound in Theorem1: k n

We now prove the corresponding lower bound.

8 Theorem 12. For 1 k 3 n there is a k-planar graph on n vertices with treewidth at √ 6 6 2 least c kn for some constant c > 0.

Proof. G n G n  > 0 G 3 Let be a cubic expander|E with(G)| =vertices.2 n Then has treewidth at leastG for 3n 0 0 0 3n 3n 4n2 some2k constant (seek for example [18G]). Considern a straight-line drawingn 6 n + of 2 .2k Clearly,< k each edge is crossed less than times. Subdivide each0 edge of at most √ G  0 n >times2 kn to produce a -planar graph with vertices, where . Subdivision does not change the treewidth of a graph. Thus has treewidth at least . tw( ) ≥ G 6 n√ k n k n Θ(min{n, kn}) Combiningk the boundn of Theorem 11 with the trivial upper bound for shows that the maximum treewidth of -planar -vertex graphs is for arbitrary and . This completes the proof of Theorem1. 4 (g, k)-Planar Graphs

(g, k) g k Recall that a graph is -planar if it can be drawn in a surface of Euler genus at most with at most crossings on each edge. The proof method used in Theorem 10 in conjunction Theorem 13. Every ( )-planar graph has layered treewidth at most (4 + 6)( + 1). with Theorem7 leadsg, to k the following theorem.G g k

Proof. G k Σ g G G0 G Consider a drawing of with at most crossings perG edge0 on a surface Σ of Euler genus . Arbitrarily orient each edge of g. Let be theG graph0 obtained from by 0 0 0 0 replacing2g + each 3 crossing by a new degree-4 vertex.T ThenG is embedded inV0 ,V1with,... no 0 0 0 Gcrossings, and thus has EulerT genus at most .2 Byg + Theorem 3 7, has layeredV treewidthi at 0 0 0 most v G. ThatT is,v there is a tree decompositionT of , and a layeringv of , such that each bag of contains at most vertices in each layer . For each vertexT of , let be the subtreeG of formed by the bags that contain . x T 0 x T

Let be the decompositionG of obtainedv byG replacingTv each occurrence ofT a dummy vertex 0 0 in a bag of byv the tailsGv of the two edges thatG cross at .v We now show that is a 0 0 tree-decomposition of .v For each vertex ofGv , let be the subgraphTv of formed by the 0 0 0 bags that contain T. Let be the subgraphGv of induced by and theT division vertices 0 on the edges for whichvw isG thex tail. Then is connected.vw Thus , whichw is preciselyTx the set of bags of that intersect , form a (connected) subtree of . Moreover, for each oriented edge of , if is the division vertex of adjacent to , then and

9 0 0 0 Tw Tv Tx Tw Tw Tv Tw T G intersect. Since contains , and contains , we have that and intersect. 0 0 dist 0 ( ) + 1 ∈ ∈ Thus is a tree-decompositionG v, w 6 k of . vw G v Vi w Vj |i − j| 6 k + 1 V0 k + 1 V (G) V1 Note that k + 1 for each edge ofV (.G Thus,) if and i then> 0 0 0 0 Vi := V (G).∩ Let(V(k+1)bei ∪ theV(k union+1)i+1 of∪ the· · · ∪ firstV(k+1)(i+1)layers−1) restrictedV0,V1,... to , let be theV union(G) of the secondv ∈ Vi layersw ∈ restrictedVj to vw, andG so on. That|i − j is,| 6 for1 , Vlet1,V2,... G G . Then k is+ 1 a partition Gof0 . Moreover, ifG0 and 2forg + some 3 edge of , then . Thus is a layering of . SinceG each layer in consists of at most layers in , and(4g each+ 6)( layerk + 1) in contains at most vertices in a single bag, each of which is replaced by at most two vertices in , the layered treewidth of this decomposition is at most .

Theorem 14. Every -vertex ( )-planar graph has treewidth at most Theorem 13 and Lemman 9 imply:g, k p 2 (4g + 6)(k + 1)n.

We now show that the bounds in Theorem 13 and Theorem 14 are tight up to a constant Theorem 15. For all g, k > 0 and infinitely many n there is an n-vertex (g, k)-planar factor. p graph with treewidth Ω( (g + 1)(k + 1)n) and layered treewidth Ω((g + 1)(k + 1)).

p × q × r (r − 1) The proof of this result depends on the separation properties of the grid graph (which is -planar). The next two results are not optimal, but have simple proofs and Lemma 16. For q ( 1 )r, every -separator of the q × r grid graph has size at least r. are all that is needed> 1 for− the main proof that follows.

Proof. S r − 1 q × r R S q − r + 1 S R Let be a set of at most vertices(q − r in+ the 1)r > qr grid graph. SomeS row avoids , and at least columns avoid . The union of these columns with induces a connected subgraph with at least vertices. Thus is not an Lemma 17. For p q ( 1 )r, every -separator of the p × q × r grid graph has size at -separator. > > 1− 1− least ( 1+ )qr.

10 Proof. G p×q×r n := |V (G)| = pqr S  G A1,...,Ac G−S |Ai| 6 n x ∈ [p] Gx := {(x, y, z): 1+ y ∈ [q],Let z ∈ [rbe]} the slicegrid graph.Gx belongs Let Ai Ai owns. Let Gbex an|Ai-separator∩ Gx| > 2 ofqr. Let be the components of . Thus . For , let

called a G.v Say Ai to Gwand Aj if v < w . 1+ iClearly,6= j noX two:= components{(y, z):(v, own y, z) the∈ G samev, (w, slice. y, z) First∈ Gw suppose} that|X| at> least2( 2 two)qr components− qr = qr each own( ay, slice. z) ∈ X That is, belongs to(v, y,and z), (v +belongs 1, y, z),..., to (w,for y, z some) and 1− 1 . LetS |S| .> Then|X| > qr > 1+ qr  > 2 . For each , the ‘straight’ path A1 A1containst some 1+ 2 2 vertext( in 2 ).qr Since6 |A thesei| 6 pqr paths aret pairwise6 1+ p disjoint, (1 − 1+ )p (since ). Now assume that at most oneGv component, say , ownsGv − S a slice. Say owns Aslices.i 1+ 1+ Thus ( 2 )qr and . Hence,S ∩ Gv at least( 2 ) slices belongq × r to no 2 1− component. For suchGv a slice , each|S component∩ Gv| > r of |S| >is(1 contained− 1+ )pr in> some( 1+ )qr and thus has at most vertices. That is, is a -separator of the grid graph induced by . By Lemma 16, . Thus .

Corollary 18. For p q 2r, the p × q × r grid graph has treewidth at least 1 qr. Note that Lemma6 and> Lemma> 17 imply: 3

p × q × r qr This lower bound is within a constant factor of optimal, since Otachi and Suda [23] proved thatProof the of Theorem 15grid. graphr := hask + pathwidth, 1 and thus treewidth, at most .

19 × × 2 g 6Let G . q q r q > r 1 G k (g, k) 2 G First suppose that1 qr . Let be the Ggrid graph where 1.qr As− observed1 p 3 3 above,Ω( (gis+ 1)(-planark + 1) andn) thus -planar. Lemma 17 implies that every -separator of has size at least . Lemma6 thus implies that has treewidth at least , which g 20 H m := b g c 5 is > , as desired. 4 > H 2m H 2m p Now assume that . By Lemma4m 65g there is a 4-regular expanderq := n/rmon vertices.q > Thus8r Ghas edges, embedsH in the orientable surfacev withH handles, and qthus× q has× r Euler genus at most Dv. We may assume that vw H is an integer withqr . Let beG obtained[Dv ∪ Dw from] 2qby× replacingq × r each vertex of by a copy ofG the (g, k) grid graphq2rm with= vertexn set , and replacing each edge of by a matching of edges, so that is a grid, as shown in Figure2. Thus is S 1 G A ,...,A G − S |A | 1 n -planar2 with vertices.1 c i 6 2 0 0 0 i ∈ [c] S := A1 := ··· := Ac := ∅ Let be a -separator in . Let be the components of . Thus for . Initialise sets .

11 G

Figure 2: Construction ofqr in the proof of0 Theorem 15. qr v H |S ∩ Dv| > 14 v ∈ S |S ∩ Dv| < 14 13 1 1−13/15 1  = 15 q > 8r > 1−13/15 r 1+13/15 = 14 13 For each vertex of , if S ∩ Dv 15then put . Otherwise, Dv − S. 13 2 13 1 Note that Lemma15 q r 17 is applicable15 with> 2 since Dv and− S . 13 2 0 Lemma15 q r 17 thus implies that is not a -separator.Ai Hencei some∈ [c] componentv ofAi 0 0 0 Shas,A at1....,A least c vertices. SinceV (H) , exactly one component of has at least vertices. This component is a subgraph of for some ; add to . Thus S0 15 H v ∈ A0 w ∈ A0 is a partition26 of . i j vw H D 2q × q × r Dv ∪ Dw 0 0 qr qr qr We nowv 6∈ proveS thatw 6∈ isS a -separator|S ∩ D inv| <. Suppose14 |S that∩ Dw| < 14and |S ∩forD| some< 7 3 1 1−3/4 1 edge of . Let be the vertex set of the= 4 q grid> 8r graph > 1− induced3/4 r by1+3/4 = 7 . 3 Since and , weS have∩ D 4 and G[D] . Thus . 3 3 2 XNoteG that[D] − LemmaS 17 is applicable4 |D| with= 2 q r since Dv Dwand . 2 1 2 Lemmaq r17 thus impliesX that Dv isD notw a -separator of 2 q.r Hence someX component 0 of v containsw at least Ai vertices. Each of andH can contain at 0 0 0 0 Amosti Averticesj in . Thus andH −eachS contain at least Averticesi in i.∈ Thus,[c] by 1 2 13 2 0 0 15 0 15 construction,2 q rm > |andAi| > 15areq r in|A thei| same .|A Thati| 6 is,26 m there is no edgeS of 26between distinctH and , and each component of is contained in some . For each , we have implying . Therefore is a -separator in .

12 0 qr 0 β |S | > βm β > 0 |S| > 14 |S | > 14 mqr β β √ p G 14 mqr − 1 = 14 mrn − 1 > Ω( g(k + 1)n) By Lemma5, for some constant . Thus . By Lemma√ 6, Ω(p ( + 1) ) tw( ) 2 has treewidth at leastG ` g k n, as6 desired.G 6 `n ` > Ω((g + 1)(k + 1)) Finally, by Lemma9, if has layered treewidth then , implying . k = 0 et al.

Note that the proof of Theorem 15 in the case is very similar to that of Gilbert tw( ) [15]. gk > n G 6 n (g, k) n p Θ(minFor {n, (gthe+ 1)( trivialk +1) uppern}) bound of g, k, n is better than that given in Theo- rem 14. We conclude that the maximum treewidth of -planar -vertex graphs is for arbitrary . This completes the proof of Theorem2. 5 Drawings with Few Crossings per Edge

Σ g m G m Σ O( g+1 ) This section studies the following natural conjecture:g = 0 for every surface of Euler genus , every graph with edges has a drawing in with crossingsm per edge. This conjectureg is= trivial 2m at both extremes: with , every graph has a straight-line drawing in the plane (and therefore a drawing in the sphere) with at most crossings per edge, and with , every graph has a crossing-free drawing in the orientable surface with one handle per edge. Moreover, if this conjecture is true, it would provide a simple proof of Theorem 15 in the same manner as the proof of Theorem 12.

Our starting point is the following well-known result of Leighton and Rao [22, Theorem 22, Theorem 19 . Let be a graph with bounded degree and vertices, mapped one-to- p. 822]: G n one onto the vertices of an expander graph H. Then the edges of G can be mapped onto paths in H so([22 that]) each path has length O(log n) and each edge of H is used by O(log n) paths.

G H It is straightforward to extend this result to regular graphs of unbounded degree, with the number of paths per edge of increasing in proportion to the degree. However, there are two difficulties with using it in our application. First, it does not directly handle graphsG in which there is considerable variation in degree from vertex to vertex: in such cases we would want the number ofG pathsH per edge to be controlled by the average degree in , but instead it is controlled by the maximum degree. And second, it does not allow us to control separately the sizes of and ; instead, both must have the same number of vertices.

13 G H G H To handle these issues, we do not map the vertices of our input graph directly to the vertices of an expander ; instead, we keep the vertices of and the vertices of disjoint from each other, connecting them by a bipartite graph that balances the degrees, according Lemma 20. Let d , d , . . . , d be a sequence of positive integers, and let q be a positive in- to the following lemma.1 2 n teger. Then there exists a bipartite graph with colour classes {v1, . . . , vn} and {w1, . . . , wq}, at most n + q − 1 edges, and a labelling of the edges with positive integers, such that

• each vertex vi is incident to a set of edges whose labels sum to di, and

• each pair of distinct vertices wi and wj are incident to sets of edges whose label sums differ by at most 1.

P P Proof. b di/qc d di/qe wi P di

Preassignd1, . . label . , dn sums of or to each vertex so that the resulting values sum to . We will construct a bipartite graph and a labelling whose sums match the numbers on one side of the bipartition and whose sums match the preassigned numbers on the other side. vi wj

Build this graph and its labelling one edge at a time, starting from a graph with no edges.vi

Atwj each step, let and be the vertices on each side of the bipartition with the smallest indices whose edge labels do not yet sum to the required values, add an edge from to , and label this edge with the largest integer that does not exceed the required sum on either vertex. P di

Each stepvn completeswq the sum for at least one vertex. Because the required values on the two sides of the bipartition bothn + sumq − to1 , the final step completes the sum for two vertices, and . Therefore, the total number of steps, and the total number of edges added to the graph, is at most . G H By combining this load-balancing step with the Leighton-RaoH expander-routing scheme, we maycyclomatic obtain a more number versatileH mapping of our given graph to a host graph n , with better mcontrol overm the− genusn + 1 of the surface we obtain from . This genus will be determined by the of , where the cyclomatic number of a graph with vertices and edges is . This number is the dimension of the cycle space of the graph, and the first Betti number of the topological space obtained from the graph by replacing each Lemma 21. Let G be an arbitrary graph, with m edges, and let Q be a q-vertex bounded- edge by a line segment. degree expander graph. Then there exists a host graph H, a one-to-one mapping of the

14 5 5 7 5 5 4 3 3 2 1

4 7 1 4 4 1 4 2 1 3 2 1 3 3

2 7 1 8 8 7 7

7, 5, 5, 4, 3, 3, 2, 1

Figure 3: A graph (left) with degree sequence and a bipartite graph (right) formed from this degree sequence by Lemma 20. The large numbers are the edge labels of the lemma, and the small numbers along the top and bottom of the bipartite graph give the sums of incident edge labels at each vertex. The top sums match the given degree verticessequence, of whileG to a the subset bottom of vertices sums all of differH, and by at a mapping most 1. of the edges of G to paths in H, with the following properties:

• The vertices of H that are not images of vertices in G induce a subgraph isomorphic to Q.

• The image of an edge e in G forms a path of length O(log q) that starts and ends at the image of the endpoints of e, and passes through the image of no other vertex of G.

• Each vertex of H that is not an image of a vertex in G is crossed by O((m log q)/q) paths.

• The cyclomatic number of H is O(q).

Proof. G u1, . . . , un G

H {v1, . . . , vn}, {w1, . . . , wq}

Let the vertices of (wibe, wj) .{ Applyw1, . . . Lemma , wq} 20 to the degree sequence of

Qto form a bipartite graph uwithi bipartitionG vi H . Then add edges between pairs of vertices so that inducesQ a subgraph isomorphic to . In thisH way, each vertex in is mappedQ to a vertexn + q −in1 so that the mapping is one-to-one and the unmappedn vertices form a copy of , asQ required. The cyclomatic number of equals the cyclomatic number of , plus Q (forq − the1 added edgesO(q) in the bipartite graph), minus (for the added vertices relative to ). These two added and subtracted terms cancel, leaving the cyclomatic number of plus , which is as required.

15 H G uiuj

G (wi0 , wj0 ) vi vj H

It remains to find pathsG in corresponding to the{ edgesv1, . . . in , vn}. Assign{w1, each . . . , w edgeq} of to a pair of vertices adjacent to the images and in , so that theQ number of edges of assignedO(log toq each) edge between (wi0 , wjand0 ) equals the corresponding label. Complete each path by applying Theorem 19 to the copyO(m/q of ); this gives paths of length connecting each pair obtainedQ in this way. TheseO(log q pairs) do not form a bounded-degree graph, but they can be partitionedQ into bounded-degreeO((m log graphs,q)/q) each of which causes each vertex in the copy of to be crossed times. Combining these suproblems, each vertex in the copy of is crossed by a total of paths, as required.

We are now ready to prove the existence of embeddings with small local crossing number, Proofon surfaces of Theorem of arbitrary3. genus. G g q O(q) H Given a graph , tog be embedded on a surface with at most Hhandles and with few crossingsG H per edge, choose so that the bound on the cyclomatic number of the graph in Lemma 21 is at most , and apply Lemma 21 to find a graph and a mapping from to obeying the conditions of theG lemma. d H d To turn this mapping into the desired embedding of , replace each vertex of degree in byxy a sphere,H punctured by the removal of unit-radius disks, and form a surface (as a cell complex, not necessarilyx y embedded into three-dimensional space) by replacing each edge of by a unit-radius cylinder connectingH boundariesg of removed disks on the spheres for vertices and . The number of handles on the resulting surface (shown in Figure4) equals the cyclomatic number of , which is at most .

Figure 4: A topological surface obtained by replacing each vertex of a graph by a punctured sphere, and each edge of the graph by a cylinder connecting two punctures. Image Square pyramid pyramid.png by Tom Ruen on Wikimedia commons, made available under a Creative Commons CC-BY-SA 4.0 International license.

16 G H G Embed each vertex of as anH arbitrarily chosen point on the sphere of the corresponding vertex of , and each edge of as a curve through the sequence of spheres and cylinders corresponding to its path in . Choose this embedding so that no intersection of edge curves occurs within any of the cylinders, and so that every pair of edges that are mapped to curves on the same sphere meet at most once, either at a crossing point or a shared endpoint. G O(log g) Because the spheres that contain vertices of O((onlym log containg)/g) curves incident to those vertices, they do not have any crossings. Each edge is mapped to a curveO through((m log2 g)/g) of the remaining spheres, and can cross at most other curves within each such sphere. Therefore, the maximum number of crossings per edge is . 6 Map Graphs

g = 0 H {A, B} Thehalf-square following characterisationH2[A] of map graphsA makes them easier to dealA with (and is well known in the case [4]). Consider a bipartiteB graph with bipartition . Define the graph with vertex set , where two vertices in are adjacent if and Lemma 22. A graph is a ( )-map graph if and only if is isomorphic to 2[ ] for only if they have a commonG neighbourg, d in . G H A some bipartite graph H with Euler genus at most g and bipartition {A, B}, where vertices in B have maximum degree at most d.

Proof. (=⇒ G (g, d) G0

g G0 H

) Say is a -map{A, B graph} definedA with respect to someG graph0 B embedded:= V (G0) in a surface of Eulerv ∈ A genus , where each facew of∈ Bis aw nation or a lake. Let be theG0 bipartite graph withv bipartitionH , where is the set of nationsG0 of and G , where a vertexH2[A] is adjacent to a vertexw B if is incident to the face in correspondingw G0 to . Then dembeds in the same surface as , and by definition, is isomorphic to . The degree of a vertex in equals the number of nations incident (⇐= { } to in , which is at most . H A, B B d H g

) Consider a bipartite graphG0 with bipartitionV (G0) := B , whereuw vertices∈ E(G0) in have vumaximumvw degree at most . From an embedding of v in∈ A a surface of Euler genusH , construct an embeddedv ∈ A graphvw1, vw2with, . . . , vertex vwp set , where wheneverv

and areH consecutive(w1, edges w2, . . . incident , wp) to some vertexG0 in the embedding of . So, for each vertex G,0 if is the cyclic order of edges incidentk to> 3 in the embedding of , then is a face of , which we label as a nation. Label every other face of as a lake. Note that a lake occurs whenever, for some , there

17 (v1, w1, v2, w2, . . . , vk, wk) H vi ∈ A wi ∈ B (w1, w2, . . . , wk)

G0 G0

Ais a face w G0 of with and .w Then wis a lakeH of . By construction,d the nations of are in 1–1 correspondencew withG0 vertices in , and for each vertex of , theA number of nations incidentw H to equalsH2[A the] degree of in , which(g, d) is at most . Two nations areG incident0 to a common vertex of if and only if the corresponding vertices in are both adjacent to in . Thus is isomorphic Lemma 23. Let H be a bipartite graph with bipartition {A, B} and layered treewidth to the -map graph associated with . k with respect to some layering A1,B1,A2,B2,...,At,Bt, where A = A1 ∪ · · · ∪ At and 2 B = B1 ∪ · · · ∪ Bt. Then the half-square graph G = H [A] has layered treewidth at most k(2d+1) with respect to layering A1,A2,...,At, where d is the maximum degree of vertices in B.

Proof. T H X w B ∩ X w X NH (w) w X v A

Let be the given tree decomposition ofNH.(v For) ∪ each{v} bag NandH (v) for∪ { eachv} vertex in , replace inH by and delete fromv . Each vertex in is nowT precisely in the bags that previously intersected . Since induces ∈ ( ) ∈ ( ) ∈ a connected subgraphuv ofE ,G the bagsu, that v nowNH containw formw a connectedB subtree of .u v G u ∈ Ai vConsider∈ Aj anw edge∈ B` uw.∈ ThenE(H) A1,B1,Afor2,B some2,...,At,B.t By construction,H and are` ∈ in { ai, i common− 1} bag, and` we∈ { havej, j − a1} tree decomposition|i − j| 6 1 of . SayA1,A2,...,Aandt and G . Since and is a layering of , we have . Similarly, . Thus . Hence is | ∩ | ∈ ∩ a layering of . X Ai X Ai v X Ai v X H v w

(WeBi ∪ nowBi+1 upper) ∩ X bound for each bag andw layer . If 2k , then (1) w was in in the givend tree decompositionX of , or (2) is adjacentv to some vertexk in |X ∩ Ai| 6 k + 2.kd Thus, the number of such vertices is at most . Each such vertex contributes at most vertices to . The number of type-(1) vertices is at most . Thus .

The next lemma is a minor technical strengthening of Theorem7. We sketch the proof for Lemma 24. Let V1,V2,...,Vt be a bfs layering of a connected graph G of Euler genus completeness. at most g. Then G has a tree decomposition of layered width 2g + 3 with respect to

V1,V2,...,Vt.

Proof Sketch. r Vi = {v ∈ V (G) : dist(v, r) = i} T

G r v G Pv vr

T v ∈LetVi beP thev vertex for which Vj j ∈ {0, . . . , i}. Let be a bfs tree of rooted at . For each vertex of , let be the vertex set of the -path in . Thus if , then contains exactly one vertex in for .

18 G0 G V (G0) = V (G) F G0 G n |LetF | = 2ben + a 2 triangulationg − 4 |E(G of0)| =with 3n + 3g − 6 (allowing parallel edges on distinct faces). Let be the set of faces of . Say has vertices. By Euler’s formula, 0 D and G . F T |V (D)| = |F | = 2n + 2g − 4 Let|E(D)|be= the|E(G subgraph0)| − |E( ofT ) the| = dual (3n + of 3g −with6) − vertex(n − 1) set = 2,n where+ 3g two− 5 vertices areet adjacent al. if the correspondingD faces share an edge not in . Thus and . Dujmovi´c [10] ∗ | ( ∗)| = | ( )| − 1 = 2 + 2 − 5 provedT that is connected. D E T V D n g X := E(D) − E(T ∗) |X| = (2n + 3g − 5) − (2n + 2g − 5) = g f = xyz 0 LetG beCf a:= spanning∪{Pa ∪ P treeb : ab of∈ X.} ∪ ThusPx ∪ Py ∪ Pz |X| = g Pv . Let

. Thus Cf 2g + 3 . For each face ∗ etof al., let (Cf : f ∈ F ) T . Since G and each contains at most one vertex in each layer, contains at most vertices in each layer. Dujmovi´c [10] proved that is a -decomposition of .

Theorem 25. Every (g, d)-map graph has layered treewidth at most (2g + 3)(2d + 1). We now present the main results of this section.

Proof. G (g, d) G G G Let Gbe a -map graph.H2[A] Since the layered treewidthH of equals the maximum{A, B} layered treewidthg of the componentsB of , we may assumed thatH is connected.G By HLemma 22, is isomorphic to r ∈ Afor somei > bipartite1 A graphi with bipartition H and Euler2 genusi − 2 , wherer verticesBi in have degree at most Hin . Since 2isi − connected,1 r

is connected.H Fix a vertex A. For= A1 ∪ ...,A, lett beB the= B set1 ∪ of· · · vertices ∪ Bt of att distanceA1,B1,...,Afromt,Bt , and let be theH set of vertices of H at distance from . 2 Since is bipartite2g + and 3 connected, A1,B1,...,At,Bandt H [Afor] some , Gand is a bfs layering(2g + 3)(2 of d.+ By 1) Lemma 24, has a tree decomposition of layered width with respect to . By Lemma 23, and thus has layered treewidth at most .

Theorem 26. Every n-vertex (g, d)-map graph has treewidth at most Lemma9 and Theorem 25 imply: p 2 (2g + 3)(2d + 1)n − 1. √ d O( dn)

Note that Chen [2] proved that -map graphs have separators of size , which is 1 implied by Theorem 26 and Lemma6. p, q, r > Yp,q,r (p + 1) × (q + 1) We now show that Theorem 26 and thus Theorem 25 are tight. For integers , let be the plane graph obtained from the grid graph by subdividing

19 r − 1 4r

Yp,q,r deach:= 4edger times, and then addingYp,q,r a vertex adjacent to the vertices of each internal face. AsZ illustratedp,q,r in Figure5, d is an internal triangulation with maximum degree . Label each internal face of as a nation, label the external face as a lake, and let be the associated -map graph.

Yp,q,r

q

K4r Zp,q,r r p

Zp,q,r Yp,q,r

Zp,q,r Figure 5: is the map graph of . The bottom figure shows the rows and columns ofLemma 27.(andFor omits ∈ other(0, 1) edges).and integers p > q > 1 and r > 1, every -separator of Zp,q,r 2(1−)pqr has size at least p+q > (1 − )qr.

Proof. Zp,q,r pr 2q qr 2p

TheS vertices of can beZp,q,r partitionedS into ‘columns’pr inducing−|S| paths of length qrand−|S|‘rows’ inducing paths of length , such that each row and column are joined by an edge. Let be an -separator of . Thus avoids at least columns and at least rows. Since each row and column are adjacent, the union of these rows and columns

20 S 2q(pr − |S|) + 2p(qr − |S|) = 4pqr − 2|S|(p + q) 4pqr − 2|S|(p + q) 6 |V (Zp,q,r)| = 4pqr 2(1−)pqr |thatS| > avoidp+q induces a connected(1 − subgraph)qr withp > atq least vertices. Thus . Hence Theorem 28. For all g > 0 and d > 8, for infinitely many integers n, there is an n-vertex p (g, d)-map graph, which with is treewidth at least Ω( (g +since 1)dn) and layered. treewidth Ω((g + 1)d).

d Proof. r := b 4 c r > 2 19 = 4 2 Let .g Thus6 . n n q r q > 1 G Zq,q,r G n G (0, 4r) 1 First suppose that(g, d) . Infinitely many values of satisfy 2 for some integerG . Let 1 qrbe . Then has vertices.G As observed above, 1isqr a− 1 -map p 2 2 Ω(graph(g and+ 1) thusdn) a -map graph. Lemma 27 implies that every -separator of has size at least . Lemma6 thus implies that has treewidth at least , which is g 20 H m := b g c 5 , as desired.> 4 > H 2m H 2m Now assume that . By Lemma4m5 6thereg is a 4-regular expander onn 2 vertices.n = (4q r Thus− 16r)mhas edges, qembeds> 100 in the orientable surface with handles, and thus has Euler genus at most . For infinitely many values of , we have that G0 for someH integer . v H (q + 1) × (q + 1) Yv

Let vwbe obtainedH from as follows.Yv ForY eachw vertex of introduce( aq copy− 1) of the

grid graph with the four corner vertices deleted,H denotedG by0 . For each edge of , identify oneH side of with (whereH a side consists of a -vertex

(2path).q + 1) The× ( sidesq + 1) are identified according to the embeddingG0 of , so that G0is embedded in the sameH surface as . Note that each edge of is associated with a copy ofr − the1 grid graph with six vertices deleted in . Each facef of corresponds4r to a face of or4 isr a 4-face inside one of the grid graphs. Now, subdividef G0 each edge times. For each faceH inside one of the grid graphs, which isG now0 a face of size , add a vertexG0 of degree adjacent to each vertex onH the boundary of . So G0embeds in the same surfacemax{d, as8} .= Labeld the resulting triangular faces of as nations. Label the faces of that correspond to the original faces of as lakes. Every vertex of is incident to ( ) at mostG g, d nations. G0 H G Zq,q,r 4r Let be the Z-mapv graph of ,4 asq2r illustrated− 16r in FigureG6. Each vertexvw of H is associated in Gwith a copy of Z2q,q,rwith the four corner cliques of4 sizer deleted. Denote this subgraphZvw by , which contains8q2r−32r verticesG in .G Each(4 edgeq2r−16rof)m = isn associated in with a copy of with eight cliques of size deleted. Denote this subgraph by , which contains vertices in . In total, has S 1 G A ,...,A G − S |A | 1 n vertices. 2 1 c i 6 2

Let be a -separator in . Let be the components of . Thus

21 0 0 0 i ∈ [c] S := A1 := ··· := Ac := ∅ for . Initialise sets .

q

Zv Zw

Zvw q q

Zvw G

Figure 6: A subgraph of in the proof of Theorem 28. v qr 0 v H |S ∩ Z | > 6 − 16r v ∈ S v qr v 5 v v |S ∩ Z | < 6 − 16r S ∩ Z 6 Z S ∩ Z 5 qr 16Considerr each vertex of 6 . If Zq,q,r then put 6 . Otherwise, . Suppose that is a -separator of . Then plus the deleted vertices form a -separator in , which has size at least by Lemma 27.

22 v qr 5 |S ∩ Z | > 6 − 16r S ∩ Zv 6 v v 5 v 5 1 Z Z − S 6 |Z | 6 > 2 v 5 v Thus Z − S, which is a contradiction.6 |Z | Hence is not a -separatorA ofi 0 0 0 0 . Hencei ∈ some[c] componentv Ai of S ,Ahas1....,A at leastc vertices.V ( SinceH) , exactly one component of has at least vertices. This component is a subgraph of S0 3 H v ∈ A0 w ∈ A0 for some ; add to 5 . Thus is a partitioni of . j 0 0 v qr w qr vw H v 6∈ S w 6∈ S |S ∩ Z | < 6 − 16r |S ∩ Z | < 6 − 16r vw qr We now|S prove∩ Z that| < 3 −is32 a r-separator in . Suppose that and for some edge of . Since and , we have and . S ∩ Zvw 3 Zvw S ∩ Zvw 32r Thus .4 3 2(1−3/4)(2q)qr qr 4 Z2q,q,r 2q+q = 3 vw qr vw Supposep = that 2q |Sis∩ a Z-separator| > 3 − of32r . Then plus the deletedS ∩ verticesZ 3 vw vw form a4 -separator inZ , which has size at least X Z − S by Lemma 27 3 vw 3 v 3 w v w (with4 |Z | = 2 |Z).| Thus= 2 |Z | , which is a contradiction.Z Z Hence is |notZv| a= |-separatorZw| of X . ThereforeX some component of containsZv at leastZw 0 v vertices.w Of course, eachAi of and can containH at most 0 0 0 0 Ai verticesAj in . Thus containsH − atS least half the verticesA ini both andi ∈ [c]. Hence, by construction, and are in the same . That is, there is no edge of between 1 (4 2 − 16 ) = 1 | | 5 (4 2 − 16 )| 0 | distinct and , and2 q eachr componentr m 2 ofn > Ai >is6 containedq r inr someAi . . For each ,

0 3 0 3 |Ai| 6 5 m S 5 H

|S0| βm β > 0 |S| ( qr − 16r)|S0| βmr( q − 16) Thus . Therefore> is a -separator in . > 6 > 6 G By Lemma5, for some constant p. Thus . ( q − 16) − 1 Ω( ) = Ω( · · 2 ) = Ω(p ) By Lemma6, βmrhas6 treewidth at> leastmrq m r q rm gdn ,

√ Ω(p( + 1) ) tw( ) 2 as desired. G ` g dn 6 G 6 `n ` > Ω((g + 1)d) Finally, by Lemma9, if has layered treewidth then , implyinggd > n . tw(G) 6 n (g, d) n p Θ(minFor {n, (gthe+ 1)( triviald + 1) uppern}) bound of g, d, n is better than that given in Theo- rem 26. We conclude that the maximum treewidth of -map graphs on vertices is for arbitrary . This completes the proof of Theorem4. 7 Pathwidth

O(n)  ∈ (0, 1) O(n) It is well known that hereditary graph classes with treewidth , for some fixed , in fact have pathwidth ; see [1] for example. In particular, the following more specific

23 √ √ O( n) O( n) result means that all the treewidth upper bounds in this paper lead to Lemma 29. Let be a graph with vertices such that every induced subgraph 0 of G n √ G G pathwidth0 upper bounds. We include the proof for completeness. p −1 with n vertices has treewidth at most c n0 − 1 for some constant c > (1 − 2/3) . Let p c0 := c(1 − 2/3)−1. Then √ 11c√ pw(G) c0 n − 1 < n − 1. 6 2

Proof. 0 1 n > √ G0 G n0 c0 n0 − 1 n0 = 1 G0 We0 proceed by induction on (1with− p the2 3) hypothesis−1 that every non-empty0 c > / √ G G subgraph0 of with vertices has0 pathwidth at most 0 − 1. If then 0 has n G√ c n G 1 0 0 pathwidth2 andS the claim holdsc sincen . ConsiderG − aS subgraph of n0 0 with2 vertices. By assumption, hasG treewidth− S at most . By Lemma6, has n0 2 0 a -separator of size at most . Thus each component2 6 3 n of contains at most 2 0 vertices. Group the components of as follows, starting with3 eachn component in 2 0 its own group. So initially each group has at most vertices.3 n While thereA are at Bleast three groups, mergeG0 the two smallest groups, which have at most A verticesB in total. q Upon termination, there0 2 are0 at most two groups, each with at most vertices. Let and c 3 n − 1 A1,...,Aa B1,...,Bb be the subgraphsA of Binduced by the twoA groups.1 ∪ S,...,A By induction,a ∪ S,S,B1 ∪andS,...,Beachb ∪ haveS pathwidth at most G0 . Let and be the corresponding path decompositionsr2 of and respectively.r2 Then√ r2 √ √ is c0 n0 − 1 + |S| c0 n0 − 1 + c n0 = (c0 + c) n0 − 1 = c0 n0 − 1, a path decomposition3 of 6 with3 width 3 √ G c0 n as desired. Hence has pathwidth at most . √ Theorem 30. Every n-vertex graph with layered treewidth k has pathwidth at most 11 kn− Lemma9 and Lemma 29 imply: 1.

Acknowledgement.

This research was initiated at the 3rd Workshop on Graphs and Geometry held at the Bellairs Research Institute in 2015. Thanks to Thomas Bl¨asiusfor pointing out a minor error in a preliminary version of this paper. References

k Theoret. Comput. Sci. 209(1-2) [1] H. L. Bodlaender, A partial -arboretum of graphs with bounded treewidth. , :1–45, 1998.

24 J. 41(1) [2] Z.-Z. Chen, Approximation algorithms for independent sets in map graphs. , k J. Graph Theory :20–40, 2001. 55(4) [3] Z.-Z. Chen, New bounds on the edge number of a -map graph. , J. ACM 49(2) :267–290, 2007.

[4] Z.-Z. Chen, M. Grigni, and C. H. Papadimitriou, Map graphs. , :127–138, 2002. SIAM J. Discrete Math. 18(3) [5] E. D. Demaine, F. V. Fomin, M. Hajiaghayi, and D. M. Thilikos, Bidimensional parame- ters and local treewidth. , :501–511, 2004/05. (k, r) ACM Trans. Algorithms [6] 1(1)E. D. Demaine, F. V. Fomin, M. Hajiaghayi, and D. M. Thilikos, Fixed-parameter algorithms for -center in planar graphs and map graphs. , :33–47, 2005. Proc. 15th Annual ACM-SIAM Symposium [7] onE. D.Discrete Demaine Algorithms and M. (SODA Hajiaghayi ’04), Equivalence of local treewidth and linear local treewidth and its algorithmic applications. In J. Combin. Theory Series B. , pp. 840–849, SIAM, 2004. 110 [8] V. Dujmovi´c, Graph layouts via layered separators. , :79–89, 2015. SIAM J. Comput. 34(3) [9] V. Dujmovi´c, P. Morin, and D. R. Wood, Layout of graphs with bounded tree-width. , :553–579, 2005.

[10] V. Dujmovi´c, P. Morin, and D. R. Wood, Layered separators in minor-closed families Chicago with applications. Electronic preprint arXiv: 1306.1595, 2013. J. of Theoretical Computer Science 2016(1) [11] V. Dujmovi´c, A. Sidiropoulos, and D. R. Wood, Layouts of expander graphs. , , 2015.

[12] Z. Dvor´ak and S. Norin, Treewidth of graphs with balanced separations. Electronic Algorithmica preprint arXiv: 1408.3869, 2014. 27 [13] D. Eppstein, Diameter and treewidth in minor-closed graph families. , :275–291, 2000. Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete [14] AlgorithmsF. V. Fomin, D. Lokshtanov, and S. Saurabh, Bidimensionality and geometric graphs. In , pp. 1563–1575, 2012. J. Algorithms 5(3) [15] J. R. Gilbert, J. P. Hutchinson, and R. E. Tarjan, A separator theorem for graphs of bounded genus. , :391–407, 1984.

25 Algorithmica 49(1) [16] A. Grigoriev and H. L. Bodlaender, Algorithms for graphs embeddable with few Combina- crossings per edge. , :1–11, 2007. torica 23(4) [17] M. Grohe, Local tree-width, excluded minors, and approximation algorithms. J. Combin. Theory , :613–632, 2003. Ser. B 99(1) [18] M. Grohe and D. Marx, On tree width, bramble size, and expansion. , :218–228, 2009. J. Combinatorial Theory 4 [19] R. K. Guy, T. Jenkyns, and J. Schaer, The toroidal crossing number of the complete J. Geometry 8(1-2) graph. S , :376–390, 1968. Bull. [20] R. Halin, -functions for graphs. , :171–186, 1976. Amer. Math. Soc. (N.S.) 43(4) [21] S. Hoory, N. Linial, and A. Wigderson, Expander graphs and their applications. , :439–561, 2006. J. ACM 46(6) [22] T. Leighton and S. Rao, Multicommodity max-flow min-cut theorems and their use in Discrete designing approximation algorithms. , :787–832, 1999. Math. 311(10-11) [23] Y. Otachi and R. Suda, Bandwidth and pathwidth of three-dimensional grids. Combinatorica , :881–887, 2011. 17(3) [24] J. Pach and G. Toth´ , Graphs drawn with few crossings per edge. , :427–439, 1997. Surveys in London Math. Soc. Lecture Note Ser. [25] B. A. Reed, Tree width and tangles: a new connectivity measure and some applications. In , vol. 241 of , pp. 87–162, Cambridge Univ. Press, 1997. J. Algorithms 7(3) [26] N. Robertson and P. D. Seymour, Graph minors. II. Algorithmic aspects of tree-width. Electron. J. , :309–322, 1986. Combin. DS21 [27] M. Schaefer, The graph crossing number and its variants: A survey. 29th Euro- , , 2014. pean Workshop on Computational Geometry (EuroCG 2013) [28] F. Shahrokhi, New representation results for planar graphs. In , pp. 177–180, 2013, arXiv: 1502.06175. Algorithmica 16(1) [29] F. Shahrokhi, L. A. Sz´ekely, O. S´ykora, and I. Vrt’o, Drawings of graphs on surfaces with few crossings. , :118–131, 1996.

26