1 Introduction

A stack layout of a graph consists of a linear order on the vertices and an assignment of the edges to stacks, such that no two edges in a single stack cross. A “dual” concept is a queue layout, which is defined similarly, except that no two edges in a single queue may be nested. The minimum number of stacks (queues) needed in a stack layout (queue layout) of a graph is called its stack number (queue number). Stack and queue layouts were respectively introduced by Ollmann [13] and Heath et al. [10, 11]. These are ubiquitous structures with a variety of applications, including complexity theory, VLSI design, bioinformatics, parallel process scheduling, matrix computations, permutation sorting, and graph drawing; see [7] for more details.

Stack and queue layouts have been extensively studied for planar graphs. The stack number of a graph, also known as book thickness, is one if and only if the graph is outerplanar [4]. The stack number of a graph G is at most two if and only if G is subhamiltonian, that is, a subgraph of a planar graph that has a Hamiltonian cycle [4]. More generally, all planar graphs have stack number at most four [18]. Similarly, every graph admitting a 1-queue layout is planar with an “arched leveled-planar” embedding [10]. Many subclasses of planar graphs have bounded queue number: Every tree has queue number one [11], outerplanar graphs have queue number at most two [10]; series-parallel graphs have queue number at most three [15], and planar 3-trees have queue number at most seven [17]. It is, however, an open question whether every planar graph have a constant queue number; Dujmović shows that planar graphs have queue number \({\mathcal {O}}(\log n)\) [6], improving an earlier result of \({\mathcal {O}}(\log ^4 n)\) by Di Battista et al. [5].

Stack and queue layouts are generalized through the notion of a mixed layout, in which every edge is assigned to a stack or to a queue that is defined with respect to a common vertex ordering [11]. Such a layout is called an s-stack q-queue layout, if it utilizes s stacks and q queues. One reason for studying mixed stack and queue layouts is that they model the dequeue data structure, as a dequeue may be simulated by two stacks and one queue [1, 8]. Here we study mixed layouts of planar graphs.

In their seminal paper [11], Heath and Rosenberg make the following conjecture, which has hitherto been unresolved.

Conjecture 1

(Heath and Rosenberg [11]). Every planar graph admits a mixed 1-stack 1-queue layout.

In this paper we disprove the conjecture by providing a planar graph that does not have a 1-stack 1-queue layout.

Theorem 1

There exists a planar graph that does not admit a mixed 1-stack 1-queue layout.

We found, however, that mixed layouts are rather “powerful”. Our experimental evaluation indicates that all planar graphs with \(|V| \le 18\) vertices admit a 1-stack 1-queue layout. This is in contrast with pure stack and queue layouts: There exists a 11-vertex planar graph that requires three stacks, and there exists 14-vertex planar graphs that requires three queues. Thus a reasonable question is what subclasses of planar graphs admit a 1-stack 1-queue layout. Dujmović and Wood [8] consider graph subdivisions, that is, graphs created by replacing every edge of a graph by a path; they show that every planar graph has a 1-stack 1-queue subdivision with four division vertices per edge. We strengthen this result by showing that one division vertex per edge is sufficient.

Theorem 2

Every planar graph admits a mixed 1-stack 1-queue subdivision with one division vertex per edge.

Proof Ideas and Organization. Our construction of the counterexample for Conjecture 1 (presented in Sect. 2) is based on a sequence of gadgets — planar graphs that do not admit a mixed layout under certain conditions. We start with a relatively simple gadget whose linear layouts can be analyzed exhaustively; this gadget does not admit a mixed layout under fairly strong conditions. Several small gadgets are combined into a bigger one, that does not have a mixed layout under weaker conditions; these bigger gadgets are combined together to produce the final counterexample. We believe that such an approach is general and can be used for creating other lower bounds in the context of linear layouts.

Our technique for proving Theorem 2 (considered in Sect. 3) is quite different from the one used by Dujmović and Wood [8] for proving the earlier (weaker) result. We make use of the so-called concentric representation of planar graphs. While the existence of such a representation for a planar graph is known, we extend the representation by finding a suitable order for the vertices, and show that all planar graphs admit the extended representation. We are not aware of any work that uses concentric representations in the context of linear layouts.

Section 4 concludes the paper with a discussion of our experiments, possible future directions, and interesting open problems.

Related Work. Although there exists numerous works on stack and queue layouts of graphs (refer to [7] for a detailed list of references), the concept of mixed layouts received much less attention. Heath and Rosenberg [11] suggest to study such generalized layouts and present Conjecture 1, which is a topic of this paper. Dujmović and Wood [8] investigate mixed layouts of graph subdivisions. They show that every graph G (not necessarily planar) has an s-stack q-queue subdivision with \({\mathcal {O}}(\log sn(G))\) or \({\mathcal {O}}(\log qn(G))\) vertices per edge, where sn(G) and qn(G) are the stack and queue numbers of G, respectively. Enomoto and Miyauchi [9] improve the constants of the bounds for the numbers of division vertices per edge.

For the case of planar graphs, Dujmović and Wood [8] show that four division vertices per edge are sufficient to construct a mixed 1-stack 1-queue; the bound is improved by Theorem 2. Our result mimics the fact that every planar graph with one division vertex per edge has a 2-stack layout, as such graphs are bipartite [14]. Also related is a work by Auer [1] who study dequeue layouts of planar graphs, and prove that a planar graph admits a dequeue layout if and only if it contains a Hamiltonian path. Since a dequeue may be simulated by two stacks and one queue, such graphs also admit a 2-stack 1-queue layout. To the best of our knowledge, it is open whether every planar graph has a 2-stack 1-queue layout.

2 A Counterexample for Conjecture 1

A vertex ordering of a graph \(G=(V,E)\) is a total order of the vertex set V. In a vertex ordering < of G, let L(e) and R(e) denote the endpoints of an edge \(e \in E\) such that \(L(e) < R(e)\). Consider two edges \(e, f \in E\). If \(L(e)< L(f)< R(e) < R(f)\) then e and f cross, and if \(L(e)< L(f)< R(f) < R(e)\) then e and f nest. In the latter case, we also say that e covers f. It is convenient to express the total order < by permutation of vertices \([v_1, v_2, \dots , v_{|V|}]\), where \(v_1< v_2< \dots < v_{|V|}\). This notion extends to a subset of vertices in the natural way. Thus, two edges, e and f, cross if the order is [L(e), L(f), R(e), R(f)], and they nest if the order is [L(e), L(f), R(f), R(e)]. A stack (resp. queue) is a set of edges \(E' \subset E\) such that no two edges in \(E'\) cross (nest). A mixed layout of a graph is a pair \((<, \{{\mathcal {S}}, {\mathcal {Q}}\})\), where < is a vertex ordering of G, and \(\{{\mathcal {S}}, {\mathcal {Q}}\}\) is a partition of E into a stack \({\mathcal {S}}\) and a queue \({\mathcal {Q}}\).

Our counterexample for Conjecture 1 is depicted in Fig. 1. The graph, \({\overline{G}}\), is built from 19 copies of a gadget, H, by identifying two vertices, A and B. The graph consists of 173 vertices and 361 edges. Let us introduce some definitions for the graph. Every copy of gadget H consists of two twins, s and t, connected by a twin edge, (st). Each pair of twins is connected by A, B, and seven degree-2 vertices, \(x_1, \dots , x_7\), that we call connectors. The set of connectors corresponding to s and t is denoted by \(C_{s,t}\). Now we prove the main result of the section.

Fig. 1.
figure 1

A graph that does not admit a mixed 1-stack 1-queue layout.

Theorem 1

There exists a planar graph that does not admit a mixed 1-stack 1-queue layout.

Proof

The proof is by contradiction; we assume that there exists a mixed layout of graph \({\overline{G}}\) shown in Fig. 1b. Using symmetry, we may assume that in the mixed layout of the graph \(A < B\), \(s_i < t_i\) for all \(1 \le i \le 19\), and \(s_1< s_2< \dots < s_{19}\). Let us analyze possible relative orderings of vertices AB and two twins, s and t in a gadget H. It is easy to see that there are only six permutations of the vertices: (i) [stAB]; (ii) [sAtB]; (iii) [sABt]; (iv) [AstB]; (v) [AsBt]; (vi) [ABst]. Since graph \({\overline{G}}\) contains 19 pairs of twins, there exist at least four twin pairs that form the same permutation with A and B. Therefore, to prove the claim of the theorem, it is sufficient to show impossibility of a mixed layout with four twin pairs forming the same permutation. Permutations (i) and (vi) are considered in Case 4, as they are symmetric. Permutations (ii) and (v) are considered in Case 2. Permutation (iii) is considered in Case 1. Permutation (iv) is considered in Case 3.     \(\square \)

Before moving to the case analysis, we prove three lemmas that are common for the proofs of all the cases.

Lemma 1

Assume that a vertex ordering of graph \({\overline{G}}\) contains \([v_1, s, t, v_2]\) with edge \((v_1, v_2) \in {\mathcal {Q}}\) and twins st. Then the following holds:

 

1a:

the order is \([v_1, s, t, v_2, x_1, x_2, x_3]\) or \([x_1, x_2, x_3, v_1, s, t, v_2]\) for some connectors \(x_1, x_2, x_3 \in C_{s,t}\); that is, at least three of the connectors are either before \(v_1\) or after \(v_2\) in the order;

1b:

\((s, x_i) \in {\mathcal {S}}\) and \((t, x_i) \in {\mathcal {Q}}\), or \((s, x_i) \in {\mathcal {Q}}\) and \((t, x_i) \in {\mathcal {S}}\) for some \(x_i \in C_{s,t}\), \(1 \le i \le 3\); that is, at least one of the connectors is adjacent to a queue edge and a stack edge.

 

Proof

For the first part of the lemma, assume that three of the connectors corresponding to s and t are between \(v_1\) and \(v_2\); that is, \(v_1< x_5< x_6< x_7 < v_2\) for some connectors \(x_5, x_6, x_7 \in C_{s,t}\). Since the graph induced by vertices \(s, t, x_5, x_6, x_7\) is not 1-stack (that is, outerplanar), at least one of edges, \((s, x_5)\), \((s, x_6)\), \((s, x_7)\), \((t, x_5)\), \((t, x_6)\), \((t, x_7)\), is a queue edge. However, this edge is covered by \((v_1, v_2) \in {\mathcal {Q}}\), a contradiction.

For the second part of the lemma, assume the order is \([v_1, s, t, v_2, x_1, x_2, x_3]\) (the proof for the other order is symmetric). Suppose that none of the connectors is adjacent to both queue and stack edges. Hence, there are two connectors, say \(x_1\) and \(x_2\), with edges assigned to a queue or to a stack. However, one of \((s, x_1)\) and \((t, x_2)\) is a queue edge, as the two edges cross. Similarly, one of edges \((s, x_2)\) and \((t, x_1)\) is a stack edge, as the edges are nested, a contradiction.     \(\square \)

Lemma 2

Assume that a vertex ordering of graph \({\overline{G}}\) contains \([v_1, u_1, s, t, u_2, v_2]\) with edges \((v_1, v_2) \in {\mathcal {Q}}\), \((u_1, u_2) \in {\mathcal {S}}\) and twins st. Then \({\overline{G}}\) does not admit a mixed layout.

Proof

By Lemma 1a applied for vertices \(v_1, s, t, v_2\), there exists a connector \(x \in C_{s,t}\) such that \(x < v_1\) or \(x > v_2\). By Lemma 1b, one of edges (sx), (tx) is a stack edge. However, this edge crosses stack edge \((u_1, u_2)\), a contradiction; see Fig. 2a.     \(\square \)

Fig. 2.
figure 2

Impossible configurations for a mixed layout of graph \({\overline{G}}\), as shown by Lemmas 2 and 3. Stack edges are blue and queue edges are red. (Color figure online)

Lemma 3

Assume that for three pairs of twins \(s_i\), \(t_i\), \(1 \le i \le 3\), a vertex ordering of graph \({\overline{G}}\) contains \([v_1, s_i, t_i, v_2]\), where edge \((v_1, v_2) \in {\mathcal {Q}}\). Then \({\overline{G}}\) does not admit a mixed layout.

Proof

Notice that all twin edges, \((s_i, t_i)\) for \(1 \le i \le 3\), are stack edges, as they are covered by \((v_1, v_2) \in {\mathcal {Q}}\). Moreover, the edges do not nest each other, as otherwise the two nested edges together with \((v_1, v_2)\) form a configuration as in Lemma 2, which is impossible. Thus, we have three non-nested pairs of twins, that is, up to renumbering the order is \([v_1, s_1, t_1, s_2, t_2, s_3, t_3, v_2]\).

Let us apply Lemma 1a for the three pairs of twins and edge \((v_1, v_2) \in {\mathcal {Q}}\). There are two triples of connectors, \(x_1, x_2, x_3 \in C_{s_p,t_p}\) and \(y_1, y_2, y_3 \in C_{s_q,t_q}\) for \(p, q \in \{1,2,3\}\), that are all either before \(v_1\) or after \(v_2\) in the order. Without loss of generality, we assume \(v_2 < x_j\) and \(v_2 < y_j\) for all \(1\le j \le 3\).

By Lemma 1b applied for twins \(s_p\) and \(t_p\), one of the connectors, say \(x_1\), is adjacent to a queue edge, \(e_p\), and to a stack edge, \(f_p\). Similarly, a connector of \(s_q\) and \(t_q\), say \(y_1\), is adjacent to a queue edge, \(e_q\), and to a stack edge, \(f_q\); see Fig. 2b. However, it is not possible to assign these four edges to \({\mathcal {S}}\) and \({\mathcal {Q}}\): If \(x_1 < y_1\), then the two queue edges, \(e_p\) and \(e_q\), nest; If \(x_1 > y_1\), then the two stack edges, \(f_p\) and \(f_q\), cross.     \(\square \)

Now we are ready to analyze the cases proving Theorem 1.

Case 1

(sABt). Assume that the vertex ordering is \([s_i, A, B, t_i]\) for twins \(s_i, t_i\) for all \(1 \le i \le 4\). Then graph \({\overline{G}}\) does not admit a mixed layout.

Proof

Let us assume that the vertex ordering is \([s_1, s_2, s_3, s_4, A, B, d_1, d_2, d_3, d_4]\), where \(d_i \in \{t_1, t_2, t_3, t_4\}\) for all \(1 \le i \le 4\). Note that \({\overline{G}}\) contains edges \((A, d_i)\) and \((B, d_i)\) for all \(1 \le i \le 4\).

Start with a pair of edges \((A, d_4)\) and \((B, s_1)\); since they cross, one of the edges is a queue edge. Without loss of generality, we may assume that \((A, d_4) \in {\mathcal {Q}}\). Hence, all edges covered by \((A, d_4)\) are stack edges; that is, \((B, d_3)\), \((B, d_2)\), \((B, d_1) \in {\mathcal {S}}\). It follows that all edges crossing the three edges are in the queue: \((A, d_2)\), \((A, d_1) \in {\mathcal {Q}}\); see Fig. 3a.

Now let \(s_x\) be a twin of \(d_2\). Edge \((s_x, d_2)\) is a stack edge since it covers \((A, d_1) \in {\mathcal {Q}}\). However, \((s_x, d_2)\) crosses \((B, d_3) \in {\mathcal {S}}\), a contradiction.     \(\square \)

Fig. 3.
figure 3

An illustration for the proofs of cases of Theorem 1. Stack edges are blue and queue edges are red. (Color figure online)

Case 2

(AsBt). Assume that the vertex ordering is \([A, s_i, B, t_i]\) for twins \(s_i, t_i\) for all \(1 \le i \le 4\). Then graph \({\overline{G}}\) does not admit a mixed layout.

Proof

Let us assume that the vertex ordering is \([A, s_1, s_2, s_3, s_4, B, d_1, d_2, d_3, d_4]\), where \(d_i \in \{t_1, t_2, t_3, t_4\}\) for all \(1 \le i \le 4\).

Suppose that \(e=(A, d_2)\) is a stack edge. Then \((B, d_3) \in {\mathcal {Q}}\), as it crosses e. This is impossible, as twin edge \((s_x, d_4)\) (for some \(1\le x \le 4\)) crosses a stack edge, \((A, d_2)\), and covers a queue edge, \((B, d_3)\). Hence, \((A, d_2)\) is a queue edge.

Since \((A, d_2) \in {\mathcal {Q}}\), all nested edges are in the stack; in particular, \((s_1, B) \in {\mathcal {S}}\) and \((s_y, d_1) \in {\mathcal {S}}\), where \(s_y\) is the twin of \(d_1\). Notice that in order for edges \((s_1, B)\) and \((s_y, d_1)\) to be non-crossing, \(s_y\) should be equal to \(s_1\); see Fig. 3b. It follows that edge \((B, d_2)\) is a queue edge since it crosses \((s_1, d_1)\). Finally, we observe that the twin edge of \(d_3\), \((s_z, d_3)\) for some \(2 \le z \le 4\), crosses a stack edge, \((s_1, d_1)\), and covers a queue edge, \((B, d_2)\), which is not possible.     \(\square \)

Case 3

(AstB). Assume that the vertex ordering is \([A, s_i, t_i, B]\) for twins \(s_i, t_i\) for all \(1 \le i \le 4\). Then graph \({\overline{G}}\) does not admit a mixed layout.

Proof

Let us assume that the vertex ordering is \([A, d_1, d_2, \dots , d_8, B]\), where \(s_i, t_i \in \{d_1, \dots , d_8\}\) for all \(1 \le i \le 4\).

Since edges \((A, d_8)\) and \((d_1, B)\) cross, one of them is a queue edge. Without loss of generality, we may assume \((A, d_8) \in {\mathcal {Q}}\). Consider seven vertices \(d_1, d_2, \dots , d_7\). It is easy to see that they form three pairs of twins (while the forth pair is formed with \(d_8\)). By Lemma 3 applied for \((A, d_8) \in {\mathcal {Q}}\) and the twins, it is impossible.     \(\square \)

Case 4

(ABst). Assume that the vertex ordering is \([A, B, s_i, t_i]\) for twins \(s_i, t_i\) for all \(1 \le i \le 4\). Then graph \({\overline{G}}\) does not admit a mixed layout.

Proof

Let us assume that the vertex ordering is \([A, B, d_1, d_2, \dots , d_8]\), where \(s_i, t_i \in \{d_1, \dots , d_8\}\) for all \(1 \le i \le 4\).

Suppose that edge \(e=(A, d_7) \in {\mathcal {Q}}\); then edge \((B, d_6) \in {\mathcal {S}}\), as it is covered by e. Additionally, we have five vertices, \(d_1, d_2, d_3, d_4, d_5\), which form at least one pair of twins. This pair of twins together with \((A, d_7) \in {\mathcal {Q}}\) and \((B, d_6) \in {\mathcal {S}}\) form a configuration as in Lemma 2, which is impossible. Therefore, edge \((A, d_7) \in {\mathcal {S}}\) and the crossing edge, \((B, d_8)\), is a queue edge.

Consider vertices \(d_1, \dots , d_7\). There are three pairs of twins formed by the vertices; all of the pairs are covered by \((B, d_8) \in {\mathcal {Q}}\), contradicting Lemma 3.     \(\square \)

3 Mixed Layouts of Planar Subdivisions

In this section we prove Theorem 2. To this end, we utilize a special representation of a planar graph, which is called ordered concentric. In such a representation, the vertices of a graph are laid out on a set of circles around a specified origin vertex, so that each circle contains exactly the vertices with the same graph-theoretic distance to the origin; see Fig. 4. To construct such a representation, we begin with an arbitrary vertex of the graph as the origin, and consider a planar embedding of the graph with the origin on the outer face. The layers of vertices are formed by a breadth-first search starting at the origin, and the edges are routed without crossings and connect vertices of the same layer or vertices of two consecutive layers. Formally an ordered concentric representation is defined next. We assume that for a graph \(G=(V, E)\), \(dist_G(u, v)\) is the graph-theoretic distance between vertices \(u, v \in V\).

Fig. 4.
figure 4

(a) A plane graph and (b) its ordered concentric representation with the origin \(v^*=1\). Concentric circles are shown dashed.

Definition 1

Let \(G=(V, E)\) be a connected planar graph with a specified vertex \(v^* \in V\). An ordered concentric representation of G with the origin \(v^*\), denoted by \(\varGamma ^o\), is a drawing of G with the following properties:

  1. (i)

    The drawing is planar with vertex \(v^*\) lying on the outer face;

  2. (ii)

    \(V_i = \{x \in V~|~dist_{G}(v^*, x) = i\}\) for all \(0 \le i \le k\) and some \(k \in \mathbb {N}\). The set \(V_i\) is called the i -th level of G. For every level \(V_i\), \(1 \le i \le k\), the vertices of \(V_i\) are arranged in a sequence \(x_1, x_2, \dots ,x_r\) with \(|V_i| = r\).

    In the drawing, the vertices are laid out on a closed curve in the order; the curve is called the i -th circle. The vertices of \(V_j\), \(j < i\) are located inside the area bounded by the i-th circle, while the vertices of \(V_j\), \(j > i\) are located outside the area bounded by the i-th circle.

  3. (iii)

    For every edge \((u, w) \in E\) with \(u \in V_i\) and \(w \in V_j\), it holds that either \(i=j\), in which case the edge is called a level edge, or \(|i-j|=1\), corresponding to a non-level edge.

    Every level edge \((u, w) \in E\), \(u, w \in V_i\) is realized as a curve routed outside the i-th circle. Every non-level edge \((u, w) \in E\), \(u \in V_i\), \(w \in V_{i+1}\) is realized as a curve consisting of at most two pieces: the first (required) piece is routed between the i-th and the \((i+1)\)-th circles, and the second (optional) piece is routed outside the \((i+1)\)-th circle.

Notice that the notion of concentric representations is related to radial drawings [2]. The main difference is that in radial drawings “monotonicity” of edges is required; equivalently, every edge shares at most one point with a circle in a radial drawing. In contrast, some edges of a concentric representation may cross a circle multiple times; for example, see an edge (5, 8) in Fig. 4b. As a result, a radial drawing may not exist for a planar graph, while an ordered concentric representation can always be constructed as shown by Lemma 4.

Another closely related concept is a (non-ordered) concentric representation of a planar graph [12, 16]. Such a representation is defined similarly, except that the vertices of each level form a cyclic sequence and the origin vertex is not required to lie on the outer face. In a sense, Definition 1 provides a refinement of a concentric representation, as it dictates the (non-cyclic) order of the vertices of every level. The next lemma shows that every planar graph admits an ordered concentric representation.

Lemma 4

For every connected planar graph \(G=(V, E)\) and every \(v^* \in V\), there exists an ordered concentric representation of G with the origin \(v^*\).

Proof

We start by constructing a breadth-first search tree, T, of G rooted at \(v^*\). Consider an arbitrary combinatorial embedding of G (that is, cyclic orders of edges around each vertex), and draw T on a set of horizontal lines respecting the planar embedding. A line with y-coordinate \(=i\) contains vertices \(V_i\), \(0 \le i \le k\) with \(k = \max _{u \in V} dist_G(v^*, u)\). The order of the vertices along each line is defined by the embedding of G. Notice that the drawing is planar and satisfies Definition 1. Here the circles are formed by connecting the leftmost and the rightmost vertices of each horizontal line with a curve surrounding the drawing; see Fig. 5a. All the edges of T are drawn as straight-line segments between consecutive levels, that is, they are non-level edges. Next we show how to draw the remaining edges of E while preserving the properties of Definition 1.

Fig. 5.
figure 5

(a) A starting point for construction an ordered concentric representation for graph shown in Fig. 4a, as described in Lemma 4. (b) Maintaining the invariant of Lemma 4 while drawing edge (2, 9) and then edge (5, 8).

To this end, we maintain the following invariant: For every face f of the currently drawn graph, H, there exists a vertical line segment of length \(\varepsilon > 0\) such that every vertex \(u \in f\) can be connected to every point of the segment via a curve, which is monotone in the y-direction, while avoiding crossing with the edges of H. Since the drawing of T defines only one face, it is clear that the segment with endpoints (xk) and \((x, k+1)\) (for an arbitrary \(x \in \mathbb {R}\)) satisfies the invariant; see Fig. 5a. Let us show how to draw the next edge. Assume that an edge, \((u, w) \in E\), belongs to a face f of H. Due to the invariant, there exists a line segment with endpoints \(p_0=(x, y_0)\) and \(p_1=(x, y_1)\) (for some \(x, y_0, y_1 \in \mathbb {R}\)) that is reachable from both u and w. We identify point \(p=(x, (y_0 + y_1) / 2)\) on the segment and route the edge along the curves connecting u to p and then p to w. The edge splits f into two faces such that the condition of the invariant can be satisfied using segments \(p_0, p\) and \(p, p_1\); see Fig. 5b. To complete the proof, we observe that the edge also satisfies Definition 1. If \(dist_G(v^*, u) = dist_G(v^*, w)\), then (uw) is a level edge. Otherwise, if \(|dist_G(v^*, u) - dist_G(v^*, w)| = 1\), then (uw) is a non-level edge represented by a two-piece curve.     \(\square \)

Now we are ready to prove the main result of the section. Our construction of a mixed layout for a given graph G is as follows. We start with an ordered concentric representation, \(\varGamma ^o\), of G, which is created by a breadth-first search starting at an arbitrary vertex \(v^*\). We distinguish three types of edges in \(\varGamma ^o\): (a) level edges with both endpoints belonging to the same level of \(\varGamma ^o\), (b) short non-level edges whose curves are routed between consecutive levels of \(\varGamma ^o\), and (c) long non-level edges whose curves cross some circles of \(\varGamma ^o\). Our goal is to keep the edges of type (a) in the stack and the edges of type (b) in the queue. The edges of type (c) shall be subdivided into a stack edge and a queue edge. The order of vertices in the mixed layout is constructed from the levels of \(\varGamma ^o\): we place the origin \(v^*\), which is followed by the vertices of \(V_1\) (in the order given by the ordered concentric representation), followed by the vertices of \(V_2\) etc. The correctness of the mixed layout follows from the planarity of \(\varGamma ^o\); see Fig. 6. Next we provide a formal proof.

Fig. 6.
figure 6

(a) An ordered concentric representation for graph shown in Fig. 4a. Red squares are subdivision vertices introduced for long non-level edges. (b) A mixed 1-stack 1-queue layout of the graph constructed as described in Theorem 2. (Color figure online)

Theorem 2

Every planar graph admits a mixed 1-stack 1-queue subdivision with one division vertex per edge.

Proof

Let \(G = (V, E)\) be a planar graph and \(v^* \in V\). We assume that G is connected; otherwise, each connected component of G can be processed individually. Using Lemma 4, construct an ordered concentric representation \(\varGamma ^o\) of the graph with the origin \(v^*\) and a set of levels \(V_i\), \(0 \le i \le k\) for some \(k \ge 0\).

Consider an edge \((u, w) \in E\) with \(u \in V_i\) and \(w \in V_j\). Since the levels are constructed with a breadth-first search, it holds that \(i=j\) or \(|i-j|=1\). Let \(P_{u,w}\) be the (ordered) sequence of levels of \(\varGamma ^o\) such that the corresponding circles share a point with the curve realizing edge (uw). By Definition 1, \(E = E_a \cup E_b \cup E_c\), where

  • \(E_a = \{(u, w) : u, w \in V_i \text{ for } \text{ some } 1 \le i \le k\) with \(P_{u,w}=(V_i, \dots , V_i)\) in \(\varGamma ^o \}\);

  • \(E_b = \{(u, w) : u \in V_i, w \in V_{i+1}\) with \(P_{u,w}=(V_i, V_{i+1})\) in \(\varGamma ^o \}\);

  • \(E_c = \{(u, w) : u \in V_i, w \in V_{i+1}\) with \(P_{u,w}=(V_i, V_{y_1}, \dots , V_{y_d}, V_{i+1})\) in \(\varGamma ^o\) for some \(d \ge 1\), \(y_1 = i+1\) and \(y_t > i+1\) for \(2 \le t \le d \}\).

We construct a subdivision \(G^s=(V^s, E^s)\) as follows. For an edge \(e=(u, w) \in E_c\), consider the crossing point, \(y_1(e)\), between the \((i+1)\)-th circle and the curve realizing e in \(\varGamma ^o\) (which corresponds to the second element, \(V_{y_1}\), of \(P_{u, w}\)). Let

$$V^s = V \cup \bigcup _{e \in E_c} \{y_1(e)\} \text { and } E^s = E_a \cup E_b \cup E_{c_1} \cup E_{c_2}, \text { where }$$
$$E_{c_1} = \bigcup _{e \in E_c} \{(u, y_1(e))\} \text { and } E_{c_2} = \bigcup _{e \in E_c} \{(y_1(e), w)\}.$$

In order to construct a mixed layout of \(G^s\), we use the following order:

$$ \sigma = (v^*,~~ x_1^1, x_2^1, \dots , x_{r_1}^1,~~ x_1^2, x_2^2, \dots , x_{r_2}^2,~~ x_1^3, x_2^3, \dots , x_{r_3}^3, \dots ), $$

where \(\{x_1^i, x_2^i, \dots , x_{r_i}^i\} = V_i^s \supseteq V_i\) are the vertices of the i-th level of \(G^s\) in the order given by \(\varGamma ^o\). All edges of \(E_a\) and \(E_{c_2}\) are stack edges; that is, \(e \in {\mathcal {S}}\) for every \(e \in E_a \cup E_{c_2}\). All the remaining edges are queue edges; that is, \(e \in {\mathcal {Q}}\) for every \(e \in E_b \cup E_{c_1}\). Next we prove the correctness of the construction.

Let us show that all stack edges are crossing-free with respect to the specified order, \(\sigma \). Assume two edges, \((u_1, w_1), (u_2, w_2) \in {\mathcal {S}}\), cross each other, that is \(u_1< u_2< w_1 < w_2\) with respect to \(\sigma \). Observe that all edges in the stack are the edges of the same level in the ordered concentric representation. Thus, \(u_1, w_1 \in V_i^s\) and \(u_2, w_2 \in V_j^s\) for some \(0 \le i, j \le k\). However, the levels are arranged consecutively in \(\sigma \), which means that \(i=j\) and two edges of the same level cross. This is impossible, as all vertices of the same level of \(\varGamma ^o\) and the corresponding level edges form an outerplanar graph by Definition 1.

Finally, let us show that all queue edges are non-nested with respect to \(\sigma \). Assume that two edges, \((u_1, w_1), (u_2, w_2) \in {\mathcal {Q}}\), nest each other so that \(u_1< u_2< w_2 < w_1\). Since the queue edges belong to consecutive levels in the ordered concentric representation, it holds that \(u_1 \in V_i^s\), \(w_1 \in V_{i+1}^s\), \(u_2 \in V_j^s\), \(w_2 \in V_{j+1}^s\) for some \(0 \le i, j \le k\). Since the levels do not overlap in \(\sigma \), it holds that \(i = j\). Hence, the two edges are routed between the same consecutive levels, \(V_i^s\) and \(V_{i+1}^s\), and therefore, cross each other, which violates the planarity of \(\varGamma ^o\).     \(\square \)

4 Discussion

In this paper we resolved a conjecture by Heath and Rosenberg [11] by providing a graph that does not admit a mixed 1-stack 1-queue layout. The graph contains 173 vertices, and a reasonable question is what is the size of the smallest counterexample. In an attempt to answer the question, we implemented an exhaustive search algorithmFootnote 1 (based on the SAT formulation of the linear embedding problem suggested by Bekos et al. [3]) and tested all 977, 526, 957 maximal planar graphs with \(|V| \le 18\). It turns out that all such graphs have a mixed 1-stack 1-queue layout. The evaluation suggests that mixed layouts are more “powerful” than pure stack and queue layouts, as there exist fairly small graphs that do not admit 2-stack and 2-queue layouts. The smallest planar graph requiring three stacks contains 11 vertices, and the smallest planar graph requiring three queues contains 14 vertices; see Figs. 7a and b. We were able to find a smaller counterexample for Conjecture 1; see Fig. 7c. This instance consists of \(|V|=37\) vertices and \(|E|=77\) edges, and has a similar structure as the graph in Theorem 1. However, showing that the graph does not admit a mixed layout requires significantly more effort.

Fig. 7.
figure 7

The smallest planar graphs that require (a) 3 stacks, (b) 3 queues. (c) A graph with \(|V|=37\) and \(|E|=77\) that does not admit a mixed layout.

An interesting future direction is to consider bipartite planar graphs. We noticed that all our counterexamples contain triangles, which seem to be important for non-embeddability. Based on our experiments, we conjecture that every bipartite planar graph admits a mixed 1-stack 1-queue layout. Such a result would strengthen Theorem 2, as a subdivision of a graph with one vertex per edge is clearly bipartite. Also observe that a pure 2-stack layout exists for every bipartite planar graph, as shown by Overbay [14].

Conjecture 2

Every bipartite planar graph admits a mixed 1-stack 1-queue layout.

Another future direction is to study mixed s-stack q-queue layouts of planar graphs. What are possible values of s and q such that there exists a mixed s-stack q-queue layout for every planar graph? By the result of Yannakakis [18], we know that \(s=4, q=0\) is a valid option, while Theorem 1 shows that \(s=1, q=1\) is not sufficient. Here it is worth mentioning a result by Auer [1] who shows that every planar graph with a Hamiltonian path admits a mixed layout with \(s=2\) and \(q=1\). However it is open whether there exists some \(s > 0\) and \(q > 0\) with \(2 < s + q \le 4\) realizing all planar graphs.