An Exact Algorithm for the Generalized List $T$-Coloring Problem

The generalized list $T$-coloring is a common generalization of many graph coloring models, including classical coloring, $L(p,q)$-labeling, channel assignment and $T$-coloring. Every vertex from the input graph has a list of permitted labels. Moreover, every edge has a set of forbidden differences. We ask for such a labeling of vertices of the input graph with natural numbers, in which every vertex gets a label from its list of permitted labels and the difference of labels of the endpoints of each edge does not belong to the set of forbidden differences of this edge. In this paper we present an exact algorithm solving this problem, running in time $\mathcal{O}^*((\tau+2)^n)$, where $\tau$ is the maximum forbidden difference over all edges of the input graph and $n$ is the number of its vertices. Moreover, we show how to improve this bound if the input graph has some special structure, e.g. a bounded maximum degree, no big induced stars or a perfect matching.

The notion L(p, q)-labeling (for integers p ≥ q ≥ 1) is inspired by the frequency assignment problem in telecommunication. We look for a labeling of the vertices G with integers, so that the labels of adjacent vertices differ by at least p and the labels of the vertices with a common neighbor differ by at least q. The best studied case is L(2, 1)-labeling, inroduced by Griggs and Yeh [14]. We refer the reader to surveys on this problem by Yeh [29] and Calamoneri [6]. The list version of this problem has been studied for example by Fiala and Škrekovski [12].
Notice that (list) L(p, q)-labeling of a graph G is equivalent to an instance (G 2 , Λ, t) of the generalized list T -coloring, where G 2 is a square of G, Λ(v) is the list of labels available for v (or the set of all colors in a non-list case) and t(e) = {0, 1, .., p−1} for e ∈ E(G) and t(e) = {0, 1, .., q−1} for e ∈ E(G 2 )\E(G).

Channel assignment
Channel assignment problem is a generalization of L(p, q)-labeling. Its instance is a pair (G, ω), where G is a graph and ω is a weight function ω : E(G) → N. We ask for such a labeling f of vertices of G with natural numbers, that |f (v) − f (u)| ≥ ω(uv) for any uv ∈ E(G). We refer the reader to the survey by Král' [23] for more information about this problem.
For an instance (G, ω) of the (list) channel assignment problem, we have an equivalent instance (G, Λ, t) of the generalized list T -coloring, where Λ(v) is the list of labels available for v (or the set of all labels in a non-list case) and t(e) = {0, 1, .., ω(e) − 1} for e ∈ E(G).

T -coloring
The last graph coloring model listed here is so-called T -coloring. It has been first introduced by Hale [15] as frequency constrained channel assignment problem. The instance of T -coloring is a pair (G, T ), where G is a graph and T is a subset of natural numbers. We ask for such a labeling f of vertices G with natural numbers, that |f (u) − f (v)| / ∈ T for all uv ∈ E(G). Unlike channel assignment problem, T -coloring allows the case when forbidden differences do not form an interval. It is interesting to mention that for T = {0, 7, 14, 15} we obtain the model for interferences for the UHF transmitters (see McDiarmid [25]). The list version of this problem has been studied for example by Alon and Zaks [1].
To obtain an instance of the generalized list T -coloring, which is equivalent to given instance of the (list) T -coloring, we have to set t(e) = T for every e ∈ E(G).
All the problems mentioned above are NP-complete for general graphs and remain so for many restricted graph classes. Therefore the generalized list Tcoloring problem is NP-complete as well. When dealing with an NP-hard problem, there is little hope to design an exact algorithm, running in polynomial time. Therefore we try to design exact exponential algorithm with exponential factor in the complexity bound as small as possible.
Many such algorithms have been presented for the best-studied of the mentioned problems, i.e. graph coloring (see for example Lawler [24], Eppstein [9], Byskov [5]). Currently best exact exact algorithm for graph coloring was presented by Björklund et al. [3] and runs in time O * (2 n ) 1 .
An instance of channel assignment is called -bounded if ω(e) ≤ for all e ∈ E(G). The first exact algorithm for the channel assignment problem with time complexity O * ((2 +1) n ) was proposed by McDiarmid [26]. Then Král' [22] presented the algorithm running in time O * (( + 2) n ). This bound was beaten by Cygan and Kowalik [8], who showed the algorithm with time complexity O * (( + 1) n ). It still remains a great challenge to design an exact algorithm for the channel assignment problem with time complexity bounded by O * (c n ) for c being a constant (or to prove that there is no such algorithm, under standard complexity assumptions).
To our best knowledge, T -coloring itself has not raised any attention from the exact algorithms community so far. In this paper we present a method to solve the generalized T -coloring problem. Namely, we adapt the algorithm for the L(2, 1)-labeling presented by Junosza-Szaniawski et al. [19]. We focus on the case when t(e) = {0} for at least one one edge e (in other case we obtain a well-studied list coloring problem, which can be solved in time O * (2 n ) by adapting the algorithm by Björklund et al. [3]). The time and space complexity of our algorithm is bounded by O * ((τ +2) n ), where τ is the maximum forbidden difference over all edges of the input graph.
Although the algorithm by Cygan and Kowalik [8] is designed for the channel assignment problem, it can be be adapted to solve the generalized T -coloring problem. Its time complexity is then the same as the time complexity of our algorithm. Their approach uses a well-known inclusion-exclusion principle and fast zeta transform. However, we believe that the method presented in this paper is interesting on its own and can be used to solve many different problems.
In section 3.1 we show that the complexity bound of our algorithm can be improved if the input graph has some special structure. We consider bounded degree graphs, K 1,d -free graphs (for integer d) and graphs having a clique factor, i.e. a spanning subgraph whose every connected component is a clique with at least 2 vertices.

Preliminaries
An instance of a the generalized list T -coloring problem is a triple (G, Λ, t), where G = (V, E) is a graph, Λ : V → 2 N is a function that assigns to each vertex a set (list) of permitted labels and t : E → 2 N∪{0} is a function that assigns to each edge a set of forbidden differences over that edge. We assume that 0 ∈ t(e) for any e ∈ E. We aim to find a mapping ϕ : V → N, satisfying the following conditions: Such a function is called a proper labeling.
Let Λ max denote the maximum value in the set v∈V Λ(v). We say that an instance of the generalized list T -coloring problem is τ -bounded if max{ e∈E t(e)} ≤ τ . In this paper we focus on the case when τ ≥ 1.
For a vector w and a set of vectors A let A w denote the set {v : wv ∈ A} (by wv we denote the concatenation of vectors w and v). Vector w is also called a prefix of a vector wv.

The algorithm
Let (G, Λ, t) be an instance of the general list T -coloring problem.
We assume that the graph G is connected -in other case we may label each of its connected components separately. For the graph G = (V, E) we consider some ordering v 1 , v 2 , .., v n of the vertices in V (this ordering will be specified later).
Our strategy is to construct a labeling of G in a way similar to one presented by Junosza-Szaniawski et al. [19]. ., k} such that : In other words, this encoding of partial k-channel assignments unifies the sets of vertices labeled with labels not exceeding k − τ , since they do not interfere with the next label to be assigned, which is k + 1. Moreover, 0 indicates an unlabeled vertex, which can be labeled with label k + 1, while0 indicates an unlabeled vertex with label k + 1 blocked.
The table below shows the values of ⊕ for different inputs (entry "−" means that the value is undefined) . τ τ + 1 We generalize ⊕ to vectors coordinate-wise, i.e.

For two sets of vectors
Let P ⊆ {0, 1} n be the set of the characteristic vectors of all independent sets of G. Formally, p ∈ P if and only if there is an We shall use T [k] ⊕ P to find T [k + 1].

For a vector
n denote a vector in τ + 1 n such that:

Analogously, for a set of vectors
and p ∈ P such that b ⊕ p (k) = b . Let ϕ be a partial k-labeling corresponding to b and X be an independent set encoded by p.
Note that since b⊕p is defined, the labeling ϕ could be extended by labeling every vertex from X with label k + 1, obtaining a proper partial (k +1)-labeling ϕ . Moreover, ϕ can be extended to a proper partial (k + 2)-labeling by labeling a vertex v i with label k + 2 if and only if: • there is no neighbor v j of v i , which is labeled by ϕ such that In the remaining cases we have To sum up, one can observe that b corresponds to a partial (k + 1)-labeling ϕ such that: On the other hand, let b ∈ T [k + 1]. Let ϕ be a partial labeling corresponding to b and ϕ be partial labeling defined as follows: in G and therefore its characteristic vector p belongs to P . Note . This finishes the proof.
Moreover, observe that if we set T [0] := {0 n }, the following holds: To compute T [k] ⊕ P efficiently we will partition the vertex set into subsets of a bounded size (they shall be defined later). Let Then we shall process each of the subsets at once, in the following manner (in each step we consider the first set from S and delete it from S).
We can rewrite this formula in the following way.
The computation can be omitted whenever the prefix a cannot To show where the advantage of processing whole sets S i at once, consider the following example. If we process each vertex separately, at each step we have to consider τ + 2 prefixes (0, 1, . . . , τ + 1).
Suppose now that our input graph has a perfect matching S. Then, by processing two adjacent vertices at once, we can omit all prefixes in the form aa for a ∈ {2, 3, . . . , τ + 1}. This is because each of values in {2, 3, . . . , τ +1} describes a single label and no two adjacent vertices can get the same label. Therefore instead of considering all (τ + 2) 2 prefixes in [τ + 1] × [τ + 1] (as we would do when processing each vertex separately), we have to deal with (τ + 2) 2 − τ prefixes.
One can observe that the choice of the partition S is crucial for this approach and will be discussed in Section 3.1.
To estimate the computational complexity of this approach, we have to calculate the number of pairs a, p, for which there exists at least one b such that b ⊕ p = a. Notice that if we fix a, then p i = 1 whenever a i = τ + 1 (otherwise p i = 0). Therefore the number of such pairs a, p is equal to the number of of prefixes a Preparing the recursive calls and combining their results takes only time linear in the sizes of the tables T [k] and P . The size of P is at most n · 2 n bits and the size of T [k] is at most n · r i=1 f i bits. We arrive at the following recursion for the running time (in every step we remove S 1 from S and the index of every remaining set in S is reduced by one, so that the first one is still called S 1 ): One can verify by induction that this recursion is satisfied by the following formula: F (n) = O n 3 · 2 n + n 3 · r i=1 f i . By induction hypothesis we have:

Thus we obtain
The space complexity of the algorithm is bounded by the total size of sets T [k] and the set P . Therefore it is bounded by the same expression as computational complexity, i.e. O * 2 n + r i=1 f i .

Complexity bounds
In this section we shall consider several possible partitions S of the vertex set and use them to bound the complexity of the algorithm with functions of various invariants of G. Using formula (1) we obtain the bound for the complexity F (n) = However, we can improve it by a more careful construction of the partition S.

Partitions into stars
Let S = {S 1 , S 2 , . . . , S r } be a partition of the vertex set of G, such that for any i = 1, 2, . . . , r we have s i ≥ 2 and G[S i ] has a spanning subgraph, which is a star. We call such a partition a star partition of G. Note that every connected graph (with at least 2 vertices) has a star partition. Some ways of constructing star partitions will be described further in this section. Hence the number of possible s i -element prefixes of a vector a in This combined with formula (1) gives us the following bound on the complexity: Note that the value of r−1 i=1 (2(τ + 2) s i −1 + τ (τ + 1) s i −1 ) is maximized if all s i 's are equal. Consider this case and let d := s 1 = . . . = s r−1 . Note that d ≤ n r−1 and therefore r − 1 ≤ n/d. Thus we obtain the following: By analyzing the derivative of the function α τ (d) = (2(τ +2) d−1 + , one can observe that for every fixed τ there exists d 0 such that α τ (d) is decreasing for d < d 0 and increasing for d > d 0 . Since d ≤ D + 1, we can bound the value of α τ (d) by max(α τ (2), α τ (D + 1)). Having in mind that τ ≥ 1, we obtain the following solution.
The remainder of this section is devoted to various ways of constructing the initial star factor S.
Remark. Notice that a star partition can be constructed from a spanning tree of our input graph. Let us consider T being a spanning tree of G. Let v and u be, respectively, the end-vertex and its neighbor on a longest path in T . If T is not a star, then all neighbors of u in T except exactly one are leaves in T . We include the set S i consisting of u and all its neighbors which are leaves in T to our partition S. Then we proceed recursively with the tree T \ S i .
If T is a star, we set S r = V (T ) and finish. Moreover, notice that if we construct our star partition using spanning tree T , in a way described, each set S i (for i ∈ {1, 2, . . . , r− 1}) has at most ∆(T ) elements, while S r has at most ∆(T ) + 1 elements.
Observe ∆(T ) ≤ ∆(G) for any spanning tree T of G, we obtain the following corollary.
The following theorem shows that we may obtain a star partition consisting of smaller stars (and therefore a better bound on the complexity of the algorithm). We can improve this bound for graphs with no big induced stars.
Let d be number, such that G has no induced K 1,d star (i.e. it is a K 1,d -free graph).
The simplest and probably best-studied class with such a property are claw-free graphs (i.e. K 1,3 -free graphs, see for example Brandstädt et al. [4] for more information). Sumner [27] showed that every claw-free graph with even number of vertices has a perfect matching. Therefore it has a star partition with every set of cardinality 2 (but at most one set with cardinality 3). This observation gives us the following bound. However, we may obtain a similar improvement for K 1,d -free graph for different d.
then x is not a leaf, since we assumed that G has at least d + 1 vertices. Therefore the set We shall recursively transform our spanning tree T using one of the following transformations.  Figure 2).  Figure 3).
Notice that if none of the above transformations can be applied Having such a partition, we obtain the following complexity bound.
Recall that star partitions consisting of small stars yield lower complexity bound of the algorithm. Therefore, if we want to construct them using a spanning tree, the maximum degree of such a tree should be lowest possible. However, deciding if the input graph has a spanning tree with maximum degree at most k is NP-complete for every k ≥ 2 (see Garey, Johnson [13]).

Partitions into cliques
Another subgraphs in the input graph may also prove useful in constructing the partition S. Hell and Kirkpatrick [17] studied the problem of partitioning the vertex set of a graph into cliques. Let clique packing be a subgraph whose every connected component is a clique with at least 2 vertices. Let ρ(G) denote the order of the largest (in terms of the number of vertices) clique packing in G.
Note that a matching is a special case of a clique packing of G.
Therefore, if m is the size of maximum matching in G, we have: Let G be a graph, such that |V (G)| = ρ(G) and let H be its largest clique packing. A clique partition is a partition of V (G) into vertex sets of connected components of H. In other words, every set of the clique partition induces a clique in G.
Hell and Kirkpatrick [17] presented an elegant structural theorem allowing to compute the value of ρ(G). Moreover, they described graphs G having a clique partition. Let p be a number of components isomorphic to K 2 and q be the number of components isomorphic to K 3 . Clearly 2p + 3q = ρ(G).
Let S = {S 1 , .., S r } be a partition of V (G), such that the sets S i for i ≤ p correspond to K 2 -components in H and the sets S i for p ≤ p + q correspond to K 3 -components of H . The remaining sets S i for i > c contain the remaining vertices of G, one vertex per set.
Let us consider a subgraph G[S i ] for some i ≤ p + q. Since it is a clique, each vertex has to be labeled with a different label. Therefore in any prefix of a vector from T [k]⊕P , corresponding to the vertices from S i , each element from {2, .., τ + 1} may appear at most once.
For the remaining sets S i (containing single vertices, i.e. for i > p + q), there are τ + 2 possible prefixes of length 1. Hence the number of possible s i -element prefixes of a vector a in T [k] ⊕ P is at most for i ≤ p τ 3 + 3τ 2 + 8τ + 8 for p < i ≤ p + q τ + 2 for i > p + q.
Again, using formula (1), we obtain the following.