Two Results on Layered Pathwidth and Linear Layouts

Layered pathwidth is a new graph parameter studied by Bannister et al (2015). In this paper we present two new results relating layered pathwidth to two types of linear layouts. Our first result shows that, for any graph $G$, the stack number of $G$ is at most four times the layered pathwidth of $G$. Our second result shows that any graph $G$ with track number at most three has layered pathwidth at most four. The first result complements a result of Dujmovi\'c and Frati (2018) relating layered treewidth and stack number. The second result solves an open problem posed by Bannister et al (2015).


Introduction
The treewidth and pathwidth of a graph are important tools in structural and algorithmic graph theory. Layered treewidth and layered H-partitions are recently developed tools that generalize treewidth. These tools played a critical role in recent breakthroughs on a number of longstanding problems on planar graphs and their generalizations, including the queue number of planar graphs [13], the nonrepetitive chromatic number of planar graphs [12], centered colourings of planar graphs [8], and adjacency labelling schemes for planar graphs [7,11].
Motivated by the versatility and utility of layered treewidth, Bannister et al. [2,3] introduced layered pathwidth, which generalizes pathwidth in the same way that layered treewidth generalizes treewidth. The goal of this article is to fill the gaps in our knowledge about the relationship between layered pathwidth and the following well studied linear graph layouts: queue-layouts, stack-layouts and track layouts. We begin by defining all these terms.

Layered Treewidth and Pathwidth
A tree decomposition of a graph G is given by a tree T whose nodes index a collection of sets B 1 , . . . , B p ⊆ V (G) called bags such that (1) for each v ∈ V (G), the set T [v] of bags that contain v induces a non-empty (connected) subtree in T ; and (2) for each edge vw ∈ E(G), there is some bag that contains both v and w. If T is a path, the resulting decomposition is a called a path decomposition. The width of a tree (path) decomposition is the size of its largest bag. The treewidth (pathwidth) of G, denoted tw(G) (pw(G)), is the minimum width of any tree (path) decomposition of G minus 1.
A layering of G is a mapping : V (G) → Z with the property that vw ∈ E(G) implies | (v) − (w)| ≤ 1. One can also think of a layering as a partition of G's vertices into sets indexed by integers, where L i = {v ∈ V (G) : (v) = i} is called a layer. A layered tree (path) decomposition of G consists of a layering and a tree (path) decomposition with bags B 1 , . . . , B p of G. The (layered) width of a layered tree (path) decomposition is the maximum size of the intersection of a bag and a layer, i.e., max{|L i ∩ B j | : i ∈ Z, j ∈ {1, . . . , p}}. The layered treewidth (pathwidth) of G, denoted ltw(G) (lpw(G)) is the smallest (layered) width of any layered tree (path) decomposition of G. Figure 1 shows a layered path decomposition of a grid with diagonals, G, in which each pair of consecutive columns is contained in a common bag B i each row is contained in a single layer L j := {x ∈ V (G) : (x) = j}. This decomposition shows that G has layered pathwidth 2 since each bag B i contains two elements per layer L j .
Note that while layered pathwidth is at most pathwidth, pathwidth is not bounded 1 by layered pathwidth. There are graphs-for example the n × n planar grid-that have unbounded pathwidth and bounded layered pathwidth. Thus upper bounds proved in terms of layered pathwidth are quantitatively stronger than those proved in terms of pathwidth. In addition, while having pathwidth at most k is a minor-closed property, 2 having layered pathwidth at most k is not. For example, the 2 × n × n grid graph has layered pathwidth at most 3 but it has K n as a minor, and thus it has a minor of unbounded layered pathwidth. (Analogous statements hold for layered treewidth)

Linear Layouts
After introducing layered path decompositions, Bannister et al. [2,3] set out to understand the relationship between track/queue/stack number and layered pathwidth.
A t-track layout of a graph G is a partition of V (G) into t ordered independent sets T 1 , . . . , T t (with a total order ≺ i for each T i , i ∈ {1, . . . , t}) with no X-crossings. Here an X-crossing is a pair of edges vw and xy such that, for some i, j ∈ {1, . . . , t}, v, x ∈ T i with v ≺ i x and w, y ∈ T j with y ≺ j w. The minimum number of tracks in any t-track layout of G is called the track number of G and is denoted as tn(G). A t-track graph is a graph that has a t-track layout.
A stack (queue) layout of a graph G consists of a total order σ of V (G) and a partition of E(G) into sets, called stacks (queues), such that no two edges in the same stack (queue) cross; that is, there are no edges vw and xy in a single stack with v ≺ σ x ≺ σ w ≺ σ y (nest; there are no edges vw and xy in a single queue with v ≺ σ x ≺ σ y ≺ σ w.). The minimum number of stacks (queues) in a stack (queue) layout of G is the stack number (the queue number ) of G and is denoted as sn(G) (qn(G)). A stack layout is also called a book embedding and stack number is also called book thickness and page number. An s-stack graph (q-queue graph) is a graph that has a stack (queue) layout with at most s stacks (q queues).

Summary of (Old and New) Results
A summary of known and new results on these rich relationships between layered pathwidth, queue number, stack number, and track number are outlined in Table 1. The first two rows show (the older results) that track number and queue number are tied ; each is bounded by some function of the other [14,15].
The next group of rows relates queue number and layered pathwidth. Queue number is bounded by layered pathwidth [14]. Graphs with queue number 1 are arched-levelled planar graphs 3 and have layered pathwidth at most 2. 4 However, there are graphs with queue number 2 that are expanders; these graphs have pathwidth Ω(n) and diameter O(log n), so their layered pathwidth is Ω(n/ log n) [16]. Thus, layered pathwidth is not bounded by queue number. 1 We say that an integer-valued graph parameter µ is bounded by some other integer-valued graph parameter ν if there exists a function f : N → N such that µ(G) ≤ f (ν(G)) for every graph G. 2 A graph H is a minor of a graph G if a graph isomorphic to H can be obtained from a subgraph of G by contracting edges. A class G of graphs is minor-closed if for every graph G ∈ G, every minor of G is in G. A minor-closed class is proper if it is not the class of all graphs. 3 An arched leveled planar embedding is one in which the vertices are placed on parallel lines (levels) and each edge either connects vertices on two consecutive levels or forms an arch that connects two vertices on the same level by looping around all previous levels. A graph is arched levelled if it has an arched levelled planar embedding.
4 Theorem 6 in [3] can easily be modified to prove that arched levelled planar graphs have layered pathwidth at most 2. That is achieved by adding the leftmost vertex of each level to each bag of the path decomposition.
The next group of rows examines the relationship between stack number and layered pathwidth. Graphs of stack number at most 1 are exactly the outerplanar graphs, which have layered-pathwidth at most 2 [3]. On the other hand, there are graphs of stack number 2 that have unbounded layered pathwidth [16]. Thus, in general, layered pathwidth is not bounded by stack number. Our first result, Theorem 1, shows that stack number is nevertheless bounded by layered pathwidth.
The final group of rows relates track number and layered pathwidth. Track number is bounded by layered pathwidth [3]. Layered pathwidth is bounded by track number when the track number is 1, or 2, but is not bounded by track number when the track number is 4 or more [3]. The question of what happens for track number 3 is stated as an open problem by Bannister et al. [3], who solved the special case when G is bipartite and has track number 3. Our Theorem 2 solves this problem completely by showing that graphs with track number at most 3 have layered pathwidth at most 4.
Note that minor-closed classes that have bounded layered pathwidth have been characterized (as classes of graphs that exclude an apex tree 5 as a minor) [9]. However, this result could not have been used to prove Theorem 2 since the family of 3-track graphs is not closed under taking minors. 6 Theorem 2 Every graph G that has tn(G) ≤ 3, has lpw(G) ≤ 4.

Proof of Theorem 1
Let G be any graph, let B = B 1 , . . . , B p be a path decomposition of G, and : V (G) → Z be a layering that obtains so that B has layered width lpw(G) with respect to the layering .
We may assume that B is left-normal in the sense that, for every distinct pair v, w ∈ V (G), min{i ∈ Z : v ∈ B i } = min{i ∈ Z : w ∈ B i }. It is straightforward to verify that any path decomposition can be made left-normal without increasing the layered width of the decomposition.
For any edge vw with v ≺ B w we call v the left endpoint of the edge and w the right endpoint. We use the convention of writing any edge with endpoints v and w as vw where v is the left endpoint and w is the right endpoint. With these definitions and conventions in hand, we are ready to proceed.
Proof: [Proof of Theorem 1] This proof is illustrated in Figure 2. Consider a left-normal path decomposition B = B 1 , . . . , B p of G and a layering : V (G) → Z such that B has layered width at most k with respect to . Our goal is to construct a stack layout of G using 4k stacks.
We first construct a total ordering ≺ σ on the vertices of G, as follows: Figure 2: Colourings used in the proof of Theorem 1.
Next we define a colouring ϕ : . . , k} that determines a partition of the E(G) into stacks. We begin with a (greedy) vertex k-colouring ϕ : V → {1, . . . , k} so that, for any i, j ∈ N, no two vertices in B i ∩ L j are assigned the same colour. This is easily done since, for each j ∈ Z, the path decomposition B i ∩ L j : i ∈ Z has bags of size at most k.
We say that an edge vw has positive slope if (v) = (w)+1 and has non-positive slope otherwise. Therefore, we only need to consider pairs of edges xy and vw where (v) = (x) = i. We assume, without loss of generality that i is even and that v ≺ σ x. With these assumptions, there are only three cases in which vw and xy can cross: Since (v) = (x) = i is even and v ≺ σ x, we have v ≺ B x (by Property 2a) and (w) ≥ i (by Property 1). If (w) = i, then v ≺ B x ≺ B w (by Property 2a), so v and x both appear in some bag B j and ϕ(v) = ϕ(x), so ϕ(vw) and ϕ(xy) differ in their third component. If (w) = i + 1, then w ≺ σ y implies that (y) ≥ (w) (by Property 1), which implies (y) = (w) = i + 1, so y ≺ B w (by Property 2b). We now have v ≺ B x ≺ B y ≺ B w so v and x appear in a common bag B j and ϕ(vw) and ϕ(xy) differ in their third component.
3. y ≺ σ v ≺ σ x ≺ σ w. Since y ≺ σ x, ell(y) ≤ (x) = i (by Property 1). If (y) = i then, since i is even, y ≺ B x (by Property 2a) so it must be the case that (y) = i − 1. Since x is the left endpoint of xy, xy therefore has positive slope.
Since v ≺ σ w and (v) = i is even, we have (v) ≤ (w) (by Property 2a). Since v is the left endpoint of vw, vw therefore has non-positive slope. Therefore ϕ(vw) and ϕ(xy) differ in their second component.
Therefore, for any pair of edges vw, xy ∈ E(G) that cross, ϕ(vw) = ϕ(xy), so the partition P is a partition of V (G) into 4k stacks with respect to ≺ σ , as required.

Proof of Theorem 2
Let G be an edge-maximal n-vertex graph with tn(G) = 3. Here, G is edge-maximal if adding any edge e increases the track number to four or more. It is helpful to recall that G is a planar graph that has a straight-line crossing-free drawing with the vertices of the track T 1 placed on the positive x-axis, the vertices of the track T 2 placed on the positive y-axis and the vertices of the track T 3 placed on the ray {(a, a) : a < 0}. See Figure 3. It will be easier to prove Theorem 2 for a weaker notion of layering. An s-weak layering of G is a mapping : V (G) → Z with the property that, for every vw ∈ E(G), | (v) − (w)| ≤ s. The Let T 1 , T 2 , T 3 be a 3-track layout of G with T 1 = {x 1 , . . . , x n1 }, T 2 = {y 1 , . . . , y n2 }, and T 3 = {z 1 , . . . , z n3 } and the total orders ≺ 1 , ≺ 2 , ≺ 3 are implicit so that, for example z i ≺ 3 z j if and only if 1 ≤ i < j ≤ n 3 . In terms of Figure 3, this means that x 1 , y 1 , z 1 form the triangular face containing the origin and x n1 , y n2 , z n3 form the cycle on the boundary of the outer face. From this point onward, all track indices are implicitly taken "modulo 3" so that for any integer j, T j refers to the track T j with index j = ((j − 1) mod 3) + 1.
The following observation follows from the fact that G is edge-maximal.
Observation 1 For any two vertices of G on distinct tracks, say x i and y j , at least one of the following conditions is satisfied (see Figure 4): 1. x i y j ∈ E(G); or 2. there exists x i y j ∈ E(G) with i > i and j < j; or 3. there exists x i y j ∈ E(G) with j > j.
Theorem 2 is a consequence of the following lemma.
Before proving Lemma 2, we show how it implies Theorem 2. Since layered pathwidth is monotone with respect to the addition of edges, it is safe to assume (as Lemma 2 does) that G is edge-maximal. By Lemma 2, therefore G has lpw 2 (G) ≤ 2 and therefore, by Lemma 1, lpw(G) ≤ 4.
Proof: [Proof of Lemma 2] If |V (G) ≤ 4, then the result is trivial so assume from this point onward that |V (G) ≥ 5. Next, suppose V (G) contains a cut set C = {x i , y j , z k } having exactly one vertex in each track. Since G is edge-maximal, x i , y j , z k form a cycle in G. Now, the subgraph G 1 of G induced by {x 1 , . . . , x i , y 1 , . . . , y j , z 1 , . . . , z k } is an edge-maximal graph with tn(G 1 ) = 3 and we can inductively apply Lemma 2 to find a width-2 2-weak layered path decomposition of G 1 in which x i , y j , z k are in the last bag and are assigned to three consecutive distinct layers r + 1, r + 2, and r + 3. Note that there are three possible assignments of x i , y j , z k to these three layers depending on the value of r mod 3. Suppose, without loss of generality, that (y j ) = r + 1 (so (z k ) = r + 2 and (x i ) = r + 3.) Now, consider the graph G 2 induced by {x i , . . . , x n1 , y j , . . . , y n2 , z k , . . . , z n3 }. We apply Lemma 2 inductively on G 2 relabelling tracks to ensure that in the resulting layered decomposition (y j ) = 1, (z k ) = 2 and (x i ) = 3. We can now obtain a width-2 2-weak layered path decomposition of G by joining the two decompositions. In particular, concatenating the sequence of bags for G 1 with the sequence of bags for G 2 gives a path decomposition of G and adding r to the indices of all layers in the layering of G 2 gives a 2-weak layering of G.
Thus, all that remains is to study the case where G contains no cut set having exactly one vertex on each track. We claim that, in this case, G contains the edge x 1 z 2 or it contains the edge z 1 x 2 . Since G is edge-maximal, this is obvious unless n 1 = n 3 = 1 so that neither z 2 nor x 2 exist. However, since |V (G)| ≥ 5, n 2 ≥ 3, so this would imply that x 1 , z 1 , y 2 is a cut set with one vertex on each track, since its removal separates all y 1 from y 3 .
We will construct a path P = v 1 , . . . , v r , an example of which is illustrated in Figure 5(a). The first vertex of P will be one of x 1 , y 1 , z 1 and the final three vertices are x n1 , y n2 , and z n3 , though not necessarily in that order. The path P will spiral in the sense that v i ∈ T i for all i ∈ {1, . . . , r}. Observe that this spiralling implies that the subsequence of vertices of P on any track T i is increasing (getting further from the origin).
P is constructed greedily: if P has reached vertex v k , it continues to the neighbouring vertex v k+1 of v k with the highest index on track T k+1 that is not yet in P . We will call this vertex v k+1 the furthest neighbouring vertex of v k . To see why this is always possible, recall that P already contains an edge v k−3 , v k−2 . Now, without loss of generality we can apply Observation 1 with x i = v k and y j = v k−2 , so there are three cases (see Figure 6): is a cut set with exactly one vertex in each track. In the former case, the path P is complete. The latter case is excluded by the assumption that G contains no such cut sets.  Figure 6: The path P can always be extended.
2. there exists an edge x i y j ∈ E(G) with i > i (i.e. i > k) and j < j (i.e. j < k − 2). This case is not possible, since this edge would cross v k−3 v k−2 .
3. there exists an edge v k y j ∈ E(G) with j > j (i.e. j > k − 2). In this case, P is extended by adding v k+1 = y j .
Thus we have constructed the furthest vertex path P = v 1 , . . . , v r whose first vertex is one of x 1 , y 1 , z 1 and whose last three vertices are x n1 , y n2 and z n3 (not necessarily in order). We assign layers to the vertices of P as follows: For each vertex v i on P , we set (v i ) = i. Note that this satisfies Conditions 3 and 5 of the lemma and also satisfies Condition 1 for the vertices of P . For each t ∈ {1, 2, 3}, any vertex v ∈ T t that is not in P is assigned to the same layer as v's immediate successor in P ∩ T t . This assignment satisfies Condition 1 for vertices not in P . Finally, we will prove that this gives a 2-weak layering of G. In other words, in the worst case, a vertex v with (v) = i can only share an edge with vertex u where i − 2 ≤ (u) ≤ i + 2. See Figure 5(b).
Any edge between v and w where neither v nor w is in P will only span one layer. Any edge between any two vertices v i and v j where v i , v j ∈ P , will span only one layer if j = i ± 1. This would mean that v i v j is an edge in the graph G and that this edge was used to construct our furthest vertex path P . If j = i ± 1, then there are two cases: 1. j = i ± 2 Such an edge is possible, and allowed since it spans only two layers.
2. j = i ± 4 Such an edge cannot exist since it would contradict our greedy path constructing algorithm.
would not have been added to P .
Any edge between v and w where v ∈ P and w ∈ P will be one of 7 types (see Figure 7). Without loss of generality, assume the spiral is travelling from T 1 to T 2 to T 3 . Let x i be a vertex on the constructed path P . First, we look at the possible cases for an edge between x i with (x i ) = m and y j where y j / ∈ P .
1. (y j ) = m + 3n where n ≥ 1. This edge cannot exist since it would contradict our greedy path constructing algorithm.
y j z k x i (7) Figure 7: The edge between a vertex x i and a vertex y j or z k cannot span more than 2 layers Next, we will need a notion of levelled planar graphs. The class of levelled planar graphs was introduced in 1992 by Heath and Rosenberg [18] in their study of queue layouts of graphs. A levelled planar drawing of a graph is a straight-line crossing-free drawing in the plane, such that the vertices are placed on a sequence of parallel lines (called levels), where each edge joins vertices in two consecutive levels. A graph is levelled planar if it has a levelled planar drawing. (This is a well studied model for planar graph drawing, known as a Sugiyama-style drawing [19,4,17,5].) Now, consider the graph G−P obtained by removing the vertices of P from G (see Figure 5(c)). We claim that this graph is a levelled planar graph in which the levels of the vertices are given by the layering defined above. (Recall that the edges of G spanning two layers all have at least one endpoint in P .) Refer to Figure 8. One way to see this is to imagine G as being drawn with its vertices on the three vertical edges of the surface of a triangular prism so that x 1 , y 1 , z 1 are the vertices of one triangular face and x n1 , y n2 , z n3 are the vertices of the other triangular face. Now, if we remove the triangular faces of this prism, cut it along the embedding of P , and unfold the resulting surface so that it lies in the plane, then we obtain a drawing of G − P in which the vertices lie on a set of parallel lines and in which the edges only join vertices on two consecutive lines. This gives the desired levelled planar drawing of G − P .
By a result of Bannister et al. [3, Proof of Theorem 5], G − P has a layered path decomposition B 1 , . . . , B p of width 1 using the layering defined above. If we add the vertices of P to every bag of this decomposition we obtain a width-2 2-weak layered path decomposition of G. Finally, to satisfy Conditions 2 and 4 of the lemma, we prepend a bag B 0 = {x 1 , y 1 , z 1 } and append a bag B p+1 = {x n1 , y n2 , z n3 }.

Conclusions
We have presented two results on layered pathwidth that help complete our understanding of the relationship between layered pathwidth, stack number, and track number. Graphs of bounded layered pathwidth include grids and certain types of intersection graphs. Theorem 1, for example, implies that unit-disk graphs with maximum clique size k have stack number O(k) since they have been shown to have O(k) layered pathwidth [2,3].
We conclude this discussion by remarking that upper bounds on the stack number of graphs of bounded layered treewidth are not yet known, and present a challenging avenue for further study. For example, k-planar graphs are known to have layered treewidth O(k) [10, Theorem 3.1]. Therefore, bounding stack number by a function of layered treewidth would imply that k-planar graphs have bounded stack-number. It is still unknown whether k-planar graphs have bounded stack-number except in the case k = 1 [6,1].