Transforming Stacks into Queues:
Mixed and Separated Layouts of Graphs
Abstract
Some of the most important open problems for linear layouts of graphs ask for the relation between a graph’s queue number and its stack number or mixed number. In such, we seek a vertex order and edge partition of into parts with pairwise non-crossing edges (a stack) or with pairwise non-nesting edges (a queue). Allowing only stacks, only queues, or both, the minimum number of required parts is the graph’s stack number , queue number , and mixed number , respectively.
Already in 1992, Heath and Rosenberg asked whether is bounded in terms of , that is, whether stacks “can be transformed into” queues. This is equivalent to bipartite -stack graphs having bounded queue number (Dujmović and Wood, 2005). Recently, Alam et al. asked whether is bounded in terms of , which we show to also be equivalent to the previous questions.
We approach the problem by considering separated linear layouts of bipartite graphs. In this natural setting all vertices of one part must precede all vertices of the other part. Separated stack and queue numbers coincide, and for fixed vertex orders, graphs with bounded separated stack/queue number can be characterized and efficiently recognized, whereas the separated mixed layouts are more challenging. In this work, we thoroughly investigate the relationship between separated and non-separated, mixed and pure linear layouts.
Keywords and phrases:
Separated linear Layouts, Stack Number, Queue Number, mixed Number, bipartite GraphsFunding:
Julia Katheder: The work of J. Katheder is supported by DFG grant Ka 812-18/2.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Mathematics of computing Graph theory ; Mathematics of computing CombinatoricsEditors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim ThắngSeries and Publisher:

1 Introduction
In this paper we study linear layouts of graphs111Throughout, all graphs in this paper are simple, undirected, finite, and have at least one edge.. That is, for a graph , we consider a total order of its vertex set , while defines the relative position of its edges. In particular, we investigate for a graph its well-known parameters stack number, , and its queue number, , as well as their common generalization called its mixed number, . Their precise definitions go as follows.
Stack, Queue, and Mixed Numbers.
Given a vertex order , two edges and in are said to cross in if any order of their endvertices symmetric to is prescribed by . Roughly speaking, for the stack number of , we want a vertex order in which not many edges pairwise cross. Formally, for an integer , an -stack layout of is a total order of together with a partition of into subsets , called stacks, such that no two edges in the same stack cross. The minimum number of stacks needed for a stack layout of graph is called its stack number and denoted by . Stack numbers were first investigated by Bernhart and Kainen [6] in 1979, building on Kainen and Ollman [20, 24]222We remark that -stack layouts are also known as -page book embeddings, where stacks are then called pages. Similarly, the stack number is sometimes called the book thickness or page number of ..
As a concept “dual” to -stack layouts, for an integer , a -queue layout of is a total order of together with a partition of into subsets , called queues, such that no two edges in the same queue nest; that is, there are no edges and in a queue with (or any symmetric order). The minimum number of queues needed for a queue layout of graph is called its queue number and denoted by . Queue numbers were introduced by Heath and Rosenberg [18] in 1992.
Stack and queue layouts are generalized through the notion of a mixed layout. For integers , an -stack -queue layout of is a total order of together with a partition of into stacks and queues. The minimum value of needed for an -stack -queue layout of graph is called its mixed number and denoted by . Mixed layouts were already considered by Heath and Rosenberg [18] in 1992, while a thorough study started only recently [26, 22, 16]. In contrast to mixed layouts, we call a layout pure if only stacks or only queues are being used.
Comparing Stack, Queue, and Mixed Numbers.
Besides their similar definitions, there are more similarities between -stack graphs, -queue graphs, and -mixed graphs, where a -(stack, queue, mixed) graph is defined as a graph admitting a -(stack, queue, mixed) layout. For example, in each case we have sparse graphs with only edges for vertices [6, 18, 25]. Moreover, stack, queue, and mixed numbers are all bounded for planar graphs [8, 14, 5, 30] and for bounded treewidth graphs [1, 28, 9, 15]. On the other hand, neither stack nor queue number is bounded for -regular graphs [29, 3]. Already in 1992, Heath, Leighton, and Rosenberg [17] investigated the relationship between stack and queue layouts; in particular whether stack layouts and queue layouts can be transformed into each other. They introduced the following fundamental question, which remains unanswered despite a wealth of studies on linear graph layouts.
Open Problem 1 (Heath, Leighton, and Rosenberg [17], see also [11, 7, 13]).
Do graphs with bounded stack number have bounded queue number?
We emphasize that a companion question (“do graphs with bounded queue number have bounded stack number?”) has been recently resolved in the negative by Dujmović et al. [7]. One attempt to resolve Open Problem 1 was made by Dujmović and Wood [11] who showed that the problem is equivalent to the question of whether bipartite -stack graphs have bounded queue number. Note that -stack graphs and -stack graphs are planar, and hence, they have a bounded queue number [8], but the question remains open for -stack graphs.
Turning to mixed layouts, it follows from the definition of the mixed number that for every graph we have and . However for some graphs , their mixed number is strictly less than and ; for example, for the complete graph it holds that but , as illustrated in Figure 1. In particular, graphs with bounded mixed number potentially form a strictly larger class than those of bounded stack number. Thus, the following problem of Alam et al. [22] asks for something (potentially) stronger than Open Problem 1.
Open Problem 2 (Alam et al. [22]).
Do graphs with bounded mixed number have bounded queue number?
As one of our results (cf. Theorem 4), we shall show that Open Problems 1 and 2 are in fact equivalent. That is, either both questions have a Yes-answer or both have a No-answer. In that sense, it is easier to prove a No-answer by finding graphs of unbounded queue number but bounded mixed number (instead of bounded stack number). As a second result, also in Theorem 4, we shall prove that it indeed suffices to look for graphs of mixed number ; specifically, graphs that admit -stack -queue layouts. That is, Open Problems 1 and 2 have a Yes-answer if and only if all -stack -queue graphs have bounded queue number.
Separated Linear Layouts.
Since Open Problems 1 and 2 are likely very challenging in their full generality, we investigate a special case for separated mixed layouts of bipartite graphs. A vertex order of a bipartite graph with bipartition333 is a bipartition if , , and both induced subgraph are edgeless. is separated if all vertices in precede all vertices in (or vice versa). This naturally gives rise to separated -stack, separated -queue, and separated -stack -queue layouts of bipartite graphs , as well as the corresponding separated stack number , separated queue number , and separated mixed number .
Observe that a separated -stack -queue layout can be transformed into a separated -stack -queue layout by reversing the vertex order of one of the parts. It follows that for every bipartite graph . Furthermore, every separated vertex order of with bipartition induces an injective mapping of the edges of to points of the integer grid; see Figure 2. This grid is sometimes referred to as a reduced adjacency matrix of . One can easily verify that a subset of edges forms a queue (resp. a stack) if and only if the corresponding points form a monotonically increasing (resp. decreasing) subset in the grid. The stack-queue transformation mentioned above then corresponds to mirroring the grid along the -axis or along the -axis.
This separated setting has been widely studied (sometimes, implicitly) under different names, such as 2-track layouts [10, 27] or 2-layer drawings [23, 2, 12]. For the present paper, let us introduce the following special variant of Open Problem 2.
Open Problem 3.
Do bipartite graphs with bounded separated mixed number have bounded queue number?
Our Contributions.
We make progress towards the resolution of Open Problems 1 and 2, as well as our new Open Problem 3. Each of these problems asks whether graphs with low stack number (Open Problem 1), low mixed number (Open Problem 2), or low separated mixed number (Open Problem 3) have also low queue number. Formally, we say that the queue number is bounded by stack number (similarly, bounded by mixed number, and bounded by separated mixed number) if for every graph with stack number and queue number , it holds that for some function (independent of ). The question of whether such functions, , exist are Open Problems 1, 2, and 3.
Clearly, a function that bounds the queue number in terms of the stack number exists if and only if for all there is a constant such that every -stack graph has queue number at most . Surprisingly, it is enough to consider just one particular value for . In fact, Dujmović and Wood [11] show that Open Problem 1 is equivalent to the existence of a constant such that every -stack graph has queue number at most . (It is known that -stack and -stack graphs have queue number at most [17] and at most [4], respectively.)
Here, we extend the list to four equivalent statements, showing in particular that Open Problems 1 and 2 are equivalent, and that it is enough to consider -stack -queue graphs.
Theorem 4.
The following are equivalent:
-
(1)
every -stack graph has queue number at most for some function
(“queue number is bounded by stack number”); -
(2)
every -stack graph has queue number at most for some constant ;
-
(3)
every -stack -queue graph has queue number at most for some constant ;
-
(4)
every -stack -queue graph has queue number at most for some function
(“queue number is bounded by mixed number”).
Turning to separated layouts of (necessarily bipartite) graphs, our main contribution is also a list of four equivalent statements, one of which, namely (1), is Open Problem 3. Statements (3) and (4) show that it is enough to consider -stack -queue graphs, respectively even only -stack -queue graphs, for solving Open Problem 3. Additionally, we discuss a natural approach for Open Problem 3 where we start with the grid representation of a separated -stack -queue layout, and then permute the rows and columns so as to obtain a separated -queue layout. Another surprising contribution is that it is always enough to apply the same permutation to the rows and the columns, which is statement (2).
Theorem 5.
The following are equivalent:
-
(1)
every separated -stack -queue graph has queue number at most for some function (“queue number is bounded by mixed number”);
-
(2)
every separated -stack -queue layout of a graph with can be transformed into a separated -queue layout for some function by applying the same permutation to and ;
-
(3)
every separated -stack -queue graph has queue number at most for some function ;
-
(4)
every separated -stack -queue graph has queue number at most for some constant .
Finally, let us discuss the connections between non-separated and separated layouts. Standard techniques for queue layouts (which we present in Section 2) easily give that Open Problem 2 implies Open Problem 3. In fact, Corollary 7 states that for every bipartite graph we have . However, it remains open whether Open Problem 3 implies Open Problem 2 (or equivalently Open Problem 1). The situation is summarized in Figure 3.
2 Preliminaries
In this section we collect several facts about manipulating vertex orders in linear layouts, which keep the stack and/or queue numbers within a constant factor from each other.
Lemma 6 (Riffle-Lemma).
Let be a graph with a given -queue layout using as the vertex order and be a partition of . Then, for any vertex order where for vertices it holds that whenever :
-
(1)
admits a -queue layout.
-
(2)
admits a -queue layout if is bipartite, and .
Proof.
We show that every queue for can be split into queues for ; see Figure 4(a). Overall, this results in the desired -queue layout. For let contain all edges such that and and . This partitions into many edge sets , and we claim that each is a queue for . For , the relative order of any is unchanged in , and hence is a queue for . For , let and be two edges in with and . Without loss of generality assume that (hence ) and assume for a contradiction that nests in , that is, or . In either case, it follows that and hence . Together with (as ) this yields and nests in – a contradiction to being a queue. It follows that each requires at most one queue in the layout with vertex order , which concludes the first case of the proof.
In the bipartite case, for each queue in the original layout, let be an edge in with with and with . As there are combinations of and , and we require two queues, namely and , for each combination, the resulting layout with vertex order requires -queues in total.
Applying the lemma to bipartite graphs with and such that and yields the following (well-known) fact; see [25] for an alternative proof.
Corollary 7.
Every -queue graph with bipartition has a separated -queue layout.
The next two results concern graph subdivisions. A subdivision of a graph is a graph obtained from by replacing each edge in by a path with one or more edges. Internal vertices on such a path are called division vertices.
Lemma 8 (Lemma 2 in [11]).
Let be a graph and be a subdivision of with at most one division vertex per edge. If admits a -queue layout with vertex order , then with bipartition and admits a separated -queue layout in which is ordered as in .
A converse operation to a subdivision is a (path-)contraction. We use a more general transformation here. An r-shallow minor is a restricted form of a graph minor in which each (connected) subgraph that is contracted to form the minor has radius at most , where the radius is defined as the minimum of the eccentricities of its vertices. For an -stack -queue graph , we will combine the following result with finding an -stack -queue subdivision where and , which has as an -shallow minor in order to prove equivalence statements in Theorem 4 and Theorem 5.
Lemma 9 (Lemma 12 in [19]).
For every graph and , where is a -shallow minor of , it holds that .
3 Non-Separated Layouts
In this section we explore Open Problem 2. Dujmović and Wood [11] studied graph subdivisions of stack and queue layouts. They proved that every -stack graph has
-
(i)
a -stack subdivision with division vertices per edge, and
-
(ii)
a -stack -queue subdivision with division vertices per edge.
Similarly, every -queue graph has
-
(i)
a -stack subdivision with division vertices per edge, and
-
(ii)
a -queue subdivision with division vertices per edge, and
-
(iii)
a -stack -queue subdivision with division vertices per edge.
Notice some asymmetry in the statements of the two results: It is not always possible to subdivide an -stack graph with division vertices per edge (for an arbitrary function ) such that the result admits an -queue layout. Otherwise, such a subdivision combined with Lemma 9 would imply that every -stack graph admits an -queue layout, contradicting the main result of Dujmović et al. [7].
The crux of the contributions of Dujmović and Wood [11] is a technical construction, which we formalize next. Let be a rooted tree with nodes and edges . Given a graph , a -partition of is a pair consisting of a tree and a partition of into sets , such that for every edge one of the following holds: (i) for some , or (ii) there is an edge of with and . The sets are called the bags of the -partition. A -layout of a graph is a -partition of in which the bags are ordered, that is, is a total order of vertices in ; see Figure 5(a) for an example. The vertex orders are described in terms of two functions, and , defined for the nodes of . We prescribe each bag to contain either only stacks or only queues formed by intra-bag edges. Here (respectively, ) denotes the stack (queue) number of the intra-bag edges on under vertex order such that if is prescribed to contain stacks, i.e., if then , and if is a bag containing queues, then and . Similarly, for the edges of , is the minimum number of edge sets needed to partition the inter-bag edges of between and such that they are pairwise non-crossing. Under the concatenation of the orders and , each , will form a queue, while each forms a stack when concatenating and . The leaf nodes of a tree are denoted .
In this paper, we work with simple -layouts, where
-
for every non-leaf node , bag forms an independent set in , that is, ;
-
for every leaf node , bag admits a -stack or a -queue layout under , that is, or ;
-
for every edge , it holds that .
In all our constructions of tree-partitions, we utilize a binary tree, that is, a rooted tree in which every node has at most two children. The following result provides a subdivision and a tree-layout for a given graph.
Lemma 10 (a special case of Lemma 21 in [11]).
Let be a graph that admits a -stack (respectively, -queue) layout with vertex order , and be a binary tree of height with or more leaves. Then has a subdivision, , with an even number of division vertices per edge such that has a simple -layout in which (respectively, ) for every leaf node . The number of division vertices per edge is at most , or exactly if all the leaves of are at depth . Moreover, the vertices of correspond to vertices in the root bag of and their order in the -layout is , whereas all other bags contain only division vertices.
In what follows we consider a (not necessarily proper) -coloring of edges of a tree using colors blue and red, i.e., we allow edges with the same color at a common endvertex. Throughout, we associate blue colors with stacks, and red colors with queues. The set of blue edges is and the set of red edges is .
Lemma 11 (a special case of Lemma 22 in [11]).
Let be a graph with a -layout for some tree . Suppose that edges of are 2-colored in red and blue, and its nodes, , are ordered by such that the blue edges, , form a stack and the red edges, , form a queue. Let
Then admits a mixed -stack -queue layout. Furthermore, the order of vertices in the root bag of the -layout is preserved in the mixed layout.
Now we can state the new results of the section.
Lemma 12.
Let be an -stack -queue graph. Then has a -stack subdivision with at most division vertices per edge.
Proof.
First we show how to obtain a tree-layout for an -stack -queue graph with the vertex order . Denote so that . Assume that , where are stacks and are queues.
Consider the subgraph of induced by all stack edges, . Let be a binary tree of height in which the root node has a single child, each internal non-root node has exactly two children, and all leaves are at the same depth. By Lemma 10, there exists a subdivision of , denoted , with exactly division vertices per edge and a simple -layout of . It holds that for , for , and for ; see Figure 5.
Next consider the subgraph of induced by the queue edges, . Start with a binary tree of height , denoted , which is a copy of (that is, the root node has one child and each internal non-root node has two children). There exists a subdivision of with exactly subdivision vertices and its simple -layout by Lemma 10. We modify the subdivision and the tree-layout as follows. Consider a leaf node and let be the graph induced by vertices in and the corresponding intra-bag edges. Observe that in the -layout, and hence, with as the vertex order. Now, we apply Lemma 8 by subdividing every edge of once and let be the resulting graph. This results in a -queue layout of the subdivision in which the vertices of are separated from the new division vertices and are ordered as in the -layout. Thus, we can build a new tree, denoted , by appending a child, , to every node . This results in a (non-simple) -layout for , where the leaf nodes of contain the division vertices in the order given by Lemma 8. Since the queue number of is at most , the inter-bag edges between and can be partitioned into two sets of pairwise non-crossing edges, i.e., we have that for all , where ; see Figure 5(a) for an illustration.
By Lemma 10, the root bags of the -layout and the -layout contain the same vertices, , both ordered by . Thus, we can merge the two tree-layouts into a joint one, called -layout; see Figure 5(b). The corresponding subdivision of , denoted , has stack edges subdivided times and queue edges subdivided times. To apply Lemma 11 for the -layout, we color all the edges of blue and find a -stack layout of the tree via a depth-first search traversal such that every node precedes its children in the order. Let us argue that the result of applying Lemma 11 is a -stack layout, that is, and .
Note that for all nodes of and the tree contains no red edges; thus, . For the stack number, consider four disjoint groups of nodes of :
-
for , it holds that and for ;
-
for and , it holds that , there exists one edge with and two edges with ;
-
for , it holds that , for a single edge , and for a single edge ;
-
for , it holds that , and for a single edge .
Combining everything together, we get
Therefore, subdivision of admits a -stack layout by Lemma 11.
With a similar technique we can find a -stack -queue subdivision (Lemma 13) instead of a -stack subdivision (Lemma 12). The proof of the next result is given in [21].
Lemma 13.
Let be an -stack -queue graph. Then has a -stack -queue subdivision with at most division vertices per edge.
We now prove Theorem 4, in particular that Open Problems 1 and 2 are equivalent.
See 4
Proof.
It is immediate that (4) implies (1), (2), and (3). That (1)(2) is proven by Dujmović and Wood [11].
Now we show that (2) (4). Assume that every -stack graph has a bounded queue number, . Let be an -stack -queue graph. By Lemma 12, admits a -stack subdivision, , with at most division vertices per edge. By the assumption, . Note that is an -shallow minor of for . By Lemma 9, we get
which proves that has a bounded queue number, as long as and are constants.
Similarly we show that (3) (4). Suppose that every -stack -queue graph has queue number at most . Let be an -stack -queue graph. By Lemma 13, admits a -stack -queue subdivision, , with division vertices per edge. By the assumption, , and is an -shallow minor of for . Again by Lemma 9, we get
which shows that has a bounded queue number, as long as and are constants.
4 Separated Layouts
In this section we investigate separated mixed layouts of bipartite graphs and Open Problem 3. Recall that a vertex order of a bipartite graph with bipartition is separated if all vertices of precede all vertices of in (or vice versa).
Observation 14.
Every separated -stack -queue layout of a bipartite graph with bipartition can be transformed to a separated -stack -queue layout by reversing the order of all vertices in (or alternatively all vertices in ).
Reversing the order of some consecutive vertices (as in 14) is the simplest modification we could do to a given layout. It turns out that this is already enough to show that graphs with separated -stack -queue layouts have a constant queue number.
Theorem 15.
Every separated -stack -queue graph admits a separated -queue layout.
Proof.
Let be a bipartite graph with bipartition admitting a separated -stack -queue layout with vertex order . Consider the reduced adjacency matrix with columns and rows ordered according to . The edges in the stack form a monotonically weakly decreasing subset of . The edges in the queue form a monotonically weakly increasing subset of . Without loss of generality we can assume (by adding edges to the graph) that and correspond to inclusion-maximal such subsets; see Figure 6.
Let be a point/edge that is contained in both, and . Now consider the vertex order of the columns obtained by reversing the order of . Similarly, consider the vertex order of the rows obtained by reversing the order of . Let denote the resulting separated vertex order of . Now the edges in incident to form a queue in . Also the remaining edges in , incident to form a queue in . Similarly, the edges in incident to form a queue in . Also the remaining edges in , incident to form a queue in ; see again Figure 6. This is a separated -queue layout of .
Note that by applying 14, separated -stack -queue graphs also admit a separated -stack layout. However, we do not know whether the bound of in Theorem 15 is best-possible and remark that admits a separated -stack -queue layout but its separated stack/queue number is .
The simple operation of reversing the order of some consecutive vertices can be employed in a “checkerboard” fashion. Consider a given separated mixed layout (e.g., with stacks and queues). Assume we have partitioned the reduced adjacency matrix by means of a superimposed grid with a checkerboard odd-even pattern, in such a way that odd grid cells contain no stack edges and even grid cells contain no queue edges. Then, the vertex order of every second row and column can be reversed to derive a separated pure queue layout. Finding such a grid refinement is always possible, that is, down to individual rows and columns, however the derived and are dependent on the grid granularity and thus may not be bounded by . An example for specific separated -stack -queue layouts with bounded number are grids where each cell contains either an increasing or decreasing diagonal. In this case, grid columns and rows can be halved in order to apply the checkerboard approach; see Figure 7.
However there exist graphs, where such operations do not suffice and more involved row and column permutations are necessary. In [21] we provide as a challenging example a subcubic bipartite graph that admits a separated -stack -queue layout and a fairly simple -queue pure layout. However, the grid granularity has to be super-constant in order to transform the mixed into the pure layout. We conclude that even for low-degree graphs with , it is not obvious how to transform a separated mixed layout into a separated pure layout, say with few queues.
While we do not know how to generalize Theorem 15 even just to separated -stack -queue layouts, we can narrow down the difficult case of Open Problem 3. If Open Problem 3 is answered positively, we can find an -queue layout for any bipartite graph admitting a separated -stack -queue layout. In Theorem 5 we show three equivalent formulations of this problem. In the challenging example presented in our preprint [21], the transformation from the separated mixed to the separated pure layout applies the same column and row permutation. Now, Theorem 5 states that we may always assume that rows and columns are identically permuted when transforming a separated mixed layout into a separated pure layout.
Further, we show in Lemma 17 that every separated -stack -queue layout can be transformed into a separated -stack -queue layout, while this transformation does not change the separated queue number by too much. This implies that one can restrict the attention to separated -stack -queue layouts, for solving Open Problem 3.
See 5
Proof.
Observe that (1) immediately implies (3), which implies (4). That (2) implies (1) is also immediate, when adding isolated vertices to guarantee . The proofs of the other directions are deferred, in particular see Lemma 16 for (1) (2) and Lemma 17 for (3) (1). For (4), we show equivalence by proving that (4) implies (3) in Lemma 18.
Lemma 16.
If there is a function such that every separated -stack -queue graph admits a separated -queue layout, then every separated -stack -queue layout of a bipartite graph with can be transformed into a separated -queue layout by applying the same permutation to and .
Proof.
Let and be the order of and in the given separated -stack -queue layout of . We add the “identity” queue , where for each , , there is the edge (if not already present in ). Let be the resulting bipartite graph. By assumption, there exists a separated -queue layout of with vertex order . We are looking for another vertex order such that, compared to the initial order, and are permuted the same, that is, the columns and rows in the reduced adjacency matrix are identically permuted. Since we added the identity queue to obtain in the beginning, this is equivalent to restoring to the diagonal in the matrix; see Figure 8.
To that end, we shall apply Lemma 6 to change only the order of vertices in , which corresponds to permuting the columns in the matrix. Let and be the queues in the -queue layout of and , . We want to apply the Riffle-Lemma (Lemma 6-(2)) with the partition of into and . To this end, we keep the order of (the rows), and restore as a diagonal by simply sorting the columns according to their row in . Since each is a queue, the relative order within each is kept intact, as required by Lemma 6. Hence, by Lemma 6-(2), the resulting layout has at most queues in total.
Lemma 17.
Let be a bipartite graph with a separated -stack -queue layout. Then there exists another bipartite graph admitting a separated -stack -queue layout, where is a -shallow minor of , such that .
Proof.
Assume we have a bipartite graph , that admits a separated -stack -queue layout. We will build a new bipartite graph , such that has a separated -stack -queue layout. We will then show that for the separated queue numbers of and , it holds that . That is, a small queue number of implies a small queue number of . Next we make the argument formal.
Let , be the stacks and be the queues in the separated -stack -queue layout. We build as follows. The vertices of are , where and are copied from , while and for any are new. contains a vertex for each vertex incident to an edge . Likewise, contains a vertex for each such . Vertices in and that are not incident to an edge in are omitted in and . (Note that for each stack , the new vertices in and are added to construct parts of the graph starting from , while the last stack is left as is.) In the reduced adjacency matrix of , the new vertices are represented by additional blocks of consecutive rows for each and consecutive columns for each , where () is the number of vertices of () having an edge in . Row blocks of and column blocks of are subsequent for . Intuitively, we move the stack from to , . We leave the last stack with all initial queues in . Finally, we put one new queue each in and , . Figure 10 shows the construction and in particular the order of the rows and columns .
More formally, for every edge , there is an edge in . For every stack edge, of stack , there are three edges in . (In case of multiple edges between a pair of vertices, we keep only one instance.) It is easy to verify that admits a separated -stack -queue layout, as for every original stack , the edges and for every form a queue respectively, due to the increasing column and row indices of each block and starting from the bottom left of the matrix. In fact, edges between vertices in and and edges between vertices in and fit in a single queue, since the former lie below and to the left of the latter in the matrix. The original queues remain, yielding queues in total. For a stack , the edges are a decreasing subset in and due to the increasing ordering of indices in every column and row block of the matrix, the edges in have the same property. The ordering of the row blocks and column blocks , where and , are positioned diagonally from the top left to the bottom right of the matrix, then allows to combine the stacks of into one single stack in .
Finally, we show that . To this end, consider a -queue layout of . Now, contract for each the vertex with its neighbors of the form , . Similarly, contract for each the vertex with its neighbors of the form , . The result is a -shallow minor of , and most crucially, the result is exactly the initial graph . Hence, Lemma 9 with radius gives that .
Lemma 18.
Let be a bipartite graph with a separated -stack -queue layout. Then has a subdivision with at most division vertices per edge that admits a separated -stack -queue layout.
Proof.
Let be a bipartite graph that admits a separated -stack -queue layout such that is a stack and are queues. Denote so that . We consider the subgraph of induced by the queue edges, . Let be a complete binary tree of height . By Lemma 10, there exists a subdivision of , denoted , and a simple -layout of in which for all , for all non-leaf nodes , and for all . Note that contains exactly division vertices per edge and it is bipartite; see Figure 11.
Now, color all edges of red and find a -queue layout of via a breadth-first search traversal such that every node precedes its children in the order. By Lemma 11 applied to graph and its simple -layout, we obtain a linear layout of . Let us argue that this result is in fact a -queue layout of , i.e., that and as defined in Lemma 11. On the one hand, for all the nodes of and there are no blue edges in . Thus, we have . On the other hand, every node has at most two outgoing edges in the layout of , i.e., the set contains at most two edges. Hence,
The final step is to convert the -queue layout of into a separated layout. This is accomplished by Corollary 7, which in worst case doubles the number of queues. The transformations of Lemma 11 and Corollary 7 keep the relative order of the original vertices unchanged. Thus, the resulting layout of can be joined with the stack edges to finally yield a subdivision of (in which the stack edges are not subdivided) with a separated -stack -queue layout.
5 Conclusions and Open Questions
We have explored the relation between mixed and pure stack or queue layouts, in the separated as well as in the non-separated setting. An interesting (and somewhat surprising) result is the equivalence of Open Problems 1 and 2, which we believe sheds some light on the famous open problem, whether bounded stack number always implies bounded queue number. Let us highlight a few intriguing questions and possible directions in the area.
-
1.
Do graphs with (non-separated) -stack -queue layouts have a constant queue number? This might be hard in general, but one could for example start with subcubic graphs.
-
2.
Do graphs with separated -stack -queue layouts have a constant queue number? Lemmas 16 and 18 combined show that separated -stack -queue graphs are as hard as the general case, and we feel that the same holds for separated -stack -queue graphs. On the other hand, Theorem 15 solves the separated -stack -queue case.
-
3.
Is there a constant such that every bipartite -stack -queue graph admits a separated -stack -queue layout? A positive answer would imply that Open Problems 3, 1, and 2 are all equivalent.
References
- [1] Jawaherul Md Alam, Michael A Bekos, Martin Gronemann, Michael Kaufmann, and Sergey Pupyrev. Queue layouts of planar 3-trees. Algorithmica, pages 1–22, 2020. doi:10.1007/s00453-020-00697-4.
- [2] Patrizio Angelini, Giordano Da Lozzo, Henry Förster, and Thomas Schneck. 2-layer k-planar graphs density, crossing lemma, relationships and pathwidth. The Computer Journal, 67(3):1005–1016, April 2023. doi:10.1093/comjnl/bxad038.
- [3] János Barát, Jirí Matousek, and David R. Wood. Bounded-degree graphs have arbitrarily large geometric thickness. The Electronic Journal of Combinatoric, 13(1), 2006. doi:10.37236/1029.
- [4] Michael A. Bekos, Martin Gronemann, and Chrysanthi N. Raftopoulou. On the queue number of planar graphs. In International Symposium on Graph Drawing and Network Visualization, pages 271–284, Berlin, Heidelberg, 2021. Springer-Verlag. doi:10.1007/978-3-030-92931-2_20.
- [5] Michael A. Bekos, Michael Kaufmann, Fabian Klute, Sergey Pupyrev, Chrysanthi N. Raftopoulou, and Torsten Ueckerdt. Four pages are indeed necessary for planar graphs. Journal of Computational Geometry, 11(1):332–353, 2020. doi:10.20382/jocg.v11i1a12.
- [6] Frank Bernhart and Paul C. Kainen. The book thickness of a graph. Journal of Combinatorial Theory, Series B, 27(3):320–331, 1979. doi:10.1016/0095-8956(79)90021-2.
- [7] Vida Dujmović, David Eppstein, Robert Hickingbotham, Pat Morin, and David R Wood. Stack-number is not bounded by queue-number. Combinatorica, pages 1–14, 2021. doi:10.1007/s00493-021-4585-7.
- [8] Vida Dujmović, Gwenaël Joret, Piotr Micek, Pat Morin, Torsten Ueckerdt, and David R Wood. Planar graphs have bounded queue-number. Journal of the ACM, 67(4):1–38, 2020. doi:10.1145/3385731.
- [9] Vida Dujmović, Pat Morin, and David R Wood. Layout of graphs with bounded tree-width. SIAM Journal on Computing, 34(3):553–579, 2005. doi:10.1137/S0097539702416141.
- [10] Vida Dujmović, Attila Pór, and David R Wood. Track layouts of graphs. Discrete Mathematics & Theoretical Computer Science, 6(2):497–522, 2004. doi:10.46298/DMTCS.315.
- [11] Vida Dujmović and David R Wood. Stacks, queues and tracks: Layouts of graph subdivisions. Discrete Mathematics and Theoretical Computer Science, 7:155–202, 2005. doi:10.46298/dmtcs.346.
- [12] Peter Eades and Nicholas C Wormald. Edge crossings in drawings of bipartite graphs. Algorithmica, 11(4):379–403, 1994. doi:10.1007/BF01187020.
- [13] David Eppstein, Robert Hickingbotham, Laura Merker, Sergey Norin, Michał T Seweryn, and David R Wood. Three-dimensional graph products with unbounded stack-number. Discrete & Computational Geometry, pages 1–28, 2023. doi:10.1007/s00454-022-00478-6.
- [14] Henry Förster, Michael Kaufmann, Laura Merker, Sergey Pupyrev, and Chrysanthi N. Raftopoulou. Linear layouts of bipartite planar graphs. In Pat Morin and Subhash Suri, editors, Algorithms and Data Structures - 18th International Symposium, WADS 2023, Montreal, QC, Canada, July 31 - August 2, 2023, Proceedings, volume 14079 of Lecture Notes in Computer Science, pages 444–459. Springer, 2023. doi:10.1007/978-3-031-38906-1_29.
- [15] Joseph L. Ganley and Lenwood S. Heath. The pagenumber of k-trees is O(k). Discrete Applied Mathematics, 109(3):215–221, 2001. doi:10.1016/S0166-218X(00)00178-5.
- [16] Deborah Haun, Laura Merker, and Sergey Pupyrev. Forbidden patterns in mixed linear layouts. In 42nd International Symposium on Theoretical Aspects of Computer Science (STACS 2025), 2024. doi:10.48550/arXiv.2412.12786.
- [17] Lenwood S Heath, Frank Thomson Leighton, and Arnold L Rosenberg. Comparing queues and stacks as machines for laying out graphs. SIAM Journal on Discrete Mathematics, 5(3):398–412, 1992. doi:10.1137/0405031.
- [18] Lenwood S Heath and Arnold L Rosenberg. Laying out graphs using queues. SIAM Journal on Computing, 21(5):927–958, 1992. doi:10.1137/0221055.
- [19] Robert Hickingbotham and David R. Wood. Shallow minors, graph products, and beyond-planar graphs. SIAM Journal on Discrete Mathematics, 38(1):1057–1089, 2024. doi:10.1137/22M1540296.
- [20] Paul C. Kainen. Some recent results in topological graph theory. In Ruth A. Bari and Frank Harary, editors, Graphs and Combinatorics, pages 76–108, Berlin, Heidelberg, 1974. Springer Berlin Heidelberg. doi:10.1007/BFb0066436.
- [21] Julia Katheder, Michael Kaufmann, Sergey Pupyrev, and Torsten Ueckerdt. Transforming stacks into queues: Mixed and separated layouts of graphs. CoRR, abs/2409.17776, 2024. doi:10.48550/arXiv.2409.17776.
- [22] Jawaherul Md. Alam, Michael A. Bekos, Martin Gronemann, Michael Kaufmann, and Sergey Pupyrev. The mixed page number of graphs. Theoretical Computer Science, 931:131–141, 2022. doi:10.1016/j.tcs.2022.07.036.
- [23] Hiroshi Nagamochi. An improved bound on the one-sided minimum crossing number in two-layered drawings. Discrete & Computational Geometry, 33(4):569–591, 2005. doi:10.1007/S00454-005-1168-0.
- [24] L Taylor Ollmann. On the book thicknesses of various graphs. In Proc. 4th Southeastern Conference on Combinatorics, Graph Theory and Computing, volume 8, page 459. Utilitas Math., 1973.
- [25] Sriram Venkata Pemmaraju. Exploring the powers of stacks and queues via graph layouts. PhD thesis, Virginia Polytechnic Institute and State University, 1992.
- [26] Sergey Pupyrev. Mixed linear layouts of planar graphs. In International Symposium on Graph Drawing and Network Visualization, pages 197–209. Springer, 2017. doi:10.1007/978-3-319-73915-1_17.
- [27] Sergey Pupyrev. Improved bounds for track numbers of planar graphs. Journal of Graph Algorithms and Applications, 24(3):323–341, 2020. doi:10.7155/JGAA.00536.
- [28] Veit Wiechert. On the queue-number of graphs with bounded tree-width. The Electronic Journal of Combinatorics, 24(1):P1.65, 2017. doi:10.37236/6429.
- [29] David R. Wood. Bounded-degree graphs have arbitrarily large queue-number. Discrete Mathematics and Theoretical Computer Science, 10(1), 2008. doi:10.46298/DMTCS.434.
- [30] Mihalis Yannakakis. Embedding planar graphs in four pages. Journal of Computer and System Sciences, 38(1):36–67, 1989. doi:10.1016/0022-0000(89)90032-9.