Journal of Combinatorial Optimization

, Volume 35, Issue 2, pp 641–665

# Computational aspects of greedy partitioning of graphs

Open Access
Article

## Abstract

In this paper we consider a variant of graph partitioning consisting in partitioning the vertex set of a graph into the minimum number of sets such that each of them induces a graph in hereditary class of graphs $${\mathcal {P}}$$ (the problem is also known as $${\mathcal {P}}$$-coloring). We focus on the computational complexity of several problems related too greedy partitioning. In particular, we show that given a graph G and an integer k deciding if the greedy algorithm outputs $${\mathcal {P}}$$-coloring with at least k colors is $$\mathbb {NP}$$-complete if $${\mathcal {P}}$$ is a class of $$K_p$$-free graphs with $$p\ge 3$$. On the other hand we give a polynomial-time algorithm when k is fixed and the family of minimal forbidden graphs defining the class $${\mathcal {P}}$$ is finite. We also prove $$\text {co}\mathbb {NP}$$-completeness of deciding if for a given graph G and an integer $$t\ge 0$$ the difference between the largest number of colors used by the greedy algorithm and the minimum number of colors required in any $${\mathcal {P}}$$-coloring of G is bounded by t. In view of computational hardness, we present new Brooks-type bound on the largest number of colors used by the greedy $${\mathcal {P}}$$-coloring algorithm.

### Keywords

Graph partitioning Computational complexity Graph coloring Greedy algorithm Grundy number Minimal graphs

### Mathematics Subject Classification

68Q17 68R10 05C85 05C15

## 1 Introduction

Partitioning a graph into smaller parts is one of the fundamental algorithmic techniques and often an important part of more general tasks like parallelization, complexity reduction or simply a single step of divide-and-conquer algorithm. Over the years graph partitioning has been a subject of many variations and generalizations but it has been usually understood as partitioning the vertex set of a graph such that certain objective is met, e.g., it is possible to seek partitions into a given number of equal-sized sets such that the number of edges having endvertices in distinct sets is minimized or, as in this paper, one can minimize the number of the resulting sets under assumption that each set induces a graph with appropriate property.

Our main concern is the computational complexity of several problems related to greedy partitioning the vertex set of simple, finite and undirected graphs in such a way that each of the resulting sets induces a graph in some fixed hereditary class of graphs.

### 1.1 Hereditary classes

A class $${\mathcal {P}}$$ of graphs is hereditary if for every graph G in $${\mathcal {P}}$$ all induced subgraphs of G belong to $${\mathcal {P}}$$, and it is additive if for every graph G all of whose components are in $${\mathcal {P}}$$ it follows that also G is in $${\mathcal {P}}$$. All classes of graphs considered in this paper are additive and hereditary, and we assume that the single-vertex graph and the empty graph (i.e., the graph with no vertices) belong to every nonempty hereditary class. This is a well known property due to Greenwell et al. (1973) that every hereditary class $${\mathcal {P}}$$ of graphs can be uniquely characterized by the family $${\varvec{F}}({\mathcal {P}})$$ of minimal forbidden graphs consisting of graphs G such that $$G\notin {\mathcal {P}}$$ but each proper induced subgraph of G belongs to $${\mathcal {P}}$$. We will also use a fact that hereditary class is additive if and only if all minimal forbidden graphs of that class are connected. The family $${\varvec{F}}({\mathcal {P}})$$ should be distinguished from the family of minimal graphs in the class $${\mathcal {P}}$$, denoted by $${\min }_{\le }{\mathcal {P}}$$, which consists of all graphs in $${\mathcal {P}}$$ that contain no graph from $${\mathcal {P}}$$ as a proper induced subgraph. Naturally, if $${\mathcal {I}}$$ denotes the class of all graphs, then $${\varvec{F}}({\mathcal {P}})={\min }_{\le }({\mathcal {I}}\setminus {\mathcal {P}})$$. The graphs in $${\varvec{F}}({\mathcal {P}})$$ as well as the graphs in $${\min }_{\le }{\mathcal {P}}$$ are incomparable, in the sense that for any two graphs H and G neither $$H\le G$$ nor $$G\le H$$, where $$H\le G$$ means that H is an induced subgraph of G (for brevity we will also say that G contains H).

### 1.2 Problem statement

A $${\mathcal {P}}$$-coloring of a graph $$G=(V,E)$$ is a partition $$(V_1,\ldots ,V_k)$$ of the vertex set V(G) such that for each $$i\in \{1,\ldots ,k\}$$ the graph induced by $$V_i$$, denoted by $$G[V_i]$$, is not empty and belongs $${\mathcal {P}}$$. Equivalently, every $${\mathcal {P}}$$-coloring can be seen as a partition into $${\mathcal {P}}$$-independent sets, where a set of vertices is $${\mathcal {P}}$$-independent if graph induced by the vertices of that set belongs to $${\mathcal {P}}$$. For example, if $${\varvec{F}}({\mathcal {P}}) = \{K_2\}$$, where $$K_p$$ denotes a complete graph of order p, then we deal with the classical proper coloring in which we simply partition the vertex set into independent sets (for brevity, when dealing with the classical variant, we usually omit $${\mathcal {P}}$$). The smallest k for which there exists some $${\mathcal {P}}$$-coloring of a graph G with k colors is called the $${\mathcal {P}}$$-chromatic number of G, and it is denoted by $$\chi _{{\mathcal {P}}}(G)$$.

Greediness, as an an algorithmic paradigm, has already proved its usefulness in diverse areas of computer science. The greedy $${\mathcal {P}}$$-coloring algorithm (the greedy algorithm for short) colors subsequent vertices of graph G, one by one, in some order that is independent of the algorithm. Following the imposed order $$(v_1,\ldots ,v_{n(G)})$$ the algorithm colors each vertex $$v_i$$ with the smallest color whose assignment to $$v_i$$ results in $${\mathcal {P}}$$-coloring of the graph induced by $$\{v_1,\ldots ,v_i\}$$ (in what follows, we assume that deciding the membership in $${\mathcal {P}}$$ is polynomial). Let $$(V_1,\ldots ,V_k)$$ be an arbitrary $${\mathcal {P}}$$-coloring of a graph G. A vertex v is called a Grundy vertex if either $$v\in V_1$$, or $$v\in V_i$$ with $$i\ge 2$$ and every set $$V_j$$ with $$j<i$$ contains a subset $$D_j$$ such that $$G[D_j\cup \{v\}]\in {\varvec{F}}({\mathcal {P}})$$. Since in every $${\mathcal {P}}$$-coloring produced by the greedy algorithm each vertex is a Grundy vertex, such a $${\mathcal {P}}$$-coloring is called the Grundy $${\mathcal {P}}$$-coloring. The number of colors used by the greedy algorithm strongly depends on vertex ordering; with the largest number of colors called the $${\mathcal {P}}$$-Grundy number of a graph G and denoted by $${\varGamma _{\mathcal {P}}(G)}$$.

In what follows we focus mainly on the following two problems.
• Grundy $${\mathcal {P}}$$-Coloring
• Input: A graph G and positive integer k.

• Question: Does G have a Grundy $${\mathcal {P}}$$-coloring with at least k colors?

• Grundy $$({\mathcal {P}},k)$$-Coloring
• Input: A graph G.

• Question: Does G have a Grundy $${\mathcal {P}}$$-coloring with at least k colors?

Considering the above problems we indirectly use interpolation result of Cockayne et al. (1972) who proved that for every hereditary class $${\mathcal {P}}$$ and every graph G the number of colors used by the greedy algorithm can take any value from $$\chi _{{\mathcal {P}}}(G)$$ to $${\varGamma _{\mathcal {P}}(G)}$$. We shall also use a fact that both $$\chi _{{\mathcal {P}}}(G)$$ and $${\varGamma _{\mathcal {P}}(G)}$$ are monotone with respect to taking induced subgraphs, i.e., if $$H\le G$$, then $$\chi _{{\mathcal {P}}}(H)\le \chi _{{\mathcal {P}}}(G)$$ and $${\varGamma _{\mathcal {P}}(H)}\le {\varGamma _{\mathcal {P}}(G)}$$.

### 1.3 Related research on proper coloring and our results

For proper coloring, the notion of the Grundy number is usually attributed to Christen and Selkow (1979) but it has its roots in the seminal work of Grundy (1939). From that moment on, the Grundy number has been intensively studied. The subject became too broad to be surveyed in a concise way, so we focus only on selected aspects related to our results.

Namely, from the computational point of view, Goyal and Vishwanathan (1998) proved that, restricted to proper coloring, the former of the above-mentioned problems is $$\mathbb {NP}$$-complete even for chordal graphs. In this way they solved the problem posed by Hedetniemi et al. (1982) (cf. Section 10.4 of the book on graph coloring problems by Jensen and Toft (1995)). Later, Zaker (2006) proved $$\mathbb {NP}$$-completeness of this problem for the complements of bipartite graphs. In this paper we ask if Grundy $${\mathcal {P}}$$-Coloring is $$\mathbb {NP}$$-complete for every nontrivial $${\mathcal {P}}$$. In view of this question, it is worth mentioning that for every class $${\mathcal {P}}$$, every Grundy $${\mathcal {P}}$$-coloring of any graph in the class $${\mathcal {P}}$$ requires at most one color and hence Grundy $${\mathcal {P}}$$-Coloring with inputs in $${\mathcal {P}}$$ can be solved in time O(1). Therefore, when considering hardness of Grundy $${\mathcal {P}}$$-Coloring one should focus on inputs in classes $${\mathcal {Q}}$$ satisfying $${\mathcal {P}}\subset {\mathcal {Q}}$$.

On the positive side, we know that for proper coloring the latter problem can be solved in polynomial time, which follows from a finite basis theorem of Gyárfás et al. (1979) who proved that for every nonnegative integer k the number of minimal forbidden graphs characterizing the class of graphs with the Grundy number equal to k is finite (in more detail, we refer to that result in Sect. 2; for closely related concepts see also Zaker (2006), and Borowiecki and Sidorowicz (2012)). Independently of vertex ordering the greedy algorithm outputs an optimal proper coloring for $$P_4$$-free graphs and graphs G with their chromatic number $$\chi (G)$$ equal to $$Q(G)+1$$, where Q(G) is the potential of G (see Borowiecki and Rautenbach 2015) for the definition, and Sect. 6 for a generalization of this notion. For several classes of graphs, e.g., for trees and $$P_4$$-laden graphs, determining the Grundy number is known to be polynomial (see Hedetniemi et al. 1982; Araujo and Linhares-Sales 2012, respectively). For other classes, e.g., interval graphs (Narayanaswamy and Subhash Babu 2008), complements of bipartite as well as chordal graphs (Gyárfás and Lehel 1990), bounded tolerance graphs (Kierstead and Saoub 2011) and $$\{P_5,K_4-e\}$$-free graphs (Choudum and Karthick 2010), polynomial-time constant-factor approximation algorithms are known. For more extensive discussion on approximability and other aspects of the Grundy number, including various bounds in terms of the clique number of a graph, we refer the reader to works of Borowiecki (2004), Goyal and Vishwanathan (1998), Kierstead (1998) and Kortsarz (2007).

The reminder of this paper is organized as follows. In Sect. 2 we shortly present our motivation and introduce the so-called critical partitions with an emphasis on the role of graphs minimal in the class of all graphs admitting such partitions. As we will see in Sect. 3, this leads to a polynomial-time algorithm for Grundy $$({\mathcal {P}},k)$$-Coloring, provided that $${\varvec{F}}({\mathcal {P}})$$ is finite. Next, in Sect. 4 we show that Grundy  $${\mathcal {P}}$$ -Coloring is $$\mathbb {NP}$$-complete if $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ and $$p\ge 3$$. Finally, in Sect. 5 we prove that deciding whether for a given graph G and an integer $$t\ge 0$$ the difference between the $${\mathcal {P}}$$-Grundy number and the $${\mathcal {P}}$$-chromatic number of G is bounded by t, or equivalently, the problem of the membership in the class
\begin{aligned} {\mathcal {H}}({\mathcal {P}},t)=\{G\!\mid \!{\varGamma _{\mathcal {P}}(G)}-\chi _{{\mathcal {P}}}(G)\le t\} \end{aligned}
is $$\text {co}\mathbb {NP}$$-complete. In view of computational hardness in Sect. 6 we give a new Brooks-type bound on the $${\mathcal {P}}$$-Grundy number. Namely, for the $${\mathcal {P}}$$-Grundy number of every graph G we have
\begin{aligned} {\varGamma _{\mathcal {P}}(G)} \le {{\varPhi }_{\mathcal {P}}(G)} + 1 , \end{aligned}
where $${{\varPhi }_{\mathcal {P}}(G)}$$ is the maximum of a new potential function defined in Sect. 6. Our new bound generalizes and strengthens several bounds for proper coloring stated in terms of various potential functions (see, e.g., Borowiecki and Rautenbach 2015; Stacho 2001 and Zaker 2008).

In what follows we use standard notation and terminology. In particular, by $$N_G(v)$$ we denote the neighborhood of vertex v in a graph G while $$d_G(v) = |N_G(v)|$$ stands for the degree of v. The clique number of graph G is denoted by $$\omega (G)$$ while n(G) and m(G) denote the order and size of G, respectively. For any undefined notions we refer the reader to the following books: Brandstädt et al. (1999), Papadimitriou (1994) and West (2001).

## 2 Motivation, critical partitions and minimal graphs

Introducing critical partitions and describing their structural properties we step towards a general technique that benefits from the knowledge of polynomial-time approximation algorithms for diverse optimization problems with inputs in certain graph classes, called basic classes. We use such algorithms to develop new polynomial-time approximation algorithms that can be applied to all inputs in carefully constructed superclasses of the basic classes. Our approach ensures that extending basic classes of inputs we preserve the order of approximation ratios of the original algorithms. More formally, let $${{\mathcal {C}}({\mathcal {{\mathcal {P}}}},k)}$$ denote the class of graphs $${\mathcal {P}}$$-colorable with at most k colors and let $$(V_1,\ldots ,V_k)$$ be a $${\mathcal {P}}$$-coloring of an arbitrary graph $$G\in {{\mathcal {C}}({\mathcal {{\mathcal {P}}}},k)}$$. Now, consider a minimization problem $$\varPi$$ for which there is a polynomial-time $$\delta (n)$$-approximation algorithm $${{\texttt {A}}}_1$$ for inputs in $${\mathcal {P}}$$. Naturally, since $$G[V_i]\in {\mathcal {P}}$$, the algorithm $${{\texttt {A}}}_1$$ can be directly applied to each $$G[V_i]$$. Additionally, assume that there exists a polynomial-time algorithm $${{\texttt {A}}}_2$$ that, given the outputs of $${{\texttt {A}}}_1$$ for each input $$G[V_i]$$ gives a solution of $$\varPi$$ for G such that $${{\texttt {A}}}_1(G)\le k\cdot \max \{{{\texttt {A}}}_1(G[V_i]) \mid 1\le i \le k\}$$, where $${{\texttt {A}}}_1(G[V_i])$$ denotes the worst-case cost of the solution produced by $${{\texttt {A}}}_1$$ for $$G[V_i]$$. We say that $$\varPi$$ is a problem with compositive solutions if such an algorithm $${{\texttt {A}}}_2$$ exists (note that such algorithms can be easily given for various domination and coloring problems). A major drawback of such a three-phase approach (partition, solve, compose) is that we do not know any simple realization of this procedure, because, with a sole exception of proper 2-Coloring, the $${\mathcal {P}}$$-coloring problem is computationally hard (see Brown 1996; Kratochvíl and Schiermeyer 1997). Furthermore, our knowledge of minimal forbidden subgraphs that characterize $${\mathcal {C}}({\mathcal {P}},k)$$ is far from being complete (for some recent results in context of proper k-coloring of graphs in selected classes, mainly for $$k\in \{3,4\}$$, see, e.g., Hoàng et al. (2015), Chudnovsky et al. (2016), and Goedgebeur and Schaudt (2016)). This directs our attention to the class $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}$$ consisting of all graphs for which $${\varGamma _{\mathcal {P}}(G)}\le k$$. Naturally, for every $$k\ge 2$$ we have $${\mathcal {P}}\subset {{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}\subset {{\mathcal {C}}({\mathcal {{\mathcal {P}}}},k)}$$. Hence, the class $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}$$ is an extension of $${\mathcal {P}}$$ and offers an intrinsic algorithmic property of its members to be greedily $${\mathcal {P}}$$-colorable with at most k colors. Therefore, the algorithm that follows the above-mentioned three phases and uses greedy $${\mathcal {P}}$$-coloring routine in the first phase (we denote this algorithm by $${{\texttt {PH}}}$$), can be used for all inputs in $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}$$ and achieves an approximation ratio of the same order as $${{\texttt {A}}}_1$$ for inputs in $${\mathcal {P}}$$. For an illustration of the above concept see Fig. 1.

### Proposition 2.1

Let $$\varPi$$ be a minimization problem with compositive solutions. If $$\varPi$$ admits a polynomial-time $$\delta (n)$$-approximation in $${\mathcal {P}}$$, then the algorithm $${{\texttt {PH}}}$$ is a polynomial-time $$k{\cdot }\delta (n)$$-approximation algorithm for $$\varPi$$ in $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}$$. $$\square$$

In what follows we also use a fact that every $${\mathcal {P}}$$-coloring $$(V_1,\ldots ,V_k)$$ of a graph G with k colors can be seen as a surjection $${\varphi :V(G)}\rightarrow \{1,\ldots ,k\}$$ such that $$\varphi (v)=i$$ for every vertex $$v\in V_i$$ (for brevity we also say that $$\varphi$$ is a $${\mathcal {P}}$$-coloring). A subset U of vertices of a graph G is strongly  $${\mathcal {P}}$$-dominating in G if for every vertex $$v\in V(G)\setminus U$$ there exists a set $$D\subseteq U$$ such that $$G[D\cup \{v\}]\in {\varvec{F}}({\mathcal {P}})$$.

### Proposition 2.2

Let $$k\ge 2$$ and let H be an induced subgraph of a graph G. If $${\varGamma _{\mathcal {P}}(H)}\ge k-1$$ and V(G) contains a nonempty $${\mathcal {P}}$$-independent set I that is disjoint from V(H) and strongly $${\mathcal {P}}$$-dominating in $$G[I\cup V(H)]$$, then $${\varGamma _{\mathcal {P}}(G)}\ge k$$.

### Proof

Let $$V(H)=\{x_1,\ldots ,x_{n(H)}\}$$, $$I=\{y_1,\ldots ,y_t\}$$ and let $$(x_1,\ldots ,x_{n(H)})$$ be an ordering of V(H) that forces the greedy algorithm to produce $${\mathcal {P}}$$-coloring $$\varphi$$ of the graph H with $$k-1$$ colors. Now, consider the assignment of colors produced by the same algorithm for vertex ordering $$(y_1,\ldots ,y_t, x_1,\ldots ,x_{n(H)})$$. Naturally, since I is strongly $${\mathcal {P}}$$-dominating in $$G[I\cup V(H)]$$, for each vertex $$x \in V(H)$$ there exists a subset D of I such that $$G[D\cup \{x\}]\in {\varvec{F}}({\mathcal {P}})$$. Moreover, since I is $${\mathcal {P}}$$-independent and no vertex in I is preceded by a vertex in V(H), all vertices in I will be colored 1. Consequently, according to the greedy rule, for each vertex x of H the algorithm will use color $$\varphi (x)+1$$. This yields $${\varGamma _{\mathcal {P}}(G)}\ge k$$, since $$G[I\cup V(H)]\le G$$. $$\square$$

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 $${\mathcal {P}}$$-Grundy number under taking induced subgraphs. For $$k\ge 1$$ by $${{\mathcal {U}}({\mathcal {P}},k)}$$ we denote the class of graphs G for which $${\varGamma _{\mathcal {P}}(G)} \ge k$$. Naturally $${{\mathcal {U}}({\mathcal {P}},k)} = {\mathcal {I}}\setminus {{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k-1)}$$ (recall that $${\mathcal {I}}$$ denotes the class of all graphs). In what follows $${\varvec{C}}_k({\mathcal {P}})$$ stands for the family of minimal graphs in the class $${{\mathcal {U}}({\mathcal {{\mathcal {P}}}},k)}$$, that is, the graphs for which $${\varGamma _{\mathcal {P}}(G)} = k$$ and $${\varGamma _{\mathcal {P}}(G-v)} < k$$, where v is an arbitrary vertex of G. Note that $${\varvec{C}}_1({\mathcal {P}})=\{K_1\}$$, $${\varvec{C}}_2({\mathcal {P}})={\varvec{F}}({\mathcal {P}})$$ and that forbidding all graphs in $${\varvec{C}}_k({\mathcal {P}})$$ defines $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k-1)}$$; more formally $${\varvec{C}}_k({\mathcal {P}})={\varvec{F}}({{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k-1)})$$. Minimal graphs play a crucial role in the greedy coloring process; in fact they determine the number of colors used by the greedy algorithm in the worst case, and they characterize classes $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k)}$$. For proper coloring the classes $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},2)}$$ and $${{\mathcal {G}}({\mathcal {{\mathcal {P}}}},3)}$$ were characterized by Gyárfás et al. (1979) who proved that $${\varvec{C}}_{3}({\mathcal {P}})=\{K_3,P_4\}$$ and listed all 22 graphs in $${\varvec{C}}_{4}({\mathcal {P}})$$.

The key notion in our analysis of minimal graphs is a class $${\mathcal {F}}({\mathcal {P}},k)$$ consisting of all graphs G for which there exists a partition (IC) of V(G) such that I is nonempty, $${\mathcal {P}}$$-independent and strongly $${\mathcal {P}}$$-dominating in G, and $$G[C]\in {\varvec{C}}_{k-1}({\mathcal {P}})$$, where $$k\ge 2$$. Such a partition is called a critical partition of the graph G. Note that critical partition of G does not have to be unique.

### Example 2.1

Consider the graphs $$G_1,\ldots ,G_4$$ in Fig. 2 and the class $${\mathcal {P}}$$ for which $${\varvec{F}}({\mathcal {P}})=\{K_3\}$$. The graphs $$G_1$$ and $$G_2$$ are the elements of $${\varvec{C}}_{3}({\mathcal {P}})$$; their Grundy $${\mathcal {P}}$$-coloring with 3 colors can be easily obtained using Proposition 2.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 (IC). It is not hard to verify that deleting any vertex results in the $${\mathcal {P}}$$-Grundy number equal to 2. The graphs $$G_3$$ and $$G_4$$ belong to $${\mathcal {F}}({\mathcal {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 $${\mathcal {P}}$$-independent. To see that I is strongly $${\mathcal {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\in {\varvec{C}}_{4}({\mathcal {P}})$$. Consequently, since $$G_3\le G_4$$, we get $$G_4\in {\mathcal {F}}({\mathcal {P}},4)\setminus {\varvec{C}}_{4}({\mathcal {P}})$$.    $$\square$$

### Theorem 2.1

For every class $${\mathcal {P}}$$ and integer $$k\ge 2$$,
\begin{aligned} {\varvec{C}}_k({\mathcal {P}})={\min }_{\le }{\mathcal {F}}({\mathcal {P}},k) . \end{aligned}

### Proof

Recall that $${\varvec{C}}_k({\mathcal {P}})$$ is defined as a family of minimal graphs in the class $${{\mathcal {U}}({\mathcal {P}},k)}$$ in which for every graph G we have $${\varGamma _{\mathcal {{\mathcal {P}}}}(G)}\ge k$$. If $$G\in {\mathcal {F}}({\mathcal {P}},k)$$, then by the definition of the class $${\mathcal {F}}({\mathcal {P}},k)$$ and Proposition 2.2 we have $${\varGamma _{\mathcal {{\mathcal {P}}}}(G)}\ge k$$. Thus $${\mathcal {F}}({\mathcal {P}},k)\subseteq {{\mathcal {U}}({\mathcal {{\mathcal {P}}}},k)}$$. Consequently, for every graph $$H^\prime \in \min _{\le }{\mathcal {F}}({\mathcal {P}},k)$$ there exists a graph $$H\in \min _{\le }{{\mathcal {U}}({\mathcal {P}},k)}$$ such that $$H\le H^\prime$$. To finish the proof it remains to show that $$H\in {\mathcal {F}}({\mathcal {P}},k)$$. Note that by minimality $${\varGamma _{\mathcal {{\mathcal {P}}}}(H)}=k$$. Now, if $$(V_1,\ldots ,V_k)$$ is an arbitrary Grundy $${\mathcal {P}}$$-coloring of H with k colors, we can simply construct a partition (IC) of V(H) by setting $$I=V_1$$ and $$C=\bigcup _{i=2}^k V_i$$. Naturally, the set I of the partition is nonempty, $${\mathcal {P}}$$-independent, and by the definition of Grundy $${\mathcal {P}}$$-coloring it is also strongly $${\mathcal {P}}$$-dominating in H. Since $$(V_2, \ldots ,V_k)$$ is a Grundy $${\mathcal {P}}$$-coloring of H[C], we have $${\varGamma _{\mathcal {P}}(H[C])}\ge k-1$$. We shall show that $$H[C]\in {\varvec{C}}_{k-1}({\mathcal {P}})$$. Suppose, contrary to our claim, that there exists a vertex $$v\in C$$ and an ordering of $$C^\prime =C\setminus \{v\}$$ that forces the algorithm to color $$H[C^\prime ]$$ with $$k-1$$ colors. Consequently, from Proposition 2.2 applied to I and $$H[C^\prime ]$$ it follows that $${\varGamma _{\mathcal {P}}(H[I\cup C^{\prime }])}\ge k$$. This contradicts minimality of H in the definition of $${\varvec{C}}_k({\mathcal {P}})$$. Hence $$H\in {\mathcal {F}}({\mathcal {P}},k)$$. $$\square$$

## 3 The complexity of Grundy $$({\mathcal {P}},k)$$-coloring

In what follows, we have to carefully distinguish between the two important cases of finite and infinite family $${\varvec{F}}({\mathcal {P}})$$. In this section we prove that if $${\varvec{F}}({\mathcal {P}})$$ is finite, then Grundy  $$({\mathcal {P}},k)$$ -Coloring can be solved in polynomial time.

### Proposition 3.1

Let $${\mathcal {P}}$$ be a class of graphs with finite $${\varvec{F}}({\mathcal {P}})$$. If $$\alpha$$ and $$\beta$$ denote the minimum and maximum order of a graph in $${\varvec{F}}({\mathcal {P}})$$, respectively, then for every integer $$k\ge 1$$ and every graph $$G\in {\varvec{C}}_k({\mathcal {P}})$$ we have $$(\alpha -1)(k-1)+1 \le n(G) \le \beta ^{k-1}.$$

### Proof

We use induction on k. The above inequalities are evidently fulfilled for $$k\in \{1,2\}$$. Assume that the statement is true for the parameters smaller than k, where $$k\ge 3$$. Let $$G\in {\varvec{C}}_k({\mathcal {P}})$$. By Theorem 2.1 there exists a partition (IC) of V(G) such that I is nonempty, $${\mathcal {P}}$$-independent and strongly $${\mathcal {P}}$$-dominating in G. Moreover $$G[C]\in {\varvec{C}}_{k-1}({\mathcal {P}})$$, which by the induction hypothesis implies
\begin{aligned} (\alpha -1)(k-2)+1 \le |C|\le \beta ^{k-2}. \end{aligned}
(3.1)
Since $$V(G)=I\cup C$$ and $$I\cap C=\emptyset$$, the proof will be completed by showing $$\alpha -1\le |I| \le \beta ^{k-2}(\beta -1)$$.
The inequality $$\alpha -1\le |I|$$ is obvious because C is nonempty and I is strongly $${\mathcal {P}}$$-dominating in G. Suppose to the contrary that $$|I|\ge \beta ^{k-2}(\beta -1)+1$$. Let $${\vartheta }:C\rightarrow 2^I$$ be a mapping that assigns to each $$x\in C$$ a subset $${\vartheta }(x)$$ of I such that $$G[{\vartheta }(x)\cup \{x\}]\in {\varvec{F}}({\mathcal {P}})$$. Note that the existence of the set $${\vartheta }(x)$$ follows immediately by the assumption that I is strongly $${\mathcal {P}}$$-dominating in G. Naturally $$|{\vartheta }(x)|\le \beta -1$$ for each $$x\in C$$ and the sets $${\vartheta }(x_1)$$, $${\vartheta }(x_2)$$ need not be distinct when $$x_1\ne x_2$$. Let $$I^\prime$$ denote the following union $$\bigcup _{x\in C}{\vartheta }(x)$$. Thus
\begin{aligned} |I^\prime |=\bigl |\bigcup _{x\in C}{\vartheta }(x)\bigr | \le \sum _{x\in C}|{\vartheta }(x)| \le (\beta -1)|C| {\mathop {\le }\limits ^{(3.1)}} (\beta -1)\beta ^{k-2}. \end{aligned}
Consequently as a proper subset of I, the set $$I^\prime$$ is $${\mathcal {P}}$$-independent in G and hence it is $${\mathcal {P}}$$-independent in each induced subgraph of G. Therefore, if $$G^\prime =G[I^\prime \cup C]$$, then $$I^\prime$$ is strongly $${\mathcal {P}}$$-dominating in $$G^\prime$$ by its definition, and it is $${\mathcal {P}}$$-independent in $$G^\prime$$ by our earlier consideration. Finally, it follows that $$G^\prime \in {\mathcal {F}}({\mathcal {P}},k)$$ and that $$G^\prime$$ is a proper induced subgraph of G. This contradicts the fact that by Theorem 2.1 the graph G is minimal in $${\mathcal {F}}({\mathcal {P}},k)$$. $$\square$$

In what follows we need the class $${\mathcal {T}}({\mathcal {P}},k)$$ of forcing  $$({\mathcal {P}},k)$$-trees. Namely, if $$k=2$$, then $${\mathcal {T}}({\mathcal {P}},2)={\varvec{C}}_2({\mathcal {P}})$$. For $$k\ge 3$$ let B be a graph in $${\mathcal {T}}({\mathcal {P}},k-1)$$ and let $$F_1,\ldots ,F_{n(B)}$$ be disjoint graphs, each being isomorphic to a graph in $${\varvec{F}}({\mathcal {P}})$$. A graph G belongs to $${\mathcal {T}}({\mathcal {P}},k)$$ if it can be obtained from $$B,F_1,\ldots ,F_{n(B)}$$ by an identification of each vertex of B with an arbitrary vertex of some graph $$F_j$$, $$j\in \{1,\ldots ,n(B)\}$$ in such a way that every $$F_j$$ takes part in exactly one identification. As the root of forcing $$({\mathcal {P}},k)$$-tree we select an arbitrary vertex of $$B\in {\mathcal {T}}({\mathcal {P}},2)$$. All graphs in $${\mathcal {T}}({\mathcal {P}},k)$$ are minimal in the class $${\mathcal {F}}({\mathcal {P}},k)$$ for every $$k\ge 2$$ (see Borowiecki 2006).

### Theorem 3.1

For every class $${\mathcal {P}}$$ and every integer $$k\ge 2$$, the set $${\varvec{C}}_k({\mathcal {P}})$$ is finite if and only if $${\varvec{F}}({\mathcal {P}})$$ is finite.

### Proof

If $${\varvec{F}}({\mathcal {P}})$$ is finite, then simply observe that by Proposition 3.1 the set $${\varvec{C}}_k({\mathcal {P}})$$ is finite, too. Now, suppose to the contrary that $${\varvec{F}}({\mathcal {P}})$$ is infinite and that for some k the set $${\varvec{C}}_{k}({\mathcal {P}})$$ is finite. Since $${\varvec{C}}_2({\mathcal {P}})={\varvec{F}}({\mathcal {P}})$$, it remains to consider $$k\ge 3$$. Let $$n^*$$ be the largest order of a graph in $${\varvec{C}}_{k}({\mathcal {P}})$$ and let $$F\in {\varvec{F}}({\mathcal {P}})$$ be a graph such that $$n(F)>\!\!\root k-1 \of {n^*}$$. Note that by the finiteness of $${\varvec{C}}_{k}({\mathcal {P}})$$ and the infiniteness of $${\varvec{F}}({\mathcal {P}})$$ such a number and such a graph always exist. Next, consider $$T_k\in {\mathcal {T}}({\mathcal {P}},k)$$ constructed in $$k-1$$ steps starting with $$T_2=F$$ and such that for each step $$i\in \{2,\ldots ,k-1\}$$, in which we obtain $$T_{i+1}$$, we have $$F_1=\cdots =F_{n(T_i)}=F$$. Since $$T_k\in {\varvec{C}}_k({\mathcal {P}})$$, the construction of $$T_k$$ and the assumption on n(F) imply $$n(T_k) = (n(F))^{k-1} > (\!\root k-1 \of {n^*})^{k-1} = n^*$$. A contradiction with the choice of $$n^*$$. $$\square$$

The above finite basis theorem allows the proof of the following result on the computational complexity of Grundy  $$({\mathcal {P}},k)$$ -Coloring.

### Theorem 3.2

If $${\mathcal {P}}$$ is a class with finite $${\varvec{F}}({\mathcal {P}})$$ and $$k>0$$ is a fixed integer, then Grundy $$({\mathcal {P}},k)$$ -Coloring admits a polynomial-time algorithm.

### Proof

Indeed, 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 $${\varvec{F}}({\mathcal {P}})$$ by Proposition 3.1 the order of any graph in $$H\in {\varvec{C}}_{k}({\mathcal {P}})$$ is bounded from above by $$\beta ^{k-1}$$, deciding if H is contained in G can be done in $$O(n^{\beta ^{k-1}})$$ time. The proof is completed by the observation that for any fixed k by Theorem 3.1 the number of graphs in $${\varvec{C}}_k({\mathcal {P}})$$ is finite and independent of n. $$\square$$

## 4 The complexity of Grundy $${\mathcal {P}}$$-coloring

In this section we prove that Grundy $${\mathcal {P}}$$ -Coloring is $$\mathbb {NP}$$-complete for every class $${\mathcal {P}}$$ defined by $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ with $$p\ge 3$$.

In our proof we use a polynomial-time reduction from 3-Coloring of planar graphs with vertex degree at most 4 (for $$\mathbb {NP}$$-completeness see Garey et al. (1976)). 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\equiv 1(\text{ mod } r)$$ and every vertex belonging to at least one triangle; the class of such graphs we denote by $${\mathcal {L}}(r)$$.

### Theorem 4.1

For every fixed $$r\ge 2$$, the problem 3-Coloring is $$\mathbb {NP}$$-complete in $${\mathcal {L}}(r)$$.

For a proof of Theorem 4.1 we refer the reader to “Appendix A”.

### Theorem 4.2

For every class $${\mathcal {P}}$$ such that $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ with $$p\ge 3$$, the problem Grundy $${\mathcal {P}}$$ -Coloring is $$\mathbb {NP}$$-complete.

In order to prove the above theorem we give Construction 4.1 and prove several lemmas. Let $$p\ge 3$$, $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$, and let G be an instance of 3-Coloring in $${\mathcal {L}}(p-1)$$. We construct a graph $$G^\prime$$ and calculate an integer k such that $$G^\prime$$ has a Grundy $${\mathcal {P}}$$-coloring with k colors if and only if G has a proper 3-coloring.

### Construction 4.1

First, we define the vertices of $$G^\prime$$. For each vertex $$v_i\in V(G)$$, $$i\in \{1,\ldots ,n(G)\}$$ create a set of vertices $$U_i = \{u^i_1,\ldots ,u^i_{p-1}\}$$. Similarly, for each edge $$e_i\in E(G)$$, $$i\in \{1,\ldots ,m(G)\}$$ create a set of vertices $$W_i = \{w^i_1,\ldots ,w^i_{p-1}\}$$ and a single vertex $$x_i$$. Let Q denote the set $$\{x_1,\ldots ,x_{m(G)}\}$$ and let $$U = \bigcup _{1\le i\le n(G)} U_i$$, $$W = \bigcup _{1\le i\le m(G)}W_i$$. Finally, set $$V(G^\prime ) = Q\cup W\cup U$$. Now, we define the edges of $$G^\prime$$. First, create all edges so that Q induces a complete graph. Then, for every edge $$e_t\in E(G)$$, $$t\in \{1,\ldots ,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\cup W_t$$ and $$U_j\cup W_t$$ induce complete graphs. In what follows a graph induced in $$G^\prime$$ by $$W_t\cup U_i\cup U_j\cup \{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
\begin{aligned} k =\lceil {m(G)}/(p-1) \rceil + 3. \end{aligned}
For an example of the construction see Fig. 3. $$\square$$

### Property 4.1

Let $$H^\prime$$ and $$G^\prime$$ be the graphs resulting from Construction 4.1 applied to H and G, respectively. If $$H \subseteq G$$, then $$H^\prime \le G^\prime$$.

### Property 4.2

Let $$X_{t,i,j}$$ be a gadget and let $$H=K_p$$ with $$p\ge 3$$. If H contains some vertex in $$W_t$$, then
1. (a)

$$V(H)\subseteq V(X_{t,i,j})$$,

2. (b)

$$V(H)\subseteq U_{\tau }\cup W_t\cup \{x_t\}$$ if there exists $$u\in V(H)\cap U_{\tau }$$ for some $$\tau \in \{i,j\}$$.

We say that in a $${\mathcal {P}}$$-colored graph H a set $$U\subseteq V(H)$$ uses color $$\ell$$ if every vertex in U has color $$\ell$$.

### Lemma 4.1

If G has a proper coloring with 3 colors, then the graph $$G^\prime$$ admits a Grundy $${\mathcal {P}}$$-coloring with k colors.

### Proof

Let $$\varphi$$ be a proper 3-coloring of G. In order to define the corresponding Grundy $${\mathcal {P}}$$-coloring $$\varphi ^\prime$$ of $$G^\prime$$ we set $$\varphi ^\prime (u)=\varphi (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 $${\mathcal {P}}$$-independent. Let $$X_{t,i,j}$$ be an arbitrary gadget in $$G^\prime$$. Since $$X_{t,i,j}$$ corresponds to the edge $$v_i v_j$$ and $$\varphi$$ is proper, the sets $$U_i$$ and $$U_j$$ use distinct colors, say a and b, respectively. Thus for every vertex $$w\in W_t$$ its colored neighbors in $$U_i\cup U_j$$ use colors in $$\{a,b\}$$ and hence the color $$c\in \{1,2,3\}\setminus \{a,b\}$$ is feasible for w. We set $$\varphi ^\prime (w)=c$$. Following Construction 4.1, for every vertex $$w\in W_t$$ we have $$G^\prime [U_i\cup \{w\}]=K_p$$ and $$G^\prime [U_j\cup \{w\}]=K_p$$. It remains to observe that independently of color permutation, each color smaller than $$\varphi ^\prime (w)$$ is used by $$U_i$$ or $$U_j$$. Hence, if $$\varphi ^\prime (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_{\tau }\}$$, the colors used by the corresponding sets $$U_i, U_j$$ and $$U_{\tau }$$ are distinct and uniquely determine distinct colors used by the sets $$W_t$$ and $$W_{t^\prime }$$ that correspond to the edges $$v_iv_j$$ and $$v_iv_{\tau }$$, respectively. Naturally, u is a Grundy vertex, which follows by a similar argument as above (note $$G^\prime [W_t\cup \{u\}]=K_p$$ and $$G^\prime [W_{t^\prime }\cup \{u\}]=K_p$$). Thus we have proved that $$\varphi ^\prime \vert _{W\cup U}$$ is a Grundy $${\mathcal {P}}$$-coloring. It remains to extend $$\varphi ^\prime \vert _{W\cup U}$$ to $$V(G^\prime )$$ by processing vertices of Q in an arbitrary order and $${\mathcal {P}}$$-coloring them greedily. Since for each $$x_t\in Q$$ the sets $$W_t, U_i, U_j$$ of $$X_{t,i,j}$$ use three distinct colors in $$\{1,2,3\}$$ and $$G^\prime [A\cup \{x_t\}]=K_p$$ for every $$A\in \{U_i,U_j,W_t\}$$, and $$G^\prime [D\cup \{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 $$\lceil m(G)/(p-1)\rceil +3$$. For an example see Fig. 3. $$\square$$

### Lemma 4.2

If $$\varphi ^\prime$$ is a Grundy $${\mathcal {P}}$$-coloring of a graph $$G^\prime$$ using $$k\ge 6$$ colors, then $$\varphi ^\prime (v) \le 3$$ if and only if vertex v belongs to $$U\cup W$$.

For a rather technical proof of Lemma 4.2 we refer the reader to “Appendix B”.

Let $$V_1$$, $$V_2$$ be two nonempty vertex sets of the same cardinality, and let $$\ell _1$$, $$\ell _2$$ be two distinct colors. We say that $$V_1$$, $$V_2$$ mix colors $$\ell _1$$ and $$\ell _2$$ if there exists a partition $$(A_1,A_2)$$ of $$V_1\cup V_2$$ such that $$\vert A_1\vert = \vert A_2\vert$$, $$A_1\ne V_i$$ and $$A_i$$ uses $$\ell _i$$, $$i\in \{1,2\}$$. The next lemma says that certain vertex sets of $$G^\prime$$ cannot mix colors.

### Lemma 4.3

Let $$X_{t,i,j}$$ be an arbitrary gadget in $$G^\prime$$. If $$\varphi ^\prime$$ is a Grundy $${\mathcal {P}}$$-coloring of a graph $$G^\prime$$ with $$k\ge 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})\setminus \{x_t\}$$ contains the three sets such that each of them uses a distinct color in $$\{1,2,3\}$$. By Lemma 4.2 we have $$\varphi (x_t)\ge 4$$. Hence, since $$x_t$$ is a Grundy vertex, for each $$\ell \in \{1,2,3\}$$ there exists a set $$D_{\ell }$$ that uses color $$\ell$$ in coloring $$\varphi ^\prime$$ and $$G^\prime [D_{\ell }\cup \{x_t\}]=K_p$$. By the same claim it follows that each of these sets is contained in $$N_{G^\prime }(x_t)\cap (U\cup W)$$ while from the construction of $$G^\prime$$ it is easy to see that $$N_{G^\prime }(x_t)\cap (U\cup W) = V(X_{t,i,j})\setminus \{x_t\}$$. Clearly, the sets $$D_1, D_2$$ and $$D_3$$ are pairwise disjoint and hence by their cardinalities it follows that $$D_1\cup D_2\cup D_3 = V(X_{t,i,j})\setminus \{x_t\}$$. It remains to prove that $$\{D_1,D_2,D_3\} = \{U_i,U_j,W_t\}$$. Using Property 4.2(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\in \{1,2,3\}$$ and $$U_j$$ (resp. $$U_i$$) uses the color in $$\{1,2,3\}\setminus \{a,b\}$$. Now, we show that if one considers $$X_{t,i,j}$$ as a subgraph of $$G^\prime$$, 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_{\tau }$$. Let $$X_{t,i,j}$$, $$X_{t^\prime ,i,\tau }$$ and $$X_{t^{\prime \prime },j,\tau }$$ be the gadgets corresponding to the edges of this triangle. Without loss of generality, suppose to the contrary that $$U_i$$, $$W_t$$ mix colors $$a,b\in \{1,2,3\}$$. If so, then following (b) for $$X_{t^\prime ,i,\tau }$$ we get that also $$U_i$$, $$W_{t^\prime }$$ have to mix a and b. Again by (b) applied to $$X_{t,i,j}$$ and $$X_{t^\prime ,i,\tau }$$, it follows that $$U_j$$ and $$U_\tau$$ have to use the third color, say c. This results in $$2(p-1)$$ vertices of $$X_{t^{\prime \prime },j,\tau }$$ that use color c and hence contradicts the property that $$V(X_{t^{\prime \prime },j,\tau })$$ contains three sets of cardinality $$p-1$$ such that each of them uses a distinct color in $$\{1,2,3\}$$. $$\square$$

### Lemma 4.4

If $$G^\prime$$ has a Grundy $${\mathcal {P}}$$-coloring with k colors, then G admits a proper coloring with 3 colors.

### Proof

By the construction of $$G^\prime$$, each set $$U_i$$ of $$G^\prime$$ corresponds to a unique vertex $$v_i$$ of G, $$i\in \{1,\ldots ,n(G)\}$$. Let $$\varphi ^\prime$$ be a Grundy $${\mathcal {P}}$$-coloring of $$G^\prime$$ with k colors and let $$\ell _i$$ denote the color used by the set $$U_i$$ in $$\varphi ^\prime$$. In order to define an appropriate proper coloring $$\varphi$$ of the graph G with 3 colors, for each vertex $$v_i$$ of G we set $$\varphi (v_i)=\ell _i$$. From Lemma 4.3 it follows that $$\ell _i\in \{1,2,3\}$$ and that for every edge $$e_t=v_iv_j$$ of G the corresponding sets $$U_i, U_j$$ of the gadget $$X_{t,i,j}$$ use distinct colors. Thus $$\varphi$$ is a proper coloring of G with 3 colors. $$\square$$

### Proof of Theorem 4.2

If $${\varvec{F}}({\mathcal {P}})$$ is finite, we can use the arguments similar to those in the proof of Theorem 3.2 to show that a certificate function $$\varphi :V(G)\rightarrow \mathbb {N}$$ can be verified in polynomial time for being a Grundy $${\mathcal {P}}$$-coloring with k colors. Hence Grundy $${\mathcal {P}}$$ -Coloring belongs to $$\mathbb {NP}$$. Now, Lemmas 4.1 and 4.4, and the fact that Construction 4.1 is polynomial in the size of G imply $$\mathbb {NP}$$-hardness of the problem, which finishes the proof. $$\square$$

## 5 $$\text {co}\mathbb {NP}$$-completeness of the membership in $${\mathcal {H}}({\mathcal {P}},t)$$

In this section we investigate the computational complexity of the problem of deciding the membership in the class $${\mathcal {H}}({\mathcal {P}},t)=\{G\!\mid \!{\varGamma _{\mathcal {P}}(G)}-\chi _{{\mathcal {P}}}(G)\le t\}$$. We prove that the problem is $$\text {co}\mathbb {NP}$$-complete for every $$t\ge 0$$ and every class $${\mathcal {P}}$$ for which $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ with $$p\ge 3$$. We present a polynomial-time reduction from Grundy  $${\mathcal {P}}$$ -Coloring of graphs in the class $${\mathcal {Q}}(p-1)$$, where by $${\mathcal {Q}}(p-1)$$ we mean the class of graphs obtained by the application of Construction 4.1 to all graphs G in $${\mathcal {L}}(p-1)$$ for which $$m(G)\ge 4p-3$$ (note that such a restriction on the size of graphs does not influence the hardness of Grundy  $${\mathcal {P}}$$ -Coloring, i.e., it remains $$\mathbb {NP}$$-complete even in $${\mathcal {Q}}(p-1)$$). Before proving the hardness of the above membership problem we need some facts on the $${\mathcal {P}}$$-Grundy number of graphs in $${\mathcal {Q}}(p-1)$$.

### Lemma 5.1

Let $${\mathcal {P}}$$ be a class of graphs such that $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ with $$p\ge 3$$. If $$G^\prime \in {\mathcal {Q}}(p-1)$$, then
\begin{aligned} \chi _{{\mathcal {P}}}(G^\prime )=\lceil \omega (G^\prime )/(p-1) \rceil . \end{aligned}

### Proof

Let $$G\in {\mathcal {L}}(p-1)$$, where $$p\ge 3$$ and $$m(G)\ge 4p-3$$. Moreover, let an instance $$(G^\prime ,k)$$ of Grundy $${\mathcal {P}}$$ -Coloring result from the application of Construction 4.1 to a graph G (recall that $$k = \lceil m(G)/(p-1)\rceil +3$$). We are going to prove that $$\chi _{{\mathcal {P}}}(G^\prime ) = k-3$$.

First, observe that if $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$, then for every graph H we have $$\chi _{{\mathcal {P}}}(H) \ge \lceil \omega (H)/(p-1) \rceil ,$$ where $$\omega (H)$$ stands for the clique number of H. From the construction of $$G^\prime$$ it easily follows that if $$m(G)\ge 2p-1$$, then $$\omega (G^\prime ) = m(G)$$ (recall $$m(G) = \vert Q \vert$$). Consequently, if $$m(G)\ge 4p-3$$, then $$\chi _{{\mathcal {P}}}(G^\prime ) \ge k-3$$.

Next, in order to show $$\chi _{{\mathcal {P}}}(G^\prime ) \le k-3$$ we start with an arbitrary $${\mathcal {P}}$$-coloring of complete graph $$G^\prime [Q]$$ using $$k-3$$ colors. Now, we argue that it is possible to color the remaining vertices of $$G^\prime$$ such that all vertices in U are colored before any vertex in W and that we do not need to introduce any additional colors. Let $$X_{t,i,j}$$ be an arbitrary gadget in $$G^\prime$$. Since G is a graph of degree bounded by 4, every vertex $$u\in U_i$$ has at most 4 neighbors in Q. Moreover, by assumption $$k = \lceil m(G)/(p-1)\rceil + 3$$ and $$m(G)\ge 4(p-1)+1$$, which implies $$k\ge 8$$. Hence, there are at least 5 colors used for vertices in Q. Thus, for every vertex $$u\in U_i$$ there exists at least one color in $$\{1,\ldots ,k-3\}$$ that has not been used for any vertex in $$N_{G^\prime }(u)\cap Q$$. Note that the same color can be used for all $$p-1$$ vertices in $$U_i$$ and since U is $${\mathcal {P}}$$-independent, the selection of color for vertices in $$U_i$$ is independent of selections for vertices in $$U\setminus U_i$$. Thus, there exists a $${\mathcal {P}}$$-coloring of $$G^\prime [Q\cup U]$$ with $$k-3$$ colors. It remains to color the vertices in W. First, observe that for every vertex $$w\in W_t$$ we have $$N_{G^\prime }(w) = U_i\cup U_j\cup \{x_t\}$$, where $$x_t\in Q$$. Thus, following the above $${\mathcal {P}}$$-coloring of $$G^\prime [Q\cup U]$$, there are at most three colors used for vertices in $$N_{G^\prime }(w)$$ and hence, since $$k\ge 8$$, there are at least two colors in $$\{1,\ldots ,k-3\}$$ that can be used for w. The argument is completed by the observation that the same color can be used for all $$p-1$$ vertices in $$W_t$$ and that the selection of color for vertices in $$W_t$$ is independent of selections for vertices in $$W\setminus W_t$$.

Since $$\chi _{{\mathcal {P}}}(G^\prime ) = k-3$$, to complete the proof observe that if $$m(G)\ge 4p-3$$, then $$m(G)=\omega (G^\prime )$$. $$\square$$

### Remark 5.1

Since by the above proof $$\chi _{{\mathcal {P}}}(G^\prime ) = k-3$$, the problem of determining the $${\mathcal {P}}$$-Grundy number of graphs in $${\mathcal {Q}}(p-1)$$ can be solved in polynomial time. Moreover, since by Lemma 4.1 we have $${\varGamma _{\mathcal {{\mathcal {P}}}}(G^\prime )} \ge k$$, we know that $$\chi _{{\mathcal {P}}}(G^\prime ) < {\varGamma _{\mathcal {{\mathcal {P}}}}(G^\prime )}$$ for every graph $$G^\prime \in {\mathcal {Q}}(p-1)$$.

### Theorem 5.1

If $${\mathcal {P}}$$ is a class of graphs such that $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$ with $$p\ge 3$$, then for every $$t\ge 0$$ the problem of the membership in $${\mathcal {H}}({\mathcal {P}},t)$$ is $$\text {co}\mathbb {NP}$$-complete.

### Proof

In order to show that our problem belongs to $$\text {co}\mathbb {NP}$$ it is enough to observe that a graph does not belong to $${\mathcal {H}}({\mathcal {P}},t)$$ if and only if it admits two Grundy $${\mathcal {P}}$$-colorings 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 $${\mathcal {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  $${\mathcal {P}}$$ -Coloring of graphs in $${\mathcal {Q}}(p-1)$$ to the problem of the membership in $${\mathcal {I}}\setminus {\mathcal {H}}({\mathcal {P}},t)$$ (recall that $${\mathcal {I}}$$ denotes the class of all graphs). Given an arbitrary instance $$(G,\kappa )$$ of the former problem, for every $$t\ge 0$$ we construct a graph $$G^\prime$$ such that $$G^\prime \notin {\mathcal {H}}({\mathcal {P}},t)$$ if and only if $${\varGamma _{\mathcal {P}}(G)}\ge \kappa$$.

### Construction 5.1

First, given graph G with the vertex set $$\{v_1,\ldots ,v_{n(G)}\}$$ we construct a graph $$H_t$$. Let $$T_1,\ldots ,T_{n(G)}$$ be disjoint graphs such that each of them is isomorphic to the forcing $$({\mathcal {P}},t+1)$$-tree T (note that because $${\varvec{F}}({\mathcal {P}})=\{K_p\}$$, such a graph T is unique) and let $$x_i$$ denote the root of $$T_i$$, $$i\in \{1,\ldots ,n(G)\}$$. The graph $$H_t$$ we construct from the graphs $$G,T_1,\ldots ,T_{n(G)}$$ by the identification of each vertex $$v_i$$ of G with the root $$x_i$$ of the corresponding $$T_i$$, $$i\in \{1,\ldots ,n(G)\}$$. Next, following Lemma 5.1 we calculate $$\chi _{{\mathcal {P}}}(G)$$. If $$\chi _{{\mathcal {P}}}(G) \ge \kappa$$, then we set $$G^\prime =H_t$$. On the other hand, if $$\chi _{{\mathcal {P}}}(G) < \kappa$$, then in order to construct $$G^\prime$$ we take a complete graph K of order $$\kappa (p-1)$$ and a set $$S\subseteq V(K)$$ such that $$\vert S \vert = p-1$$ and join each vertex of $$H_t$$ with all vertices in S. Since the order of $$G^\prime$$ is at most $$n(G)\cdot p^t + \kappa = O(n(G))$$ and by Lemma 5.1 determining $$\chi _{{\mathcal {P}}}(G)$$ admits a polynomial-time algorithm, the graph $$G^\prime$$ can be constructed in polynomial time. See Fig. 4 for an illustration of the construction. $$\square$$

In what follows we use the following properties of $$H_t$$ with $$t\ge 0$$.
1. (i)

$$\chi _{{\mathcal {P}}}(H_t) = \chi _{{\mathcal {P}}}(G)$$,

2. (ii)

$${\varGamma _{\mathcal {P}}(H_t)} = {\varGamma _{\mathcal {P}}(G)} + t$$.

The former equation follows easily by the fact that every forcing $$({\mathcal {P}},t+1)$$-tree admits a $${\mathcal {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 $$({\mathcal {P}},t+1)$$-trees $$T_1,\ldots ,T_{n(G)}$$ while an upper bound follows by the analysis of graphs F in $${\varvec{C}}_k({\mathcal {P}})$$ contained in $$H_t$$ and such that $$k>\chi _{{\mathcal {P}}}(F)$$.

First, let $$\chi _{{\mathcal {P}}}(G)\ge \kappa$$. Naturally, $$\chi _{{\mathcal {P}}}(G)\ge \kappa$$ implies $${\varGamma _{\mathcal {P}}(G)}\ge \kappa$$ and hence $$(G,\kappa )$$ is a Yes instance of Grundy  $${\mathcal {P}}$$ -Coloring. Since by Remark 5.1 for every graph $$G\in {\mathcal {Q}}(p-1)$$ we have $$\chi _{{\mathcal {P}}}(G) < {\varGamma _{\mathcal {P}}(G)}$$, by (i) and (ii) we get $$\chi _{{\mathcal {P}}}(G^\prime ) = \chi _{{\mathcal {P}}}(G) < {\varGamma _{\mathcal {P}}(G)} = {\varGamma _{\mathcal {P}}(G^\prime )} - t$$ (recall $$G^\prime =H_t$$). Thus $$G^\prime \notin {\mathcal {H}}({\mathcal {P}},t)$$; in other words $$G^\prime$$ is a Yes instance of the problem of the membership in $${\mathcal {I}}\setminus {\mathcal {H}}({\mathcal {P}},t)$$.

Next, assume $$\chi _{{\mathcal {P}}}(G) < \kappa$$. Let us consider a graph $$H^\prime = H_t + G^\prime [S]$$. It is not hard to see that $$\chi _{{\mathcal {P}}}(H^\prime ) \le \chi _{{\mathcal {P}}}(H_t)+1$$ and hence by (i) we easily get $$\chi _{{\mathcal {P}}}(H^\prime )\le \chi _{{\mathcal {P}}}(G)+1$$. On the other hand, $$\chi _{{\mathcal {P}}}(H^\prime ) \ge \lceil \omega (H^\prime )/(p-1) \rceil$$. Since $$\omega (H^\prime ) = \omega (H_t) + p - 1$$ and $$\omega (H_t)=\omega (G)$$, we have $$\chi _{{\mathcal {P}}}(H^\prime ) \ge \lceil \omega (G)/(p-1) \rceil + 1$$, which, by Lemma 5.1, results in $$\chi _{{\mathcal {P}}}(H^\prime ) \ge \chi _{{\mathcal {P}}}(G) + 1$$. Finally, $$\chi _{{\mathcal {P}}}(H^\prime ) = \chi _{{\mathcal {P}}}(G)+1$$.

Now, consider $$G^\prime$$ and observe that $$\chi _{{\mathcal {P}}}(G^\prime ) = \max \{\chi _{{\mathcal {P}}}(H^\prime ), \chi _{{\mathcal {P}}}(K)\}$$. Hence, since $$\chi _{{\mathcal {P}}}(K)=\kappa$$ and by assumption $$\chi _{{\mathcal {P}}}(G) < \kappa$$, we get
\begin{aligned} \chi _{{\mathcal {P}}}(G^\prime ) = \max \{ \chi _{{\mathcal {P}}}(G) + 1, \kappa \} = \kappa . \end{aligned}
Moreover, by Proposition 2.2 and simple analysis of maximum degrees of appropriate subgraphs of $$G^\prime$$ we see that $${\varGamma _{\mathcal {P}}(H^\prime )} = {\varGamma _{\mathcal {P}}(H_t)} + 1$$. A similar argument results in $${\varGamma _{\mathcal {P}}(G^\prime )} = \max \{{\varGamma _{\mathcal {P}}(H^\prime )}, {\varGamma _{\mathcal {P}}(K)} \}$$, and since $${\varGamma _{\mathcal {P}}(K)} = \kappa$$ and by (ii) we have $${\varGamma _{\mathcal {P}}(H_t)} = {\varGamma _{\mathcal {P}}(G)} + t$$, we see that
\begin{aligned} {\varGamma _{\mathcal {P}}(G^\prime )} = \max \{{\varGamma _{\mathcal {P}}(G)} + t + 1, \kappa \}. \end{aligned}
Now, we continue by considering the two possibilities. If $${\varGamma _{\mathcal {P}}(G)}\ge \kappa$$, then $${\varGamma _{\mathcal {P}}(G^\prime )} \ge \max \{\kappa + t + 1, \kappa \} = \kappa + t + 1 > \chi _{{\mathcal {P}}}(G^\prime ) + t,$$ which implies $$G^\prime \notin {\mathcal {H}}({\mathcal {P}},t)$$. On the other hand, if $${\varGamma _{\mathcal {P}}(G)}<\kappa$$, then $${\varGamma _{\mathcal {P}}(G^\prime )} \le \max \{\kappa -1+ t + 1, \kappa \} = \kappa + t = \chi _{{\mathcal {P}}}(G^\prime ) + t$$ and hence $$G^\prime \in {\mathcal {H}}({\mathcal {P}},t)$$.

Thus $$G^\prime \notin {\mathcal {H}}({\mathcal {P}},t)$$ if and only if $${\varGamma _{\mathcal {P}}(G)}\ge \kappa$$. $$\square$$

## 6 An upper bound on the $${\mathcal {P}}$$-Grundy number

We conclude our paper with a new upper bound on the $${\mathcal {P}}$$-Grundy number. For clarity of presentation first we recall some notation introduced in the proof of Lemma 4.2 (see “Appendix B”). For a vertex v of a graph G we use $${\mathcal {D}}(G,v)$$ to denote the family of all subsets of $$V(G)\setminus \{v\}$$ such that $$G[D\cup \{v\}]\in {\varvec{F}}({\mathcal {P}})$$ holds for every D in $${\mathcal {D}}(G,v)$$. The set $${N_{G}({\mathcal {P}},v)} = \{u\in D \mid D \text{ is } \text{ a } \text{ member } \text{ of } {\mathcal {D}}(G,v)\}$$ is called the $${\mathcal {P}}$$-neighborhood of vertex v in G. By the $${\mathcal {P}}$$-degree of a vertex v of G, denoted by $${d_{G}({\mathcal {P}},v)}$$, we mean the cardinality of a largest subfamily of $${\mathcal {D}}(G,v)$$ consisting of pairwise disjoint sets.

A natural upper bound
\begin{aligned} {\varGamma _{\mathcal {P}}(G)} \le \max _{v\in V(G)}{d_{G}({\mathcal {P}},v)} + 1 \end{aligned}
(6.1)
follows directly from the greedy color assignment rule. The above bound, however, can be significantly improved by careful analysis of function $${\phi }_{G}:V(G)\rightarrow \mathbb {N}_0$$ defined recursively on the vertex set of a graph G. Namely, let $${{\phi }^{0}_{G}({\mathcal {P}},v)} = {d_{G}({\mathcal {P}},v)}$$. For every integer $$r\ge 1$$, let $${{\phi }^{r}_{G}({\mathcal {P}},v)}$$ be the largest k for which there exist k pairwise disjoint sets $$D_1,\ldots ,D_k$$ in $${\mathcal {D}}(G,v)$$ such that for each of them $${\lambda ^{r-1}_{G}(D_i)}\ge i$$, where $${\lambda ^{r-1}_{G}(D_i)}$$ denotes the $$(r-1)$$st intensity of $$D_i$$ defined as follows
\begin{aligned} {\lambda ^{r-1}_{G}(D_i)} = \min \{{{\phi }^{r-1}_{G}({\mathcal {P}},u)} \mid u\in D_{i}\}, \end{aligned}
where $$i\in \{1,\ldots ,k\}$$. A simple inductive argument shows that $${{\phi }^{r}_{G}({\mathcal {P}},v)}\le {{\phi }^{r-1}_{G}({\mathcal {P}},v)}$$ for every vertex v and every $$r\ge 1$$. This implies the existence of an integer $$t\ge 0$$ such that $${{\phi }^{t}_{G}({\mathcal {P}},v)}={{\phi }^{r}_{G}({\mathcal {P}},v)}$$ for every vertex v and every $$r\ge t$$. Thus $${{\phi }^{t}_{G}({\mathcal {P}},v)}$$ is uniquely determined. The $${\mathcal {P}}$$-potential of a vertex v, denoted by $${{\phi }^{}_{G}({\mathcal {P}},v)}$$, is given by $${{\phi }^{}_{G}({\mathcal {P}},v)}={{\phi }^{t}_{G}({\mathcal {P}},v)}.$$ The $${\mathcal {P}}$$-potential of a graph G, denoted by $${{\varPhi }_{\mathcal {P}}(G)}$$, is defined as follows
\begin{aligned} {{\varPhi }_{\mathcal {P}}(G)} = \max \{{{\phi }^{}_{G}({\mathcal {P}},v)} \mid v\in V(G)\}. \end{aligned}
Let us consider a simple example.

### Example 6.1

Let $$H\in {\varvec{C}}_k({\mathcal {P}})$$ and let $$H_1,\ldots ,H_m$$ with $$m\ge 2$$ be disjoint copies of H. In each $$H_i$$, $$i\in \{1,\ldots ,m\}$$ we distinguish a single vertex $$x_i$$. Let G be a graph obtained from $$H_1,\ldots ,H_m$$ by the identification of vertices $$x_1,\ldots ,x_m$$, and let x denote the unique vertex of G that has neighbors in each $$H_i$$, $$i\in \{1,\ldots ,m\}$$. Using simple arguments, e.g., minimality of H and the fact that x is a cut vertex, it is not hard to see that for every $$v\in V(G)\setminus \{x\}$$ we have $${d_{G}({\mathcal {P}},v)} = 1$$, while $${d_{G}({\mathcal {P}},x)} = m$$. Thus, by (6.1) we have $${\varGamma _{\mathcal {P}}(G)} \le m + 1$$. Moreover, when considering x, observe that the only choice of the sets in $${\mathcal {D}}(G,x)$$ that realize $${d_{G}({\mathcal {P}},x)}$$ is $$D_i=V(H_i)\setminus \{x\}$$ for all $$i\in \{1,\ldots ,{d_{G}({\mathcal {P}},x)}\}$$. Hence $${\lambda ^{0}_{G}(D_i)} = 1$$, which implies $${{\phi }^{1}_{G}({\mathcal {P}},x)} = 1$$. Similarly, other vertices v of G satisfy $${{\phi }^{1}_{G}({\mathcal {P}},v)} = 1$$. This finally gives $${{\phi }^{}_{G}({\mathcal {P}},v)} = 1$$ for all vertices v of G and hence $${{\varPhi }_{\mathcal {P}}(G)} = 1$$. As we will see later on from (6.2) it follows that $${\varGamma _{\mathcal {P}}(G)}\le 2$$, which is best possible. Moreover, the example shows that the difference between the bounds (6.1) and (6.2) can be arbitrarily large. $$\square$$

For the proof of Theorem 6.1 we need the following property.

### Proposition 6.1

Let $${\mathcal {P}}$$ be a class of graphs and let G be a graph in $${\mathcal {P}}$$. If $$H\le G$$ and v is a vertex of H, then $${{\phi }^{r}_{H}({\mathcal {P}},v)}\le {{\phi }^{r}_{G}({\mathcal {P}},v)}$$ for every $$r\ge 0$$.

### Proof

The proof is by induction on r. If $$r=0$$, then the assertion holds by the fact that $${d_{H}({\mathcal {P}},v)}\le {d_{G}({\mathcal {P}},v)}$$. Let $$r>0$$. If $${{\phi }^{r}_{H}({\mathcal {P}},v)}=k$$, then for every $$j\in \{1,\ldots ,k\}$$ there exists $$D_j\subseteq {N_{H}({\mathcal {P}},v)}$$ such that $$H[D_j\cup \{v\}]\in {\varvec{F}}({\mathcal {P}})$$ and $${\lambda ^{r-1}_{H}(D_j)}\ge j$$, which implies $${{\phi }^{r-1}_{H}({\mathcal {P}},u)}\ge j$$ for every $$u\in D_j$$. Thus, by the induction hypothesis, all vertices $$u\in D_j$$ satisfy $${{\phi }^{r-1}_{G}({\mathcal {P}},u)}\ge j$$, where $$j\in \{1,\ldots ,k\}$$. This implies $${\lambda ^{r-1}_{G}(D_j)}\ge j$$ for every $$j\in \{1,\ldots ,k\}$$, which results in $${{\phi }^{r}_{G}({\mathcal {P}},v)}\ge k$$. $$\square$$

### Theorem 6.1

For every class $${\mathcal {P}}$$ and every graph G we have
\begin{aligned} {\varGamma _{\mathcal {P}}(G)} \le {{\varPhi }_{\mathcal {P}}(G)} + 1. \end{aligned}
(6.2)

### Proof

Let G be a graph such that $${\varGamma _{\mathcal {P}}(G)}=k$$. It is not hard to see that the assertion holds for $$k=1$$. Assume $$k\ge 2$$ and let H be an induced subgraph of G such that $$H\in {\varvec{C}}_{k}({\mathcal {P}})$$ and let $$(V_1,\ldots ,V_k)$$ be a Grundy $${\mathcal {P}}$$-coloring $$\varphi$$ of H with k colors. Since every vertex $$v\in V_i$$, $$i\in \{1,\ldots ,k\}$$ is a Grundy vertex, for every $$j\in \{1,\ldots ,i-1\}$$ there exists $$D_j\subseteq {N_{H}({\mathcal {P}},v)}\cap V_j$$ such that $$H[D_j\cup \{v\}]\in {\varvec{F}}({\mathcal {P}})$$ (naturally, $$D_j$$ and $$D_{j^\prime }$$ are disjoint when $$j\ne j^\prime$$). If $$i=k$$, then directly from minimality of H it follows that $$V_k$$ is a singleton, say $$V_k=\{v_k\}$$. On the other hand, if $$i<k$$, then by minimality of H there exist $$w\in V_{i+1}$$ and $$D_i\subseteq {N_{H}({\mathcal {P}},w)}\cap V_{i}$$ such that $$v\in D_i$$ and $$H[D_i\cup \{w\}]\in {\varvec{F}}({\mathcal {P}})$$. In other words, every vertex v with color $$i<k$$ has to be active in forcing some color $$\ell >i$$, for otherwise $${\varGamma _{\mathcal {P}}(H-v)}=k$$, which contradicts the minimality of H. In the proof, for coloring $$\varphi$$ and vertex $$v\in V_i$$ with $$i<k$$ we use $${\mathcal {S}}_i(v)$$ in place of $$D_1,\ldots ,D_i$$ (note that we include $$D_i$$) and we simply say that w is a friend of $$D_i$$.

We claim that the following conditions are satisfied:
1. (a)

$${{\phi }^{r}_{H}({\mathcal {P}},v_k)}\ge k-1$$,

2. (b)

$${{\phi }^{r}_{H}({\mathcal {P}},v)}\ge i$$ for every $$v\in V_i$$, $$i\in \{1,\ldots ,k-1\}$$.

The proof is by induction on r. First we justify conditions (a) and (b) when $$r=0$$. Since for every $$i\in \{1,\ldots ,k-1\}$$ the sets in $${\mathcal {S}}_i(v)$$ are pairwise disjoint, $${d_{H}({\mathcal {P}},v)}\ge i$$ holds, and since $${{\phi }^{0}_{H}({\mathcal {P}},v)}={d_{H}({\mathcal {P}},v)}$$, we have $${{\phi }^{0}_{H}({\mathcal {P}},v)}\ge i$$. Similarly, the sets $$D_1,\ldots ,D_{k-1}$$ are pairwise disjoint and hence $${d_{H}({\mathcal {P}},v_k)}\ge k-1$$, which by the definition of $${\phi }$$ results in $${{\phi }^{0}_{H}({\mathcal {P}},v_k)}\ge k-1$$.

Let $$r\ge 1$$ and assume that the assertion holds for parameters smaller than r. Let $$v\in V_i$$, where $$i\in \{1,\ldots ,k-2\}$$. Assume $$D^\prime = D_i\setminus \{v\}\cup \{w\}$$, where $$D_i\in {\mathcal {S}}_i(v)$$ and w is a friend of $$D_i$$. Since $$w\in V_{i+1}$$, by the induction hypothesis $${{\phi }^{r-1}_{H}({\mathcal {P}},w)}\ge i+1$$ while for every $$u\in D^\prime$$ such that $$u\ne w$$ we have $${{\phi }^{r-1}_{H}({\mathcal {P}},u)}\ge i$$. Hence, by definition $${\lambda ^{r-1}_{H}(D^\prime )}\ge i$$. Moreover, for every $$j\in \{1,\ldots ,i-1\}$$ by the induction hypothesis all vertices $$u\in D_j$$ satisfy $${{\phi }^{r-1}_{H}({\mathcal {P}},u)}\ge j$$ and hence by definition $${\lambda ^{r-1}_{H}(D_j)}\ge j$$. Thus, taking into account the intensities of $$D_1,\ldots ,D_{i-1}$$ and $$D^\prime$$ we get $${{\phi }^{r}_{H}({\mathcal {P}},v)}\ge i$$.

Let $$v\in V_{k-1}$$. Similarly as above, assume $$D^\prime =D_{k-1}\setminus \{v\}\cup \{v_k\}$$, where $$D_{k-1}\in {\mathcal {S}}_{k-1}(v)$$ and $$v_k$$ is the friend of $$D_{k-1}$$. By part (a) of the induction hypothesis we have $${{\phi }^{r-1}_{H}({\mathcal {P}},v_k)}\ge k-1$$ while by part (b) for all $$u\in D^\prime$$ such that $$u\ne v_k$$ we have $${{\phi }^{r-1}_{H}({\mathcal {P}},u)}\ge k-1$$. Hence, by definition $${\lambda ^{r-1}_{H}(D^\prime )}\ge k-1$$. Moreover, by the induction hypothesis applied to all vertices of every $$D_j$$ with $$j\in \{1,\ldots ,k-2\}$$ we get $${\lambda ^{r-1}_{H}(D_j)}\ge j$$. Thus taking into account the intensities of $$D_1,\ldots ,D_{k-2}$$ and $$D^\prime$$ it follows that $${{\phi }^{r}_{H}({\mathcal {P}},v)}\ge k-1$$.

Analogously, for the last case (i.e., when $$v=v_k$$) we directly apply part (b) of the induction hypothesis to all vertices of every $$D_j$$ with $$j\in \{1,\ldots ,k-1\}$$, which clearly results in $${\lambda ^{r-1}_{H}(D_j)}\ge j$$ for all of these sets and hence $${{\phi }^{r}_{H}({\mathcal {P}},v_k)}\ge k-1$$.

Thus (a) and (b) hold, as claimed.

By the above claim and the definition of $${\varPhi }_{{\mathcal {P}}}$$ we have $${{\varPhi }_{\mathcal {P}}(H)}\ge {\phi }_H(v_k)\ge k-1$$, and since from Proposition 6.1 it follows that $${{\varPhi }_{\mathcal {P}}(G)}\ge {{\varPhi }_{\mathcal {P}}(H)}$$, we get $${{\varPhi }_{\mathcal {P}}(G)}\ge {\varGamma _{\mathcal {P}}(G)}-1$$, which completes the proof. $$\square$$

## Notes

### Acknowledgements

Special thanks to Dariusz Dereniowski and Ewa Drgas-Burchardt for their remarks on preliminary version of this paper, and to Sundar Vishwanathan for sending me the manuscript (Goyal and Vishwanathan 1998). An extended abstract of a preliminary version of this paper has been presented at 11th International Workshop on Frontiers in Algorithmics, FAW 2017 (see Borowiecki 2017).

### References

1. Araujo J, Linhares-Sales C (2012) On the Grundy number of graphs with few $$P_4$$’s. Discrete Appl Math 160:2514–2522
2. Borowiecki P (2004) On-line coloring of graphs. In: Kubale M (ed) Graph colorings. Contemporary mathematics, vol 352. American Mathematical Society, Providence, pp 21–33
3. Borowiecki P (2006) On-line $$\cal{P}$$-coloring of graphs. Discuss Math Gr Theory 26:389–401.
4. Borowiecki P (2017) On computational aspects of greedy partitioning of graphs. In: Proceedings of 11th international workshop on frontiers in algorithmics, FAW’17, LNCS 10336. Springer, pp 34–46.
5. Borowiecki P, Rautenbach D (2015) New potential functions for greedy independence and coloring. Discrete Appl Math 182:61–72.
6. Borowiecki P, Sidorowicz E (2012) Dynamic coloring of graphs. Fund Inf 114:105–128.
7. Brandstädt A, Le VB, Spinrad JP (1999) Graph classes: a survey. SIAM monographs in discrete mathematics and applications. SIAM, Philadelphia
8. Brown JI (1996) The complexity of generalized graph colorings. Discrete Appl Math 69:257–270
9. Choudum SA, Karthick T (2010) First-fit coloring of $$\{P_5, K_4-e\}$$-free graphs. Discrete Appl Math 158:620–626
10. Christen CA, Selkow SM (1979) Some perfect coloring properties of graphs. J Combin Theory Ser B 27:49–59
11. Chudnovsky M, Goedgebeur J, Schaudt O, Zhong M (2016) Obstructions for three-coloring graphs with one forbidden induced subgraph. In: Proceedings of 27th annual ACM-SIAM symposium on discrete algorithms, SODA’16, pp 1774–1783Google Scholar
12. Cockayne EJ, Miller GG, Prins G (1972) An interpolation theorem for partitions which are complete with respect to hereditary properties. J Combin Theory Ser B 13:290–297
13. Garey MR, Johnson DS, Stockmeyer L (1976) Some simplified NP-complete graph problems. Theor Comput Sci 1:237–267
14. Goedgebeur J, Schaudt O (2016) Exhaustive generation of $$k$$-critical $$\cal{H}$$-free graphs. In: Proceedings of 42nd international workshop on graph-theoretic concepts in computer science, WG’16, LNCS 9941. Springer, pp 109–120Google Scholar
15. Goyal N, Vishwanathan S (1998) NP-completeness of undirected Grundy numberings and related problems. (Unpublished manuscript)Google Scholar
16. Greenwell DL, Hemminger RL, Klerlein J (1973) Forbidden subgraphs. In: Proceedings of 4th S-E conference on combinatorics, graph theory and computing. Utilitas Mathematica, pp 389–394Google Scholar
17. Grundy PM (1939) Mathematics and games. Eureka 2:6–8Google Scholar
18. Gyárfás A, Király Z, Lehel J (1979) On-line 3-chromatic graphs II. Critical graphs. Discrete Math 177:99–122
19. Gyárfás A, Lehel J (1990) First-fit and on-line chromatic number of families of graphs. Ars Combinatoria 29C:168–176
20. Hedetniemi SM, Hedetniemi ST, Beyer T (1982) A linear algorithm for the Grundy (coloring) number of a tree. Congr Numer 36:351–363
21. Hoàng CT, Moore B, Recoskie D, Sawada J, Vatshelle M (2015) Constructions of $$k$$-critical $$P_5$$-free graphs. Discrete Appl Math 182:91–98.
22. Jensen TR, Toft B (1995) Graph coloring problems. Wiley, New York
23. Kierstead HA (1998) Coloring graphs on-line. In: Fiat A, Woeginger GJ (eds) Online algorithms—the state of the art, vol 1442. LNCS. Springer, Berlin, pp 281–305
24. Kierstead HA, Saoub KR (2011) First-fit coloring of bounded tolerance graphs. Discrete Appl Math 159:605–611.
25. Kortsarz G (2007) A lower bound for approximating Grundy numbering. Discrete Math Theor Comput Sci 9:7–22
26. Kratochvíl J, Schiermeyer I (1997) On the computational complexity of $$({\cal{O}},{\cal{P}})$$-partition problems. Discuss Math Gr Theory 17(2):253–258.
27. Narayanaswamy NS, Subhash Babu R (2008) A note on first-fit coloring of interval graphs. Order 25:49–53
29. Stacho L (2001) New upper bounds for the chromatic number of a graph. J Gr Theory 36:117–120
30. West DB (2001) Introduction to graph theory. Prentice Hall, Upper Saddle RiverGoogle Scholar
31. Zaker M (2006) Results on the Grundy chromatic number of graphs. Discrete Math 306:3166–3173
32. Zaker M (2008) New bounds for the chromatic number of graphs. J Gr Theory 58:110–122