On Computational Aspects of Greedy Partitioning of Graphs

. In this paper we consider a problem of graph P -coloring consisting in partitioning the vertex set of a graph such that each of the resulting sets induces a graph in a given additive, hereditary class of graphs P . We focus on partitions generated by the greedy algorithm. In particular, we show that given a graph G and an integer k deciding if the greedy algorithm outputs a P -coloring with a least k colors is NP - complete for an inﬁnite number of classes P . On the other hand we get a polynomial-time certifying algorithm if k is ﬁxed and the family of minimal forbidden graphs deﬁning the class P is ﬁnite. We also prove co NP -completeness of the problem of deciding whether for a given graph G the diﬀerence between the largest number of colors used by the greedy algorithm and the minimum number of colors required in any P -coloring of G is bounded by a given constant. A new Brooks-type bound on the largest number of colors used by the greedy P -coloring algorithm is given.


Introduction and Problem Statement
We are interested, specifically, in partitions of the vertex set of simple, finite and undirected graph in which each of the resulting sets induces a graph belonging to a given additive, hereditary class of graphs.A class P of graphs is called hereditary if for every graph G in the class all induced subgraphs of G belong to P, and it is called additive if for each graph G all of whose components are in P it follows that also G is in P. All classes of graphs considered in this paper are additive and hereditary.It is well known that if a class P is additive and hereditary, then it can be characterized by the family F (P) of connected minimal forbidden graphs consisting of graphs G such that G / ∈ P but each proper induced subgraph of G belongs to P (for graphs G and H we write H ≤ G if G contains H, that is, if there exists an induced subgraph of G isomorphic to H).The family F (P) should be distinguished from the family of minimal graphs in the class P denoted by min ≤ P which consists of all graphs in P that do not contain any graph from P as a proper induced subgraph.
Returning to the notion of partitions, a P-coloring of a graph G = (V, E) is a partition (V 1 , . . ., V k ) of its vertex set V (G) such that each graph G[V i ] induced by a color class V i with i ∈ {1, . . ., k} belongs to the class P. Equivalently, every P-coloring can be seen as a partition into P-independent sets, where a set of vertices is P-independent if the graph induced by the vertices of that set belongs to P. For example, if F (P) = {K 2 }, then we deal with the classical proper coloring in which we simply partition the vertex set into independent sets.The smallest k for which there exists some P-coloring of a graph G with k colors is called the P-chromatic number of G and it is denoted by χ P (G).
The greedy P-coloring algorithm (for brevity, we say the greedy algorithm) colors the vertices of a graph G, one by one, in some order (v 1 , . . ., v n(G) ) that is independent of the algorithm.Following the order, the algorithm colors each vertex v i using the smallest color such that its assignment to v i results in a Pcoloring of the graph induced by {v 1 , . . ., v i } (throughout the paper we assume that P is a class for which deciding the membership in P is polynomial).A Pcoloring produced by the greedy algorithm is called a Grundy P-coloring.Note that every Grundy P-coloring of a graph G with k colors can be seen as a surjection ϕ : V (G) → {1, . . ., k}.The number of colors used by the greedy algorithm strongly depends on vertex ordering; with the largest number of colors denoted by Γ P (G) and called the P-Grundy number of a graph G.By interpolation theorems of Cockayne et al. [7] the number of colors used by the greedy algorithm can take any value from χ P (G) to Γ P (G).For proper coloring, the notion of the Grundy number is usually attributed to Christen and Selkow [6].Considering generalization of this notion we focus on the following problems.

Grundy P-Coloring
Input: A graph G and positive integer k.
Question: Does G have a Grundy P-coloring with at least k colors?
Question: Does G have a Grundy P-coloring with at least k colors?Both problems have been intensively studied in context of proper coloring.Goyal and Vishwanathan [10] and Zaker [17] proved that for proper coloring the former problem is NP-complete.Does it also hold for every nontrivial fixed P? On the other hand, for proper coloring, by finite basis theorem of Gyárfás et al. [11] the latter problem admits a polynomial-time solution (for related concepts see Zaker [17], Borowiecki and Sidorowicz [3]).Determining the Grundy number is known to be polynomial, e.g., for trees [13] and P 4 -laden graphs [1].For some classes of graphs, e.g., interval graphs [16], complements of as well bipartite as chordal graphs [12] and {P 5 , K 4 − e}-free graphs [5], polynomial-time constantfactor approximation algorithms are known.For a deeper discussion on approximability and other aspects of the Grundy number we refer to [10,14,15].
In Sect. 3 of this paper we give a polynomial-time certifying algorithm for Grundy (P, k)-Coloring when F (P) is finite (this strongly relies on structural properties related to critical partitions introduced in Sect.2).In Sect. 4 we show that Grundy P-Coloring is NP-complete for every class P such that F (P) = {K p } with p ≥ 3, while in Sect. 5 we prove that for every integer t ≥ 0 the problem of the membership in H(P, t) = {G | Γ P (G) − χ P (G) ≤ t} is coNPcomplete.We conclude the paper with a new Brooks-type bound on the P-Grundy number generalizing and strengthening the bounds given in [2,18].

Motivation, Critical Partitions and Minimal Graphs
Describing the structural properties of critical partitions we step towards a general technique that benefits from the knowledge of polynomial-time approximation algorithms solving diverse optimization problems for inputs in certain graph classes.We use these algorithms to develop new polynomial-time approximation algorithms that are applicable to all inputs in carefully constructed superclasses of the above-mentioned classes and preserve the order of original approximation ratios.More formally, let C(P, k) denote a class of graphs Pcolorable with at most k colors.Consider a minimization problem Π for which there is a polynomial-time δ(n)-approximation algorithm A 1 for inputs in P, and assume that (V 1 , . . ., V k ) is an arbitrary P-coloring of G ∈ C(P, k).Moreover, suppose that there exists a polynomial-time algorithm A 2 that, given the outputs of A 1 for each of the k instances G[V i ], gives a solution of Π for G.A solution that admits such an algorithm A 2 is called compositive (note that the solutions of various domination and coloring problems are trivially compositive).We do not know, however, any simple realizations of this three-phase approach, since in general the P-coloring problem is computationally hard [4] (with a sole exception of proper 2-Coloring) and our knowledge of F (C(P, k)) is very limited.This directs our attention to a subclass G(P, k) of C(P, k), which consists of all graphs for which Γ P (G) ≤ k.Since P ⊂ G(P, k) ⊂ C(P, k) for every k ≥ 2, the algorithm PH that follows the above defined three phases and uses greedy P-coloring in the first phase, works for all inputs in an extension G(P, k) of an arbitrary class P and has an approximation ratio of the same order as A 1 on P. Proposition 1.If Π admits a polynomial-time δ(n)-approximation in P and its solutions are compositive, then PH is a polynomial-time We say that a subset U of the vertices of a graph G is strongly The above proposition reveals the importance of specific bipartition of the vertex set in which both parts have certain coloring or domination properties.We focus on how they come into play in graphs that are minimal with respect to the P-Grundy number under taking induced subgraphs.For k ≥ 1 by U(P, k) we denote the class of graphs G for which , where I denotes the class of all graphs.In what follows C k (P) stands for the family of minimal graphs in the class U(P, k), that is, the graphs for which Γ P (G) = k and Γ P (G − v) < k, where v is an arbitrary vertex of G.Note that C 1 (P) = {K 1 }, C 2 (P) = F (P) and that forbidding all graphs in C k (P) defines G(P, k − 1); more formally C k (P) = F (G(P, k − 1)).Minimal graphs play a crucial role in the greedy coloring process; in fact they determine the number of colors used in the worst case, and they characterize classes G(P, k).For proper coloring the classes G(P, 2) and G(P, 3) were characterized by Gyárfás et al. [11] who proved that C 3 (P) = {K 3 , P 4 } and listed all 22 graphs in C 4 (P).
The key notion in our analysis of minimal graphs is a class F(P, k) consisting of all graphs G for which there exists a partition (I, C) of V (G) such that I is nonempty, P-independent and strongly P-dominating in G, and Example 1.Consider the graphs G 1 , . . ., G 4 in Fig. 1 and the class P for which F (P) = {K 3 }.The graphs G 1 and G 2 are the elements of C 3 (P); their Grundy P-coloring with 3 colors can be easily obtained using Proposition 2 with black vertices forming the set I. Additionally, if we denote by C the set of white vertices, then we get a critical partition (I, C).It is not hard to verify that deleting any vertex results in the P-Grundy number equal to 2. The graphs G 3 and G 4 belong to F(P, 4), since they admit critical partitions with black and white vertices forming the sets I and C, respectively.Indeed, white vertices induce G 1 or G 2 , while black ones do not induce K 3 which means that I is P-independent.To see that I is strongly P-dominating observe that each white vertex belongs to a triangle with two black vertices.Again, it is not hard to see that G 3 ∈ C 4 (P).Consequently, since G 3 ≤ G 4 , we get G 4 ∈ F(P, 4) \ C 4 (P).
Theorem 1.If P is a class of graphs and k ≥ 2 is an integer, then Proof.Recall that C k (P) is defined as a family of minimal graphs in the class U(P, k) in which for every graph G it holds Γ P (G) ≥ k.If G ∈ F(P, k), then by the definition of the class F(P, k) and Proposition 2 we have Γ P (G) ≥ k.Thus F(P, k) ⊆ U(P, k).Consequently, for every graph H ∈ min ≤ F(P, k) there exists a graph H ∈ min ≤ U(P, k) such that H ≤ H .To finish the proof it remains to show that H ∈ F(P, k).Note that by minimality Naturally, the set I of the partition is nonempty, P-independent, and by the definition of Grundy P-coloring it is also strongly

The Complexity of Grundy (P, k)-Coloring
In what follows, we have to carefully distinguish between the two important cases of finite and infinite family F (P). Proposition 3. Let P be a class of graphs with finite F (P).If α and β denote the minimum and maximum order of a graph in F (P), respectively, then for every k ≥ 1 and every graph Proof.We use induction on k.The above inequalities are evidently fulfilled for k ∈ {1, 2}.Assume that the statement is true for the parameters smaller than k, where k ≥ 3. Let G ∈ C k (P).By Theorem 1 there exists a partition (I, C) of V (G) such that I is nonempty, P-independent and strongly P-dominating in G. Moreover G[C] ∈ C k−1 (P), which by the induction hypothesis implies ( Since V (G) = I ∪ C and I ∩ C = ∅, the proof will be completed by showing Consequently as a proper subset of I, the set I is P-independent in G and hence it is then I is strongly P-dominating in G by its definition, and it is P-independent in G by our earlier consideration.Finally, it follows that G ∈ F(P, k) and that G is a proper induced subgraph of G.This contradicts the fact that by Theorem 1 the graph G is minimal in In what follows we need the class T (P, k) of forcing (P, k)-trees.Namely, if k = 2, then T (P, 2) = C 2 (P).For k ≥ 3 let B be a graph in T (P, k − 1) and let F 1 , . . ., F n(B) be disjoint graphs, each being isomorphic to a graph in F (P).A graph G belongs to T (P, k) if it can be obtained from B, F 1 , . . ., F n(B) by an identification of each vertex of B with an arbitrary vertex of some graph F j , j ∈ {1, . . ., n(B)} in such a way that every F j takes part in exactly one identification.As the root of a forcing (P, k)-tree we take any vertex of B ∈ T (P, 2).It is known that all graphs in T (P, k) are minimal in F(P, k).Theorem 2. For every class P and every integer k ≥ 2, the set C k (P) is finite if and only if F (P) is finite.
Proof.If F (P) is finite, then simply observe that by Proposition 3 the set C k (P) is finite, too.Now, suppose to the contrary that F (P) is infinite and that for some k the set C k (P) is finite.Since C 2 (P) = F (P), it remains to consider k ≥ 3. Let n * be the largest order of a graph in C k (P) and let F ∈ F (P) be a graph such that n(F ) > k−1 √ n * .Note that by the finiteness of C k (P) and the infiniteness of F (P) such a number and such a graph always exist.Next, consider T k ∈ T (P, k) constructed in k − 1 steps, starting with T 2 = F , and such that for each step i ∈ {2, . . ., k − 1}, in which we obtain T i+1 , it holds The above finite basis theorem allows for the proof of the following result on the computational complexity of Grundy (P, k)-Coloring.Theorem 3. If P is a class with finite F (P) and k > 0 is a fixed integer, then Grundy (P, k)-Coloring admits a polynomial-time certifying algorithm.
Proof.For a fixed k by Theorem 2 the number of graphs in C k (P) is finite.Moreover, checking whether a graph H of order p is an induced subgraph of a given graph G of order n can be done by brute force in O(n p ) time.Since for finite F (P) by Proposition 3 the order of any graph in C k (P) is bounded from above by β k−1 , we can check if H is contained in G in O(n β k−1 ) time.If G does not contain a graph in C k (P), then application of the greedy algorithm results in a Grundy P-coloring with at most k − 1 colors, while in the opposite case, i.e., when Γ P (G) ≥ k we get an induced subgraph (a Yes certificate) that can be used to force a Grundy P-coloring of G with at least k colors.
For the state-of-the-art survey on the computational complexity of coloring graphs with forbidden subgraphs, including certification, see Golovach et al. [9].

The Complexity of Grundy P-Coloring
In this section we prove that Grundy P-Coloring is NP-complete for every class P defined by F (P) = {K p } with p ≥ 3.In our proof we use a polynomialtime reduction from 3-Coloring of planar graphs with vertex degree at most 4 (for NP-completeness see Garey et al. [8]).In fact we need a slight strengthening of their result consisting in restricting the class to planar graphs with vertex degree at most 4, size m ≡ 1(mod r) and every vertex belonging to at least one triangle; the class of such graphs we denote by L(r) (the proof of this result is omitted due to a limited space).Theorem 4. For every fixed r ≥ 2, 3-Coloring is NP-complete in L(r).Theorem 5.For every class P such that F (P) = {K p } with p ≥ 3, Grundy P-Coloring is NP-complete.
In order to prove the above theorem we give Construction 1 and prove several lemmas.Let p ≥ 3, F (P) = {K p }, and let G be an instance of 3-Coloring in L(p − 1).We construct a graph G and calculate an integer k such that G has a Grundy P-coloring with k colors if and only if G has a proper 3-coloring.

Construction 1. First, we define the vertices of G . For each vertex
we define the edges of G .First, create all edges so that Q induces a complete graph.Then, for every edge e t ∈ E(G), t ∈ {1, . . ., m(G)} with endvertices v i , v j join the corresponding vertex x t with all vertices in U i , U j and W t , and create all edges so that U i ∪ W t and U j ∪ W t induce complete graphs.In what follows a graph induced in G by W t ∪ U i ∪ U j ∪ {x t } is denoted by X t,i,j and called the gadget corresponding to the edge e t .The construction is completed by setting k = m(G)/(p − 1) + 3.For an example of the construction see Fig. 2.

Property 1. Let X t,i,j be a gadget and let
(1) (2) (2) G G X 4,1,4 Q Fig. 2.An example of Construction 1 for F (P) = {K3}; the numbers in braces denote colors, while the lines in a drawing of G represent joins.
We say that in a P-colored graph H a set U ⊆ V (H) uses color if every vertex in U has color .

Lemma 1. If G has a proper coloring with 3 colors, then G admits a Grundy P-coloring with k colors.
Proof.Suppose that ϕ is a proper 3-coloring of G.In order to define the corresponding Grundy P-coloring ϕ of G we set ϕ (u) = ϕ(v i ) for all vertices u in the set U i corresponding to the vertex v i of G. Consequently, each set U i uses one of the colors in {1, 2, 3}, which is feasible since U is P-independent.Let X t,i,j be an arbitrary gadget in G .Since X t,i,j corresponds to the edge v i v j and ϕ is proper, the sets U i and U j use distinct colors, say a and b, respectively.Thus for every vertex w ∈ W t its colored neighbors in U i ∪ U j use colors in {a, b} and hence the color c ∈ {1, 2, 3} \ {a, b} is feasible for w.We set ϕ (w) = c.Following Construction 1, for every vertex w It remains to observe that independently of color permutation, each color smaller than ϕ (w) is used by U i or U j .Hence, if ϕ (w) = c, then w is a Grundy vertex.Now, without loss of generality consider a vertex u in U i .Since by assumption every vertex of G belongs to a triangle, say induced by {v i , v j , v τ }, the colors used by the corresponding sets U i , U j and U τ are distinct and uniquely determine distinct colors used by the sets W t and W t that correspond to the edges v i v j and v i v τ , respectively.Naturally, u is a Grundy vertex, which follows by similar argument as above (note G [W t ∪ {u}] = K p and G [W t ∪ {u}] = K p ). Thus we have proved that ϕ | W ∪U is a Grundy P-coloring.It remains to extend ϕ | W ∪U to V (G ) by processing vertices of Q in an arbitrary order and P-coloring them greedily.Since for each x t ∈ Q the sets W t , U i , U j of X t,i,j use three distinct colors in {1, 2, 3} and G [A ∪ {x t }] = K p for every A ∈ {U i , U j , W t }, and G [D ∪ {x t }] = K p for every (p − 1)-element subset D of Q, a simple inductive argument shows that every (p − 1)st vertex of Q new color is introduced with the largest one achieving m(G)/(p − 1) + 3.For an example see Fig. 2.

Lemma 2. If ϕ is a Grundy
The proof of Lemma 2 is rather technical so we skip it due to a limited space.Let V 1 , V 2 be two nonempty vertex sets of the same cardinality, and let 1 , 2 be two distinct colors.We say that V 1 , V 2 mix colors 1 and 2 if there exists a partition The next lemma says that certain vertex sets of G cannot mix colors.Lemma 3. Let X t,i,j be an arbitrary gadget in G .If ϕ is a Grundy P-coloring of a graph G with k ≥ 6 colors, then the sets U i , U j and W t of X t,i,j use pairwise distinct colors in {1, 2, 3}.
Proof.First we show that V (X t,i,j ) \ {x t } contains the three sets such that each of them uses a distinct color in {1, 2, 3}.By Lemma 2 we have ϕ(x t ) ≥ 4. Hence, since x t is a Grundy vertex, for each ∈ {1, 2, 3} there exists a set D that uses color in coloring ϕ and G [D ∪ {x t }] = K p .By the same claim it follows that each of these sets is contained in Clearly, the sets D are pairwise disjoint and hence by their cardinalities it follows that Using Property 1(b) it is not hard to argue that for every gadget X t,i,j , considered independently of other gadgets, either (a) U i , U j , W t use distinct colors in {1, 2, 3}, or (b) U i , W t (resp.U j , W t ) mix colors a, b ∈ {1, 2, 3} and U j (resp.U i ) uses the color in {1, 2, 3} \ {a, b}.Now, we show that if one considers X t,i,j as a subgraph of G , then only the former condition is feasible.Let v i be an arbitrary vertex of G.By assumption v i belongs to a triangle, say induced by v i , v j and v τ .Let X t,i,j , X t ,i,τ and X t ,j,τ be the gadgets corresponding to the edges of this triangle.Suppose to the contrary that U i , W t mix colors a, b ∈ {1, 2, 3}.Following (b) for X t ,i,τ we get that U i , W t have to mix a and b.Again by (b) applied to X t,i,j and X t ,i,τ , it follows that U j and U τ have to use the third color, say c.This results in 2(p − 1) vertices of X t ,j,τ that use color c and hence contradicts the property that V (X t ,j,τ ) contains the three sets of cardinality p − 1 such that each of them uses a distinct color in {1, 2, 3}.Proof.By the construction of G , each set U i of G corresponds to a unique vertex v i of G, i ∈ {1, . . ., n(G)}.Let ϕ be a Grundy P-coloring of G with k colors and let i denote the color used by the set U i in ϕ .In order to define an appropriate proper coloring ϕ of the graph G with 3 colors, for each vertex v i of G we set ϕ(v i ) = i .From Lemma 3 it follows that i ∈ {1, 2, 3} and that for every edge e t = v i v j of G the corresponding sets U i , U j of the gadget X t,i,j use distinct colors.Thus ϕ is a proper coloring of G with 3 colors.
Proof of Theorem 5.If F (P) is finite, we can use the arguments similar to those in the proof of Theorem 3 to show that a certificate function ϕ : V (G) → N can be verified in polynomial time for being a Grundy P-coloring with k colors.Hence Grundy P-Coloring belongs to NP.Now, Lemmas 1 and 4, and the fact that Construction 1 is polynomial in the size of G imply NP-hardness of the problem, which finishes the proof.

coNP-Completeness of the Membership in H(P, t)
In this section we prove that the problem of deciding the membership in the class H(P, t) is coNP-complete for every t ≥ 0 and every class P for which F (P) = {K p } with p ≥ 3. We present a polynomial-time reduction from Grundy P-Coloring of graphs in the class Q(p−1), where by Q(p−1) we mean a class of graphs obtained by the application of Construction 1 to all graphs G in L(p − 1) for which m(G) ≥ 4p − 3 (note that such a restriction on the size of graphs does not influence the hardness of Grundy P-Coloring, i.e., it remains NP-complete even in Q(p−1)).Before proving the hardness of the above membership problem we need some facts on the P-Grundy number of graphs in Q(p − 1).

Lemma 5. Let P be a class of graphs such that
Thus, the problem of determining the P-Grundy number of graphs in Q(p−1) can be solved in polynomial time.Moreover, since by Lemma 1 we have Γ P (G ) ≥ k, for every graph G ∈ Q(p − 1) it holds χ P (G ) < Γ P (G ).Theorem 6.If P is a class of graphs such that F (P) = {K p } with p ≥ 3, then for every t ≥ 0 the problem of the membership in H(P, t) is coNP-complete.
Proof.In order to show that our problem belongs to coNP it is enough to observe that a graph does not belong to H(P, t) if and only if it admits two Grundy Pcolorings with k 1 and k 2 colors respectively, and k 2 > k 1 + t.Equivalently, two orderings of the vertex set leading to the above-mentioned colorings could also serve as an appropriate No certificate.Clearly, due to the general assumption that the membership in P can be checked in polynomial time, the problem of the verification of our certificate is also polynomial.Now, we present a polynomial-time reduction from Grundy P-Coloring of graphs in Q(p − 1) to the problem of the membership in I \ H(P, t).In what follows we use the following properties of H t .Namely, for every t ≥ 0: (i) χ P (H t ) = χ P (G), (ii) Γ P (H t ) = Γ P (G) + t.The former follows easily by the fact that every forcing (P, t + 1)-tree admits a P-coloring with 2 colors.For a lower bound in the latter one it is enough to consider one of the "from the leaves up" orderings, that forces the greedy algorithm to use t + 1 colors on each of the forcing (P, t + 1)-trees T 1 , . . ., T n(G) , while an upper bound follows by the analysis of graphs F in C k (P) contained in H t and such that k > χ P (F ).

An Upper Bound on the P-Grundy Number
We conclude our paper with a new upper bound on the P-Grundy number.For a vertex v of a graph G we use D(G, v) to denote the family of all subsets of V (G) \ {v} such that for every D in D(G, v) it holds G[D ∪ {v}] ∈ F (P).The P-degree of a vertex v of G, denoted by d G (P, v), we mean the cardinality of a largest subfamily of D(G, v) consisting of pairwise disjoint sets.A natural upper bound Γ P (G) ≤ max v∈V (G) d G (P, v) + 1 follows directly from the greedy rule.This can be significantly improved by careful analysis of a specific function on the vertex set of a graph.Let φ 0 G (P, v) = d G (P, v).For every integer r ≥ 1, let φ r G (P, v) be the largest k for which there exist k pairwise disjoint sets D 1 , . . ., D k in D(G, v) such that for each of them λ r−1 G (D i ) ≥ i, where λ r−1 G (D i ) denotes the (r−1)st intensity of D i defined as follows λ r−1 G (D i ) = min{φ r−1 G (P, u) | u ∈ D i }.A simple inductive argument shows that φ r G (P, v) ≤ φ r−1 G (P, v) for every vertex v and every r ≥ 1.This implies the existence of an integer t ≥ 0 such that φ t G (P, v) = φ r G (P, v) for every vertex v and every r ≥ t.Thus φ t G (P, v) is uniquely determined.The potential of a vertex v, denoted by φ G (P, v), is given by φ G (P, v) = φ t G (P, v), while Φ P (G) stands for the potential of a graph G, defined by Φ P (G) = max{φ G (P, v) | v ∈ V (G)}.Using the properties of minimal graphs (see Sect. 2) it is possible to prove the following upper bound on Γ P (G).It is also not hard to prove that for every η > 0 there exists an infinite number of graphs G for which max{d G (P, v) | v ∈ V (G)} − Φ P (G) > η.
Suppose, contrary to our claim, that there exists a vertex v ∈ C and an ordering of C = C \ {v} that forces the algorithm to color H[C ] with k − 1 colors.Consequently, from Proposition 2 applied to I and H[C ] it follows that Γ P (H[I ∪ C ]) ≥ k.This contradicts minimality of H in the definition of C k (P).Hence H ∈ F(P, k).

Lemma 4 .
If G has a Grundy P-coloring with k colors, then G admits a proper coloring with 3 colors.

Theorem 7 .
For every class P and every graph G it holdsΓ P (G) ≤ Φ P (G) + 1.
Let k ≥ 2 and let H be an induced subgraph of a graph G.If Γ P (H) ≥ k − 1 and V (G) contains a nonempty P-independent set I that is disjoint from V (H) and strongly P-dominating in G[I ∪V (H)], then Γ P (G) ≥ k.
since I is P-independent and no vertex in I is preceded by a vertex in V (H), all vertices in I will be colored 1.Consequently, for each vertex x of H the algorithm will use color ϕ(x) + 1.This yields Γ P Note that the existence of the set ϑ(x) follows immediately by the assumption that I is strongly P-dominating in G. Naturally |ϑ(x)| ≤ β − 1 for each x ∈ C and the sets ϑ(x 1 ), ϑ(x 2 ) need not be distinct when x 1 = x 2 .Let I denote the following union x∈C ϑ(x).Thus is obvious because C is nonempty and I is strongly P-dominating in G. Suppose to the contrary that |I| ≥ β k−2 (β − 1) + 1.Let ϑ : C → 2 I be a mapping that assigns to each x ∈ C a subset ϑ(x) of I such that G[ϑ(x) ∪ {x}] ∈ F (P).
i of G with the root x i of the corresponding T i , i ∈ {1, . . ., n(G)}.Next, following Lemma 5 we calculate χ P (G).If χ P (G) ≥ κ, then we set G = H t .On the other hand, if χ P (G) < κ, then to construct G we take a complete graph K of order κ(p−1) and a set S ⊆ V (K) such that |S| = p−1 and join each vertex of H t with all vertices in S. Since the order of G is at most n(G)•p t +κ = O(n(G)) and by Lemma 5 determining χ P (G) admits a polynomial-time algorithm, the graph G can be constructed in polynomial time.
t .Let T 1 , . . ., T n(G) be disjoint graphs such that each of them is isomorphic to the forcing (P, t+1)-tree T (note that since F (P) = {K p }, such a graph T is unique) and let x i denote the root of T i , i ∈ {1, . . ., n(G)}.The graph H t we construct from the graphs G, T 1 , . . ., T n(G) by the identification of each vertex v Thus G / ∈ H(P, t); in other words G is a Yes instance of the problem of the membership in I \H(P, t).Now, assume that χ P (G) < κ.Let us consider graph H = H t +G [S].It is not hard to see that χ P (H ) ≤ χ P (H t ) + 1 and hence by (i) we easily get χ P (H ) ≤ χ P