Finer Tight Bounds for Coloring on Clique-Width

We revisit the complexity of the classical $k$-Coloring problem parameterized by clique-width. This is a very well-studied problem that becomes highly intractable when the number of colors $k$ is large. However, much less is known on its complexity for small, concrete values of $k$. In this paper, we completely determine the complexity of $k$-Coloring parameterized by clique-width for any fixed $k$, under the SETH. Specifically, we show that for all $k\ge 3,\epsilon>0$, $k$-Coloring cannot be solved in time $O^*((2^k-2-\epsilon)^{cw})$, and give an algorithm running in time $O^*((2^k-2)^{cw})$. Thus, if the SETH is true, $2^k-2$ is the"correct"base of the exponent for every $k$. Along the way, we also consider the complexity of $k$-Coloring parameterized by the related parameter modular treewidth ($mtw$). In this case we show that the"correct"running time, under the SETH, is $O^*({k\choose \lfloor k/2\rfloor}^{mtw})$. If we base our results on a weaker assumption (the ETH), they imply that $k$-Coloring cannot be solved in time $n^{o(cw)}$, even on instances with $O(\log n)$ colors.


Introduction
Graph Coloring (from now on simply Coloring) is one of the most intensely studied problems in theoretical computer science. In this classical problem we are given a graph G = (V, E) and an integer k and are asked if we can partition V into k sets inducing edge-less graphs. Coloring is a notoriously hard problem as it remains NP-hard even in very restricted cases (e.g. 4-regular planar graphs [11]) and is essentially completely inapproximable in general [12,31]. This intractability has motivated the study of the problem in the framework of parameterized complexity, especially with respect to structural graph parameters. 1 Treewidth is by far the most widely studied among such graph parameters, and Coloring has long been known to be FPT by treewidth. This can be seen by either invoking Courcelle's theorem [5], or by applying a straightforward dynamic programming technique which, for each bag of a tree decomposition of width tw considers all possible k tw colorings. Remarkably, thanks to the work of Lokshtanov, Marx, and Saurabh [24], we know that this basic algorithm is likely to be optimal, or at least that improving it would require a major breakthrough on SAT-solving, as, for any k ≥ 3, ǫ > 0, the existence of a (k − ǫ) tw algorithm would contradict the Strong Exponential Time Hypothesis of Impagliazzo and Paturi [19,20]. More recently, these lower bounds were strengthened, as Jaffke and Jansen showed that a (k − ǫ) w algorithm would contradict the SETH when w is the graph's vertex edit distance from being a path [21]. The same paper showed that the trivial algorithm can, more restricted versions of clique-width [26,28]. The modular treewidth of a graph G is defined as the treewidth of the graph obtained from G if one collapses each twin class into a single vertex, where two vertices are twins if they have the same neighbors. By slightly altering our results for clique-width we tightly characterize the complexity of k-Coloring for these parameters: the problem is solvable in time O * k ⌊k/2⌋ mtw , but not solvable in O * ( k ⌊k/2⌋ − ǫ) mpw under the SETH. Using the same reduction but relaxing the hypothesis to the ETH, we show that k-Coloring cannot be solved in time n o(mpw) , and hence neither in time n o(cw) even on instances where k = O(log n). This can be seen as a strengthening of the lower bound of [15], which applies only to clique-width and uses Ω(n) colors. Our result is incomparable to the more recent double-exponential bound of [18] as it applies to the more restricted case where the number of colors is logarithmic, and is tight for this case. Indeed, any reduction giving a double-exponential bound, such as the one in [18], must inevitably use more than log n colors, otherwise it would contradict the aforementioned algorithms.
Non-binary CSPs. We mention as a secondary contribution of this paper a proof that, under the SETH, n-variable CSPs over an alphabet of size B cannot be solved in time (B − ǫ) n , for any B, ǫ. The interest of such a result is not so much technical (its proof is implicit in previous SETH-based bounds, going back to [24]), as conceptual. Such CSPs provide a convenient starting point for a SETH-based lower bound for any base of the exponential and hence allow us to isolate a technical part of such proofs from the main part of the reduction. This explicit statement on the hardness of CPSs has allowed the proofs of this paper to be significantly shortened, and may facilitate the design of other SETH-based hardness proofs.

Definitions and Preliminaries
We use standard graph-theoretic notation and assume that the reader is familiar with the basics of parameterized complexity, as well as standard notions such as treewidth [9,14]. Let us recall the definition of clique-width (see [7,6] for more details). A labeled graph G has clique-width w if it can be constructed using w labels and the following four basic operations: Introduce(i), for i ∈ {1, . . . , w}, which constructs a single-vertex graph whose vertex has label i; Union(G 1 , G 2 ), which constructs the disjoint union of two labeled graphs of cliquewidth w; Rename(i, j) which changes the label of all vertices labeled i to j; and Join(i, j) which adds all possible edges between vertices labeled i and vertices labeled j. Computing a graph's clique-width is NP-hard [13], and the best currently known approximation is exponential in clique-width [27]. In this paper, we will often assume that we are given together with a graph G, a clique-width expression constructing G. Since most of our results are negative, this only makes them stronger, as it shows that our lower bounds do not rely on the hardness of computing clique-width. We view a clique-width expression as a rooted binary tree, where the sub-tree rooted in each internal node represents the corresponding sub-graph of G. We use cw(G) to denote the minimum number of labels needed to construct a clique-width expression of G, and tw(G), pw(G) to denote the treewidth and pathwidth of G respectively. In a graph G = (V, E) we say that u, v ∈ V are false twins if N (u) = N (v) and true twins if We say that u, v are twins if they are true or false twins. We note that in any graph G the partition of vertices into twin classes is always unique, as the property of being twins is an 159:4 Finer Tight Bounds for Coloring on Clique-Width equivalence relation [23]. Let G t be the graph obtained from G by deleting from each twin class all but a single vertex. We define (following [26]) the modular treewidth of G, denoted mtw(G), as tw(G t ), and similarly the modular pathwidth mpw(G) as pw(G t ).
Proof. The inequality pw(G) ≥ mpw(G) follows trivially from the definition of modular pathwidth and the fact that deleting vertices from a graph can only decrease its pathwidth. The inequality mpw(G) ≥ mtw(G) follows from the fact that paths are trees.
Finally, observe that if u, v are twins of G then cw(G) = cw(G − v), because given a clique-width expression for the graph obtained by deleting v, we can obtain a clique-width expression for G by introducing v immediately after u using a different label, joining them if they are true twins, and then renaming the label of v to that of u. We therefore have The Exponential Time Hypothesis (ETH) of Impagliazzo, Paturi, and Zane [20] states that there exists a constant c 3 > 1 such that 3-SAT on instances with n variables cannot be solved in time c n 3 . If the ETH is true then we can define, for all q ≥ 3 a constant c q > 1 such that q-SAT, that is, SAT on instances where clauses have maximum size q, cannot be solved in time c n q . The Strong Exponential Time Hypothesis (SETH) [19] states that lim q→∞ c q = 2, or equivalently that, for each ǫ > 0 there exists a q such that q-SAT cannot be solved in (2 − ǫ) n . We note that sometimes a slightly weaker form of the SETH is used, which states simply that SAT cannot be solved in (2 − ǫ) n for any ǫ > 0. The two formulations are not currently known to be equivalent. In this paper we use the original, stronger formulation of [19] (see also e.g. [8]) which assumes that c q tends to 2.
For any q, B ≥ 2 we define the q-CSP-B problem as follows: we are given a set X of n variables which take values in {1, . . . , B}, and a set C of q-constraints on X. A q-constraint c is defined by an ordered tuple V (c) of q variables of X, and a set S(c) ⊆ {1, . . . , B} q of satisfying assignments for c. The question is whether there exists an assignment σ : X → {1, . . . , B} which satisfies all constraints c ∈ C. We say that a constraint c ∈ C is satisfied if applying σ to V (c) produces a tuple of assignments that appears in S(c). To simplify presentation, we will assume that in the input the list S(c) of the at most B q satisfying assignments of each constraint is given explicitly, and that a q-CSP-B instance is allowed to contain constraints on fewer than q variables (as we can add dummy variables to a constraint).

SETH and Non-binary CSPs
The SETH states, informally, that as SAT clauses become larger, eventually the best algorithm for SAT is simply to try out all possible assignments to all variables. In this section we show that the same is essentially true for CSP with a larger, non-binary alphabet. The interest in presenting such a result is that very often we seek to prove a SETH-based lower bound showing that a problem does not admit an algorithm running in c w , for some constant c and width parameter w (such as treewidth, or in our case clique-width). This becomes complicated when we reduce directly from SAT if c is not a power of 2 as one cannot make a one-to-one correspondence between binary SAT variables and "units of width" (in our case labels) in the new instance, which are intended to encode c choices. As a result, essentially all known SETH lower bounds of this form include as part of their construction a group gadget, which maps every t variables of the original SAT instance to p elements of the new problem, for appropriately chosen integers p, t (see e.g. [4,10,21,24]). Such gadgets are, however, often cumbersome to design, because they require a problem-specific trick that expresses a mapping of assignments from a binary to a non-binary domain. We therefore prefer to construct a custom-made CSP with a convenient running time bound, which will later allow us to reduce directly to the problem we are interested in (Coloring on clique-width), in a way that maps exactly one variable to one clique-width label. This will allow our SETH-based bounds to be significantly simplified, as we will no longer have to worry about a discrepancy between the bases of the exponentials.
◮ Theorem 2. For any B ≥ 2, ǫ > 0 we have the following: if the SETH is true, then there exists a q such that n-variable q-CSP-B cannot be solved in time Proof. Fix a B, ǫ, and suppose that there is an algorithm solving n-variable q-CSP-B in (B − ǫ) n time, for any q. We will find some δ > 0, such that we will obtain an algorithm that solves n-variable q-SAT in time (2 − δ) n for any q. This will contradict the SETH. Suppose that we are given a q-SAT instance with n variables. We first define an integer p and a real δ > 0 such that there exists an integer t for which we have: In particular, it suffices to select p so that B p ≥ 2(B − ǫ) p for such a t to exist. Equivalently, and then a δ that satisfies the second inequality always exists.
We now group the n variables of the given SAT instance into γ = ⌈n/t⌉ groups of at most t variables each. Call these groups V 1 , V 2 , . . . , V γ . For each such group V i we construct a group of p variables of the CSP instance, call them X i . Furthermore, we define (in some arbitrary way) a correspondence which for each assignment to the variables of V i gives a distinct assignment to the variables of X i . This is always possible, since 2 t ≤ B p . Observe that our CSP instance has γp = p⌈n/t⌉ ≤ pn t + p variables. Now, for each clause of the q-SAT instance, if it involves variables from the groups V i1 , V i2 , . . . , V iq , we construct a constraint that involves all the variables of the groups X i1 , . . . , X iq (in other words, we transform q-clauses into (qp)-constraints). To define the satisfying assignments of the constraint, recall that we have defined a function that maps each assignment of a group V i to an assignment of a group X i . We extend these to obtain a function that maps assignments to V i1 ∪ . . . ∪ V iq to assignments of X i1 ∪ . . . ∪ X iq , and retain as satisfying assignments for the constraint exactly those assignments that are images of assignments that satisfy the original clause.
This completes the construction, and we remark that everything can be performed in polynomial time if q, B, ǫ are constants, as p, t only depend on B, ǫ. It is also not hard to see that the instances are equivalent: if there is a satisfying SAT assignment, we give each X i the assignment that the satisfying assignment of V i is mapped to; in the converse direction, because all constraints are satisfied we have selected for each X i an assignment that is the image of some assignment to V i , and in such a way that the obtained assignment for the SAT instance satisfies all clauses.
We now invoke the supposed CSP algorithm on our instance where each constraint involves at most qp variables, and the number of variables is N = p⌈n/t⌉ ≤ pn t + p. The algorithm will run in time Again, because t only depends on B, ǫ, this running time is O * ((2 − δ) n ), and we have obtained a faster than 2 n algorithm for q-SAT, for any q. ◭

159:6
Finer Tight Bounds for Coloring on Clique-Width

SETH-based Lower Bound for Clique-width
In this section we present our main lower bound result stating that k-Coloring cannot be solved in time O * (2 k − 2 − ǫ) cw , for any k ≥ 3, ǫ > 0, under the SETH. In Section 4.1 we present some basic gadgets that will also be of use in our lower bound for modular pathwidth (Section 5). We then present the main part of the proof in Section 4.2.

List Coloring and Basic Gadgets
The high-level machinery that we will make use of in our reduction consists of two major points: first, we would like to be able to express implication constraints, that is, constraints of the form "if vertex u received color c 1 , then vertex v must receive color c 2 "; second, we would like to express disjunction constraints of the form "at least one of the vertices of the set S ⊆ V must take a special color 1". We build this machinery in the following steps: first, we show that we can (almost) equivalently produce an instance of the more general List Coloring problem; then we use the ability to construct lists to make weak edge gadgets, which for a given pair of vertices (u 1 , u 2 ) rule out a specific pair of assigned colors; using these weak edges we construct the aforementioned implication gadgets; and finally we are able to implement OR constraints using paths on vertices with appropriate lists. We give all details for these constructions below. We remark however, for the convenience of the reader, that a high-level understanding of the informal meaning of implication gadgets and OR gadgets (precisely stated in Lemmata 7, 10) is already sufficient to follow the description of the main part of the reduction, given in Section 4.2. See also Figure 1.

List Coloring
To simplify the presentation of our reduction it will be convenient to use a slightly more general problem. In List Coloring, we are given a graph G and a list of possible colors associated with each vertex and are asked if there is a proper coloring such that each vertex uses a color from its list. This problem clearly generalizes k-Coloring, as all lists may be {1, . . . , k}. We will make use of a reduction in the opposite direction.
◮ Lemma 3. There is a polynomial-time algorithm which, given an instance of List Coloring on a graph G where all lists are subsets of {1, . . . , k}, transforms it into an equivalent instance of k-Coloring on a graph G ′ . Furthermore, the algorithm transforms a cliquewidth expression of G with cw labels, to a clique-width expression of G ′ with cw + k labels. If all twins of G share the same list, the algorithm transforms a modular path decomposition of width mpw for G, to a modular path decomposition of G ′ of width mpw + k.
Proof. For the modular pathwidth part, we add to the graph a clique on k vertices, call them c 1 , . . . , c k . For each vertex u of G whose list is L ⊆ {1, . . . , k} we connect u to all c i such that i ∈ L. It is not hard to see that this produces an equivalent instance. Furthermore, if all twins of G share the same list, they remain twins. We can therefore obtain a modular path decomposition of the new graph by adding c 1 , . . . , c k to all bags of the original decomposition.
To obtain a clique-width expression we start with a clique-width expression of the original graph, and let l 1 , . . . , l k be k fresh labels. For every vertex u whose list is L(u) ⊆ {1, . . . , k}, we replace its introduce node with a sub-expression which introduces the vertex u, as well as k new vertices each using a distinct label from l 1 , . . . , l k ; and then performs join operations between the label of u and all labels l i , for i ∈ L(u). In the root of the expression we add join operations between every pair of labels in {l 1 , . . . , l k }. As a result, we have added to Figure 1 Basic gadgets, where empty vertices are internal and solid vertices are endpoints that will be connected to the rest of the graph. On the left, a weak edge that forbids the combination (1, 5) on its endpoints. In the middle, an implication that forces color 2 on the right if color 1 is used on the left. On the right an OR gadget: one of the solid vertices must take color 1.
the graph a complete k-partite graph, and each original vertex is connected to a subset of the parts of this graph in a way that simulates its list. ◭

Weak Edges and Implications
Normally, the existence of an edge (u, v) in an instance of Coloring forbids the vertices u, v from obtaining the same color, whatever that color may be. We will find it convenient to construct edges that forbid only a specific pair of colors from appearing on u, v, while allowing any other combination of colors to be used on these two vertices. Similar versions of this gadget have appeared before, for example [24,25].
◮ Definition 4. For two vertices u 1 , u 2 of a graph G and two colors c 1 , c 2 a (c 1 , c 2 )-weak edge from u 1 to u 2 consists of the following: induces a path in this order, with endpoints u 1 , u 2 , and v 1 , v 2 , v 3 having no edges to the rest of G.
◮ Lemma 5. Let G be an instance of List Coloring that contains a (c 1 , c 2 )-weak edge from u 1 to u 2 . Then G does not admit a valid coloring that assigns colors (c 1 , c 2 ) to (u 1 , u 2 ). Furthermore, if G ′ denotes the graph obtained by deleting the internal vertices of the weak edge, any proper list coloring of G ′ that does not assign c 1 to u 1 or does not assign c 2 to u 2 can be extended to a proper list coloring of G.
Proof. Suppose we assign colors c 1 , c 2 to u 1 , u 2 . If c 1 = c 2 this would mean that we would have to color v 1 with c 2 , which forces v 2 to color c ′ , which leaves no available color to v 3 . If c 1 = c 2 and we use this color on both u 1 , u 2 then we must give colors c ′ , c ′′ to v 1 , v 3 respectively, making it impossible to color v 2 . For the converse direction, suppose a coloring of G ′ assigns a color other than c 1 to u 1 . We can then give color c 1 to v 1 and this means that for any color we give to v 3 , v 2 has a color available to complete the coloring. If on the other hand a coloring gives a color other than c 2 to u 2 , we give color c 2 to v 3 . If c 1 = c 2 we are done, because the list of v 2 does not contain c 2 , so we can always extend a coloring of v 1 to v 2 . If c 1 = c 2 , we color v 2 with c ′ , and this will not contradict any coloring of v 1 , since c ′ is not in the list of v 1 . ◭ Let us now use the weak edges we have defined above to construct an implication gadget. The intuitive meaning of placing an implication gadget from a vertex u 1 to a vertex u 2 is to impose the constraint that if u 1 is assigned color c 1 , then u 2 must be assigned color c 2 .

159:8
Finer Tight Bounds for Coloring on Clique-Width ◮ Definition 6. For two vertices u 1 , u 2 and two colors (c 1 , c 2 ) a (c 1 → c 2 )-implication from vertex u 1 to vertex u 2 is constructed as follows: for each color c ′ = c 2 , we add a (c 1 , c ′ )-weak edge from u 1 to u 2 . ◮ Lemma 7. Let G be an instance of List Coloring that contains a (c 1 → c 2 )-implication from u 1 to u 2 . Then G does not admit a list coloring that gives color c 1 to u 1 and a color c ′ = c 2 to u 2 . Furthermore, if G ′ is the graph obtained from G by deleting the internal vertices of the implication gadget, any coloring of G ′ that either does not assign c 1 to u 1 , or assigns c 2 to u 2 can be extended to a coloring of G.
Proof. Follows directly from the proof of Lemma 5. In particular, if u 1 receives c 1 and u 2 receives c ′ = c 2 , by construction there exists a (c 1 , c ′ )-weak edge from u 1 to u 2 which cannot be colored. For the converse direction, all weak edges of the implication gadget are activated either by setting u 1 to c 1 , or setting u 2 to a color other than c 2 . ◭ ◮ Lemma 8. Let G be an instance of List Coloring, and G ′ be the graph obtained from G by replacing every (c 1 , c 2 )-weak edge or (c 1 → c 2 )-implication gadget with endpoints u 1 , u 2 with an edge (u 1 , u 2 ) (or simply deleting the internal vertices of the weak edge if (u 1 , u 2 ) already exists). Then pw(G) ≤ pw(G ′ ) + 3.

Proof.
We prove the lemma just for (c 1 , c 2 )-weak edges, since implication gadgets are just collections of weak edges that share the same endpoints. Consider a path decomposition of G ′ . We construct a path decomposition that contains the internal vertices of a weak edge with endpoints u 1 , u 2 as follows: first we find a bag of the decomposition of G ′ that contains both u 1 , u 2 (such a bag exists because (u 1 , u 2 ) is an edge of G ′ ); then we insert after this bag an identical bag, into which we insert the three internal vertices of the weak edge. We repeat this process for all weak edges. ◭

OR gadgets
We will also make use of a gadget that forces any valid list coloring of a graph to assign a special color 1 to one vertex out of a set of vertices. Invariably, the idea will be that this will be a color that activates some implications, allowing us to propagate information about the coloring between parts of the graph. We recall that a similar version of an OR gadget was also used in [24].
◮ Definition 9. An OR gadget on an independent set of vertices S, denoted OR(S), is constructed as follows: we assign list {1, 2, 3} to all vertices of S; we construct a new set S ′ of internal vertices (that will not be connected to the rest of G), such that |S ′ | = |S| + 1 and S ∪ S ′ induces a path alternating between vertices of S and S ′ ; we assign list {2, 3} to all vertices of S ′ , except the two endpoints of the path, which receive lists {2}, {3}, respectively.  Figure 2 Left: high-level view of the reduction. Rows correspond to variables, columns to constraints. Here, variable x1 appears in constraints c0, c1, c3, c4. Right: connections between the OR gadgets OR(Sj) and the V j i , U j i sets. Giving color 1 to a1 represents selecting this assignment. This forces the use of some colors in V 0,a 1 1 and the complementary set in U 0,a 1 1 .

Reduction for Clique-width
The proof of Theorem 11 consists of a reduction from a CSP produced by Theorem 2. Before giving details, let us give some intuition. Our new instance will be a graph and a clique-width expression with, roughly, n labels, where n is the number of variables of the CSP instance. The set of colors used in each label will encode the value given to a variable in a satisfying assignment. As a result, with k colors, we will have 2 k − 2 encodings available, as every label set uses at least one color, but will never use all k colors. To verify that these assignments are correct, we will construct for each constraint an OR gadget which forces the use of color 1 on a vertex representing a particular assignment. This assignment dictates the value of each variable of the constraint, and therefore the set of colors used in some of our label sets. To verify that the assignment is consistent we use implication gadgets that force some auxilliary vertices to receive the complement of the colors dictated by the constraint assignment, and then connect these with the vertices encoding the true assignment. If the assignment used is truly consistent, these edges will end up being properly colored.

Construction.
We are given k ≥ 3, ǫ > 0. Let B = 2 k −2. Let q be the smallest integer such that n-variable q-CSP-B does not admit an O * ((B − ǫ) n ) algorithm. According to Theorem 2, q exists if the SETH is true, and it depends only on B, ǫ. Consider an arbitrary n-variable instance of q-CSP-B, call it φ. We use the existence of the supposed O * (2 k − 2 − ǫ) cw algorithm to obtain an O * ((B − ǫ) n ) algorithm that decides φ, contradicting the SETH.
We define in some arbitrary way a translation function T which, given a value v ∈ {1, . . . , B} returns a non-empty proper subset of {1, . . . , k}. We make sure that T is defined in such a way that it is one-to-one; this is possible since the number of non-empty proper subsets of {1, . . . , k} is exactly B = 2 k − 2.
Let X = {x 1 , . . . , x n } be the set of the n variables of the q-CSP-B instance and C = {c 0 , . . . , c m−1 } the set of its m constraints. Let L = 3m(nk + 1). We now construct our graph, where if we don't specify the list of a vertex it can be assumed to be {1, . . . , k}. For each j ∈ {0, . . . , L − 1} we do the following: 1. Let j ′ = j mod m and let S be the set of satisfying assignments of the constraint c j ′ . We construct an independent set of vertices S j that contains a vertex for every assignment of S. We construct an OR(S j ) gadget on these vertices.

2.
For each x i which appears in c j ′ and for each assignment a ∈ S we do the following: This completes the construction, and we call the constructed List Coloring instance G(φ). The intended meaning is that the sets V j,a i will use a set of colors that encodes the value of the variable x i , while the sets U j,a i will use colors from the complement of this set.

◮ Lemma 12. If φ is a satisfiable q-CSP-B instance, then G(φ) admits a proper list coloring.
Proof. Suppose that we have a satisfying assignment for φ which gives value v i to variable x i . The invariant we will maintain is that for all j, a, all vertices of sets V j,a i will use only colors from T (v i ), while all vertices of sets U j,a i will use only colors from {1, . . . , k} \ T (v i ). As a result, all edges added in step 2d will be properly colored. The rest of the graph will be easy to color if we respect the informal meaning of OR and implication gadgets.
More specifically, for each OR(S j ) gadget we let j ′ = j mod m and consider the constraint c j ′ . The supposed assignment to φ assigns to the variables of the constraint values consistent with a satisfying assignment a of c j ′ . We give color 1 to the corresponding vertex of S j . We use colors {2, 3} to color all remaining vertices of the OR gadget. Note that the OR gadget is connected to the rest of the graph only through implication gadgets activated by color 1. Hence, by Lemma 7 we can remove all non-activated implication gadgets. For the remaining, activated implication gadgets we color their other endpoints, which are found in the sets In other words, to obtain the candidate assignment for x i at index j, we take the union of all colors used in V j,a i , and then translate this set back into a value in {1, . . . , B}. We observe that for all i, j, such that x i appears in c j ′ , where j ′ = j mod m, there exists an assignment a such that c(V j,a i ) = {1, . . . , k} \ c(U j,a i ). To see this, note that by Lemma 10, one of the vertices of the OR(S j ) gadget must have received color 1, say the vertex that corresponds to assignment a. All the implications incident on this vertex are therefore activated, which means that, if a gives value v ∈ {1, . . . , B} to x i , then c(V j,a i ) = T (v) and c(U j,a i ) = {1, . . . , k} \ T (v) (because of the implications of steps 2b,2c and Lemma 7).
A key observation now is the following: for all j 2 > j 1 and for all i such that variable x i appears in constraints i . Since c ∈ c(V j1 i ), this contradicts the correctness of the coloring. The property established in the previous paragraph implies that for each i there exist at most k distinct candidate assignments v j i we can obtain for different values of j, as each assignment is obtained by translating the set of colors used in V j i , this set only increases, it always contains at least one color and at most k colors. Let us say that an index j 1 is problematic if, for some i ∈ {1, . . . , n} we have the following: x i appears in constraint c j ′ 1 , where j ′ 1 = j 1 mod m; and if j 2 is the minimum index such that j 2 > j 1 and In other words, an index is problematic if the candidate assignment it produces for a variable disagrees with the candidate assignment produced for the same variable in the next index that involves this variable. It is not hard to see that there are at most kn problematic indices, because for each variable there are at most k problematic indices. Therefore, since L = 3m(nk + 1), by pigeonhole principle, there exists an interval L ′ of at least 3m consecutive non-problematic indices.
We now obtain an assignment for the original instance as follows: for each variable i we take an index j ∈ L ′ such that x i appears in constraint c j ′ , where j ′ = j mod m, and give x i the candidate value v j i from that index. Observe that, by the definition of L ′ the index we select is irrelevant, as all candidate values are constant throughout the interval L ′ .
We claim that this is a satisfying assignment. Suppose not, so there exists an unsatisfied constraint c j ′ . Because L ′ contains 3m consecutive indices, there exists three indices j 1 < j 2 < j 3 ∈ L ′ such that j ′ = j 1 mod m = j 2 mod m = j 3 mod m. We observe that for all variables x i appearing in c j ′ we have given value v j2 i , that is the candidate value obtained at index j 2 , since all indices in L ′ give the same candidate values to all variables. Now, there exists a vertex in S j2 that received color 1, representing an assignment a. If the assignment we produced is not consistent with a, there exists a variable x i such that we have given Proof. For fixed k ≥ 3, ǫ > 0, we have that B = 2 k − 2 and q is a constant that only depends on B, ǫ (that is, on k, ǫ). Each constraint of the q-CSP-B instance has at most B q satisfying assignments. Therefore, it is not hard to see that the whole construction can be performed in polynomial time, if k, ǫ, B, q are constants. For clique-width we use the following labels:

Because of the implication gadgets, it uses the colors T
1. n main labels, representing the variables of φ.

2.
A single junk label. Its informal meaning is that a vertex that receives this label will not be connected to anything else not yet introduced in the graph. 3. O(B q ) constraint work labels. 4. O(qk 2 B q ) variable-constraint incidence work labels.
To give a clique-width expression we will describe how to build the graph, following essentially the steps given in the description of the construction by maintaining the following invariant: before starting iteration j, all vertices of the set j ′ <j V j ′ ,a i (where we take the union over all assignments a), have label i, and all other vertices have the junk label.
This invariant is vacuously satisfied before the first iteration, since the graph is empty. Suppose that for some j ∈ {0, . . . , L − 1} the invariant is true. We use the O(B q ) constraint work labels to introduce the vertices of the OR(S j ) gadget of step 1, giving each vertex a distinct label. We use join operations to construct the internal edges of the OR gadget.
Then, for each variable x i that appears in the current constraint we do the following: we use O(k 2 B q ) of the variable-constraint incidence work labels to introduce the vertices of V j,a i , U j,a i as well as the implication gadgets connecting these to S j . Again we use a distinct label for each vertex, but the number of vertices (including internal vertices of the implication gadgets) is O(k 2 B q ), so we have sufficiently many labels to use distinct labels for each of the q variables of the constraint. We use join operations to add the edges inside all implication gadgets. Then we use join operations to connect U j,a i to all vertices j ′ <j V j ′ ,a i , for j ′ < j. This is possible, since the invariant states that all the vertices of j ′ <j V j ′ ,a i have the same label. We then rename all the vertices of U j,a i , for all a to the junk label, and do the same also for internal vertices of all implication gadgets. We proceed to the next variable of the same constraint and handle it using its own O(k 2 B q ) labels. Once we have handled all variables of the current constraint, we rename all vertices of each V j,a i to label i for all a. We then rename all vertices of the OR(S j ) gadget to the junk label and increase j by 1. It is not hard to see that we have maintained the invariant and constructed all edges induced by the vertices introduced in steps up to j, so repeating this process constructs the graph. ◭ Theorem 11. The proof now follows from the described construction, Theorem 2, and Lemmata 3, 12, 13, 14. In particular, given any fixed k ≥ 3, ǫ > 0, our construction, in combination with Lemma 3 and 12 produces a k-Coloring instance of clique-width n + f (k, ǫ) and size polynomial in the original q-CSP-B instance. If there exists an algorithm running in O * (2 k − 2 − ǫ) cw for k-Coloring, since we have set B = 2 k − 2, this immediately gives a O * ((B − ǫ) n ) algorithm for q-CSP-B. However, we assumed that q is sufficiently large that the existence of such an algorithm would contradict the SETH. ◭

Modular Pathwidth and ETH
We present a lower bound on the complexity of k-Coloring parameterized by modular pathwidth. Specifically, we show that, under the SETH, no algorithm can solve k-Coloring in O * ( k ⌊k/2⌋ − ǫ) mpw . This bound is somewhat weaker than the one in Theorem 11, which is natural since modular pathwidth is more restrictive than clique-width. As we see in Section 6, however, this bound is tight. We complete this section by performing the same reduction with the ETH, rather than the SETH, as a starting point. Under this weaker assumption we prove that k-Coloring does not admit an algorithm running in n o(mpw) , even when k = O(log n), which implies that the problem does not admit an algorithm running in 2 o(k·mpw) . This is tight, and also applies to clique-width (Lemma 1). In this way, our reduction gives an alternative proof that k-Coloring is unlikely to be FPT parameterized by clique-width, even in instances with a logarithmic number of colors. As in Theorem 11, we begin our reduction from a q-CSP-B instance, where the alphabet size B is equal to the base of the exponential in our lower bound. The intuition will be that the "important" vertices of the bags in a modular tree decomposition of our graph will correspond to classes of ⌊k/2⌋ true twin vertices. The set of ⌊k/2⌋ colors used to color them will encode the value of one variable of the original instance. We construct an independent set S j with one vertex for each element of S. We construct an OR(S j ) gadget on the set S j . 3. For each j ∈ {0, . . . , m − 1}, each satisfying assignment a for the constraint c j , and each variable x i appearing in c j we do the following:

SETH-based Lower Bound
a. We construct a set U j,a i of ⌈k/2⌉ vertices. b. Suppose a assigns value v to x i . For each color c ∈ {1, . . . , k} \ T (v) we select a vertex of U j,a i . We construct a (1 → c)-implication gadget from the vertex representing a in S j to this vertex of U j,a i . c. We connect all vertices of U j,a i with all vertices of V i .

◮ Lemma 16. If φ is a satisfiable q-CSP-B instance, then G(φ) admits a proper list coloring.
Proof. Suppose we have a satisfying assignment to φ. If the assignment gives value v i to variable x i , we use the colors of T (v i ) to color V i , in some arbitrary way. For each constraint c j , the assignment gives values to the variables of c j consistent with some satisfying assignment a of the constraint. We give color 1 to the vertex of S j representing a, and use colors 2, 3 to color the rest of S j . The only implication gadgets activated in this way are those incident on the vertex representing a; we give to their other endpoint, which is found in U j,a i , the only viable color. For all other a ′ = a we give to vertices of U j,a ′ i a color that we used in U j,a i . We claim that this is a proper coloring because the colors we used in U j,a i are {1, . . . , k} \ T (v i ), while the colors we used in V i are T (v i ), hence all edges between V i and U j,a i are properly colored for any a. ◭ ◮ Lemma 17. If G(φ) admits a proper list coloring, then φ is a satisfiable q-CSP-B instance.
Proof. Suppose that we are given a proper list coloring c : V → {1, . . . , k} for G. We extract an assignment for φ as follows: for each i ∈ {1, . . . , n}, let c(V i ) be the set of colors the coloring uses for V i . Since V i is a clique, this set includes ⌊k/2⌋ elements. We therefore set x i = T −1 (c(V i )) and this is well-defined since T is a one-to-one correspondence between {1, . . . , B} and subsets of {1, . . . , k} of size ⌊k/2⌋. We argue that this assignment is satisfying. Suppose to the contrary that it does not satisfy a clause c j . Because of the OR gadget, one of the vertices of S j has received color 1, say the vertex that represents the satisfying assignment a of c j . This assignment must disagree with our assignment in some variable that appears in c j , say the variable x i . Suppose that a assigns value v ′ to x i , while our assignment has given value v to x i .
Because of the implication gadgets incident on the vertex representing a in S j , we have that U j,a i uses the ⌈k/2⌉ colors of {1, . . . , k} \ T (v ′ ). However, V i uses the ⌊k/2⌋ colors of Proof. We first observe that, for all i ∈ {1, . . . , n}, the vertices of V i are true twins with the same list ({1, . . . , k}). For the purposes of computing the modular pathwidth of the graph, we can therefore retain a single vertex of each V i . We now delete these n vertices, and what remains is to show that the graph we obtain has pathwidth O(1). By Lemma 8 we can replace all implication gadgets by simple edges, and this will not decrease the pathwidth of the graph by more than a small constant. We observe that after removing the sets V i , the graph is disconnected, and we have one component for each j ∈ {0, . . . , m}. This component contains an OR(S j ) gadget, and the vertices of the sets U j,a i . However, all such vertices are now leaves, because each such vertex is connected to a unique vertex of S j and its other neighbors (the set V i ) no longer exist in the graph. If we remove such leaves the graph that remains is simply the OR(S j ) gadgets, which form paths. Hence, the graph obtained after removing the sets V i has constant pathwidth. ◭ Theorem 15. The proof now follows from the described construction, Theorem 2, and Lemmata 3, 16, 17, 18 in a same way as the proof of Theorem 11. ◭ Theorem 19. The construction we use to prove Theorem 19 is identical to the construction presented in the previous section. We change, however, our starting point: given an nvariable 3-SAT instance, we will construct a q-CSP-B instance where q = 3 and B = n.

ETH-based Lower Bound
More specifically, given an instance φ 1 of 3-SAT with n variables, our first step will be to construct an instance φ 2 of q-CSP-B. We assume without loss of generality that n is a power of 2. We partition the variables of φ into t sets V 1 , . . . , V t , such that each set contains at most log n variables. Therefore t = ⌈n/ log n/⌉. For each group of variables V i we define a CSP variable x i that will take values in {1, . . . , n}. We make a one-to-one correspondence translation between values of x i and truth assignments for the variables of V i . We now construct the constraints of φ 2 as follows: for each clause c j of φ 1 , suppose that c j involves three variables, from the groups V j1 , V j2 , V j3 . We construct a constraint c ′ j involving the variables x j1 , x j2 , x j3 . The satisfying assignments of this constraint are all assignments whose translation satisfies c j . It is not hard to see that the construction of φ 2 can be done in polynomial time, and that we produce an equivalent instance. We

Algorithms
We present two algorithms establishing that the lower bounds of Sections 4,5 are essentially tight. Though both algorithms are based on standard techniques, we remark that the algorithm for clique-width requires some extra effort to obtain a DP of the promised size.

Clique-width algorithm
Our algorithm is based on standard DP. Its basic idea is that a partial solution is characterized by the set of colors it uses to color a set of vertices that share the same label. This leads to a DP table of size (2 k − 1) cw , by observing that for any non-empty label set, any viable partial solution will use at least one color, hence there are 2 k − 1 possible subsets of {1, . . . , k} to consider. To improve this to (2 k − 2) cw , which would match the lower bound of Theorem 11 we need a further idea which will allow us to also rule out the set that uses all k colors. Let t be a node of the binary tree representing the clique-width expression of G, and let V i t be the set of vertices that have label i ∈ {1, . . . , cw} in the labeled graph G t produced by the sub-expression rooted at t. We will say that V i t is a live label set if there exists an edge in G that is incident on a vertex of V i t and does not appear in G t . In other words, a label set is live if there is a join operation that involves its vertices which has not yet appeared in t. The main observation is that live label sets cannot use all k colors in a valid partial solution, since then the subsequent join operation will fail. Non-live label sets, on the other hand, are irrelevant, since if the coloring is already valid for such a set it is guaranteed to remain valid. Our DP algorithm will therefore keep track of the partial colorings only of live label sets, and thus produce a DP table of size (2 k − 2) cw . In this sense, our DP algorithm is slightly non-standard, as part of its procedure involves "looking ahead" in the graph to determine if a label set is live or not. What remains is the problem of implementing the DP so that it takes time linear in the table size; this is handled using the techniques introduced in [2,30].
◮ Theorem 20. There is an algorithm which, given a graph G, an integer k, and a clique- Proof. We assume we are given a binary tree representing the clique-width expression that produces G. For each node t let ℓ(t) be the number of live labels in the graph G t , that is, the graph produced by the sub-expression rooted at t. A label i is live at G t if the set V i t of vertices that have this label in G t is non-empty, and there is an edge in G that is incident on a vertex of V i t and does not appear in G t . Clearly, ℓ(t) ≤ cw. Let C := 2 {1,...,k} \ {∅, {1, . . . , k}} be the set of all interesting sets of colors, that is, all sets of colors except the empty set and the set that contains all colors. For each node t of the tree we will maintain a dynamic programming table A t : C ℓ(t) → N. The meaning of such a table is the following: its input, describes the signature of a partial solution, that is, a valid k-coloring of G t , in the sense that it defines for each live label i the set of colors used in a partial coloring to color the vertices of V i t . Given such a signature the table stores the number of colorings of G t that agree with this signature. The reason we select to solve the more general counting problem is that this allows us to adopt the techniques of [30] to speed up that computation of the table in union nodes. To ease notation, we will interpret signatures S ∈ C ℓ(t) as functions which, given a live label return the set of colors used in this label set in signature S.
Before proceeding, let us explain why this table, whose size is O * (2 k − 2) cw stores sufficient information to solve the problem. First, it is not hard to see that it is not a problem that A t does not store information regarding empty label sets, hence it is not a problem that ∅ ∈ C. Second, if a partial solution uses all colors {1, . . . , k} to color a live label set V i t , it is clear that this solution cannot be extended to a coloring of the whole graph, as the vertices of V i t will later acquire a new common neighbor (since i is live), for which no color is available. Hence, not considering such solutions for live labels is also not a problem. Finally, if a partial solution represents valid k-colorings of G t , vertices belonging to a non-live label have all their edges properly colored. Since the label is non-live, these vertices already have their incident edges properly colored in G, A t does not need to store information on non-live labels, apart from the fact that the coloring of G t is valid.
Given the above definition of the table we will now proceed inductively on its calculation. For introduce nodes that construct a vertex with label l ∈ {1, . . . , cw} there is only one live label, so for each color c ∈ {1, . . . , k} the table A t has an entry A t [{c}] = 1.
For a join node t with child node t ′ where the join operation is performed between labels i 1 , i 2 , for every signature S ∈ C ℓ(t ′ ) such that S(i 1 ) ∩ S(i 2 ) = ∅ we update the corresponding entry of A t ′ to 0. Then, if i 1 , i 2 are still live labels in t we simply copy A t ′ to A t . If i 1 has become non-live in t we set A t [S] = S1∈C A t ′ [S × S 1 ], that is, to compute the number of solutions that produce a signature S in t we consider all signatures S ′ in t ′ which extend S by giving a set of colors to label i 1 , and take the sum of the corresponding entries. We do a similar operation if i 2 , or both i 1 , i 2 become non-live.
For a rename node t with child node t ′ where the rename operation is performed from label i 1 to label i 2 , we have several cases. First, if i 1 was a non-live label in t ′ , then i 2 is also non-live in both t, t ′ . In this case, we simply copy the table A t ′ to A t . Second, if i 1 is live in t ′ , then i 2 is live in t. Now, suppose that i 2 is non-live in t ′ . This means that i 2 is empty in t ′ , so we can again copy A t ′ to A t replacing label i 1 with i 2 in every signature. Finally, the interesting case is when i 1 , i 2 are both live in t ′ , therefore i 2 is live in t. We have ℓ(t) = ℓ(t ′ ) − 1. We initialize A t to be 0 everywhere and then, for every entry of A t ′ we do the following: if A t ′ [S] = v we take the signature S ′ in t which sets S ′ (i 2 ) = S(i 1 ) ∪ S(i 2 ), and S ′ (i ′ ) = S(i ′ ) for i ′ = i 2 , and add to A[S ′ ] the value v, under the condition that S(i 1 ) ∪ S(i 2 ) = {1, . . . , k}. In other words, in order to calculate how many solutions give a set of colors to label i 2 in t, we consider all solutions in t ′ such that the union of colors used in i 1 , i 2 gives this set. As explained, we disregard signatures S for which S(i 1 ) ∪ S(i 2 ) = {1, . . . , k}, because such signatures do not represent solutions that can be extended to colorings of G, due to the liveness of i 1 , i 2 .
Finally, the most challenging part of this algorithm is how to handle a union node t with two children t 1 , t 2 . Here, we will need to transform the tables A t1 , A t2 in a form that will more easily allow us to combine the solutions, along the lines of the technique used in [30]. In particular, define two tables B t1 , B t2 : C ℓ(t) → N whose intended meaning is the following: the input is a signature S giving set of colors for every live label of t (note that some of these labels may be empty in t 1 or t 2 ); a partial solution in G t1 satisfies this signature if for each live label i of t the coloring uses a subset of S(i) to color V i t1 (and similarly for G t2 ). In other words, the difference between tables A, B is that in A the sets of colors given in the signature are exact, while in B they form upper bounds on the set of allowed colors that a partial solution may use in a label set. It is not hard to see that the size of B t1 , B t2 is O * (2 k − 2) cw , because once again we are only interested in live labels of t.
We now need to describe three steps: first, how we can convert A t1 , A t2 to B t1 , B t2 in time almost-linear in the size of the tables; second, how we can compute B t from B t1 , B t2 in the same time; third, how we can obtain A t from B t .
For the first part, we proceed inductively. Let ℓ = ℓ(t 1 ) be the number of live labels of t 1 , and suppose without loss of generality that these labels are [S ′ ], where S ′ is the signature that agrees with S everywhere, except it sets S ′ (i) = S(i) \ {j}. The correctness of this procedure follows directly from the definitions given above. Note that we have defined B t1 on signatures on live labels in t 1 , rather than signatures on live labels of t. However, the labels which are live in t but not t 1 are empty in G t1 , hence their coloring is irrelevant, and a version of B t1 that uses signatures on live labels of t can easily be obtained. We obtain B t2 with the same algorithm. Finally, to convert B t to A t we use the reverse of the procedure we described. We again define B i,j

Modular Treewidth Algorithm
For modular treewidth, we remark that k-Coloring for this parameter can be seen as an equivalent version of Multi-Coloring parameterized by treewidth. In Multi-Coloring, each vertex v has a demand b(v), and we are asked to assign b(v) distinct colors to each vertex so that neighboring vertices have disjoint colors (see e.g. [3]). In our context, the vertex representing a class of b true twins corresponds to a vertex with demand b.
◮ Theorem 21. There is an algorithm which, given a graph G, an integer k, and a modular tree decomposition of G of width mtw, decides if G is k-colorable in time O * k ⌊k/2⌋ mtw .
Proof. The algorithm uses standard DP techniques, so we will sketch some of the details. We assume that we are given the graph G t , where each twin class is represented by a single vertex (otherwise, G t can be computed in polynomial time). Furthermore, we can assume that G did not contain any false twins, because if for two vertices u, v we have N (u) = N (v) then deleting one of the two vertices does not affect the k-colorability of the graph. Hence, every vertex of G t represents a class of true twins in G. For each vertex v of G t we define b(v) as the size of the class of true twins that contains v in G (therefore, for vertices without twins in G we have b(v) = 1). We observe that max v∈V b(v) ≤ k, because otherwise there exists a clique of size k + 1 and we can immediately reject.
We will now solve Multi-Coloring on G t with the demands b(v) we defined. We recall that the goal is to assign to each vertex v a subset C(v) ⊆ {1, . . . , k} with |C(v)| = b(v) so that for any edge (u, v) ∈ E we have C(v) ∩ C(u) = ∅.
Our algorithm will, in every bag consider all possible assignments of b(v) colors to each vertex v of the bag. We reject partial solutions for which two neighbors in the bag have nondisjoint assignments. It is not hard to see how this table can be maintained with standard DP techniques in time linear in its size, if we are working with a nice tree decomposition [1]. Let us therefore bound the size of the table. For a vertex v with demand b(v) our algorithm will consider all k b(v) possible colorings. However, k b(v) ≤ k ⌊k/2⌋ , we therefore have that the size of the table is at most k ⌊k/2⌋ mtw . ◭ 7

Conclusions -Open Problems
We have given tight bounds for k-Coloring parameterized by clique-width, complementing previously known bounds for treewidth. A natural question is now how robust these bounds are, especially in the context of approximation. Specifically, does there exist a constant factor approximation algorithm for k-Coloring running in O * ((k − ǫ) tw ) or O * (2 k − 2 − ǫ) cw ? Current knowledge cannot even rule out the existence of such algorithms with a small additive approximation error and this area is still largely unexplored.