 # Linear Layouts of Complete Graphs

A page (queue) with respect to a vertex ordering of a graph is a set of edges such that no two edges cross (nest), i.e., have their endpoints ordered in an ABAB-pattern (ABBA-pattern). A union page (union queue) is a vertex-disjoint union of pages (queues). The union page number (union queue number) of a graph is the smallest k such that there is a vertex ordering and a partition of the edges into k union pages (union queues). The local page number (local queue number) is the smallest k for which there is a vertex ordering and a partition of the edges into pages (queues) such that each vertex has incident edges in at most k pages (queues). We present upper and lower bounds on these four parameters for the complete graph K_n on n vertices. In three cases we obtain the exact result up to an additive constant. In particular, the local page number of K_n is n/3 ± O(1), while its local and union queue number is (1-1/√(2))n ± O(1). The union page number of K_n is between n/3 - O(1) and 4n/9 + O(1).

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

A linear layout of a graph consists of a vertex ordering together with a partition of the edges. For a fixed vertex ordering , we say that two independent edges and with and

• nest if or and

• cross if or .

A queue, respectively a page (also called stack), is a subset of edges that are pairwise non-nesting, respectively non-crossing. A queue layout, respectively a book embedding, is a linear layout whose partition of the edge set consists of queues, respectively pages. The queue number and page number (also called stack number or book thickness) denote the smallest such that there is a linear layout consisting of at most queues, respectively at most pages. Both queue layouts and book embeddings were intensively investigated in the past decades, where complete graphs are one of the very first considered graph classes [2, 9].

Queue layouts and book embeddings model how the edges of a graph can be assigned to and processed by queues, respectively stacks. It was first asked by Heath, Leighton, and Rosenberg  whether queues or stacks are more powerful in this context. Recently, Dujmović et al.  partly answered this question by presenting a class of graphs with bounded queue number that needs an unbounded number of stacks, showing that stacks are not more powerful than queues for representing graphs. In the classical variant in this question, the total number of necessary queues or stacks serves as a measure for the power of queues and stacks. Local and union variants relax the setting by allowing more queues or stacks, as long as each vertex is touched by a small number of queues, respectively stacks, or if they operate on vertex-disjoint subgraphs.

Local and union variants of queue layouts and book embeddings were recently introduced by the second and third author [13, 14]. A linear layout is called -local if each vertex has incident edges in at most parts of the edge partition. The local queue number, respectively local page number, is the smallest such that there is a -local queue layout, respectively a -local book embedding for . Given a fixed vertex ordering, a union queue (union page) is a vertex-disjoint union of queues (pages). The union queue number, respectively union page number, then is the smallest such that there is a linear layout whose edge partition consists of at most union queues, respectively union pages.

Local and union variants have been considered for numerous graph decomposition parameter, such as boxicity, interval numbers, planar thickness, poset dimension, several arboricities, and many more. Especially in recent years, there has been a lot of interest in these variants in various directions, see e.g. [3, 7, 12, 10, 4, 11].

In this paper, we continue the investigation of local and union variants of linear layouts, that is, queue numbers and page numbers. We establish bounds on the respective graph parameters for complete graphs, which interestingly turns out to be non-trivial; in contrast to their classic counterparts. Our results show that the local and union variants of queue numbers and page numbers for -vertex complete graphs are located strictly between the trivial lower bound of due to the density [13, 14, see also Section 2] and , respectively , which is the queue number, respectively page number, of complete graphs [2, 9].

### Outline.

In Section 2, we survey the relation between local and union variants of queue layouts and book embeddings. We give a lower bound on the local queue number of complete graphs and show how to obtain the same upper bound for the union queue number in Section 3 (up to an additive constant). Section 4 continues with a lower and a matching (up to an additive constant) upper bound on the local page number. We also present an upper bound on the union page number and discuss properties that an improved bound needs to satisfy in this section.

### Our results.

Both the local queue number and the union queue number of are linear in with the leading coefficient being . For the local queue number, the error term is small; it is between and .

###### Theorem 1.1.

The local queue number and the union queue number of satisfy

 qnℓ(Kn)=(1−1√2)n±O(1)% and qnu(Kn)=(1−1√2)n±O(1).

The local page number of is also linear in with the leading coefficient being . In this case, the error term is between and . The local page number also gives a lower bound on the union page number, whereas the leading coefficient of our upper bound is .

###### Theorem 1.2.

The local page number and the union page number of satisfy

 13n±O(1)=pnℓ(Kn)⩽pnu(Kn)⩽49n+O(1).

## 2 Preliminaries

In this section, we summarize some known results on local and union linear layouts, which are presented in [13, 14] in detail.

First, we have and , where the gap between the union and global variants can be arbitrarily large. There are graph classes (e.g. -regular graphs for ) with bounded union queue number and union page number but unbounded queue number and page number. In contrast, the local page number, the local queue number, the union page number, and the union queue number are all tied to the maximum average degree, which is defined by . In particular, we have the following connection between the maximum average degree and the union queue number, respectively the union page number. We follow the proof of a similar statement for book embeddings in . However, we stress that the vertex ordering is arbitrary as we make use of this in the proof of Lemma 3.

###### Proposition 1.

Every graph admits a -union queue layout and a -union book embedding with any vertex ordering.

###### Proof.

Nash-Williams  proved that every graph can be partitioned into at most forests. Each forest, in turn, can be partitioned into two star forests . Choosing an arbitrary vertex ordering, each of the star forests is both a union queue and a union page as the edges of a star can neither nest nor cross. ∎

In addition, the local queue number and the local page number are lower-bounded by , which gives a lower bound of for .

In the following sections, we consider the complete graph with vertex set . Due to symmetry, we may throughout assume that the vertex ordering of is given by . Partitioning the edges is the difficult part.

## 3 Local and Union Queue Numbers

We first establish the lower bound of Theorem 1.1. As the union queue number is lower-bounded by the local queue number, we only consider the latter. Note that .

###### Lemma 1.

For any we have .

###### Proof.

Consider a -local queue layout of . Without loss of generality, each edge is contained in exactly one queue. Moreover, the vertices are ordered and the length of an edge is defined as . Now for any edge with consider the queue containing . We call  left-longest if there is no edge in that is longer than and has the same right endpoint as , i.e., contains no edge with . Similarly, we call right-shortest if there is no edge in that is shorter than and has the same left endpoint as , i.e., contains no edge with . We have that

1. [(i)]

2. every edge of is left-longest or right-shortest (or both).

In fact, if is of neither type, then would contain two edges and with , and hence would not be a queue.

For each vertex let , respectively , denote the number of left-longest edges whose right endpoint is , respectively the number of right-shortest edges whose left endpoint is . That is,

• and

• .

Further let denote the number of queues in with at least one edge whose right endpoint is and at least one edge whose left endpoint is . That is,

• .

We can then write the number of queues in containing the vertex in terms of , and . Indeed, if contains an edge incident to , then it contains a left-longest or a right-shortest or both, i.e., the contribution of to is exactly one.

1. [(i)]

2. Vertex has incident edges in exactly queues in .

As every vertex is in at most queues, we have for . Also every vertex is the right endpoint of at most edges and thus . Similarly, the left endpoint of at most edges and thus . Together,

1. [(i)]

2. for every vertex we have .

Using the above and assuming (we are done otherwise), we calculate

 kn ⩾n∑i=1#{Q∈Q∣vi∈V(Q)}???=n∑i=1(ℓi+ri−bi)???⩾|E(Kn)|−n∑i=1bi ???⩾(n2)−k∑i=1(i−1)−n∑i=n−k+1(n−i)−(n−2k)k =(n2)−2(k2)−(n−2k)k.

For and we have

 √a+b<√a+b/2. (1)

Using this we get the desired bound for as follows.

 kn ⩾(n2)−2(k2)−(n−2k)k ⟺0 ⩾k2+(1−2n)k+(n2) ⟹k ⩾(n−12)−√(n−12)2−(n2)=(n−12)−√12(n2−n+12) =(n−12)−√12(n−12)2+18(n−12)−√12(n−12)2−116 =(1−1√2)(n−12)−116=(1−1√2)n−116(9−4√2)\qed

Now let us turn to the upper bound of the union queue number in Theorem 1.1. We thereby also prove an upper bound for the local queue number. However, we improve on this bound with a different construction in Lemma 4.

###### Lemma 2.

For any , we have

We prove that whenever , there is a -local queue layout and a -union queue layout of . Let be a fixed vertex ordering of . For ease of presentation, we model the edge set of as a point set in with triangular shape defined by

 Tn={(x,y)∈Z2∣x+y⩽n+1; x⩾1; y⩾1}.

The elements in correspond to the entries of the adjacency matrix of . That is, element of corresponds to edge in and conversely edge in with corresponds to element in . Two edges with and with nest if and only if the corresponding elements and in are comparable in the strict dominance order of (i.e. coordinate-wise strict inequalities of points). To see this, observe that small -coordinates correspond to a left endpoint having a small index, whereas small -coordinates correspond to a right endpoint with a large index. Hence, an edge set forms a queue if and only if the corresponding points in form a weakly monotonically decreasing chain, see Fig. 1. Figure 1: Left: Triangle T8 corresponding to K9 and the hook of vertex 4. The blue entries represent a queue, the light blue zig-zag shows that the edges are non-nesting. Right: Linear layout of the blue queue.

A vertex of corresponds to column and row in . We call the union of column and row the hook of vertex . If is the hook of vertex and is a queue corresponding to chain , then vertex  is contained in queue if and only if . For our construction of a -local queue assignment of , we use the equivalent model of covering the triangular point set with monotone chains such that no hook intersects more than chains.

Analogously to union queues, we call a subset a union chain if there is a partition of into weakly monotonically decreasing chains such that each hook intersects at most one of them. To prove Lemma 2, we partition into union chains and therefore get a -union queue layout for .

###### Lemma 3.

For any integer and any integer , the points of can be partitioned into union chains. In addition, the points of can be partitioned into weakly monotonically decreasing chains such that each hook intersects at most chains.

###### Proof.

First, we define weakly monotonically decreasing chains that cover such that no hook intersects more than chains. We then partition these chains into sets of chains that form the basis for our union chains. We assume that is even and that is the smallest even integer with . To compensate for this assumption, we construct chains such that each hook intersects at most chains and a partition of into union chains. We need for the construction, which is the case for . For , we have , so an -queue layout of gives the desired partition of , respectively , into queues, respectively chains. For any between and , one can check that the desired bounds can be obtained from a queue layout of some with a slightly smaller or greater number of vertices.111Indeed, for each between and and corresponding , one of the following two cases applies. First, there is an even such that is even, holds, and we have , respectively . Or second, there is an even such that , is even, holds, and the queue layout we obtain for can be augmented to a queue layout of matching the desired bounds. To do so, we attach at most two of the additional vertices to the left and at most two to the right and use two additional queues to cover the new edges. We then observe that , which gives the desired bounds for .

We start by defining a family of chains , illustrated in Fig. 2. Chain is composed of three blocks. The first block consists of the topmost elements in column  of . The second block starts at the lowest element of the first block, continues with a right and down alternation for steps, and ends in row . The last block consists of the rightmost elements in row . Formally, for we set

 Li= {(i,y)∈Tn∣n+1−i⩾y⩾n−2k+i} ∪ {(x,y)∈Tn∣x,y⩾i and n−2(k−i)⩽x+y⩽n−2(k−i)+1} ∪ {(x,i)∈Tn∣n−2k+i⩽x⩽n+1−i}.

The chains of cover all points of except for the bottom left triangle . The remaining points are covered by chains containing only points of a single column or row. We refer to these chains as vertical and horizontal chains, respectively. Note that vertical and horizontal chains correspond to stars in . We only define families containing vertical chains, the horizontal chains are then defined symmetrically, i.e., for . The resulting layout of is illustrated in Fig. 2. Figure 2: Chains L1,…,Lk (top right). The triangle Tn−2k is covered by families A,…,G and A′,…,G′ of vertical, respectively horizontal, chains (bottom left).

The families cover the bottom left square . For this, let consist of chains and with having size or for . The chains consist of points in column starting with the bottommost point in row . Chains with points above continue as from the bottom. Note that is empty for . For we define

 Ai ={(i,y)∈Tn∣i⩽y<(n−3k)/2+i and y⩽n−3k} and ^Ai ={(i,y)∈Tn∣1⩽y⩽i−(n−3k)/2}.

The defined chains together with the chains in cover all points whose - and -coordinates are at most . Some points, however, are covered twice. We may choose any of the two covering chains for the respective points to obtain a partition.

Family is located to the right of and consists of chains and . Above , there are chains and forming family . Considering the -coordinates of the bottommost points of the chains in , we have a slope ( for ). Symmetrically, the slope is in . For and we define

 Bi ={(n−3k+i,y)∈Tn∣⌊si⌋⩽y⩽⌈si⌉+(3n−10k)/2 and y⩽n−3k}, ^Bi ={(n−3k+i,y)∈Tn∣1⩽y⩽⌈si⌉+(3n−10k)/2−(n−3k)}, Cj ={(j,y)∈Tn∣n−3k+⌊j/s⌋⩽y⩽3(n−3k)/2+⌈j/s⌉ and n−3k

Note that and are empty for and . The chains in , and symmetrically , form a rectangle containing points. Again, we choose any chain for points that are covered by multiple chains.

Family , together with the corresponding horizontal chains in , accomplishes the square . For this, we have chains , where has size . For let

 Di ={(n−3k+i,y)∈Tn∣n−3k

Finally, we cover to remaining two triangles with three families , and of vertical chains. Families and consist of chains , respectively , each filling a triangle, whereas the chains all have size and cover a rectangle. For and we define

 Ei ={(n−3k+i,y)∈Tn∣n/2−k

The chains in , , and together cover the all points of with , and symmetrically , , and cover the triangle above . Note that we have and recall that so all intervals are well-defined.

Next we show that each hook intersects at most chains. Recall that a hook of a vertex is the union of the row and the column representing that vertex. We first count for each row and each column the number of intersecting chains and then add up the results to obtain the number of intersecting chains for each hook. We start by counting the vertical chains, which intersect rows . Note that no vertical chain intersects any row above . If , then and are empty, so we may assume when counting these chains.

• For each , row intersects chains and , which sums up to chains. The chains do not contain any points above row and thus row intersects exactly , i.e., chains.

• For the upcoming calculation, note that for . For row , we have chains for and for . This sums up to

 y+1s+4k−n2−y−1+(4k−n)/2s=4k−n2−(4k−n)/2s+2s=(4k−n)2−(4k−n)22(n−3k)2n−3k2+2s⩽(4k−n)2−n−3k2+2s(∗)<7k−2n2+4

chains. For , each row intersects at most

 y+1s−y−(3n−10k)/2−1s=3n−10k2s+2s=(n−3k−4k−n2)/s+2s=4k−n2−(4k−n)22(n−3k)2n−3k2+2s⩽4k−n2−n−3k2+2s(∗)<7k−2n2+4

chains. For , we remark that holds for all . For smaller , recall that there are only columns containing vertical chains in . That is, if , then certainly upper-bounds the number of chains in that intersect any row. However, if and , then we also have .

• For , chain intersects row only if and intersects row only if . So we have at most

 (y+1)s+n−3k−(y−1+(7k−2n)/2)s=2s+2(n−3k)2(4k−n)24k−n2⩽2s+4k−n2⩽4k−n2+3

chains. For , we have in row for , which upper-bounds the number of chains by

 ((n−3k)+2)s=2(n−3k)2(4k−n)24k−n2+2s⩽4k−n2+3.
• The vertical chains in intersect the rows . Precisely, for , row intersects the chains , i.e., chains.

• Similarly, the vertical chains in intersect the rows . For each , row intersects the chains , i.e., chains.

• All chains of intersect the rows exactly once, that is we have additional vertical chains in these rows.

• Row intersects the chains , i.e., chains.

Summing up the number of vertical chains intersecting the rows , we get at most chains from and . Additionally we have at most four horizontal chains in and . Rows intersect vertical chains in and , which sums up to chains. There are at most four additional horizontal chains in and intersecting these rows. Finally, rows intersect only vertical chains in and horizontal chains in , summing up to chains. Together, we have at most vertical and horizontal chains in row and only one horizontal chain from in row . Symmetrically, there are at most vertical and horizontal chains intersecting column and one vertical chain in each column .

Now, we count the number of chains intersecting the hook of vertex for . Recall that hook corresponds to column and row . For , hook intersects and vertical and horizontal chains. Note that row is above row and thus does not intersect any vertical or horizontal chains in . Hooks intersect all chains in and at most one vertical chain from . By symmetry all hooks intersect at most chains.

The chains defined above induce a -local queue layout. To obtain a -union queue layout, we partition the set of all chains into sets of chains with for .

We first introduce some notions that allow us to transform a set of chains into a union chain. Consider some set of chains. Note that is not necessarily a union chain as two chains may intersect the same hook. We call the set of all hooks that intersect at least two chains of the common hooks of . If has no common hooks, then is already a union chain. Otherwise, we assign each of the common hooks to at most one chain. A point that is contained in some chain and in some common hook that is not assigned to is called a bad point. Removing all bad points yields chains that together form a union chain.

We now aim to define such that the resulting bad points can be covered by a constant number of union chains. For this, we associate each vertical (horizontal) chain with the interval that consists of the -coordinates (-coordinates) of the points contained in . We say two vertical (horizontal) chains overlap if the corresponding intervals are not disjoint. Consider the set for some . We add vertical and horizontal chains to such that

1. [(i)]

2. chains in do not overlap,

3. the -coordinates (-coordinates) of all points in vertical (horizontal) chains in are smaller than , and

4. there is no vertical (horizontal) chain in in column (row) .

We first assume that Items 3, 2 and 1 hold and show that they can indeed be satisfied at the end of the proof. We merge vertical (horizontal) chains of that are in the same column (row) into a single chain. Next, we assign common hooks to chains and use the three conditions to show that union chains suffice to cover all bad points. For the analysis of bad points, we concentrate on vertical chains. The result for horizontal chains follows symmetrically. Figure 3: A set Si with two vertical chains and their hooks (dashed). Bad points are marked red.

Consider a vertical chain in column and let denote the hook that contains . Recall that vertical chains of that are in the same column are merged into a single chain. If is a common hook, we assign it to . Note that each hook either contains vertical chains or horizontal chains, and thus no hook is assigned to multiple chains. See Fig. 3 for an illustration of bad points in . Assigning to implies that all points of that are contained in some other chain of are bad points. We say that these bad points are caused by . We now analyze how many bad points are caused by . If , then intersects in at most four points, i.e., we have at most four bad points in . In this case, no horizontal chain in intersects by Item 2. Otherwise we have (due to Item 3), and Item 1 ensures that intersects at most one horizontal chain . We thus have at most one bad point in . In either case, causes at most four bad points.

It is left to show that each bad point is caused by some vertical or horizontal chain. For this, we keep fixed and consider a hook whose column intersects the triangle , i.e., with . We show that each bad point in is caused by a vertical chain. The result for hooks whose row intersect follows symmetrically with horizontal chains. Hooks that do not intersect contain no bad points since is the only chain in that intersects such a hook. Note that the row of is above and thus does not intersect any vertical or horizontal chains. If , then does not intersect . It intersects at most one horizontal chain due to Item 1. That is, if contains a bad point, then it also contains a vertical chain causing this bad point. If , then intersects neither vertical nor horizontal chains by Items 3 and 2. Thus, is the only intersected chain in and there are no bad points. If , then intersects no horizontal chains in by Item 2. Hence, if there are bad points, then they are caused by a vertical chain in column .

We are now ready to cover the bad points by a constant number of union chains. Let denote the graph that is induced by all bad points. For a vertical or horizontal chain , let denote the vertex that is represented by hook . We orient the edges of such that every edge whose corresponding bad point is caused by chain is oriented away from . Each hook contains at most four vertical or horizontal chains (see Fig. 2 and recall that each hook either contains vertical chains or horizontal chains). Recall that each chain causes at most four bad points. Thus, the out-degree of every vertex of is at most . By Proposition 1, the graph can be covered with union queues using an arbitrary vertex ordering. Hence, the bad points can be covered by union chains.

Finally, we show how to partition the vertical chains of the presented -local layout such that Items 3, 2 and 1 are satisfied. Let denote the interval graph that is given by the intervals that correspond to vertical chains, i.e., and there is an edge between two vertices if and only if the intervals are not disjoint. A clique of vertices in corresponds to a row that intersects vertical chains. Recall that every row intersects at most vertical chains. In particular, the clique number of is at most .

Note that any proper -coloring and an arbitrary mapping between color classes and the sets of chains satisfies Item 1. We next find a coloring with less than colors that also satisfies Items 3 and 2. We define an ordering on the vertices of by decreasing topmost points of the intervals, i.e., if and only if or and . We color the vertices of greedily with colors . That is, for an interval in column , we choose the largest color that is not used by any smaller neighbor and that does not equal . We then define to contain the vertical chains whose intervals have color . Since is an interval graph, the set consisting of a vertex and its smaller neighbors induces a clique that corresponds to row . The vertex thus has at most smaller neighbors. There are at least two colors left that are larger than and that are not already used by a smaller neighbor. Choosing one that does not equal satisfies Items 3 and 2.

By symmetry, we color the horizontal chains with colors such that Items 3, 2 and 1 hold. We now have a partition of all chains into sets of chains , each forming a union chain when bad points are removed. Together with the union chains for bad points, we get a partition of into union chains. ∎

Lemma 2 provides an upper bound of both for the union queue number and the local queue number and thus completes the proof of Theorem 1.1. For the local queue number, however, the following lemma improves on the constant of the additive term such that it almost matches the lower bound.

###### Lemma 4.

For any , we have

For our example of a -local queue assignment of , we again use the equivalent model of covering the triangular point set with a set of monotone chains such that no hook intersects more than of the chains in .

###### Lemma 5.

For any and any , the elements of can be partitioned into a set of weakly monotonously decreasing chains in such a way that

1. [(i)]

2. every hook intersects at most chains in ,

3. for each , column intersects at most chains in ,

4. for each , row intersects at most chains in .

###### Proof.

Note that conditions 2 and 3 are true for every partition of with chains, simply because there are only entries in the respective column and row.

We proceed by induction on . For the value of is at least as large as the queue number of , this yields an induction base.

For the remainder assume that and (without loss of generality) that