Clustering powers of sparse graphs

We prove that if $G$ is a sparse graph --- it belongs to a fixed class of bounded expansion $\mathcal{C}$ --- and $d\in \mathbb{N}$ is fixed, then the $d$th power of $G$ can be partitioned into cliques so that contracting each of these clique to a single vertex again yields a sparse graph. This result has several graph-theoretic and algorithmic consequences for powers of sparse graphs, including bounds on their subchromatic number and efficient approximation algorithms for the chromatic number and the clique number.


Introduction
For a graph G and d ∈ N, the dth power of G, denoted G d , is the graph on the same vertex set as G where vertices u, v are considered adjacent if and only if the distance between them in G is at most d. In this work we consider the following question: if we assume that a graph G is sparse and d is a fixed constant, what can we say about the structure of the graph G d ? Clearly, G d does not need to be sparse; for instance, if G is a star, then G 2 is complete. However, the intuition is that even if G d becomes dense, it should retain some strong structural properties derived from the sparseness of G.
We shall focus on two notions of uniform, structural sparseness in graphs: bounded expansion and nowhere denseness. A class of graphs C has bounded expansion if for every fixed r ∈ N, one cannot find graphs with arbitrary high edge density among depth-r minors of graphs from C. Here, a graph H is a depth-r minor of a graph G if H can be obtained from a subgraph of G by contracting mutually disjoint connected subgraphs of radius at most r. More generally, we say that C is nowhere dense if for every r ∈ N, not all complete graphs can be obtained as depth-r minors of graphs from C.
Thus, bounded expansion and nowhere denseness can be regarded as sparseness that persists even after local modifications, which are modelled by taking bounded depth minors. Following the introduction of these concepts by the first two authors [10, 11, 12], the last decade has witnessed a rapid development of various structural techniques centered around them, which proved to be useful both in the combinatorial analysis and in the algorithm design on sparse graphs. We invite the reader to various sources, e.g. [13,14], for a comprehensive introduction to this area.
It has been recently realized that the developed techniques can be used not only to work with sparse graphs, but also to explain the structure in dense graphs derived from sparse ones. For instance, Gajarský et al. [5] considered graph classes that can be obtained from classes of bounded expansion by means of one-dimensional first-order interpretations. They proved that such classes can be equivalently characterized by the existence of low shrubdepth colorings, which can be regarded as a dense analogue of low treedepth colorings that characterize classes of bounded expansion [9]. This connection was earlier discovered by Kwon et al. [8] for the operation of taking a fixed-degree power of a graph, which is a particular case of a one-dimensional first-order interpretation. A somewhat tangential direction was recently explored by Fabiański et al. [4], who used structural properties of powers of sparse graphs, . inspired by connections with the model-theoretic concept of stability, to devise efficient parameterized algorithms for domination and independence problems on such powers.
In all the abovementioned works, taking a fixed-degree power of a graph is a prime example of a well-behaved operation which turns a sparse graph into a dense graph that retains useful structural properties. The goal of this work is to further explore and describe these properties.
Our contribution. We prove that if G is a sparse graph and d ∈ N is fixed, then the graph G d admits a clustering X -a partition of the vertex set into cliques -such that the quotient graph G d /Xthe graph obtained from G d by contracting each clique of X into a single vertex -is also sparse. See Corollaries 1 and 2 in Section 3 for a formal statement. Thus, on the conceptual level, a fixed-degree power of a sparse graph can still be regarded as a sparse graph, but with some vertices replaced by possibly large cliques.
We explore several consequences of this statement. On the graph-theoretic side, we show that whenever G comes from a fixed class of bounded expansion C and d ∈ N is fixed, the graph G d has a bounded subchromatic number, which is the least number of colors needed for a coloring of vertices so that every color class induces a disjoint union of complete graphs. We also show that the coloring number (also called degeneracy) of G d is within a constant multiplicative factor from both its chromatic number and its clique number. This gives an alternative proof of the observation of Gajarský et al. [5] that fixed-degree powers of classes of bounded expansion are linearly χ-bounded.
On the algorithmic side, we show that if we are given a graph H which is promised to be an induced subgraph of a graph G d , where d ∈ N is fixed and G belongs to a fixed class C of bounded expansion, then we can constructively approximate, up to a constant factor and in O(nm) time, both the chromatic number of H and the clique number of H. Further, we show that in such graphs H there are polynomially many inclusion-wise maximal cliques, and they all can be enumerated in polynomial time. This holds even under the milder assumption that the class C is only required to be nowhere dense. An immediate consequence of this statement is a polynomial-time algorithm for finding a clique of maximum size in graphs H as above. However, here the degree of the polynomial running time is not uniformly bounded: it depends on d and the class C in question.

Preliminaries
Notation. By N we denote the set of nonnegative integers. The vertex set and the edge set of a graph G are denoted by V (G) and E(G), respectively. The open neighborhood of a vertex u consists of all the neighbors of u and is denoted by The clique number of G -the maximum size of a clique in G -is denoted by ω(G). The chromatic number of G -the minimum number of colors needed for a proper coloring of G -is denoted by χ(G). Clearly, for every graph G we have χ(G) ω(G).
A class of graphs is just a (usually infinite) set of graphs. A graph parameter is a function that maps graphs to nonnegative integers; examples include the clique number and the chromatic number. For a class of graphs C and a graph parameter π(·), we denote π(C) = sup G∈C π(G). We say that C has bounded π if π(C) is finite. For a class C, by C we denote the hereditary closure of C, that is, the class comprising all induced subgraphs of graphs from C.
For d ∈ N and a graph G, the dth power of G is the graph G d on the same vertex set as G such that two vertices u, v are adjacent in G d if and only if the distance between them in G is at most d. For a class of graphs C, we write C d = {G d : G ∈ C}.
A partition of a set U is a family X of non-empty, disjoint subsets of U such that X = U . The elements of a partition are called blocks.
Classes of sparse graphs. For r ∈ N, a graph H is a depth-r minor of a graph G if H can be obtained from a subgraph of G by contracting pairwise disjoint connected subgraphs of radius at most r. For a graph G, by ∇ r (G) we denote the maximum edge density (ratio between the number of edges and vertices) among depth-r minors of G. Similarly, ω r (G) is the largest clique number among depth-r minors of G. With these notions in place, we can define the main notions of sparsity that are considered in this work. Definition 1. For class of graphs C, we say that • C has bounded expansion if ∇ r (C) is finite for every r ∈ N; and • C is nowhere dense if ω r (C) is finite for every r ∈ N.
Obviously, every graph class of bounded expansion is nowhere dense, but the converse implication is not true in general; see [13].
Coloring numbers. A vertex ordering σ of a graph G is simply a linear order on its vertex set. We write u < σ v to indicate that u is placed before v in σ. The coloring number of a vertex ordering σ of G is the quantity col(G, σ) = 1 + max |{v : uv ∈ E(G) and v < σ u}|.
The coloring number of G, denoted col(G), is defined as the smallest coloring number among the vertex orderings of G. The quantity col(G) − 1 is often called the degeneracy of G. Given G and a vertex ordering σ, it is easy to compute a proper coloring of G with col(G, σ) colors: iterate through the vertices in the order of σ, and assign to each vertex u a color that is not present among the neighbors of u that are placed before in σ. Further, it is well-known that a vertex ordering with the optimum coloring number can be computed in linear time by iteratively extracting from the graph a vertex with the smallest degree, and putting it in front of all the vertices extracted before. Combining these two facts yields the following.
Lemma 2. For every graph G, we have χ(G) col(G). Moreover, given G, a proper coloring of G with col(G) colors can be computed in linear time.
Here and in the sequel, when we speak about a linear or a quadratic running time, we measure it in the total input size, which is the number of vertices plus the number of edges of the input graph.
The generalized coloring numbers were introduced by Kierstead and Yang [7] to lift the idea of the coloring number to larger distances. For r ∈ N, a graph G, a vertex ordering σ of G, and two vertices u, v satisfying v σ u, we say that v is weakly r-reachable from u if there exists a path of length at most r from u to v such that all the vertices on this path are not placed before v in σ. The set of vertices that are weakly-r reachable from u in σ is denoted by WReach r [G, σ, u]. Then the weak r-coloring number of σ is wcol r (G, σ) = max u∈V (G) |WReach r [G, σ, u]|, and the weak r-coloring number of G, denoted wcol r (G), is the smallest wcol r (G, σ) for σ ranging over vertex orderings of G. Note that wcol 1 (G) = col(G) for every graph G. We remark that there are also other, related notions of generalized coloring numbers -strong r-coloring number and r-admissibility -but we will not use them in this work. As shown in [12,17], weak coloring numbers can be used to characterize classes of sparse graphs. Theorem 4 ([12]). A class of graph C is nowhere dense if and only if for every r ∈ N and ε > 0, there exists c ∈ N such that wcol r (G) c · n ε for every n-vertex graph G ∈ C.
Note that in Theorems 3 and 4, the vertex orderings witnessing the boundedness of weak r-coloring numbers for different r ∈ N may be different. It is therefore natural to ask whether for every graph there exists a single vertex ordering for which all the weak r-coloring numbers are simultaneously small. The following result of van den Heuvel and Kierstead [16] shows that this is indeed the case.

Clustering
We now proceed to the main topic of this work: clustering properties of sparse graphs.

Definition 6.
A clustering of a graph H is a partition X of the vertex set of H such that every block of X is a clique in H. The quotient graph H/X is a graph whose vertices are blocks of X , where blocks A, B ∈ X are adjacent if and only if there exists u ∈ A and v ∈ B such that u and v are adjacent in H.
The next statement is the main result of this paper.
Theorem 7. Let G be a graph, σ be a vertex ordering of G, and d ∈ N. Then there exists a clustering X of G d that satisfies Proof. For a vertex u, let (u) be the vertex of WReach d/2 [G, σ, u] that is the smallest in the ordering σ. We define a clustering X as follows. The blocks of X are the equivalence classes of the following equivalence relation ∼ on the vertex set of G: We now verify the claimed upper bound on the weak coloring numbers of G d /X . For a block A of X , let (A) denote the common (u) for u ranging over the elements of A. Recall that the vertex set of G d /X is X . Then let us define a vertex ordering τ of G d /X as follows: for any A, B ∈ X , we put Note here that (A) = (B) whenever A = B, hence τ is indeed a linear order on X . We now claim that for every r ∈ N, we have wcol r (G d /X , τ ) wcol 2dr (G, σ). For this, it suffices to show that for every A ∈ X it holds that because the right hand side is bounded by wcol 2dr (G, σ). Consider any B ∈ WReach r [G d /X , τ, A] and let (C 0 , C 1 , . . . , C p ) be any path in G d /X from C 0 := A to C p := B which witnesses that B ∈ WReach r [G d /X , τ, A]; that is, p r and C i τ B for all i ∈ {0, . . . , p}. For i ∈ {0, 1, . . . , p}, let x i = (C i ). Since for each i ∈ {0, . . . , p − 1}, C i and C i+1 are adjacent in G d /X , we can find vertices y i ∈ C i and z i ∈ C i+1 that are adjacent in G d . That is, in G there is a path Q i of length at most d connecting y i with z i . Observe that by the choice of x i = (y i ) and x i+1 = (z i ), each vertex of Q i is not smaller than either x i or x i+1 in σ: the first d/2 vertices of Q i are not smaller than x i , while the last d/2 vertices are not smaller than x i+1 .
Further, by the definition of mapping (·), we can find a path P i from y i to x i such that the length of P i is at most d/2 and all vertices of P i are not smaller than x i in σ. Similarly, there is a path R i from z i to x i+1 such that the length of R i is at most d/2 and all vertices of R i are not smaller than x i+1 in σ. Thus, by concatenating paths 2dr connecting x 0 = (A) with x p = (B). As we argued, each vertex traversed by W is not smaller in σ than one of the vertices x 0 , x 1 , . . . , x p . By the choice of τ , the vertex x p is the smallest in σ among {x 0 , x 1 , . . . , x p }. We conclude that all the vertices traversed by W are not smaller than x p = (B), hence W witnesses that Since vertices (B) are pairwise different for different B ∈ WReach r [G d /X , τ, A], this implies (1) and concludes the proof.
Remark 8. The partition X provided by Theorem 7 has the following property: Note that this property directly implies that every block of X is a clique in G d , which means that X is indeed a clustering of G d .
Having established Theorem 7, we can formulate the key clustering property of powers of classes of bounded expansion. Corollary 1. Let C be a class of graphs with bounded expansion and d ∈ N. Then for every graph H ∈ C d there exists a clustering X H such that the class {H/X H : H ∈ C d } also has bounded expansion.
Proof. By Theorems 3 and 5, for every p ∈ N there is a constant c(p) such that for every graph G ∈ C there exists a vertex ordering σ satisfying wcol By applying Theorem 7 to G, σ , and d, we find a clustering X H of H satisfying By Theorem 3, this implies that the class {H/X H : H ∈ C d } has bounded expansion.
By replacing the application of Theorem 3 with Theorem 4, we can prove an analogous statement for nowhere dense classes in the same way.
Corollary 2. Let C be a nowhere dense class of graphs and d ∈ N. Then for every graph H ∈ C d there exists a clustering X H such that the class {H/X H : H ∈ C d } is also nowhere dense.
We conclude this section by discussing the algorithmic aspects of Corollaries 1 and 2. As discussed in [16], for any fixed class of bounded expansion C there is a polynomial-time algorithm that, given G ∈ C, computes a vertex ordering σ of G satisfying wcol p (G, σ ) c(p) for all p ∈ N, where c : N → N is some function that depends on C only. It is easy to see that given G ∈ C together with such an ordering σ , the clustering X H of H = G d provided by Corollary 1 can be computed in polynomial time, by just a straightforward implementation of the construction used in the proof. By combining these two facts, we conclude that Corollary 1 can be made algorithmic in the following sense: for a fixed class C of bounded expansion and d ∈ N, given G ∈ C we can compute a suitable clustering of G d in polynomial time. A similar reasoning applies to Corollary 2 as well. However, it is not clear if a suitable clustering of H = G d can be efficiently constructed if we are given only H on input, instead of G. Note here that computing the "pre-image" graph G given H = G d on input is far from being straightforward. We leave finding such an efficient clustering algorithm as an open problem.

Subchromatic index
The subchromatic index of a graph H, denoted χ sub (H), is the least integer c with the following property: the vertices of H can be colored with c colors so that the subgraph induced by each color is a disjoint union of complete graphs. Equivalently, χ sub (H) is the minimum of χ(H/X ) for X ranging over clusterings of H.
The subchromatic index was introduced by Albertson et al. [1]. It is a notion of coloring that is tailored to graphs that are possibly dense, and hence may have a large (regular) chromatic number, but admit good clustering properties. As should be expected given the results of the previous section, this idea applies well to the powers of sparse graphs.
Theorem 9. For every graph G and d ∈ N, we have Proof. By applying Theorem 7 to G and a vertex ordering of G with the minimum possible weak 2dcoloring number, we conclude that there exists a clustering X of G d such that col(G d /X ) wcol 2d (G). Then we have χ sub (G d ) χ(G d /X ) col(G d /X ) wcol 2d (G).
By combining Theorem 9 with Theorems 3 and 4, we respectively obtain the following corollaries, which express upper bounds on the subchromatic index of powers of sparse graphs.
Corollary 3. For every class of graphs C with bounded expansion and d ∈ N, we have Corollary 4. For every nowhere dense class of graphs C, d ∈ N, and ε > 0, there exists a constant c such that χ sub (G d ) c · n ε for every n-vertex graph G ∈ C.
We find Corollary 4 particularly interesting due to potential connections with low shrubdepth colorings in powers of nowhere dense classes, which we already briefly mentioned in Section 1. Without going into technical details, shrubdepth, introduced in [6], is a depth parameter suited for the treatment of dense graphs; it can be regarded as a depth-constrained variant of cliquewidth. Kwon et al. [8] proved that whenever a class C has bounded expansion and d ∈ N, the class C d has low shrubdepth colorings 1 . That is, for every p ∈ N there exists M (p) ∈ N such that every graph from C d can be colored with M (p) colors so that every subset of p colors induces a graph of bounded shrubdepth. This result was then lifted by Gajarský et al. [5] to all classes of structurally bounded expansion, that is, images of classes of bounded expansion under one-dimensional first-order interpretations. The result of Kwon et al. [8] suggests that in powers of nowhere dense classes, one should expect low shrubdepth colorings with n ε colors, rather than a constant, as phrased formally in the following conjecture.
Conjecture 1. Let C be a nowhere dense class of graphs and d ∈ N. Then for every p ∈ N there exists a class of graphs D p of bounded shrubdepth and, for every ε > 0, a constant c p,ε such that every n-vertex graph H ∈ C d admits a coloring with at most c p,ε · n ε colors in which every subset of at most p colors induces in H a subgraph that belongs to D p .
Unfortunately, the proof of Kwon et al. [8] for powers of classes of bounded expansion does not lift to nowhere dense classes, hence Conjecture 1 remains open. However, since the class of cluster graphsdisjoint unions of complete graphs -has bounded shrubdepth, Corollary 4 actually proves Conjecture 1 for the case p = 1. This may potentially point to a new, different approach to Conjecture 1.
Theorem 9 provides an upper bound on the subchromatic number of the dth power of a graph expressed in terms of its weak 2d-coloring number. It is natural to ask whether for such a bound, we could rely on weak coloring numbers for smaller distances than 2d. We now show that this is indeed the case: the boundedness of the weak d-coloring number is sufficient for bounding the subchromatic number of the dth power.
Theorem 10. For every d ∈ N there exists a function f : N → N such that for every graph G we have Proof. Let c = wcol d (G) and let σ be a vertex ordering of G with optimum wcol d (G, σ). For brevity, from now on we write WReach d [u] for WReach d [G, σ, u], etc. Let λ be a greedy weak d-coloring of G that uses c colors, computed over σ: every consecutive vertex u receives a color that is different from all the colors assigned to the other vertices of WReach d [u]. We assume that λ uses colors {1, . . . , c}.
For any set X ⊆ V (G) and x ∈ X, the index of x in X is its index in X ordered by σ, which is a number between 1 and |X|. Consider any u ∈ V (G) and let x 1 , . . . , x p be the set WReach d/2 [u] ordered by σ; then p c and x p = u. Note that for all 1 i < j p, we have x i ∈ WReach d [x j ], hence vertices x 1 , . . . , x p receive pairwise different colors under λ. With u we associate a triple of functions ξ(u) = (α u , β u , γ u ) defined as follows: • α u : {1, . . . , p} → {1, . . . , c} is defined as α u (i) = λ(x i ); • β u : {1, . . . , p} → {0, 1, . . . , d/2 } is defined as follows: β u (i) is the smallest r such that x i ∈ WReach r [u]; 1 We remark that Kwon et al. [8] only discuss bounds on the cliquewidth of graphs induced by subsets of colors, but, as noted in [5], their proof actually provides bounds on their shrubdepth. • γ u : {i, j ∈ {1, . . . , p} : i < j} → {1, . . . , c} is defined as follows: Observe that the cardinality of the co-domain of the mapping ξ is bounded by a function of c and d.
Hence, it suffices to prove that ξ is a subcoloring of G d , that is, for every triple of functions (α, β, γ) as above, the set of those u that satisfy ξ(u) = (α, β, γ) induces in G d a disjoint union of complete graphs. This is equivalent to the following claim: there are no three vertices u, v, w with same color under ξ that would induce a P 3 in G d . Suppose such three vertices exist; that is, Let P uv be a shortest path connecting u and v, and let P vw be a shortest path connecting v and w. Let x be the vertex on P uv that is the smallest in σ. Then x splits P uv into two subpaths, say of length d 1 and d 2 , which witness that x ∈ WReach d1 [u] and x ∈ WReach d2 [v], respectively. Note that d 1 +d 2 d. Suppose for a moment that d 1 d 2 ; then The other case, when d 1 d 2 , is symmetric, so we may conclude that in both cases, Letting y be the vertex on P vw that is the smallest in σ, we may apply the same reasoning as above to conclude that Since dist(u, w) > d, we have x = y. By symmetry we may assume that x < σ y. As x, y ∈ WReach d/2 [v], we have x ∈ WReach d [y]. Let i < j be the indices of x and y in WReach d/2 [v], respectively.
Observe that y is the only vertex of color λ(y) in WReach d/2 [v], and similarly y is the only vertex of color λ(y) in WReach d/2 [w]. Since α v = α w = α, we infer that the index of y in WReach d/2 [w] is also j. Since γ v = γ, the index of x in WReach d [y] is γ(i, j). However, as γ w = γ as well, the vertex of index i in WReach d/2 [w] is exactly the vertex of index γ(i, j) in WReach d [y] -which is x. Thus x ∈ WReach d/2 [w], which combined with x ∈ WReach d/2 [u] implies that dist(u, w) d, a contradiction. Theorems 9 and 10 suggest an interesting research direction: finding tight bounds on the subchromatic number of powers of concrete classes of sparse graphs. For instance, for the class of planar graphs, the following bounds on weak coloring numbers were proved in [15]: By combining this bound with Theorem 9 applied for d = 2, we conclude that On the other hand, the highest complementary lower bound known to us is χ sub (Planar 2 ) 5. An example for this can be obtained by taking a highly branching tree with high depth, and attaching to every edge uv the gadget depicted in Figure 1. We leave the easy verification that the square of the graph obtained in this way has subchromatic number equal to 5 to the reader. Finding tighter upper and lower bounds in the very concrete case of squares of planar graphs is an interesting open problem.

Cliques and colorings
Another corollary that we can derive from Theorem 7 is that in powers of sparse graphs (and even in their induced subgraphs), the coloring number approximates both the clique number and the chromatic number up to a constant factor.
Theorem 11. For every class of graphs C with bounded expansion and d ∈ N, there exists a constant c ∈ N such that Proof. The second inequality is obvious, while the third follows from Lemma 2. Hence, we focus on proving the first inequality.
Let H ∈ C d be an induced subgraph of G d , for some G ∈ C. By Theorem 7, there exists a clustering X of G d such that col(G d /X ) wcol 2d (G). Let τ be a vertex ordering of G d /X with optimum coloring number and let σ be a vertex ordering of H satisfying the following: whenever A < τ B for two blocks A, B ∈ X , then in σ every vertex of A ∩ V (H) is placed before every vertex of B ∩ V (H).
Observe that for every vertex u ∈ V (H), say belonging to A∩V (H) for a block A ∈ X , the neighbors of u that are placed before u in σ either belong to A ∩ V (H), or to B ∩ V (H) for some block B that is adjacent to A in G d /X and is placed before A in the ordering τ . Therefore, we have On the other hand, for every block A ∈ X the set A ∩ V (H) is a clique in H, implying max A∈X
Recall that a hereditary (i.e., closed under taking induced subgraphs) class of graphs C is χ-bounded if there exists a function f : N → N such that for every G ∈ C, we have χ(G) f (ω(G)). If f (·) can be chosen to be a linear function, then we say that C is linearly χ-bounded. Then Theorem 11 immediately implies that whenever C has bounded expansion and d ∈ N is fixed, the class C d is linearly χ-bounded. This result was already observed in [5,8] as a consequence of the fact that fixed-degree powers of classes of bounded expansion admit low shrubdepth colorings. The new proof provided in this paper is, however, conceptually quite different and arguably somewhat simpler.
Given these considerations, it is natural to ask whether there is any non-trivial relation between the chromatic number and the clique number in powers of arbitrary graphs. It turns out that this is indeed the case, as explained next (see also the work of Chalermsook et al. [3] for similar ideas).
Theorem 12. For every graph G and integer d 2, we have Proof. By ∆(H) we denote the maximum degree in a graph H. Note that for all p ∈ N, we have Suppose first that d is even, say d = 2k for some integer k 1. Then we have Now suppose that d is odd, say d = 2k + 1 for some integer k 1. Then we have Note that Theorem 12 cannot be extended to all induced subgraphs of degree-d powers of all graphs. Indeed, for every d ∈ N, the hereditary closure of {G d : G is a graph} comprises all graphs, as every graph is an induced subgraph of the dth power of its (d − 1)-subdivision.
It would be interesting to understand to what extent the upper bounds provided by Lemma 12 are tight. The best lower bound known to us comes from the following theorem of Alon and Mohar [2].
Theorem 13 ( [2]). For every d, t ∈ N there exists a constant c 0 such that for every r ∈ N there exists a graph G r satisfying the following: It is easy to observe that if G has maximum degree r and girth larger than 3d, then ω(G d ) O(r 2 ) for odd d. Then if for a fixed d we combine this observation with Theorem 13 applied for t = 3d + 1, we can find graphs G with arbitrary high ω(G d ) and satisfying This leaves a significant gap to the upper bound provided by Theorem 12, especially in the odd case.

Algorithmic aspects
Finally, we move to algorithmic applications of our graph-theoretic considerations. Theorem 11 together with the algorithmic tractability of the coloring number (Lemma 2) immediately suggests an approximation algorithm for the chromatic number of a power of a sparse graph.
Theorem 14. For every graph class C of bounded expansion and d ∈ N, there exists a constant c and a linear-time algorithm that given a graph H ∈ C d computes a proper coloring of H with at most c · χ(H) colors.
Proof. By Theorem 11, there exists a constant c such that for every graph H ∈ C d we have col(H) c · ω(H) c · χ(H). Therefore, the algorithm of Lemma 2 computes in linear time a proper coloring of H with the required property.

Algorithm 1: Algorithm ApxClique
Input: a graph H Output: a clique K in H By Theorem 11, whenever H ∈ C d for a fixed class of bounded expansion C and d ∈ N, we have Thus, the number col(H)/c -computable in linear-time -can serve as a constant factor approximation of the clique number of H. However, while in Theorem 14 we have shown how to compute a proper coloring with an approximately optimum number of colors, the above argument only provides an approximate clique number, but it is unclear how to actually construct a clique with the guaranteed size. We next show that this is indeed possible in quadratic time.
Theorem 15. For every graph class C of bounded expansion and d ∈ N, there exists a constant s ∈ N and an O(nm)-time algorithm that given a graph H ∈ C d finds a clique in H of size at least 1 s · ω(H). Before we proceed to the proof of Theorem 15, we need to recall some tools. For a graph H, a semi-ladder of length k in H is a pair of sequences of vertices x 1 , . . . , x k and y 1 , . . . , y k such that • for every i ∈ {1, . . . , k}, vertices x i and y i are not adjacent in H; and • for all i, j ∈ {1, . . . , k} satisfying i < j, vertices x i and y j are adjacent in H. The semi-ladder index of a graph H is the largest length of a semi-ladder in H. As usual, the semiladder index of a graph class C is the supremum of the semi-ladder indices of graphs from C.
As proved by Fabiański et al. [4], powers of nowhere dense classes have finite semi-ladder indices.
Theorem 16 ([4]). For every nowhere dense class of graphs C and d ∈ N, the class C d has a finite semi-ladder index.
Note that the semi-ladder index of a class is equal to the semi-ladder index of its hereditary closure, hence Theorem 16 also implies finiteness of the semi-ladder index of C d whenever C is nowhere dense and d ∈ N is fixed.
We now give a proof of Theorem 15 using Theorem 16.
Proof of Theorem 15. We first present the algorithm, which is summarized using pseudo-code as procedure ApxClique. The algorithm constructs a clique K in an input graph H by iteratively extending it, starting with K = ∅. At the same time it maintains an induced subgraph J of H, initially set to H itself, in which the remaining vertices of the clique will be sought. We maintain an invariant that at any point, all the vertices of J are adjacent in H to all the vertices of K. Thus, provided all further vertices added to K will be drawn from J, we can immediately conclude the correctness of the algorithm: the returned subset of vertices is indeed a clique.
The algorithm proceeds in rounds as follows. First, add all universal vertices of J to the clique K and remove them from J. Here, a vertex is universal if it is adjacent to all the vertices of a graph; note that universal vertices form a clique. Next, we iterate through all the (remaining) vertices of J and we pick v to be any vertex for which the coloring number of the graph J[N J [v]] is maximized. We add v to K, restrict J to the subgraph induced by N J (v), and proceed to the next round. The loop terminates when J becomes empty. Then we output K as the constructed clique.
From now on we assume that the input graph H belongs to C d for some class C of bounded expansion and fixed d ∈ N. The intuition behind the algorithm is that it is an iterative self-reduction scheme that uses the computation of the coloring number as an approximate guidance for where a large clique lies in the graph. Indeed, by Theorem 11, any vertex of the graph J that maximizes col(J[N J [u]]) participates in a clique in J that is of size at least 1 c · ω(J), where c is the constant provided by Theorem 11 for the class C d . Thus, in each round of the algorithm we lose a constant c on the approximation factor. This is formalized in the following claim.
Claim 1. Suppose that having run procedure ApxClique on some H ∈ C d , at the end of the ith iteration we have obtained an induced subgraph J i of H and a clique K i in H. Then We proceed by induction on i. The base case for i = 0 holds vacuously. For the induction step, let J i−1 and K i−1 be the considered objects after i − 1 iterations. Then by the induction hypothesis we have As J u is an induced subgraph of H, we have that J u ∈ C d . Hence Theorem 11 implies that On the other hand, we have as the maximum is attained for vertices u participating in maximum-size cliques in J . Let v be a vertex of J that maximizes col(J v ); say, v is the vertex picked by the algorithm. By combining (2) and (3) we infer that We conclude that . This concludes the proof of the claim.
On the other hand, we now show that the algorithm terminates within a bounded number of rounds, as in each round it constructs a next rung of a semi-ladder.
Claim 2. Procedure ApxClique run on any H ∈ C d executes at most q full iterations of the loop, where q is the semi-ladder index of C d .
Proof. Suppose the algorithm executes full iterations. Let v 1 , . . . , v be the vertices added to the clique K in consecutive iterations, in the last line of the loop. Since each vertex v i is not universal in the graph J i−1 (i.e., the graph at the beginning of the ith iteration), there is another vertex u i of J i−1 that is not adjacent to v i . It is then easy to see that vertices v 1 , . . . , v and u 1 , . . . , u form a semi-ladder in H, implying that q.
Claims 1 and 2 imply that the clique K output by the algorithm has size at least 1 s · ω(H), where s = c q . It remains to argue that the algorithm can be implemented so that it runs in time O(nm). Observe that in each iteration of the main loop we identify and remove universal vertices -which can be done in time O(m) -and then we compute the coloring number of O(n) induced subgraphs. As each such computation can be performed in time O(m), every iteration of the main loop takes O(nm) time. Finally, Claim 2 asserts that the algorithm terminates after a constant number of rounds, so the total time complexity of O(nm) follows.
Theorem 15 suggests that maximum cliques in powers of classes of sparse graphs are somewhat algorithmically tractable. We now prove that in fact, the problem of finding a maximum-size clique in powers of nowhere dense classes is polynomial-time solvable. This comes as a corollary of the following, even stronger fact: the number of (inclusion-wise) maximal cliques is always polynomial, and they can be enumerated in polynomial time.
Theorem 17. For every nowhere dense class of graphs C and d ∈ N, there exists q ∈ N such that for every n-vertex graph H ∈ C d , the number of maximal cliques in H is at most n q . Moreover, given H ∈ C d all maximal cliques in H can be enumerated in polynomial time.
Proof. Let q be the semi-ladder index of C d . Then q is finite by Theorem 16. We prove that for every H ∈ C d and every maximal clique K in H, there exists a set of vertices A ⊆ K such that |A| q and Note this proves the theorem statement, as the number of sets A of size at most q is bounded by n q , and in polynomial time we can enumerate all of them and for each check whether a∈A N H [a] is a maximal clique.
Observe that since K is inclusion-wise maximal, the set A = K satisfies (4). Therefore, we can pick A to be any inclusion-wise minimal subset of K satisfying (4). It suffices to prove that then |A| q. For this, observe that since A is inclusion-wise minimal, for every a ∈ A there exists b(a) / ∈ K satisfying the following: a and b(a) are not adjacent, but a and b(a) are adjacent for all a ∈ A, a = a. This implies that A and B = {b(a) : a ∈ A}, with any enumerations where each a and corresponding b(a) receive the same index, form a semi-ladder in H. Hence |A| q and we are done.
Theorem 17 suggests that maximal cliques in powers of sparse graphs are potentially an interesting object of study. Note that the degree of the polynomial bound provided by Theorem 17 is dependent on the given class C and distance parameter d. One could ask whether this could be improved to a polynomial bound whose degree is a universal constant, for instance a linear or an almost linear bound. Unfortunately this is not the case; the following statement provides a counterexample already in the regime of classes of bounded treedepth (which in particular have bounded expansion [13]).
Theorem 18. For all n, d ∈ N there exists a graph G n,d such that • G n,d has 3 2 2d d n + 2d vertices; • the treedepth of G n,d is at most 2d + 2; and • the graph (G n,d ) 2 has at least n 1 2 ( 2d d ) different maximal cliques.
Proof. The graph G n,d is constructed as follows; see Figure 2. This concludes the construction of G n,d .
Observe that G n,d has exactly 3n|Q| + 2d = 3 2 2d d n + 2d vertices. To see that the treedepth of G n,d is at most 2d + 2, observe that after removing the 2d vertices of A, the graph breaks into a disjoint union of paths of length 2, and each of them has treedepth 2. Finally, for the last property we use the following straightforward claim, whose verification is left to the reader. is a maximal clique in (G n,d ) 2 .
Theorems 17 and 18 highlight another interesting open problem. The running time of the algorithm of Theorem 17 is polynomial, but the degree of this polynomial depends on C and d. As witnessed by Theorem 18, this is unavoidable even for squares of classes of bounded treedepth, provided we insist on listing all maximal cliques. However, it may be that such an exhaustive enumeration is not necessary for finding a clique of maximum cardinality. Hence the question: may it be true that for every fixed class of bounded expansion C and d ∈ N, the problem of finding a maximum-size clique in a graph from C d can be solved in time O(n c ), where c is a univeral constant, independent of C and d? Note that Theorem 15 gives such an algorithm with c = 3 for the problem of find a clique of approximately maximum size, where the approximation ratio is bounded by a constant depending on C and d.