Computational aspects of greedy partitioning of graphs
 531 Downloads
 1 Citations
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 polynomialtime 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 Brookstype 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 graphsMathematics Subject Classification
68Q17 68R10 05C85 05C151 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 divideandconquer 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 equalsized 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 singlevertex 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)}\).
 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?

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 abovementioned 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 LinharesSales 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_4e\}\)free graphs (Choudum and Karthick 2010), polynomialtime constantfactor 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).
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
Proposition 2.1
Let \(\varPi \) be a minimization problem with compositive solutions. If \(\varPi \) admits a polynomialtime \(\delta (n)\)approximation in \({\mathcal {P}}\), then the algorithm \({{\texttt {PH}}}\) is a polynomialtime \(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 k1\) 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 \(k1\) 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}}}},k1)}\) (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}}(Gv)} < 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}}}},k1)}\); more formally \({\varvec{C}}_k({\mathcal {P}})={\varvec{F}}({{\mathcal {G}}({\mathcal {{\mathcal {P}}}},k1)})\). 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}})\).
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 (I, C). 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
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 (I, C) 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 k1\). We shall show that \(H[C]\in {\varvec{C}}_{k1}({\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 \(k1\) 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)(k1)+1 \le n(G) \le \beta ^{k1}.\)
Proof
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}},k1)\) 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 k1 \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 \(k1\) steps starting with \(T_2=F\) and such that for each step \(i\in \{2,\ldots ,k1\}\), 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))^{k1} > (\!\root k1 \of {n^*})^{k1} = 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 polynomialtime 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 ^{k1}\), deciding if H is contained in G can be done in \(O(n^{\beta ^{k1}})\) 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 polynomialtime reduction from 3Coloring 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 3Coloring 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 3Coloring in \({\mathcal {L}}(p1)\). 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 3coloring.
Construction 4.1
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
 (a)
\(V(H)\subseteq V(X_{t,i,j})\),
 (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 3coloring 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 \((p1)\)element subset D of Q, a simple inductive argument shows that every \((p1)\)st vertex of Q new color is introduced with the largest one achieving \(\lceil m(G)/(p1)\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(p1)\) 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 \(p1\) 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 polynomialtime reduction from Grundy \({\mathcal {P}}\) Coloring of graphs in the class \({\mathcal {Q}}(p1)\), where by \({\mathcal {Q}}(p1)\) we mean the class of graphs obtained by the application of Construction 4.1 to all graphs G in \({\mathcal {L}}(p1)\) for which \(m(G)\ge 4p3\) (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}}(p1)\)). Before proving the hardness of the above membership problem we need some facts on the \({\mathcal {P}}\)Grundy number of graphs in \({\mathcal {Q}}(p1)\).
Lemma 5.1
Proof
Let \(G\in {\mathcal {L}}(p1)\), where \(p\ge 3\) and \(m(G)\ge 4p3\). 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)/(p1)\rceil +3\)). We are going to prove that \(\chi _{{\mathcal {P}}}(G^\prime ) = k3\).
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)/(p1) \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 2p1\), then \(\omega (G^\prime ) = m(G)\) (recall \(m(G) = \vert Q \vert \)). Consequently, if \(m(G)\ge 4p3\), then \(\chi _{{\mathcal {P}}}(G^\prime ) \ge k3\).
Next, in order to show \(\chi _{{\mathcal {P}}}(G^\prime ) \le k3\) we start with an arbitrary \({\mathcal {P}}\)coloring of complete graph \(G^\prime [Q]\) using \(k3\) 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)/(p1)\rceil + 3\) and \(m(G)\ge 4(p1)+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 ,k3\}\) 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 \(p1\) 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 \(k3\) 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 ,k3\}\) that can be used for w. The argument is completed by the observation that the same color can be used for all \(p1\) 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 ) = k3\), to complete the proof observe that if \(m(G)\ge 4p3\), then \(m(G)=\omega (G^\prime )\). \(\square \)
Remark 5.1
Since by the above proof \(\chi _{{\mathcal {P}}}(G^\prime ) = k3\), the problem of determining the \({\mathcal {P}}\)Grundy number of graphs in \({\mathcal {Q}}(p1)\) 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}}(p1)\).
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 abovementioned 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 polynomialtime reduction from Grundy \({\mathcal {P}}\) Coloring of graphs in \({\mathcal {Q}}(p1)\) 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 (p1)\) and a set \(S\subseteq V(K)\) such that \(\vert S \vert = p1\) 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 polynomialtime algorithm, the graph \(G^\prime \) can be constructed in polynomial time. See Fig. 4 for an illustration of the construction. \(\square \)
 (i)
\(\chi _{{\mathcal {P}}}(H_t) = \chi _{{\mathcal {P}}}(G)\),
 (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}}(p1)\) 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 )/(p1) \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)/(p1) \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\).
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.
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 ^{r1}_{H}(D_j)}\ge j\), which implies \({{\phi }^{r1}_{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 }^{r1}_{G}({\mathcal {P}},u)}\ge j\), where \(j\in \{1,\ldots ,k\}\). This implies \({\lambda ^{r1}_{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
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 ,i1\}\) 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}}(Hv)}=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\).
 (a)
\({{\phi }^{r}_{H}({\mathcal {P}},v_k)}\ge k1\),
 (b)
\({{\phi }^{r}_{H}({\mathcal {P}},v)}\ge i\) for every \(v\in V_i\), \(i\in \{1,\ldots ,k1\}\).
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 ,k2\}\). 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 }^{r1}_{H}({\mathcal {P}},w)}\ge i+1\) while for every \(u\in D^\prime \) such that \(u\ne w\) we have \({{\phi }^{r1}_{H}({\mathcal {P}},u)}\ge i\). Hence, by definition \({\lambda ^{r1}_{H}(D^\prime )}\ge i\). Moreover, for every \(j\in \{1,\ldots ,i1\}\) by the induction hypothesis all vertices \(u\in D_j\) satisfy \({{\phi }^{r1}_{H}({\mathcal {P}},u)}\ge j\) and hence by definition \({\lambda ^{r1}_{H}(D_j)}\ge j\). Thus, taking into account the intensities of \(D_1,\ldots ,D_{i1}\) and \(D^\prime \) we get \({{\phi }^{r}_{H}({\mathcal {P}},v)}\ge i\).
Let \(v\in V_{k1}\). Similarly as above, assume \(D^\prime =D_{k1}\setminus \{v\}\cup \{v_k\}\), where \(D_{k1}\in {\mathcal {S}}_{k1}(v)\) and \(v_k\) is the friend of \(D_{k1}\). By part (a) of the induction hypothesis we have \({{\phi }^{r1}_{H}({\mathcal {P}},v_k)}\ge k1\) while by part (b) for all \(u\in D^\prime \) such that \(u\ne v_k\) we have \({{\phi }^{r1}_{H}({\mathcal {P}},u)}\ge k1\). Hence, by definition \({\lambda ^{r1}_{H}(D^\prime )}\ge k1\). Moreover, by the induction hypothesis applied to all vertices of every \(D_j\) with \(j\in \{1,\ldots ,k2\}\) we get \({\lambda ^{r1}_{H}(D_j)}\ge j\). Thus taking into account the intensities of \(D_1,\ldots ,D_{k2}\) and \(D^\prime \) it follows that \({{\phi }^{r}_{H}({\mathcal {P}},v)}\ge k1\).
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 ,k1\}\), which clearly results in \({\lambda ^{r1}_{H}(D_j)}\ge j\) for all of these sets and hence \({{\phi }^{r}_{H}({\mathcal {P}},v_k)}\ge k1\).
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 k1\), 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 DrgasBurchardt 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
 Araujo J, LinharesSales C (2012) On the Grundy number of graphs with few \(P_4\)’s. Discrete Appl Math 160:2514–2522MathSciNetCrossRefMATHGoogle Scholar
 Borowiecki P (2004) Online coloring of graphs. In: Kubale M (ed) Graph colorings. Contemporary mathematics, vol 352. American Mathematical Society, Providence, pp 21–33CrossRefGoogle Scholar
 Borowiecki P (2006) Online \(\cal{P}\)coloring of graphs. Discuss Math Gr Theory 26:389–401. https://doi.org/10.7151/dmgt.1331 MathSciNetCrossRefMATHGoogle Scholar
 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. https://doi.org/10.1007/9783319596051_4
 Borowiecki P, Rautenbach D (2015) New potential functions for greedy independence and coloring. Discrete Appl Math 182:61–72. https://doi.org/10.1016/j.dam.2013.12.011 MathSciNetCrossRefMATHGoogle Scholar
 Borowiecki P, Sidorowicz E (2012) Dynamic coloring of graphs. Fund Inf 114:105–128. https://doi.org/10.3233/FI2012620 MathSciNetMATHGoogle Scholar
 Brandstädt A, Le VB, Spinrad JP (1999) Graph classes: a survey. SIAM monographs in discrete mathematics and applications. SIAM, PhiladelphiaCrossRefGoogle Scholar
 Brown JI (1996) The complexity of generalized graph colorings. Discrete Appl Math 69:257–270MathSciNetCrossRefMATHGoogle Scholar
 Choudum SA, Karthick T (2010) Firstfit coloring of \(\{P_5, K_4e\}\)free graphs. Discrete Appl Math 158:620–626MathSciNetCrossRefMATHGoogle Scholar
 Christen CA, Selkow SM (1979) Some perfect coloring properties of graphs. J Combin Theory Ser B 27:49–59MathSciNetCrossRefMATHGoogle Scholar
 Chudnovsky M, Goedgebeur J, Schaudt O, Zhong M (2016) Obstructions for threecoloring graphs with one forbidden induced subgraph. In: Proceedings of 27th annual ACMSIAM symposium on discrete algorithms, SODA’16, pp 1774–1783Google Scholar
 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–297MathSciNetCrossRefMATHGoogle Scholar
 Garey MR, Johnson DS, Stockmeyer L (1976) Some simplified NPcomplete graph problems. Theor Comput Sci 1:237–267MathSciNetCrossRefMATHGoogle Scholar
 Goedgebeur J, Schaudt O (2016) Exhaustive generation of \(k\)critical \(\cal{H}\)free graphs. In: Proceedings of 42nd international workshop on graphtheoretic concepts in computer science, WG’16, LNCS 9941. Springer, pp 109–120Google Scholar
 Goyal N, Vishwanathan S (1998) NPcompleteness of undirected Grundy numberings and related problems. (Unpublished manuscript)Google Scholar
 Greenwell DL, Hemminger RL, Klerlein J (1973) Forbidden subgraphs. In: Proceedings of 4th SE conference on combinatorics, graph theory and computing. Utilitas Mathematica, pp 389–394Google Scholar
 Grundy PM (1939) Mathematics and games. Eureka 2:6–8Google Scholar
 Gyárfás A, Király Z, Lehel J (1979) Online 3chromatic graphs II. Critical graphs. Discrete Math 177:99–122MathSciNetCrossRefMATHGoogle Scholar
 Gyárfás A, Lehel J (1990) Firstfit and online chromatic number of families of graphs. Ars Combinatoria 29C:168–176MathSciNetMATHGoogle Scholar
 Hedetniemi SM, Hedetniemi ST, Beyer T (1982) A linear algorithm for the Grundy (coloring) number of a tree. Congr Numer 36:351–363MathSciNetMATHGoogle Scholar
 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. https://doi.org/10.1016/j.dam.2014.06.007 MathSciNetCrossRefMATHGoogle Scholar
 Jensen TR, Toft B (1995) Graph coloring problems. Wiley, New YorkMATHGoogle Scholar
 Kierstead HA (1998) Coloring graphs online. In: Fiat A, Woeginger GJ (eds) Online algorithms—the state of the art, vol 1442. LNCS. Springer, Berlin, pp 281–305CrossRefGoogle Scholar
 Kierstead HA, Saoub KR (2011) Firstfit coloring of bounded tolerance graphs. Discrete Appl Math 159:605–611. https://doi.org/10.1016/j.dam.2010.05.002 MathSciNetCrossRefMATHGoogle Scholar
 Kortsarz G (2007) A lower bound for approximating Grundy numbering. Discrete Math Theor Comput Sci 9:7–22MathSciNetMATHGoogle Scholar
 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. https://doi.org/10.7151/dmgt.1052 MathSciNetCrossRefMATHGoogle Scholar
 Narayanaswamy NS, Subhash Babu R (2008) A note on firstfit coloring of interval graphs. Order 25:49–53MathSciNetCrossRefMATHGoogle Scholar
 Papadimitriou CH (1994) Computational complexity. Addison Wesley Longman, LondonMATHGoogle Scholar
 Stacho L (2001) New upper bounds for the chromatic number of a graph. J Gr Theory 36:117–120MathSciNetCrossRefMATHGoogle Scholar
 West DB (2001) Introduction to graph theory. Prentice Hall, Upper Saddle RiverGoogle Scholar
 Zaker M (2006) Results on the Grundy chromatic number of graphs. Discrete Math 306:3166–3173MathSciNetCrossRefMATHGoogle Scholar
 Zaker M (2008) New bounds for the chromatic number of graphs. J Gr Theory 58:110–122MathSciNetCrossRefMATHGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.