Polynomial Treedepth Bounds in Linear Colorings

Low-treedepth colorings are an important tool for algorithms that exploit structure in classes of bounded expansion; they guarantee subgraphs that use few colors have bounded treedepth. These colorings have an implicit tradeoff between the total number of colors used and the treedepth bound, and prior empirical work suggests that the former dominates the run time of existing algorithms in practice. We introduce p-linear colorings as an alternative to the commonly used p-centered colorings. They can be efficiently computed in bounded expansion classes and use at most as many colors as p-centered colorings. Although a set of k<p\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k<p$$\end{document} colors from a p-centered coloring induces a subgraph of treedepth at most k, the same number of colors from a p-linear coloring may induce subgraphs of larger treedepth. We establish a polynomial upper bound on the treedepth in general graphs, and give tighter bounds in trees and interval graphs via constructive coloring algorithms. We also give a co-NP-completeness reduction for recognizing p-linear colorings and discuss ways to overcome this limitation in practice.


Introduction
Algorithms for graph classes that exhibit bounded expansion structure [12,13,14,11] offer a promising framework for efficiently solving many NP-hard problems on real-world networks.The structural restrictions of bounded expansion, which allow for pockets of localized density in globally sparse graphs, are compatible with properties of many real-world networks such as clustering and heavy-tailed degree distributions.Moreover, multiple random graph models designed to mimic these properties have been proven to asymptotically almost surely belong to classes of bounded expansion [3].From a theoretical perspective, graphs belonging to classes of bounded expansion can be characterized by low-treedepth colorings of bounded size, i.e. using only a small number of colors.Roughly speaking, a low-treedepth coloring is one in which the subgraphs induced on each small set of colors have small treedepth, a structural property stronger than treewidth.This definition naturally implies an algorithmic pipeline [13,3,4] for classes of bounded expansion involving four stages: computing a low-treedepth coloring, using the coloring to decompose the graph into subgraphs of small treedepth, solving the problem efficiently on each such subgraph, and combining the subsolutions to construct a global solution.The complexities of algorithms using this paradigm often are of the form O( k p 2 d log d • n c ) where k is the coloring size and d is the treedepth of the subgraphs.
A recent implementation [15] and experimental evaluation [16] of this pipeline has identified that the coloring size has a much larger effect on the run time than the treedepth in practice.Although graphs in classes of bounded expansion are guaranteed to admit colorings of constant size with respect to the number of vertices, the only known polynomial-time algorithms for computing these colorings are approximations [11].Consequently it is unclear to what extent our current coloring algorithms can be altered to reduce the coloring size.A more viable approach to improving the performance of the algorithmic pipeline without significant high-level changes would be to develop a new type of low-treedepth coloring that uses fewer colors but potentially has weaker guarantees about the treedepth of the subgraphs.
The traditional low-treedepth colorings for classes of bounded expansion are known as p-centered colorings.This name stems from the property that on any subgraph H, a p-centered coloring either uses at least p colors or is a centered coloring, which restricts the multiplicity of colors in induced subgraphs.In this paper we introduce an alternative that closely mirrors this paradigm but only extends the color multiplicity guarantees to path subgraphs.For this reason we refer to them as p-linear colorings and linear colorings.We identify that p-linear colorings share three important properties with p-centered colorings that allow them to be used in the bounded expansion algorithmic pipeline.
1.The minimum coloring size is constant in graphs of bounded expansion.2. A coloring of bounded size can be computed in polynomial time.3. Small sets of colors induce graphs of small treedepth.
The third of these properties is of particular interest, since understanding the tradeoffs between coloring size and treedepth in switching between pcentered and p-linear colorings fundamentally depends on bounding the maximum treedepth of a graph that admits a linear coloring with k colors.Equivalently, we frame this problem as determining the gap between the minimum number of colors needed for a linear versus a centered coloring in any given graph.Using a grid minors approach, we prove that the minimum size of a centered coloring is polynomially bounded in the minimum size of a centered coloring.Because the "heavy machinery" of this approach likely does not give a tight bound, we give stronger upper bounds on the gap in trees and interval graphs and a matching lower bound for binary trees.Surprisingly, we also prove that some p-linear colorings cannot be verified in polynomial time unless P = co-NP and discuss the practical implications of these findings.Some results in this paper appeared previously in WG 2018 [9].This version adds a polynomial treedepth upper bound for general graphs, as well as tighter lower and upper bounds for trees.

Definitions and Background
In this section we detail the background and terminology necessary to understand p-linear colorings.

Graph Terminology
We denote the vertices and edges of a graph G as V (G) and E(G), respectively, and assume all graphs are simple and undirected except where specifically noted otherwise.The open neighborhood of a vertex v, denoted N (v), is the set of vertices u such that uv ∈ E(G), while the closed neighborhood, We say In a rooted tree T , we let T v be the subtree of T rooted at v and the leaf paths of T v be the set of paths from a leaf of T v to v. We label the levels of T from bottom to top starting from 1; that is, if D is the maximum distance from a leaf to the root then the root is the only vertex in level D + 1 and level i consists of all vertices whose parents are in level i + 1. Vertices u and v are unrelated in T if u is neither an ancestor nor a descendant of v.
A coloring φ of a graph G is a mapping of the vertices of G to colors 1, . . ., k and has size |φ| = k.A coloring is proper if no pair of adjacent vertices have the same color.For any subgraph H and color c, if there is exactly one vertex v ∈ H such that φ(v) = c we say c appears uniquely in H and v is a center of H.A subgraph with no unique color is said to be non-centered.
We use the notation

p-Centered Colorings and Bounded Expansion
Definition 1 A p-centered coloring φ of graph G is a coloring such that for every connected subgraph H, H has a center or φ| H uses at least p colors.
Nešetřil and Ossana de Mendez established that bounding the minimum size of a p-centered coloring is a necessary and sufficient condition for a graph class to have bounded expansion.

Proposition 1 ([12]
) A class of graphs C has bounded expansion iff there exists a function f such that for all G ∈ C and all p ≥ 1, G admits a pcentered coloring with f (p) colors.
There are varying methods to compute p-centered colorings, such as transitivefraternal augmentations [12,5] and generalized coloring numbers [20], we focus here on distance-truncated transitive-fraternal augmentations (DTFAs) [17], which iteratively augment the graph with additional edges to impose constraints on proper colorings.This linear time algorithm guarantees that after (2 log p) p DTFA iterations, any proper coloring of the augmented graph is a p-centered coloring whose size is bounded in classes of bounded expansion.

Centered Colorings and Treedepth
Note that if φ is a p-centered coloring of G and H is a subgraph of G whose vertices use at most p − 1 colors in φ, H must have a center.This relates p-centered colorings to a more restricted class of graphs defined by centered colorings.
Definition 2 A centered coloring φ of graph G is a coloring such that every connected subgraph has a center.The minimum size of a centered coloring of G is denoted χ cen (G).
Note that a centered coloring is also proper, or else there would be a connected subgraph of size two with no center.Observe that if X is the set of all centers of G, then G\X must either be empty or disconnected.This implies that if |G| χ cen (G), then G breaks into many components after only a few vertex deletions.This property is captured by treedepth decompositions.Definition 3 A treedepth decomposition T of graph G is a rooted forest with the same vertex set as G such that uv ∈ E(G) implies u is an ancestor of v in T or vice versa.The depth of T is the length of the longest path from a leaf of T to the root of its component.The treedepth of G, td(G), is the minimum depth of a treedepth decomposition of G.
Given a centered coloring of size k, we can generate a treedepth decomposition of depth at most k by choosing any center v to be the root and setting the children of v to be the roots of the treedepth decompositions of the components of G\{v}.Likewise, given a treedepth decomposition of depth k, we can generate a centered coloring using k colors by bijectively assigning the colors to levels of the tree and coloring vertices according to their level.We refer to the colorings and decompositions resulting from these procedures as canonical ; together they imply that the treedepth and centered coloring numbers are equal for all graphs.

p-Linear and Linear Colorings
We introduce p-linear colorings as an alternative to p-centered colorings.Definition 4 A p-linear coloring is a coloring ψ of a graph G such that for every path1 P , either P has a center or ψ| P uses at least p colors.
It is proven in [17] that after performing 2 p DTFA iterations, any proper coloring of the augmented graph is a p-linear coloring.This implies that plinear colorings indeed have constant size in bounded expansion classes and can be constructed in polynomial time (like p-centered colorings).
In the interest of maintaining consistency with prior terminology, we define linear colorings analogously to centered colorings.Definition 5 A linear coloring is a coloring ψ of a graph G such that every path has a center.The linear coloring number is the minimum number of colors needed for a linear coloring and is denoted χ lin (G).
Note that linear colorings must also be proper.A simple recursive argument shows that every path of length d requires at least log 2 (d + 1) colors in a linear coloring; thus a graph of linear coloring number k has no path of length 2 k .Because every depth-first search tree is a treedepth decomposition, td(G) ≤ 2 χ lin (G) , proving that small numbers of colors in p-linear colorings induce graphs of bounded treedepth2 .
Our study of the divergence between linear and centered coloring numbers will naturally focus on linear colorings that are not also centered colorings.
We say ψ is a non-centered linear coloring (NCLC) of graph G if G contains a connected induced subgraph with no center.For NCLC ψ, we say a connected induced subgraph H is a witness to ψ if H is non-centered but every proper connected subgraph of H has a center.For the sake of completeness, we prove in Lemma 1 that many simple graph classes do not admit NCLCs.
Lemma 1 If G is a cograph, has maximum degree 2, or has independence number 2, any linear coloring of G is also a centered coloring.
Proof We analyze each graph class separately below.Maximum degree 2: Let G be a graph of maximum degree 2. Each connected induced subgraph of G is either a path or a cycle, both of which have a Hamiltonian path.Thus every connected subgraph has a center, making any linear coloring centered.Cographs: Let ψ be an NCLC of cograph G and H be a witness to ψ.If ψ| H only contains one color, H is an isolated vertex and the coloring is centered.Thus, we may assume ψ| H has at least two colors.Because H is a cograph, we can partition its vertices into nonempty sets X, Y such that xy is an edge in H for all x ∈ X and y ∈ Y .But since ψ is proper, every pair of vertices with the same color must lie in the same set X or Y .Since every color in ψ| H appears at least twice, there are vertices {v, v } ∈ X and {u, u } ∈ Y such that ψ(v) = ψ(v ) and ψ(u) = ψ(u ) but ψ(v) = ψ(u).But then v, u, v u form a path with no center and thus ψ is not a linear coloring.Independence number 2: Since independence number is hereditary, it is sufficient to show every connected graph of independence number 2 has a Hamiltonian path.We prove this by induction on the number of vertices, observing that an isolated vertex has a trivial Hamiltonian path.Let G be a graph of independence number 2 and v ∈ G a vertex such that G \ {v} is connected, e.g., v is a leaf in a minimum spanning tree of G.If G \ {v} has a Hamiltonian cycle, then G must have a Hamiltonian path.Otherwise, by the inductive hypothesis G \ {v} has a Hamiltonian path whose endpoints are some non-adjacent pair of vertices u, w.Either v is adjacent to one of u, w, in which case G has a Hamiltonian path, or {u, w, v} form an independent set of size 3.
The classes described in Lemma 1 are maximal in the sense that there are graphs with independence number 3 (graph R 3 described in Lemma 3) and binary trees (Lemma 4) that admit NCLCs.

Treedepth Lower Bounds
To understand the tradeoff between the number of colors and treedepth of small color sets when using p-linear colorings in lieu of p-centered colorings, it is important to know the maximum treedepth of a graph of fixed linear coloring number k, t max (k).In Lemmas 3 and 4, we prove lower bounds on t max (k) through explicit constructions of graph families.In order to show that these graphs have large treedepth, we first establish assumptions about the structure of treedepth decompositions that can be made without loss of generality.
Lemma 2 Let G be a graph and S ⊂ V (G) such that G[S] is connected and with respect to some component C ∈ G\S, every vertex in S is an apex of C. Then for any treedepth decomposition T of G with depth k, we can construct a treedepth decomposition T such that: Proof Let φ be a canonical centered coloring of G with respect to T .Let T be a canonical treedepth decomposition with respect to φ; if there are multiple vertices of unique color, prioritize removing those outside C before members of C, and then small colors over large colors, i.e., remove color 2 before color 5. Since T is derived from a centered coloring with k colors, its depth is at most k, satisfying condition 1. Condition 2 is satisfied as long each member of S is removed in the construction of T before any member of C. Note that since S contains apex vertices with respect to C and every vertex , the removal of any vertex from C cannot disconnect a previously connected component if S has not been removed.Thus at any point in the algorithm before the removal of S if a vertex in C has a unique color in its remaining component H, there must be another vertex in H\C of unique color as well.Consequently, we will never be forced to remove any vertex of C before S.
To prove condition 3 is satisfied, observe that u is an ancestor of w in T iff there is a connected subgraph H containing u and w and no vertex with color smaller than ψ(u).As stated previously, G\C is a connected subgraph, which means that there is a subgraph witnessing this ancestor-descendant relationship between u and w such that Using Lemma 2, we now show that t max (k) ≥ 2k.
Lemma 3 There exists an infinite sequence of graphs R 1 , R 2 , . . .such that Proof Define R i recursively such that R 0 is the empty graph and R i is a complete graph on vertices v 1 , . . ., v i along with i copies of R p for p = i−1 2 , call them H 1 , . . ., H i , such that v j is an apex with respect to H j (Figure 1).We prove that χ lin (R i ) = i and lim i→∞ χ cen (R i ) = 2i.
With respect to the linear coloring number, note that χ lin (R i ) ≥ i since the clique of size i requires i colors by Lemma 1.We prove the upper bound χ lin (R i ) ≤ i by induction on i.The case of i = 1 is trivial; assume it is true for 1, . . ., i − 1.From the inductive hypothesis, we can assume each H j only requires p colors for a linear coloring.Consider the coloring ψ of R i such that ψ(v j ) = j and ψ| Hj is a linear coloring of H j using colors {1+(j +1) mod i, 1+ (j + 2) mod i, . . ., 1 + (j + p) mod i}.If ψ is not a linear coloring, there is some path Q without a center.Since ψ(v j ) / ∈ ψ| Hj , Q must contain vertices from at least two H j s; each v j is a cut vertex, so Q cannot contain vertices from more than two H j s.However, Based on the symmetry of ψ we can apply the same argument to the remaining colors, which means that no such non-centered path Q exists and ψ is indeed a linear coloring of size i.
With respect to the centered coloring number, by Lemma 2 there is an minimum-depth treedepth decomposition in which v j is an ancestor of H j .This implies there is a j such that no vertex in H j shares a color in the canonical coloring with any of the vertices in the clique.Thus χ cen (R i ) = i + χ cen (R p ); in the limit this recursion approaches 2i.
The graphs in Lemma 3 contain large cliques.We now show that this is not a necessary condition for the linear and centered coloring numbers to diverge.
Lemma 4 Let B be the complete binary tree with levels.Then Proof Fix an integer a ≥ 1 and let b be the smallest integer such that Our proof proceeds by first constructing a coloring pattern Ψ a of B a and then using Ψ a to create a linear coloring for an arbitrarily large complete binary tree.Some vertices of B a will be left uncolored (we will call them local ), while some vertices will be colored and the fact that the sets C i are ordered in the nonincreasing order of their sizes.Furthermore, we have < 2 b .Let v 1 , v 2 , . . ., v 2 a−1 be an ordering of the leaves of B a corresponding to an in-order traversal.Consider an index 1 ≤ i ≤ .By construction, there exists a vertex v i ∈ B a at level |C i | that is the root of a subtree T vi whose leaves are exactly v j for We color the vertices of T vi level by level with (global) colors of C i ; that is, we order the colors of C i arbitrarily and color level k of T vi with the k-th color of All remaining vertices of B a (that is, those that lie in none of the subtrees T vi for 1 ≤ i ≤ ) remain local.
The following claim summarizes the properties of the above coloring.Let p < 2 a be the number of local vertices in the pattern Ψ a .For an even integer d ≥ 2, consider a coloring ψ of B ad defined as follows.Fix a palette [db] of global colors and a palette [2p] of local colors.For every 1 ≤ i ≤ d, the i-th stripe consists of a levels (i − 1)a + 1, . . ., ia.In B ad , such a stripe consists of 2 (d−i)a copies of B a .Color every such copy using the pattern Ψ a with global colors (i − 1)b + 1, . . ., ib as the b global colors of Ψ a and color each local vertex with a different local color from the set {1, 2, . . ., p} if i is odd and from the set {p + 1, p + 2, . . ., 2p} if i is even.
We claim that the above is a linear coloring of B ad with db+2p < db+2 a+1 colors.Consider a path P in B ad and let i be the index of the highest stripe intersected by P .By the choice of i, P intersects exactly one of the copies of B a in the i-th stripe.If P contains a leaf-to-leaf path in this copy, then Claim 1 asserts that P contains a center in this copy (recall that every stripe uses a different set of b global colors).Otherwise, P intersects at most one copy of B a in every stripe.If P intersects at least three stripes, then P contains a root-to-leaf path in the single copy of B a intersected by P at stripe (i − 1), and we are again done by Claim 1.Similarly, Claim 1 finishes the proof if P does not contain a local vertex at the i-th stripe.Finally, in the remaining case P intersects at most two stripes (the i-th one and possibly the (i − 1)-th one) and contains a local vertex in the i-th stripe.Since we used different set of local colors for odd and even stripes, any such local vertex in i-th stripe is a center of P .
Consequently, we have exhibited a linear coloring of B ad with less than db + 2 a+1 colors, where b is defined as in Equation ( 1).If we let d go to ∞, then the ratio (ad)/(db + 2 a+1 ) approaches a/b.This ratio, in turn, approaches log 2 (3) as a → ∞ due to the choice of b at Equation (1).This finishes the proof of the lemma.In Section 6 we show that the bound in Lemma 4 is tight for binary trees (Theorem 4).We conjecture that the construction in Lemma 3 is also tight for general graphs.
While the exclusion of a path of length 2 k indicates t max (k) ≤ 2 k , this nonetheless leaves a large gap between the upper and lower bounds on t max (k).To move towards a proof of Conjecture 1, we establish a polynomial upper bound on t max (k) in general graphs in the next section (Theorem 1).Because this proof uses "heavy machinery", we consider two restricted graph classes-namely, trees and interval graphs-in Sections 6 and 7 and give tighter upper bounds on t max (k) for graphs in these classes.

Treedepth Upper Bounds on General Graphs
This section is devoted to proving a polynomial upper bound on t max (k).
Theorem 1 There exists a polynomial p such that every graph G satsifies χ cen ≤ χ 190 lin p(log χ lin ).
Our starting point is the following theorem of Kawarabayashi and Rossman [7]: ) There is an absolute constant C such that every graph G of treedepth at least Ck 5 log 2 k satisfies at least one of the following: 1. the treewidth of G is at least k; 2. G contains a complete binary tree of height k as a minor; 3. G contains a path on 2 k vertices.
Assume that the treedepth of G is at least Ck 5 log 2 k.If G contains a path on 2 k vertices (condition 3), then clearly χ lin (G) ≥ k.If G contains a complete binary tree of height k as a minor (condition 2), then G also contains a subdivision of a complete binary tree of height k as a subgraph.Since χ lin (H) ≤ χ lin (G) for any subgraph H of G, Theorem 4 asserts that χ lin (G) ≥ k/ log 2 (3).Thus, in the proof of Theorem 1, we are left with the case when G has large treewidth.
Here, we use the celebrated grid minor theorem, with the best known bound due to Chuzhoy [2].

Theorem 3 ([2]
) There is a polynomial p such that every graph G with treewidth at least k 19 p (log k) contains a k × k grid as a minor.
We slightly relax the notion of a k × k grid minor to a k-pseudogrid, defined as follows.
Definition 6 A graph G contains a k-pseudogrid if there exist two sequences of vertex-disjoint paths in G, P = (P 1 , P 2 , . . ., P k ) and -for every i ∈ [k], the path P i is a concatenation of paths P i,0 , P Q i,1 , P i,1 , P Q i,2 , P i,2 , . .., P Q i,k , P i,k in this order such that each path P Q i,j for j ∈ [k] is a subpath of Q j (possibly consisting of a single vertex) and every path P i,j , 0 ≤ j ≤ k does not contain any edge nor internal vertex on any path Q j (we explicitly allow P i,0 and P i,k to be paths of length 0); -a symmetric condition holds with the roles of P and Q swapped.
In what follows, the paths P i,j , P Q i,j , Q i,j , and Q P i,j are considered empty for pairs of indices (i, j) not defined above.
Clearly, if G contains a k × k-grid as a minor, it contains a k-pseudogrid: just let the paths P follow the rows of the grid and the paths of Q follow the columns.To finish the proof of Theorem 1, it suffices to show the following technical result.
Proof Fix a linear coloring ψ of G. Let (P, Q) be a k-pseudogrid in G. Let V (P) = P ∈P V (P ) and similarly define V (Q).Let µ(P) be the number of distinct colors ψ uses on V (P) and similarly define µ(Q).To prove the lemma, it suffices to show for any k-pseudogrid We shall prove it by induction over k.
The statement is trivial for k ≤ 100.For an inductive step, we proceed as follows.For a vertex v ∈ V A color c is infrequent on P if it appears on V (P), but there exists a family P c ⊆ P of at size at most 50(µ(P) + µ(Q)) such that every vertex v ∈ V (P) with ψ(v) = c is either marginal or lies on one of the paths in P c .The definition of a color infrequent on Q is analogous.
For an inductive step, it suffices to show that there is always an infrequent color on P or an infrequent color on Q.Indeed, assume that c is infrequent on P (the arguments for Q are symmetrical) and let P c ⊆ P be as in the above definition.Construct a k -pseudogrid (P , Q ) from (P, Q) as follows.Start with (P , Q ) = (P, Q).First, delete from P the first and last 3 paths, and similarly for Q .Second, shorten every path P i ∈ P by deleting the edges of P i,j and P Q i,j for j ≤ 3 and j ≥ k − 2; similarly shorten every path Q j ∈ Q .Finally, delete all (shortened) paths of P c from P , and delete a matching number of paths from Q .In this manner, we obtain a k -pseudogrid (P , Q ) such that k − k ≤ 6 + 50(µ(P) + µ(Q)) and such that the color c no longer appears on V (P).Therefore, µ(P ) + 1 ≤ µ(P) and µ(Q ) ≤ µ(Q).The inductive step follows.
In the remainder of the proof, assume that there is no infrequent color on P nor an infrequent color on Q.We shall reach a contradiction by exhibiting a simple noncentered path P ⊆ P ∪ Q.
We perform the following selecting and marking scheme.Initially, no vertex is selected and no path is marked.For every color c that appears on V (P), perform the following operation twice.
1. Pick a vertex v ∈ V (P) such that ψ(v) = c, v is not marginal, and v does not lie on a marked path P i .Let the grid coordinates of v be (i, j). 2. Select v and mark all paths P i for |i − i| ≤ 10 and all paths Q j for |j − j| ≤ 10.Now swap the roles of P and Q and perform the above operation twice also for every color c that appears on V (Q).In total, we select 2(µ(P) + µ(Q)) vertices.For every selected vertex we mark 21 paths of P and 21 paths of Q.
Since there is no infrequent color, there is always a vertex to choose at Step 1, as otherwise the so-far marked paths would witness infrequency of c.Thus, the above selecting and marking scheme is well-defined.Let v, v be two distinct selected vertices and let (i, j) and (i , j ) be their grid coordinates.By the above marking scheme, we have that 3 < i, i , j, j < k − 2 and |i − i | + |j − j | ≥ 11. ( Consider now the following simple path P .We start with P being the concatenation of even-numbered paths P i without the prefixes and suffixes P i,0 ∪ P i,k in the natural order, connected by paths Q i,1 ∪ Q P i+1,1 ∪ Q i+1,1 for i divisible by 4 and by Q i,k ∪ Q P i+1,k ∪ Q i+1,k for i ≡ 2 (mod 4) (so that paths P i with i ≡ 2 (mod 4) are traversed forwards and paths P i with i divisible by 4 are traversed backwards).Then, for every selected v with grid coordinates (i, j), we pick an even i ∈ {i, i + 1} and modify locally P ∩ P i to pass through v.In the modification, we use only parts of paths . By Equation ( 2), two such modifications do not interfere with each other and no such modification interferes with the connections contained in paths Q 1 and Q k .Consequently, the final path P is a simple path contained in P ∪ Q that visits all selected vertices.Such a path does not contain a center, which is the desired contradiction.

Treedepth Upper Bounds on Trees
Schäffer proved that there is a linear time algorithm for finding a minimumsized centered coloring of a tree T [19].In this section we prove the following theorem by showing a correspondence between the centered coloring from Schäffer's algorithm and colors on paths in any linear coloring of T .
Theorem 4 Let T be a tree of maximum degree ∆ ≥ 3, Then Schäffer's algorithm finds a centered coloring of T with size at most (log 2 ∆) • χ lin (T ).
In particular, for trees of maximum degree 3 we have χ cen (T ) ≤ log 2 (3) χ lin (T ), matching the lower bound of Lemma 4. We do not have any matching lower bound for larger ∆.In fact, we conjecture that none exists, that is, the upper bound of Theorem 4 for ∆ ≥ 4 is not tight.
Schäffer's algorithm finds a particular centered coloring whose colors are ordered in a way that reflects their roles as centers.For this reason, the coloring is called a vertex ranking and the colors are referred to as ranks; it guarantees that in each subgraph, the vertex of maximum rank is also a center.We will use this terminology in this section to clearly distinguish between the ranks in the vertex ranking and colors in the linear coloring.Note that the canonical centered coloring of a treedepth decomposition is a vertex ranking if the colors are ranked decreasing from the root downwards, which implies that every centered coloring can be converted to a vertex ranking of the same size.Of central importance to Schäffer's algorithm are what we will refer to as rank lists.
Definition 7 For a vertex ranking r of tree T , the rank list of T , denoted L(T ), can be defined recursively as L(T ) = L(T \T v ) ∪ {r(v)} where v is the vertex of maximum rank in T .
Schäffer's algorithm arbitrarily roots T and builds the ranking from the leaves to the root of T , computing the rank of each vertex from the rank lists of each of its children.For brevity, we denote L(v) = L(T v ) for every v in T .

Proposition 2 ([19]
) Let r be a vertex ranking of T produced by Schäffer's algorithm and let v ∈ T be a vertex with children u 1 , . . ., u .If x is the largest integer appearing on rank lists of at least two children of v (or 0 if all such rank lists are pairwise disjoint) then r(v) is the smallest integer satisfying r(v) > x and r(v) / ∈ i=1 L(u i ).
We root T at an arbitrary leaf of T and let r be a ranking output by Schaffers algorithm applied on (rooted) T .With a vertex v in T we associate the following potential.
The following is immediate from Proposition 2: Lemma 6 For every v in T with children u 1 , u 2 , . . ., u , it holds that Furthermore, the equality holds if and only if all rank lists L(u i ) are pairwise disjoint.
Let ψ be a linear coloring of T with k := χ lin (T ) colors.Our proof of Theorem 4 is based on tracking sets of colors of ψ on paths terminating at the current vertex as Schäffer's algorithm moves up the rooted tree.Given a path P ⊆ T and a linear coloring ψ of size k, we say a color set X ⊆ {1, . . ., k} is compatible with P if both the following conditions are true: 1.For every center v ∈ P , ψ(v) ∈ X. 2. For every color c ∈ X, there is a vertex u ∈ P such that ψ(u) = c.
In other words, a compatible set must not contain colors not found on P , must contain each color appearing uniquely in P , and may or may not contain any colors appearing multiple times on P .For each v ∈ T , let S(v) be a set of sets defined recursively as follows.If v is a leaf, S(v) = {{ψ(v)}}.Otherwise, let u 1 , . . ., u be the children of v, S = i=1 S(u i ), and ξ : S → 2 [k] be an injective function such that We start with the following straightforward observation.
We prove that the construction of S(v) preserves compatibility of sets.
Lemma 8 For all vertices v ∈ T and each X ∈ S(v), there is a corresponding path P ⊆ T v with v as an endpoint such that P is compatible with X.
Proof It is clear that the lemma holds at the leaves of T , so we proceed by inductively showing the recursive step preserves the property.Observe that the path consisting of v only is compatible with {ψ(v)} ∈ S(v).For any X ∈ S(v)\{{ψ(v)}}, there is a child u of v such that X = ξ −1 (X) is in S(u).By the inductive hypothesis, there must be a path P terminating at u such that X is compatible with P .We claim that P = P • {v} is compatible with X.Since X X ⊆ {ψ(v)} and each color c = ψ(v) appears the same number of times in P and P , it is only necessary to prove the requirements for compatibility are satified with respect to ψ(v).Moreover, because ψ(v) appears at least once on P it suffices to show that if ψ(v) / ∈ X, then ψ(v) appears multiple times on P .By the definition of ξ, ψ(v) / ∈ X implies ψ(v) ∈ X and thus v is not a center of P .Define ρ(v) = X∈S(v) (∆ − 1) |X| .We observe the following Lemma 9 For any vertex v ∈ T with children u 1 , . . ., u , ρ(v) ≥ (∆ − 1) + i=1 ρ(u i ).
Recall that S = i=1 S(u i ).Let S 1 be the set of all color sets that appear in exactly one S(u i ) and S M be those that occur in multiple S(u i )'s; we have S = S 1 S M .Note that for each X ∈ S M , ψ(v) / ∈ X or else concatenating the corresponding compatible paths with v creates a path with no center.Likewise, if there are distinct color sets Y and By the definition of ξ, for each color set In the latter case, there is a corresponding color set X = X ∪ {ψ(v)} such that X ∈ S(v) and ξ −1 (X ) = X.Also, from the discussion in the previous paragraph we infer that this latter case can only happen when X, X ∈ S 1 .Hence, We infer that We conclude with the proof of Theorem 4.
Proof (Theorem 4) For every leaf v ∈ T , we have ρ Lemmas 6 and 9 show inductively that ρ(v) ≥ ζ(v) for every v ∈ T .If k is the size of the centered coloring output by Schäffer's algorithm, then for the root v 0 of T we have

Treedepth Upper Bounds on Interval Graphs
Because linear colorings are equivalent to centered colorings when restricted to paths, we turn our attention to the linear coloring numbers of "pathlike" graphs.We investigate a particular class of "pathlike" graphs in this section and prove a quadratic relationship between their centered and linear coloring numbers.
Definition 8 A graph G is an interval graph if there is an injective mapping f from V (G) to intervals on the real line such that uv ∈ E(G) iff f (u) and f (v) overlap.
We refer to the mapping f as the interval representation of G. Since the overlap between intervals f (u) and f (v) is independent of the interval representations of the other vertices, every subgraph of an interval graph is also an interval graph.The interval representation of G implies a natural "left-to-right" layout that gives it the "pathlike" qualities, which are manifested in restrictions on the length of induced cycles (chordal ) and paths between vertex triples (ATfree).
Definition 9 A graph is chordal if it has no induced cycles of length ≥ 4.
Definition 10 Vertices u, v, w are an asteroidal triple (AT) if there exist uv-, vw-, and wu-paths P uv , P vw , and P wu , respectively, such that N Intuitively, Definition 10 is a set of three vertices such that every pair is connected by a path that avoids the neighbors of the third.Roughly speaking, in the context of linear colorings, Proposition 3 indicates that if w is a center of a "long" uv-path P in G, any vertex w such that ψ(w) = ψ(w ) must have a neighbor on P .We devote the rest of this section to proving Theorem 5.
Theorem 5 There exists a polynomial time algorithm that takes as input an interval graph G and a linear coloring of G with size k and outputs a centered coloring of G with size at most k 2 .
Our algorithm makes extensive use of the following well-known property of maximal cliques in interval graphs.

Proposition 4 ([10]
) If G is an interval graph, its maximal cliques can be linearly ordered in polynomial time such that for each vertex v, the cliques containing v appear consecutively.
In particular, we identify a prevailing path in G whose vertices "span" the maximal cliques and a prevailing subgraph that consists of the prevailing path as well as vertices in maximal cliques "between" consecutive vertices on the prevailing path.We will show that any linear coloring is a centered coloring when restricted to the prevailing subgraph and that after removing the prevailing subgraph, the remaining components each use fewer colors.
Let C 1 , . . .C m be an ordering of the maximal cliques of G that satisfies Proposition 4. We say vertex v is introduced in

and denote this as
∈ C j+1 , and denote this as F (v) = j.The procedure for constructing a prevailing subgraph and prevailing path is described in Algorithm 1.This algorithm selects the vertex v from the current maximal clique that is forgotten "last" and adds v to the prevailing path and C F (v) to the prevailing subgraph.We prove in Lemma 10 that if P, Q are a prevailing path and subgraph, the vertices in Q\P can be inserted between vertices of P to form a Hamiltonian path of Q. i ← F (v) 10: Lemma 10 Every prevailing subgraph has a Hamiltonian path.
Proof Let P, Q be the prevailing path and subgraph constructed in Algorithm 1.We prove by constructing the Hamiltonian path of Q.Let M j be the set of all u ∈ Q\P , for which j is the smallest integer for which u ∈ C F (vj ) .In other words M j contains the vertices in C F (vj ) that do not appear in C F (vj−1) .If M = 1≤j≤p M j then by construction P ∪ M = Q.Moreover, for each be a ordering of M j such that F (µ i j ) ≤ F (µ i+1 j ).Then v 1 , µ Although the fact that the prevailing subgraph Q has a Hamiltonian path implies Q has a center with respect to ψ, we must ensure that the proper subgraphs of Q also have a center.In Lemma 11, we prove ψ| Q is centered by showing every proper connected subgraph of Q also has a Hamiltonian path.
Lemma 11 If Q is a prevailing subgraph of an interval graph G and ψ a linear coloring of G, ψ| Q is a centered coloring.
Proof It suffices to show that every proper, connected induced subgraph of Q has a Hamiltonian path, since the existence of a Hamiltonian path implies the subgraph has a center.Assume H ⊆ Q has a Hamiltonian path.Let w be a center and w p , w s be its predecessor and successor in the Hamiltonian path.It is clear that the subpath from the start of the Hamiltonian path to w p remains a path in H\{w}; this is also true for the subpath from w s to the end.Therefore if H\{w} is disconnected, there are two components and both have Hamiltonian paths.
Otherwise suppose H\{w} is connected.Note that if P = {v 1 , . . ., v p } is the prevailing path generated by Algorithm 1, C F (vj ) ∩ C F (vj+2) = ∅ or else v j+2 would be forgotten later than v j+1 and would have been chosen to be v j+1 instead.Thus, there is some 1 and since H\{w} is connected, for each ≤ j < q the intersection of cliques C F (vj ) and C F (vj+1) is non-empty.Consequently, the ordering of the vertices in the Hamiltonian path of Q must also define a Hamiltonian path of H\{w}.
Since any linear coloring ψ of the prevailing subgraph Q must also be a centered coloring, td(Q) ≤ |ψ|.To get a bound on the treedepth of G, we focus on the relationship between Q and G\Q.In particular, we show that the components of G\Q use fewer than |ψ| colors by proving that each such component has an apex in the prevailing path.
Lemma 12 Let P, Q be a prevailing path and subgraph of an interval graph G.For each component X of G\Q, there is a vertex a ∈ P such that X ⊆ N (a).
Proof For 1 ≤ j ≤ p, let X j be the set of components of G[ By this definition and the fact that v j is a member of both C F (vj−1) and C F (vj ) , v j is a neighbor of all vertices in X for each X ∈ X j .Thus it suffices to show that p j=1 X j are the components of G\Q.
Hence, if X ∈ X j is not a component of G\Q, then there must be some component X ∈ X i for which i = j and there exists u ∈ X and u ∈ X and uu ∈ E(G).But C F (vj ) ∪ C F (vj+1) has no common vertices with X and separates it from any vertices in X i .An analogous statement for X is true as well, so no such edges uu exist.Therefore we conclude that 1≤j≤p X j are the components of G\Q and the lemma is proven.
We can now establish a polynomial upper bound on the treedepth of interval graphs, proving Theorem 5.
Proof (Theorem 5) Let A be the algorithm that constructs a treedepth decomposition T of G by finding a prevailing subgraph Q (Algorithm 1), using ψ| Q to create a treedepth decomposition of Q, and recursively constructing treedepth decompositions of G\Q.If depth(T ) ≤ k 2 and A runs in polynomial time, then the canonical centered coloring of T is a centered coloring of G of size at most k 2 .We prove A satisfies these requirements by induction on k = |ψ|.At k = 1, the graph consists of isolated vertices and A trivially constructs a treedepth decomposition of G of depth 1 in polynomial time.
Assume A has the desired properties for linear colorings of size at most k −1.Because the maximal cliques of an interval graph can be enumerated and ordered in polynomial time (Proposition 4), identifying Q via Algorithm 1 can be done in polynomial time.By Lemma 11, the canonical treedepth decomposition of Q has depth at most k.Since every component X of G\Q has an apex a in P (Lemma 12), we can assume a is an ancestor in T of each vertex in X (Lemma 2).Because ψ is proper, ψ(a) does not appear in ψ| X and since induced subgraphs of interval graphs are themselves interval graphs, A finds a treedepth decomposition of X whose depth is at most (k − 1) 2 .Thus T has depth k + (k − 1) 2 ≤ k 2 .The recursion only lasts k ≤ n steps, so A runs in polynomial time.

Hardness of Recognizing Linear Colorings
Based on the similarity in definition between linear and centered colorings, one might assume that computing them should be roughly equally difficult.Finding a centered coloring of a fixed size is NP-hard [1], but given a coloring of a graph, we can recognize whether it is centered in polynomial time by attempting to create the canonical treedepth decomposition; this procedure will identify a non-centered subgraph if the coloring is not centered.To the contrary, we will prove that Linear Coloring Recognition, the problem of recognizing whether a coloring is linear, is co-NP-complete.In order to prove the hardness of Linear Coloring Recognition, we first define a dual problem.The Non-centered Path problem takes a graph G and coloring ψ as input and decides whether G has a non-centered path P .We focus on proving the hardness of Non-centered Path because a certificate to that problem is easily definable: a path where every color appears at least twice.
Proof A certificate to Non-centered Path can be verified in linear time by iterating over all vertices in the path and counting color occurrences.Thus, Non-centered Path is in NP.
We prove NP-hardness by reducing from CNF-SAT.Given a CNF-SAT formula Φ with variables x 1 , . . .x n and clauses C 1 , . . .C m , we construct a graph G and coloring ψ that will have a non-centered path if and only if Φ is satisfiable.We assume that Φ satisfies the following properties: (1) Every variable appears at most once in each clause.
(2) No clause contains both a variable and its negation.
(3) Every variable appears as a positive literal and negative literal.
We can assume (1) since the disjunction operation is idempotent.Every clause for which (2) does not hold is satisfied by any truth assignment of the variables and thus can be removed without changing the satisfiability of Φ.If variable x i appears only positively then assigning x i to be false does not cause any clauses to be satisfied.Therefore, it is sufficient to set x i to true and only consider the clauses of Φ that do not contain x i ; since the analogous statement is true when x i does not appear positively, we can assume (3).
The variables of Φ are represented by a set of vertices U = {u 0 , . . ., u n }.For each x i , we connect u i−1 and u i with two paths P T i and P F i ; we will force the non-centered path to contain vertices from exactly one of P T i and P F i , which will correspond to whether x i was set to true or false.The path P T i contains one vertex for each C j in which x i appears positively while P F i contains one vertex for each C j in which the negation of x i appears.By assumption (2), we can uniquely label the vertex on P T i ∪ P F i corresponding to clause C j as w i,j and the order of the vertices on P T i and P F i can be chosen arbitrarily.To complete the construction of G, we add path P 0 = u 1 , u 2 , . . ., u n , w 1 , w 2 , . . ., w m such that w m is adjacent to u 0 and all other vertices on P 0 have no additional edges.Finally, we attach a pendant vertex u 0 to u n .Since each vertex w i,j corresponds to a unique literal in Φ and |U | + |P 0 | = 2n + m + 1, G has size linear in the size of Φ.
To encode satisfaction of clauses, we color G with coloring ψ : V (G) → {0, . . ., n + m} such that ψ(u i ) = ψ(u i ) = i and ψ(w j ) = ψ(w i,j ) = n + j.In this way, we force any non-centered path to contain all colors and color j + n appears twice if and only if C j is satisfied.An example can be found in Figure 2.
We now prove that Φ is satisfiable iff G contains a path Q with no center.Given a satisfying assignment of Φ, let P * i be P T i if x i is set to true and P F i if x i is set to false.Then , is a non-centered path since it contains all pairs u i , u i and 1≤i≤n P * i contains a vertex with the same color as each vertex in 1≤j≤m w j .
To prove the reverse direction suppose G contains a non-centered path Q.Let U = {u 0 , . . ., u n }.Since each vertex in U shares a color with exactly one other vertex and that vertex is a member of U , Q contains a vertex from U iff Q contains a vertex from U .By our construction of P 0 and assumptions about Φ, no component of G\(U ∪ U ) contains two vertices of the same color.Thus, Q must contain vertices from U , U , and G\(U ∪ U ).For any 0 ≤ i = j ≤ n, every u j u j path contains u i or u i , which implies that (U ∪ U ) ⊂ Q and Q is a u 1 u 0 path.In order for Q to be connected, P 0 ⊆ Q and in order for it to be a path, exactly one of P T i and P F i (denote it P * i ) is a subpath of Q for each 1 ≤ i ≤ n.Since the colors in w 1 , . . .w m are unique, 1≤i≤n P * i contains at least one vertex of each color on [n+1, n+m], which corresponds to a selection of truth assignments to the variables of Φ such that every clause is satisfied.
Corollary 1 Linear Coloring Recognition is co-NP-complete.
The co-NP-hardness of recognizing linear colorings is compounded by three stronger hardness implications.First, the coloring ψ given in Theorem 6 has size m+n+1, which means that unless the exponential time hypothesis [6] fails, there is no 2 o(k) algorithm to recognize a linear coloring of size k.Second, the graph G constructed in the proof of Theorem 6 is outerplanar with pathwidth two, which implies that neither treewidth-style dynamic programming nor a Baker-style layering approach is likely to solve this problem efficiently.Finally, by subdividing each edge and coloring all subdivision vertices with a (single) new color, we obtain a bipartite graph with degeneracy two, proving hardness for each of those classes.Nonetheless, the fact that χ cen (G) = O(log m + log n) while |ψ| = m + n + 1 leaves open the possibility that Linear Coloring Recognition becomes easier for colorings of minimum size.

Conclusion
We have introduced p-linear and linear colorings as an alternative to p-centered and centered colorings for use in algorithms for classes of bounded expansion.The p-linear colorings are computable in polynomial time and require a constant number of colors in classes of bounded expansion, while inducing graphs of bounded treedepth for all small sets of colors, allowing direct substitution in existing algorithmic pipelines.A major direction for future work is to bring the upper bound on t max (k) of poly(k) closer to the lower bound of 2k.In particular, it appears our current toolkit for analyzing linear colorings must be expanded in order to prove (or disprove) Conjecture 1.We also believe it is worth studying whether recognizing linear colorings can be done in polynomial time if we assume the coloring is of size χ lin (G).Finally, using p-linear colorings in practice will require an efficient method for translating a linear coloring into a treedepth decomposition.Although there exist general-purpose algorithms to find treedepth decompositions efficiently in graphs of bounded linear coloring number (e.g.[18]), a more specialized algorithm that avoids "heavy machinery" is likely necessary to be practically useful.
with one of the b colors [b] (we will call these colors global ).Let C 1 , C 2 , . . ., C 2 b be the sequence of all subsets of [b] in order of nonincreasing size (in particular, C 1 = [b] and C 2 b = ∅) and let be such that i=1 2 |Ci|−1 = 2 a−1 .Note that such an index exists due to Equation (1):

Theorem 6
Non-centered Path is NP-complete.
Claim 1 For every path P in B a that either -has both endpoints in a leaf or the root of the tree B a , or -does not contain a local vertex, there exists a global color c ∈ [b] such c appears uniquely on P .Proof If a path P does not contain a local vertex, then it is contained in a single tree T vi .For such a path, the unique vertex on P of maximum level is colored with a global color that appears uniquely on P .Similarly, if P is a leaf path in B a , then any globally colored vertex of the tree T vi containing the leaf endpoint of P satisfies the desired property.Otherwise, a path P that has both endpoints in leaves of B a but contains a local vertex needs to start in a leaf of one subtree T vi and end in a leaf of a different subtree T v i .Then, observe that any (global) color of C i C i appears exactly once on P .
Algorithm 1 Construction of a prevailing path and subgraph.