Abstract 1 Introduction 2 Preliminaries 3 FPT Algorithm for Partial Grundy Coloring 4 FPT Algorithm for Grundy Coloring on 𝑲𝒊,𝒋-free Graphs References

Parameterized Saga of First-Fit and Last-Fit Coloring

Akanksha Agrawal ORCID Indian Institute of Technology Madras, India Daniel Lokshtanov ORCID University of California, Santa Barbara,CA, USA Fahad Panolan ORCID School of Computer Science, University of Leeds, UK Saket Saurabh ORCID The Institute of Mathematical Sciences, HBNI, Chennai, India
Department of Informatics, University of Bergen, Norway
Shaily Verma ORCID Algorithm Engineering Group, Hasso Plattner Institute, Potsdam, Germany
Abstract

The classic greedy coloring algorithm considers the vertices of an input graph G in a given order and assigns the first available color to each vertex v in G. In the Grundy Coloring problem, the task is to find an ordering of the vertices that will force the greedy algorithm to use as many colors as possible. In the Partial Grundy Coloring, the task is also to color the graph using as many colors as possible. This time, however, we may select both the ordering in which the vertices are considered and which color to assign the vertex. The only constraint is that the color assigned to a vertex v is a color previously used for another vertex if such a color is available.

Whether Grundy Coloring and Partial Grundy Coloring admit fixed-parameter tractable (FPT) algorithms, algorithms with running time f(k)n𝒪(1), where k is the number of colors, was posed as an open problem by Zaker and by Effantin et al., respectively.

Recently, Aboulker et al. (STACS 2020 and Algorithmica 2022) resolved the question for Grundy Coloring in the negative by showing that the problem is W[1]-hard. For Partial Grundy Coloring, they obtain an FPT algorithm on graphs that do not contain Ki,j as a subgraph (a.k.a. Ki,j-free graphs). Aboulker et al. re-iterate the question of whether there exists an FPT algorithm for Partial Grundy Coloring on general graphs and also asks whether Grundy Coloring admits an FPT algorithm on Ki,j-free graphs. We give FPT algorithms for Partial Grundy Coloring on general graphs and for Grundy Coloring on Ki,j-free graphs, resolving both the questions in the affirmative. We believe that our new structural theorems for partial Grundy coloring and “representative-family” like sets for Ki,j-free graphs that we use in obtaining our results may have wider algorithmic applications.

Keywords and phrases:
Grundy Coloring, Partial Grundy Coloring, FPT Algorithm, Ki,j-free graphs
Funding:
Akanksha Agrawal: Supported by the New Faculty Seed Grant, IIT Madras
(No. NFSC008972).
Saket Saurabh: Supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 819416).
Copyright and License:
[Uncaptioned image] © Akanksha Agrawal, Daniel Lokshtanov, Fahad Panolan, Saket Saurabh, and
Shaily Verma; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Fixed parameter tractability
Related Version:
Full Version: https://arxiv.org/pdf/2410.20629
Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim Thắng

1 Introduction

A proper coloring of a graph G is an assignment of colors to its vertices such that none of the edges have endpoints of the same color. In k-Coloring, we are given a graph G, and the objective is to test whether G admits a proper coloring using at most k colors. The k-Coloring problem is one of the classical NP-hard problems, and it is NP-complete for every fixed k3. The problem is notoriously hard even to approximate. Indeed, approximating k-Coloring within 𝒪(n1ϵ), for any ϵ>0, is hard [18]. Also, under a variant of Unique Games Conjecture, there is no constant factor approximation for 3-Coloring [14].

The k-Coloring problem has varied applications ranging from scheduling, register allocations, pattern matching, and beyond [8, 9, 29]. Owing to this, several heuristics-based algorithms have been developed for the problem. One of the most natural greedy strategies considers the vertices of an input graph G in an arbitrary order and assigns to each vertex the first available color in the palette (the color palette for us is ). In literature, this is called the first-fit rule. Notice that there is nothing special about using the “first” available color; one may instead opt for any of the previously used colors, if available, before using a new color; let us call this greedy rule the any-available rule. It leads to yet another greedy strategy to properly color a graph, and one can easily prove that this greedy strategy is equivalent to the “last-(available) fit” rule.

For any greedy strategy, one may wonder: How bad can the strategy perform for the given instance? The above leads us to the well-studied fundamental combinatorial problems, Grundy Coloring and Partial Grundy Coloring, that arise from the aforementioned greedy strategies for proper coloring. In the Grundy Coloring problem, we are given a graph G on n vertices and an integer k, and the goal is to check if there is an ordering of the vertices on which the first-fit greedy algorithm for proper coloring uses at least k colors. Similarly, we can define the Partial Grundy Coloring problem, where the objective is to check if, for the given graph G on n vertices and integer k, there is an ordering of the vertices on which the any-available greedy algorithm uses at least k colors. In this paper, we consider these two problems in the realm of parameterized complexity.

The Grundy Coloring problem has a rich history dating back to 1939 [21]. Goyal and Vishwanathan [20] proved that Grundy Coloring is NP-hard. Since then, there has been a flurry of results on the computational and combinatorial aspects of the problem both on general graphs and on restricted graph classes, see, for instance [6, 7, 16, 23, 26, 10, 36, 33, 37, 39, 35, 3, 27, 24, 38] (this list is only illustrative, not comprehensive). The problem Partial Grundy Coloring was introduced by Erdös et al. [16] and was first shown to be NP-hard by Shi et al. [34]. The problem has gained quite some attention thereafter; see, for instance [1, 32, 25, 36, 12, 15, 5, 4].

These problems have also been extensively studied from the parameterized complexity perspective. Unlike k-Coloring, both these problems admit XP algorithms [38, 15], i.e., an algorithm running in time bounded by |V(G)|f(k). The above naturally raises the question of whether they are fixed-parameter tractable (FPT), i.e., admit an algorithm running in time f(k)|V(G)|𝒪(1). In fact, these problems have also been explicitly stated as open problems [1, 7, 23, 33].

Havet and Sampaio [23] studied Grundy Coloring with an alternate parameter and showed that the problem of testing whether there is a Grundy coloring with at least |V(G)|q colors is FPT parameterized by q. Bonnet et al. [7] initiated a systematic study of designing parameterized and exact exponential time algorithms for Grundy Coloring and obtained FPT algorithms for the problem for several structured graph classes. They gave an exact algorithm for Grundy Coloring running in time 2.443nn𝒪(1) and also showed that the problem is FPT on chordal graphs, claw-free graphs and graphs excluding a fixed minor. In the same paper, they stated the tractability status of Grundy Coloring on general graphs parameterized by the treewidth or the number of colors as central open questions. Belmonte et al. [6] resolved the first question by proving that Grundy Coloring is W[1]-hard parameterized by treewidth, but surprisingly, it becomes FPT parameterized by pathwidth. Later, Aboulker et al. [1] proved that Grundy Coloring does not admit an FPT algorithm (parameterized by the number of colors) and obtained an FPT algorithm for Partial Grundy Coloring on Kt,t-free graphs (which includes graphs of bounded degeneracy, graphs excluding some fixed graph as minor/topological minors, graphs of bounded expansion and nowhere dense graphs). A graph is Ki,j-free if it does not have a subgraph isomorphic to the complete bipartite graph with i and j vertices, respectively, on the two sides. They concluded their work with the following natural open questions:

Question 1:

Does Partial Grundy Coloring admit an FPT algorithm?

Question 2:

Does Grundy Coloring admit an FPT algorithm on Ki,j-free graphs?

In this paper, we resolve the questions 1 and 2 in the affirmative by a new structural result and a new notion of representative families for Ki,j-free graphs, respectively. In the next section, we give an intuitive overview of both results, highlighting our difficulties and our approaches to overcome them.

1.1 Our Results, Methods and Overview

Our first result is the following.

Theorem 1.

Partial Grundy Coloring is solvable in time 2𝒪(k5)n𝒪(1).

Our algorithm starts with the known “witness reformulation” of Partial Grundy Coloring. It is known that (G,k) is a yes-instance of Partial Grundy Coloring if and only if there is a vertex subset W of size at most k2 such that, (G[W],k) is a yes-instance of the problem. In the above, the set W is known as a small witness set. Our algorithm is about finding such a set W of size at most k2. Observe that this witness reformulation immediately implies that Partial Grundy Coloring admits an algorithm with running time n𝒪(k2) time. To build our intuition, we first give a simple algorithm for the problem on graphs of bounded degeneracy (or even, nowhere dense graphs). This algorithm has two main steps: (a) classical color-coding of Alon-Yuster-Zwick [2], and (b) independence covering lemma of Lokshtanov et al. [28].

Let (G,k) be a yes instance of Partial Grundy Coloring, where G is a d-degenerate graph on n vertices, and W be a small witness set of size at most k2. As (G[W],k) must be a yes-instance of the problem, there exists an ordering of the vertices such that when we apply any-available greedy rule, it uses at least k colors. Let c^ be this proper coloring of G[W]. The tuple (Wi:={vWc^(v)=i})i[k] is called a k-partial Grundy witness for G. Now we apply the color-coding step of the algorithm. That is, we color the vertices of G using k colors independently and uniformly at random, and let Z1,,Zk be the color classes of this coloring. The probability that for each i[k], WiZi, is kk2. Notice that since G is a d-degenerate graph, we have that Gi=G[Zi], for each i[k], is d-degenerate. Now we exploit this fact and apply the independence covering lemma of Lokshtanov et al. [28]. That is given as input (Gi,k2), in time 2𝒪(dk2)n𝒪(1) it produces a family i of independent sets of Gi, of size 2𝒪(dk2)logn. Furthermore, given any independent set I of Gi of size at most k2, there exists an independent set Fi, such that IF (F covers I). In particular, we know that there is a set Fii that covers Wi. So, the algorithm just enumerates each tuple (F1,,Fk) of 1××k and checks whether (F1,,Fk) is a k-partial Grundy coloring of G[F1Fk]. If (G,k) is a yes instance, our algorithm is successful with probability kk2. Moreover, we can convert the described randomized algorithm to a deterministic one by using the standard derandomization technique of “universal sets” [31, 17]. Some remarks are in order; it can be shown that each of |Wi|k, and hence we can call the independence covering lemma on (Gi,k), resulting in an improved running time of 2𝒪(dk2logk)n𝒪(1). Aboulker et al. [1] proved that Partial Grundy Coloring on Kt,t-free graphs is FPT, which includes t-degenerate graphs. Aboulker et al. did not explicitly mention the running time, but their running time is at least 2ktn. Our new algorithm improves over this. For general instances, we do not have a bound on the degeneracy of the input graph. However, we can achieve this by using our new structural result.

Theorem 2 (Structural result).

There is a polynomial-time algorithm that given a graph G and a positive integer k, does one of the following:

  1. (i)

    Correctly concludes that (G,k) is a yes-instance of Partial Grundy Coloring, or

  2. (ii)

    Outputs at most 2k3 induced bicliques A1,,A in G such that the following holds. For any vV(G), the degree of v in GF is at most k3, where F is the union of the edges in the above bicliques.

The structural result (Theorem 2) is one of our main technical contributions. Next, we show how to design an algorithm for Partial Grundy Coloring using Theorem 2. We follow the same steps as for the one described for the degenerate case. That is, we have color classes Zis and they contain the respective Wis (the part of the small witness set W). Now, to design a family of independent sets in Gi=G[Zi], we do as follows. Let (Lj,Rj) be a bipartition of Aj, for each j[]. Observe that any independent set I (in particular of Gi) intersects Lj or Rj, but not both, for any j[]. Thus, we first guess whether Wi intersects Lj, Rj or none. Let this be given by a function fi:[]{L,R,N}, that is, if fi(j)=L, then WiLj=, if fi(j)=R, then WiRj=, else Wi(LjRj)=. Taking advantage of this property, for each guess of which of Lj or Rj is not contained in Wi, we delete the corresponding set (which is one of Lj or Rj, for each j[]) from Gi. We call the resulting graph Gifi. This implies that for any fi, in Gifi we delete all edges of F (where F is the union of edges in the bicliques). Hence, the maximum degree of Gifi is at most k3, and therefore it has degeneracy at most k3. Now using the independence covering step of the algorithm for degenerate graphs, we can finish the algorithm. The proof of Theorem 2 is obtained by carefully analyzing the reason for the failure of a greedy algorithm.

Our next result is an affirmative answer to Question 2.

Theorem 3.

For any fixed i,j, there is an FPT algorithm that given a graph G and a positive integer k, decides if there is Grundy coloring of G using at least k colors.

For our algorithm, we use a reinterpretation of the problem which is based on the existence of a small witness. Gyárfás et al. [22], and Zaker [38] independently showed that a given instance (G,k) of Grundy Coloring is a yes-instance if and only if there is a vertex subset W of size at most 2k1, such that (G[W],k) is also a yes-instance of the problem. The existence of this small induced subgraph directly yield an XP algorithm for the problem [38]. Using characterizations of  [22, 38] and basic Grundy coloring properties, we can reduce Grundy Coloring to finding a homomorphic image, satisfying some independence constraints, of some specific labeled trees (see Fig. 1, where different parts of it will be discussed, shortly). Let the pair (T,) denote a rooted tree T together with a labeling function :V(T)[k]. Given (T,) and a graph G, a function ω:V(T)V(G) is a labeled homomorphism if: i) for each {u,v}E(T), we have {ω(u),ω(v)}E(G), and ii) for u,vV(T), if (u)(v), then ω(u)ω(v). In particular, we will reduce the problem to the following.

Constrained Label Tree Homomorhism (CLTH) Parameter: |V(T)| Input: A host graph G and (T,:V(T)[k]), where T is a tree. Question: Does there exists a labeled homomorphism ω:V(T)V(G) such that for any z[k], Wi={ω(t)tV(T) and (t)=i} is an independent set in G?

Figure 1: Illustration of a labelled homomorphism ω:V(T4)V(G), where the graph is shown in part (i), T4 with V(T4)={r4,r4,3,r4,2,r4,1,r4,3,2,r4,3,1,r4,2,1} is shown in part (ii), and a relation to Grundy coloring is illustrated in part (iii). Here, ω(r4)=v1, ω(r4,3)=v6, ω(r4,2)=v2,ω(r4,1)=v3,ω(r4,3,2)=v2,ω(r4,3,1)=v3, and ω(r4,2,1)=v4.

Now our goal is to identify ω (and thus the witness set W). The first step of our algorithm will be to use the color-coding technique of Alon-Yuster-Zwick [2] to ensure that the labeling requirement of the graph homomorphism ω is satisfied. To this end, we randomly color the vertices of G using k colors, where we would like the random coloring to ensure that for each z[k], all the vertices in Wz are assigned the color z. Let X1,X2,,Xk be the color classes in a coloring that achieves the above property. Our objective will be to find ω such that vertices of T that are labeled z[k] are assigned to vertices in Xz.

Our next challenge is to find a homomorphism that additionally satisfies the independence condition. That is, vertices of the same label in T are assigned to an independent set in G. Note that the number of potential ωs that satisfy our requirements can be very huge; however, we will be able to carefully exploit Ki,j-freeness to design a dynamic programming-based algorithm to identify one such ω (and thus the set W). Our approach here is inspired by dynamic programming in the design of FPT algorithms based on computations of “representative sets” [30, 19]. However, this inspiration ends here, as to apply known methods we need to have an underlying family of sets that form a matroid. Unfortunately, we do not have any matroid structure to apply the known technique. Here, we exploit the fact that we have a specific labeled tree (T,) and a Ki,j-free graph. Next we define the specific trees that we will be interested in (see Fig. 1, (ii)).

Definition 4.

For each k{0}, we (recursively) define a pair (Tk,k:V(Tk)[k]), called a k-Grundy tree, where Tk is a tree and k is a labelling of V(Tk), as follows :

  1. 1.

    T1=({r1},) is a tree with exactly one vertex r1 (which is also its root), and 1(r1)=1.

  2. 2.

    Consider any k2, we (recursively) obtain Tk as follows. For each z[k1], let (Tz,z) be the z-Grundy tree with root rz. We assume that for distinct z,z[k1], Tz and Tz have no vertex in common, which we can ensure by renaming the vertices.111For the sake of notational simplicity we will not explicitly write the renaming of vertices used to ensure pairwise vertex disjointness of the trees. This convention will be followed in the relevant section. We set V(Tk)=(z[k1]V(Tz)){rk} and A(Tk)=(z[k1]A(Tz)){(rk,rz)z[k1]}. We set k(rk)=k, and for each z[k1] and tV(Tz), we set k(t)=z(t).

For vV(Tk), k(v) is the label of v in (Tk,k), and the elements in [k] are labels of Tk.

Observe that the label of a vertex tV(T) is the depth of the subtree rooted at t (the depth of a leaf is 1). In particular, the leaves are assigned the label 1, and when they are deleted, we get vertices with the label 2 as leaves, and so on. This allows us to do a bottom-up dynamic programming over Tk. Roughly speaking, for each z[k], we solve the special labelled tree homomorphism from ωz:V(Tz)X1X2Xz, where the root of Tz is mapped to a fixed vertex vXz as follows: instead of having all potential choices for ωz (or Wz={ωz(t)tV(Tz)}), we find enough representatives, that will allow us to replace Wz by something that we have stored. It is a priori not clear that such representative sets of small size exist and furthermore, even if they exist, how to find them. The existence and computation of small representative sets in this setting is our main technical contribution for Grundy Coloring.

We heavily exploit the Ki,j-freeness in our “representative set” computation. Very roughly stating, while we have computed required representatives for Wz, and wish to build such a representatives for Wz+1, by exploiting Ki,j-freeness, we either find a small hitting set or a large sub-family of pair-wise disjoint sets. In the former case, we can split the family and focus on the subfamily containing a particular vertex from the hitting set and obtain a “representative” for it (and then take the union over such families). In the latter case, we show that we are very close to satisfying the required property, except for the sets containing vertices from an appropriately constructed small set S of vertices. The construction of this small set S is crucially based on the Ki,j-freeness of the input graph. Once we have the set S, we can focus on sets containing a vertex from it and compute “representatives” for them.

Again, using standard hash functions, we can obtain a deterministic FPT algorithm for the problem by derandomizing the color coding based step [2, 31].

2 Preliminaries

Generic Notations.

We denote the set of natural numbers by . For n, [n] denotes the set {1,2,,n}. For a function f:XY and yY, f1(y):={xXf(x)=y}.

For standard graph notations not explicitly stated here, we refer to the textbook of Diestel [13]. For a graph G, we denote its vertex and edge set by V(G) and E(G), respectively. Also, if the context is clear, we will use n and m to denote the numbers |V(G)| and |E(G)|, respectively. The neighborhood of a vertex v in a graph G is the set of vertices that are adjacent to v in G, and we denote it by NG(v). The degree of a vertex v is the size of its neighborhood in G, and we denote it by dG(v). For a set of vertices SV(G), we define NG(S)=(vSN(v))S. When the graph is clear from the context, we drop the subscript G from the above notations. For XV(G), the induced subgraph of G on X, denoted by G[X], is the graph with vertex set X and edge set {{u,v}u,vX&{u,v}E(G)}. Also, G[V(G)X] is denoted by GX. For vV(G), we use Gv to denote G{v} for ease of notation. For an edge subset FE(G), GF is the graph with vertex set V(G) and edge set E(G)F. A bipartite graph G=(AB,E) is called a biclique if every vertex in A is adjacent to every vertex in B. We assume that A and B are both non-empty sets. For d, a graph is d-degenerate if each of its subgraphs has a vertex of degree at most d. For terminologies related to parameterized complexity, see the textbook of Cygan et al. [11].

3 FPT Algorithm for Partial Grundy Coloring

Consider a graph G and an integer k{0}. For a (not necessarily proper) coloring χ:V(G)[k], for simplicity, we sometimes write χ as the ordered tuple (χ1(1),χ1(2),, χ1(k)). Recall that a proper coloring of a graph is a coloring of its vertices so that for none of its edges, the two endpoints of it are of the same color. Also, a k-partial Grundy coloring of G is a proper coloring c:V(G)[k], such that for each i[k], there is a vertex vV(G) with: (i) c(v)=i and (ii) for every j[i1], there is uNG(v) with c(u)=j.

We will begin with some definitions and results that will be useful in obtaining our main structural result (Theorem 2) and our FPT-algorithm (Theorem 1).

Observe that given a k-partial Grundy coloring of an induced subgraph G^ of a graph G, we can extend this coloring to a partial Grundy coloring of the whole graph G using at least k colors by greedily coloring the uncolored vertices of GV(G^). The following observation will be particularly useful when we work with a small “witness”.

Observation 5.

Given a graph G, an induced subgraph G^ of G, and a partial Grundy coloring of G^ using k colors, we can find a partial Grundy coloring of G using at least k colors in linear time.

Proof.

Let c^:V(G^)[k] be a partial Grundy coloring of G^ with exactly k colors. We construct a partial Grundy coloring c:V(G) of G using at least k colors as follows. For each vertex vV(G^), set c(v):=c^(v). Let v1,v2,,vn be an arbitrarily fixed order of vertices in V(G)V(G^). Let G0=G^, and for each p[n], Gp=G[V(G^{v1,v2,,vp})]. We iteratively create a partial Grundy coloring cp of Gp using at least k colors (in increasing values of p) as follows. Note that c0=c^ is already a partial Grundy coloring of G0 that uses at least k colors. Consider p[n]{0}, and assume that we have already computed a partial Grundy coloring cp1:V(Gp1) of Gp1 that uses kk colors. For each z[k], let Vz=cp11(z). For each vV(Gp1), we set cp(v):=cp1(v). If the vertex vp has a neighbor in each of the sets V1,V2,,Vk, i.e., if for each z[k], NG(vp)Vz, then set cp(vp):=k+1. Otherwise, let z[k] be the smallest number such that NG(vp)Vz=, and set cp(vp):=z. Notice that by construction, cp is a partial Grundy coloring of Gp using at least k colors. From the above discussions, cn is a partial Grundy coloring of G=Gn using at least k colors.

Definition 6.

Consider a graph G and an integer k{0}. A sequence of pairwise disjoint independent sets (Q1,Q2,,Qk) of G is a k-partial Grundy witness if the following holds. For any i[k], there is vQi such that for all j[i1], QjNG(v). The vertex v is called a dominator in Qi.

Observation 7.

Given a graph G and an integer k, let (Q1,Q2,,Qk) be a k-partial Grundy witness. Suppose Y1,Y2,,Yk are pairwise disjoint independent sets in G such that QiYi, for all i[k]. Then (Y1,Y2,,Yk) is also a k-partial Grundy witness of G.

A k-partial Grundy witness (X1,X2,,Xk) is small if for each i[k], |Xi|ki+1. Next, we prove the existence of a small k-partial Grundy witness. This result is the same as the one obtained by Effantin et al. [15]; however, it is stated slightly differently for convenience.

Observation 8 ().

​​​222The proofs of the result marked with can be found in the full version of the paper on arXiv. Let G be a graph and k be an integer, where G has a k-partial Grundy witness (Q1,,Qk). Then, there exists a k-partial Grundy witness (X1,X2,,Xk) such that for each i[k], XiQi and |Xi|ki+1.

The remainder of this section is organized as follows. In Section 3.1 we prove our key structural result (Theorem 2), and then obtain our algorithm in Section 3.2. (Readers who may want to read the algorithm directly, may skip Section 3.1.)

3.1 Degree Reduction: Proof of Theorem 2

The objective of this section is to prove Theorem 2. The proof of this theorem is based on the following lemma for bipartite graphs.

Lemma 9.

There is a polynomial-time algorithm that, given a bipartite graph G=(AB,E) and a positive integer k, does one of the following.

  1. (i)

    Correctly concludes that the partial Grundy coloring of G is at least k.

  2. (ii)

    Outputs at most 4k4 bicliques A1,,A in G such that for any vV(G), degree of v in GF is at most k2, where F is the union of the edges in the above bicliques.

We first give a proof of Theorem 2 based on the above lemma.

Proof of Theorem 2.

Consider a graph G and a positive integer k. First, we run the first-fit greedy algorithm for proper coloring of the graph G for an arbitrarily fixed ordering (v1,v2,,vn) of V(G). For each j, let Cj be the vertices colored j and k be the largest integer such that Ck. Note that (C1,,Ck) is a proper coloring of G. Also, for any j[k] and any vertex v in Cj, v has a neighbor in Cj for all j[j1]. If kk, then (C1,,Ck) is a partial Grundy coloring of G using at least k colors, and thus we can correctly report it.

Next, we assume that k<k. Note that all the edges in G are between the color classes C1,,Ck. Now for every distinct i,j[k], where i<j, we apply Lemma 9 on (Hi,j=(CiCj,E(Ci,Cj)),k), where E(Ci,Cj) is the set of edges in G between the color classes Ci and Cj. Our algorithm will declare that G has a partial Grundy coloring using at least k colors if we get the output given in statement (i) in any of the (k2) applications of Lemma 9. Otherwise, for every distinct i,j[k], where i<j, let Ai,j,1,,Ai,j,i,j be the bicliques, we get as output by the algorithm in Lemma 9 on (Hi,j ,k). Note that i,j4k4. Now our algorithm will output the bicliques {Ai,j,r: 1i<jk,r[i,j]}. As k<k for all 1i<jk, the number of bicliques we output is at most (4k4)(k2), that is, at most 2k3. Since any vertex in a color class Cr has neighbors in other color classes, for r[k] and we applied Lemma 9 for every pair of color classes, the degree of v in GF is at most k3 for any vV(G), where F is the union of the edges in the above bicliques. This completes the proof of the theorem.

We now focus on the proof of Lemma 9. Toward this, we give a polynomial time procedure that, given a bipartite graph G=(LR,E) and a positive integer k, either concludes that the input graph has partial Grundy coloring using at least k colors or it outputs at most 2k2 bicliques A1,,A in G such that for any vL, dGF(v)k2, where F is the union of the edges in the above bicliques. That is, removal of the edges of these bicliques bounds the degree of each vertex in L by k2. We get the proof of Lemma 9 by applying this algorithm once for L and then for R.

Overview of our algorithm.

Let σ=v1,v2,,vn be an ordering of the vertices in L in non-increasing order of their degree in G. The algorithm constructs specific color classes Q1,Q2,,Qr in this order so that (C1=Qr,C2=Qr1,,Cr=Q1) is an r-partial Grundy witness, where |Qj|j. Furthermore, we will construct sets Bi, i[r], which will be used to construct the bicliques. Notice that if we obtain rk, then we will be able to conclude that G has a partial Grundy coloring using at least k colors. Let Q1={v1} and in our construction v1 will be the dominator in Q1 (and our construction needs to ensure this property; see Definition 6). Consider the construction of Q2. Let i be the smallest index in {2,3,,n} for which there is a vertex wNG(v1) such that vi is not adjacent to w. Then, we set Q2={vi,w}, and designate vi as the dominator in color class Cr1=Q2. Notice that all the vertices in B1={v2,,vi1} are adjacent to all the vertices in NG(v1), and hence they together form a biclique (with bipartition B1 and NG(v1)). This property will be extended in building each Qjs and the required bicliques.

For the construction of Qj, we consider unprocessed vertices (i.e., the vertices that do not belong to the previously constructed sets, i.e., to Q1B1Qj1Bj1) as follows. We would now like to choose an unprocessed vertex vi, so that we can make vi the dominator of Qj, and additionally, for each j[j1], we can include a neighbor of the dominator from Qj to the set Qj. Note for us to do the above, we need to ensure that the vertices that we add to Qj is an independent set in G, and all the vertices that we want to include in the set Qj are outside Q1Qj1. That is, among the unprocessed vertices, we choose the first vertex vi with the following property: for each j[j1], we have a neighbor wj of the previously constructed dominator in Qj such that wjQ1Qj1 and (vi,wj)E(G); we set Qj={vi,w1,,wj1}. We would like to mention that all the dominators we construct are from the bipartition L and hence {w1,,wj1}R. This will imply that Qj is an independent set.

Moreover, by the choice of vi as the smallest vertex with the desired property, it follows that for any vertex vr that appears before vi in the order σ and vrP=Q1Qj1, the vertex vr is adjacent to all the vertices in N(xj)P, where xj is the dominator in Qj, for some j[j1]. Then we add vr to Bj. Note that in the above process, we still maintain the biclique property, by explicitly ensuing that Bj and N(xj)(Q1Qj1Qj) forms a biclique.

Description of the algorithm.

We give a pseudocode of our algorithm in Algorithm 1. First, the algorithm intializes the sets Bi and Qi to be the empty set, for all i[k] (see Algorithm 1). Let σ=v1,v2,,vn be an ordering of the vertex set L in the non-increasing order of their degrees. Now, we want to construct the color classes Q1,Q2,,Qk, iteratively, such that (C1,C2,,Ck)=(Qk,Qk1,,Q1) is a k-partial Grundy witness. At line 3, we intialize with Q1:={v1}, x1:=v1, and fix the index q=2. Here, Q1 will be the color class Ck with dominator vertex x1. Now consider an iteration of the while loop. The algorithm checks if the set L(j[q1](QjBj)) is non-empty and executes the while loop. At this point we have constructed sets Q1,,Qq1 such that (Qq1,Qq2,,Q1) is a (q1)-partial Grundy witness such that each xi is a dominator vertex in Qi. Let vr be the first unprocessed vertex in L and P=j[q1]Qj by Lines 5 and 6. Now, we check if we can construct the current color class Qq with vertex vr as a dominator vertex, and for that, we need to add a neighbor wj (which is not added to any Qi before) for each already discovered dominator xj such that wj is non-adjacent to vr. Now, if there exists some j[q1] such that each neighbor of xj is a neighbor of vr , then we will not be able to construct Qq with vertex vr in it. In that case, we choose such a value j and add vr to Bj(See Line 8). Here, notice that vr is adjacent to all the vertices N(xj)P. We will maintain this property for all the vertices added to Bj, i.e., Bj union N(xj)iQi forms a biclique. Now consider the case that the condition in the if statement in Line 7 is false. Then, we choose a vertex wjN(xj)(PN(vr)) for each j[q1], by line 11 and set the vertex vr as the dominator for Qq, that is, Qq:={xq}{w1,,wq1}, at Line 13. Notice that Qq is an independent set because there is no edge between x1 and a vertex in {w1,,wq1}, and {w1,,wq1} is a subset of R, the right part of the bipartition of G. We repeat the iteration until one of the while loop conditions at line 4 fails. Next, if qk+1, we conclude that G has a partial Grundy coloring using k colors by line 18, because (Qq1,,Q1) is a (q1)-partial Grundy witness, where q1k. Otherwise, by line 20, let Aj be the graph induced on Bj(N(xj)P) and Sj be the graph induced on N[xj], for each j[q1]. Recall that Aj is a biclique. It is easy to see that Sj is a biclique, because G is a bipartite graph. At line 21, the algorithm outputs the set of graphs A1,,Aq1 and S1,,Sq1.

Algorithm 1 Algorithm for one-sided bipartite structural result.

The number of iterations of the while loop is at most n and each step in the algorithm takes polynomial time, the total running time of the algorithm is polynomial in the input size. Next, we prove the correctness of the algorithm.

Lemma 10.

Algorithm 1 is correct.

Proof.

Let q be the value of q at the end of the algorithm. To prove the correctness of the algorithm, first, we prove the following claim.

Claim 11.

The following statements are true.

  1. (i)

    For each i[q1], Qi is an independent set and Qi.

  2. (ii)

    For each i[q1] and j[i1], N(xj)Qi.

  3. (iii)

    For each i[q1] and vBi, v is adjacent to all the vertices in N(xi)(j[q1]Qj) and dG(v)dG(xi).

Proof.

We prove the statements by induction on i. The base case is when i=1. Clearly, Q1={x1} and hence statement (i) is true. Statement (ii) is vacuously true. Next, we prove statement (iii). Notice that in any iteration of the while loop, in Step 8, we may add a vertex vr to B1. If this happens, then we know that N(x1)PN(vr), where P is a subset of j[q1]Qj. That is, all the vertices in N(x1)P are adjacent to vr. This implies that vr is adjacent to all the vertices in N(x1)(j[q1]Qj). Since x1 is the vertex with the maximum degree, we have that dG(vr)d(x1).

Next, for the induction step, we assume that the induction hypothesis is true for i1, and we will prove that the hypothesis is true for i. Consider the iteration h of the while loop when q=i and Steps 11-14 is executed. Let vr be the vertex mentioned in Step 5 during that iteration. The vertices w1,,wq1 belongs to R (the right side of the bipartition of G) and hence {w1,,wq1} is an independent set. Also, notice that each wj does not belong to N(vr) (See Step 11). Hence, Qq:={vr}{w1,,wq1} is an independent set and Qq. Thus, we proved statement (i). Again, notice that wjN(xj) for all j[q1] (See Step 11). Thus, statement (ii) follows. Next, we prove statement (iii), which is similar to the proof of it in the base case. Notice that in any iteration of the while loop (after the iteration h), in Step 8, we may add a vertex vr to Bi. If this happens, then we know that N(xi)PN(vr), where P is a subset of j[q1]Qj. That is, all the vertices in N(xi)P are adjacent to vr. This implies that vr is adjacent to all the vertices in N(xi)(j[q1]Qj). Since xiQi, considered in iteration h, dG(vr)dG(xi) (See Step 5). This completes the proof of the claim.

Figure 2: Here the vertex vBi in the biclique Ai (right side). The number of neighbors of v outside Ai (blue edges) cannot be more than |P| as dG(v)dG(xi)=|NG(xi)| and v has |N(x)P| neighbours in the biclique Ai.

Now suppose qk+1. Then, by Statements (i) and (ii) in Claim 11, we get that (Qk,,Q1) is a partial Grundy coloring of the graph induced on j[q1]Qj. Thus, if the algorithm executes Step 18, then it is correct because of Claim 5.

Now suppose qk. Then the algorithm executes Step 21 and outputs the sets A1,,Aq1 and S1,,Sq1. Statement (iii) in Claim 11 implies that each Aj is a biclique in G, where j[q1]. Also, note that Sj is a biclique in G as it is induced on the set N[xj], for each j[q1]. Let F be the union of the edges in the bicliques A1,,Aq1 and S1,,Sq1. Next, we prove that for any vL, dGF(v)k2. Let X={x1,,xq1}. It is easy to see that |Qj|k and LQj={xj}X, for all j[q1] (See Steps 11-13). Hence, |j[q]Qj|k2. Let v be an arbitrary vertex in L. Note that if vX, the degree of v in GF is zero (by the definition of Sj). Next, suppose that vLX. Since Lj[q1](QjBj) (this is the condition for while loop to exit) and LQjX for all j[q1], v belongs to Bi for some i[q1]. By statement (iii) in Claim 11, v is adjacent to all the vertices in N(xi)(j[q1]Qj) and dG(v)dG(xi). Recall that the biclique Ai is the graph with bipartition Bi and N(xi)(j[q1]Qj). Moreover vBi and dG(v)dG(xi)=|NG(xi)|. This implies that the number of neighbors of v that does not belong to Ai is at most |j[q1]Qj|, which is upper bounded by k2. Therefore, the degree of v in GF is at most k2. See Figure 2 for an illustration. This concludes the proof.

3.2 FPT Algorithm for Partial Grundy Coloring

In this section, we design an FPT algorithm 𝒜 for Partial Grundy Coloring when the input has a structure dictated the second item of Lemma 9. Then, we explain how to get an FPT algorithm for Partial Grundy Coloring on general graphs using 𝒜 and Theorem 2. Moreover, our algorithm 𝒜 will provide a faster algorithm for Partial Grundy Coloring on d-degenerate graphs, improving the result in [1]. Toward the first task, we define the following problem.

Structural Partial Grundy Coloring (SPGC ) Input: Positive integers k,d,, a graph G, and bicliques A1,,A in G such that GF is d-degenerate, where F is the union of the edges in the above bicliques. Question: Decide if there is a partial Grundy coloring for G using at least k colors.

First, we design a randomized polynomial time algorithm 𝒜1 for SPGC with a success probability at least (k(d+1))2k2k2k. We increase the probability of success to a constant by running 𝒜1 multiple times. Finally, we explain the derandomization of our algorithm. Then we prove Theorem 1 using this algorithm and our structural result (Theorem 2). To design the algorithm 𝒜1, we use the following result of Lokshtanov et al. [28].

Proposition 12 (Lemma 1.1. [28]).

There is a linear-time randomized algorithm that, given a d-degenerate graph H and an integer k, outputs an independent set Y such that for any independent set X in H with |X|k, the probability that XY is at least ((k(d+1)k)k(d+1))1.

The algorithm 𝒜1 has the following steps.

  1. 1.

    Color all vertices in V(G) uniformly and independently at random with colors from the set [k]. Let the obtained coloring be ϕ:V(G)[k], and Zi=ϕ1(i), for each i[k].

  2. 2.

    For each i[], let Ai=(LiRi,Ei). For each j[k] and i[], uniformly at randomly assign Pj,i:=Li or Pi:=Ri. That is, with probability 12, Pj,i:=Li and with probability 12, Pj,i:=Ri. Let Dj=i[]Pj,i.

  3. 3.

    Now for each j[k], we apply the algorithm in  Proposition 12 for (G[ZjDj],k) to obtain an independent set Yj.

  4. 4.

    If (Y1,,Yk) is a k-partial Grundy witness of G, then output Yes, else, output No.

Since the algorithm in  Proposition 12 runs in linear time, the algorithm 𝒜1 can be implemented to run in linear time because Z1,,Zk is a partition of V(G). Clearly, if the algorithm 𝒜1 outputs Yes, then G has a k-Partial Grundy witness and hence G has a partial Grundy coloring using at least k colors. We can prove that if G has a k-Partial Grundy witness the algorithm 𝒜1 outputs Yes with probability (k(d+1))2k2k2k.

Also, by running 𝒜1, 3(k(d+1))2k2+k2k times and outputting Yes if at least one of the runs outputs a Yes, and outputs No, otherwise, we can boost the success probability to 2/3, and thus obtain the following result.

Theorem 13.

There is a randomized algorithm for SPGC running in time 𝒪((k(d+1))2k2+k2k(m+n)). In particular, if (G,k) is a no-instance then with probability 1 the algorithm outputs No; and if (G,k) is a yes-instance then with probability 2/3 the algorithm outputs Yes.

Theorem 2 and 13 imply the following theorem.

Theorem 14.

There is a randomized algorithm for Partial Grundy Coloring running in time 2𝒪(k4)n𝒪(1). In particular, if (G,k) is a no-instance then with probability 1 the algorithm outputs No; and if (G,k) is a yes-instance then with probability 2/3 the algorithm outputs Yes.

Proof Sketch.

First we run the algorithm mentioned in Theorem 2. If it concludes that G has a partial Grundy coloring with at least k colors, then we output Yes. Otherwise, we get at most 2k3 induced bicliques A1,A in G such that the following holds. For any vV(G), the degree of v in GF is at most k3, where F is the union of the edges in the above bicliques. That is the degeneracy of GF is at most k3. Then, we apply Theorem 13, and ouputs accordingly.

The derandomization of our algorithm can be found in the full version.

4 FPT Algorithm for Grundy Coloring on 𝑲𝒊,𝒋-free Graphs

This section aims to prove Theorem 3. Consider fixed i,j{0}, where ij. Recall that a graph is Ki,j-free if it does not contain a subgraph isomorphic to Ki,j. We call the special case of Grundy Coloring where the input graph is Ki,j-free, Ki,j-Free Grundy Coloring. Let (G,k) be an instance of Ki,j-Free Grundy Coloring. We begin by intuitively explaining the flow of our algorithm.

Consider a Grundy coloring c:V(G)[k] of G, where kk, and for each z[k], c1(z). Furthermore, for z[k], let Cz=c1(z). Let us focus on the first k color classes, and for z[k], arbitrarily fix a vertex vzCz. (Note that vz has a neighbor in Cz, for each z[z1].) We next intuitively describe construction, for each z[k], a set Wz initialized to {vz} as follows. Basically, for each vz, add an arbitrarily chosen neighbor of it in color class Cz, for every z<z. We do the above process exhaustively; whenever we add a vertex to a set Wz, we add an arbitrarily chosen neighbor of it from each color class Cz to Wz, where z<z. Then, let W=z[k]Wz; we will call such a set W a k-Grundy set for G and we will show that such a set of size at most 2k1 exists (for yes instances). For z[k], let Wz=z[z]Wz and W>z=z[k][z]Wz. Note that c|W is a k-Grundy coloring of G[W]. Also, we will show that G has a Grundy coloring using at least k colors if and only if some subgraph of G has a Grundy coloring using exactly k colors. We remark that the above result and the existence of W are the same as the results of Gyárfás et al. [22] and Zaker [38], although, for the sake of convenience, we state it here slightly differently. If we can identify all the vertices in W (or some other k-Grundy set), then we will be done. The first step of our algorithm will be to use the technique of color coding to randomly color the vertices of G using k colors so that, for each z[k], vWz is colored z; such a coloring will be a nice coloring and it will be denoted by χ.

The next step of our algorithm is inspired by the design of FPT algorithms based on computations of “representative sets” [30, 19]. To this end, we will interpret W in a “tree-like” fashion. With this interpretation, in a bottom-up fashion, for each z[k] and vXz, we will compute a family z,v, so that, if vWz, then there will be Wz,v so that WW>z is also a k-Grundy set for G. We will now formalize the above steps.

Grundy Tree & Grundy Witness.

We recall the Definition 4 from Section 1, and obtain some properties regarding it.

Observation 15 ().

For k{0}, for the k-Grundy tree (Tk,k), |V(Tk)|=2k1.

Observation 16 ().

Consider k{0} and the k-Grundy tree (Tk,k). We have |1(k)|=1 and for each z[k1], |k1(z)|=2kz1.

Next, we define the notion of k-Grundy witness in a graph G.

Definition 17.

Consider k{0} and a graph G. A k-Grundy witness for G is a function ω:V(Tk)V(G), where (Tk,k) is the k-Grundy tree, such that: 1) for each z[k], {ω(t)tV(Tk) and k(t)=z} is an independent set in G, 2) for each t,tV(Tk), if k(t)k(t) then ω(t)ω(t), and 3) for each (t,t)A(Tk), we have {ω(t),ω(t)}E(G).

Figure 3: An illustration of a graph G that admits a 4-Grundy coloring (on the left) and a 4-Grundy-witness ω (on the right).

Recall that for k{0}, for the k-Grundy tree (Tk,k), Tk is the tree obtained by adding a root vertex rk attached to the roots of (pairwise vertex disjoint) trees Tk1,Tk2,,T1, where for each z[k1], (Tz,z) is the z-Grundy tree. We have the following observation.

Observation 18 ().

Consider k{0}, a graph G and a k-Grundy witness ω:V(Tk)V(G) for G. For each z[k], ω|V(Tz) is a z-Grundy witness for G.

The next observation is a partial Grundy counterpart of Observation 5.

Observation 19 ().

Consider a graph G, any induced subgraph G^ of it, and an integer k. If G^ has a Grundy coloring that uses exactly k colors, then G has a Grundy coloring that uses at least k colors.

In the following two lemmas, we show that the existence of a k-Grundy witness for a graph is equivalent to the graph admitting a Grundy coloring with at least k colors.

Lemma 20.

For any k{0} and a graph G, if G has a k-Grundy witness, then G has a Grundy coloring with at least k colors.

Proof.

Consider a graph G and any k{0}. For a k-Grundy witness ω:V(Tk)V(G) of G, let V^ω={ω(t)tV(Tk)}, and for each z[k], let V^ω,z={ω(t)tV(Tk) and k(t)=z}. Note that from item 2 of Definition 17, V^ω,1,V^ω,2,,V^ω,k is a partition of V^ω, where none of the parts are empty. Let cω:V^ω[k] be the function such that for each z[k] and vV^ω,z, we have cω(v)=q.

For each k{0} and a k-Grundy witness ω:V(Tk)V(G) of G, we will prove by induction (on k) that cω is Grundy coloring of G[V^ω] using k colors. The above statement, together with Observation 19, will give us the desired result.

The base case is k=1, where T1 has exactly one vertex, r1. For any 1-Grundy witness, ω of G, note that cω(ω(r1))=1 is a Grundy coloring for G[{ω(r1)}] using 1 color. Now for the induction hypothesis suppose that for some k^{0,1}, for each 0<k<k^, the statement is true. Now we will prove the statement for k=k^, and to this end, we consider a k-Grundy witness ω:V(Tk)[k], where rk is the root of Tk. Recall that Tk is the tree obtained by adding a root vertex rk attached to the roots of (pairwise vertex disjoint) trees Tk1,Tk2,,T1, where for each z[k1], (Tz,z) is the z-Grundy tree, and Tz is rooted at rz. Let V=V^ωV^ω,k, and consider a vertex vV^ω,z, where z[k1]. We will argue that for each z[z1], NG(v)V^ω,z. Note that there must exists z[k1] and tV(Tz) such that ω(t)=v and z(v)=z, and we arbitrarily choose one such z and t. Let Vz={ω(t)tV(Tz)}. From Observation 18, ωz=ω|V(Tz) is a z-Grundy witness for G. Thus, from our induction hypothesis, cωz=cω|Vz is a Grundy coloring for G[Vz]. From the above we can conclude that for each q[z1], NG(v)V^ω,z. Now consider the vertex ω(rk)=vk and any z[k1]. Note that k(rz)=z and from item 3 of Definition 17, we can obtain that {vk,ω(rz)}E(G). From the above discussions, we can obtain that cω is Grundy coloring of G[V^ω] using at least z colors. This concludes the proof.

Lemma 21.

For any k{0} and a graph G, if G has a Grundy coloring with at least k colors, then G has a k-Grundy witness.

Proof.

Consider a Grundy coloring c:V(G)[k] of G with kk colors, and for each q[k], let Cq=c1(q). We construct a Grundy witness ω:V(Tk)V(G) by processing labels of Tk starting at k and iteratively proceeding to smaller labels as follows while maintaining the below invariants.
Pre-condition: When we begin processing a label q[k1], for each tV(Tk) with k(t)q, we have fixed the vertex ω(t).
Post-condition: After processing label q[k], we have fixed, for each tV(Tk) with k(t)q, and tNTk[t], the vertex ω(t); and these are the only vertices in Tk for which the vertex in G assigned by ω is determined.

Note that the pre-condition is vacuously satisfied for q=k. Recall that Tk is the tree obtained by adding a root vertex rk attached to the roots rk1,rk2,,r1 of (pairwise vertex disjoint) trees Tk1,Tk2,,T1, respectively, where for each q[k1], (Tq,q) is a q-Grundy tree. Pick any vertex vkCk, and set ω(rk):=vk and for each q[k1], set ω(rq):=wqk, where wqk is an arbitrarily chosen neighbor of vk from Cq (which exists as c is a Grundy coloring). After the above step, the post-condition is satisfied for q=k.

Now we (iteratively, in decreasing order) consider q[k1]{1}. From the pre-condition for q, we have fixed, for each tV(Tk) with k(t)q, the vertex ω(t). Consider tV(Tk) with k(t)=q and let vt=ω(t). Let T^q be the subtree of Tk rooted at t, and let ^q=k|V(T^q). Notice that (T^q,^q) is a q-Grundy tree, where T^q is the tree obtained from by adding edge between t and the roots r^q1,r^q2,,r^1 of T^q1,T^q2,,T^1, respectively, where (T^q,k|V(T^q)) is a q-Grundy tree, for each q[q1]. For each q[q], let w^qq be an arbitrarily chosen vertex from NG(v)Cq, and we set ω(r^q)=w^qq. Notice that after the above step, the post-condition is satisfied for q, and the pre-condition is satisfied for q1.

After we are done processing each q[k]{1}, the post-condition for q=2 (and the pre-condition of q=1 implies that for each tV(Tk), we have determined the vertex ω(t)). Moreover, the construction of ω implies that all the three conditions in Definition 17 are satisfied. This concludes the proof.

We next summarize the result we obtain from the above two lemmas.

Lemma 22.

Consider any k{0} and a graph G. The graph G has a k-Grundy witness if and only if G has a Grundy coloring with at least k colors.

Color Coding of 𝑮.

We will next use the above lemma to simplify our job in the following sense. Let ω:V(Tk)V(G) be a (fixed) k-Grundy witness of G (if it exists), where (Tk,k) is a k-Grundy tree. Let V^ω={ω(t)tV(Tk)}, and for each q[k], let V^ω,q={ω(t)tV(Tk) and k(t)=q}. Roughly speaking, our new objective will be to find the vertices in V^ω and say that G[V^ω] admits a Grundy coloring with at least k colors, using which we can conclude that G admits a Grundy coloring with at least k colors. We will use the technique of color coding introduced by Alon et al. [2], to color the vertices in V^ω “nicely” as follows. Color each vertex in G uniformly at random using a color from [k], and let χ:V(G)[k] be this coloring. A nice coloring is the one where, for each q[k], the coloring assigns the color q to all the vertices in V^ω,q.

We will work with the assumption that χ is a nice coloring of G, and for each q[k], let Xq=χ1(q). Our objective will be to look for a k-Grundy witness ω^:V(Tk)V(G), where (Tk,k) is a k-Grundy tree, such that for each q[k] and tV(Tk) with k(t)=q, we have ω^(t)Xq. To this end, we will store a “Grundy representative family” for each vertex in a bottom-up fashion, starting from q=1. The definition of such a representative is inspired by the q-representative families [30, 19], although here we need a “vectorial” form of representation. To this end, we introduce the following notations and definitions.

Grundy Representative Sets.

Recall we have the coloring χ of G with color classes Xz=χ1(z), for z[k]. A vertex subset AV(G) is χ-independent if for each z[k], AXz is an independent set in G. For p, a family of vertex subsets is a p-family if each set in has size at most p and each A if χ-independent. We will only be working with vectors all of whose entries are from without explicitly stating it. For a vector q=(q1,q2,,qk), 𝗌𝗎𝗆(q) denotes the number z[q]qz. For a vector q=(q1,q2,,qk) and BV(G), we say that the size of B is q, written as |B|=q, if for each z[k], |BXz|=qz. For vertex subsets A and B, A fits B if AB is χ-independent. For two vectors q1=(q11,q21,,qk1) and q2=(q12,q22,,qk2), and {,,>,<,=}, we write q1q2 if for each z[k], we have qz1qz2. We next define the notion of q-Grundy representation.

Definition 23.

Consider p, a vector q=(q1,q2,,qk), and a p-family of vertex subsets of G. For a sub-family , we say that q-Grundy represents , written as grepq, if the following holds. For any set B of size q, if there is A that fits B, then there is A that fits B. In the above, is a q-Grundy representative for .

Next, we obtain some properties regarding q-Grundy representatives.

Observation 24 ().

Consider p, a vector q=(q1,q2,,qk), and any two p-families 1 and 2. If 1grepq1 and 2grepq2, then 12grepq12.

Consider p and vV(G). For a family over V(G), +v denotes the family {A{v}A and A{v} is χ-independent}. Similarly, v denotes the family {A{v}A}. A p-family is a (p,v)-family if for each A, we have vA.

Observation 25 ().

Consider p, a vector q=(q1,q2,,qk), a vertex vV(G) and a (p,v)-family . Let h be the vector obtained from q by increasing its χ(v)th coordinate by 1. If grephv and ′′grepqv, then (+v)(′′+v)grepq.

For a p1-family 1 and a p2-family 2, we define a (p1+p2)-family, 12={A1A2A11,A22, and A1A2 is χ-independent}. The following lemma will be helpful in obtaining a q-representative for 12.

Lemma 26.

Consider a p1-family 1, a p2-family 2, and a vector q=(q1,q2,,qk), where 𝗌𝗎𝗆(q)+p1+p22k1. Let 11 be a p1-family such that for every vector q1q with 𝗌𝗎𝗆(q1)𝗌𝗎𝗆(q)+p2, 1grepq11. Similarly, consider a p2-family 22 such that for every vector q2q with 𝗌𝗎𝗆(q2)𝗌𝗎𝗆(q)+p1, 2grepq22. Then, 12grepq12.

Proof.

Consider any BV(G) of size q for which there is A12, such that A fits B. As A12, there must exist sets A11, A22, such that A1A2=A.

Let δ1=(δz1=|(A2Xz)B|)z[k]. Note that |BA2|=q+δ1, A1 fits BA2 and 𝗌𝗎𝗆(q)+𝗌𝗎𝗆(δ1)𝗌𝗎𝗆(q)+p2. By the premise of the lemma, there exist A11 such that A1 fits BA2, as 1grepq+δ11. The above implies that A2 fits BA1, where A11. Let δ2=(δz2=|(A1Xz)B|)z[k], and note that |BA1|=q+δ2, A2 fits BA1 and 𝗌𝗎𝗆(q)+𝗌𝗎𝗆(δ2)𝗌𝗎𝗆(q)+p1. Again, as 2grepq+δ22, there exists A22 such that A2 fits BA1. The above discussions imply that, A11, A22, and thus A1A212, where A1A2 fits B. This concludes the proof.

Recall that G is a Ki,j-free graph, where ij. Consider any computable function f(k). Let ηf(k):=if(k)k; where we skip the subscript f(k) when the context is clear. Also, for p, let αp:=3k(pη)i+1; again we skip the subscript p, when the context is clear. We next state the main lemma, which lies at the crux of our algorithm.

Lemma 27 ().

Consider any computable function f:{0}. There is an algorithm that takes as input k{0}, p, a vector q=(q1,q2,,qk), and a p-family of vertex subsets of a Ki,j-free graph G on n vertices with a coloring χ:V(G)[k], where p+𝗌𝗎𝗆(q)f(k). In time bounded by 𝒪(α2p+𝗌𝗎𝗆(q)p||) we can find with at most α2p+𝗌𝗎𝗆(q) sets such that 𝗀𝗋𝖾𝗉q.

In the remainder of this section, we prove Theorem 3, assuming the correctness of Lemma 27.

Some Useful Notations.

For z{0} and z[z], let γz,z be the number of vertices with label z in the z-Grundy tree (Tz,z), i.e., γz,z=|z1(z)|.

Let q=γk:=(γk,1,γk,2,,γk,k). We will define a vector qz=(qz,1,qz,2,,qz,k), for every z[k]. Intuitively speaking, the zth entry of qz will denote the number of vertices with label z appearing in Tk after removing exactly one subtree rooted at a vertex with label z. Formally, for each z{z+1,z+2,,k}, we have qz,z=γk,z, and for each z[z], qz,z=γk,zγz,z. For z[k], we let 0z be the vector of dimension k where the zth entry is 1, and all the other entries are 0.

For a tree T^ rooted at r and tV(T^), we let T^t be the subtree of T^ rooted at t, i.e., V(T^t)={tV(T^)t=t, or t is a descendant of t in T^} and T^t=T^[V(T^t)].

For a set WV(G), we say that W is a k-Grundy set if there is a k-Grundy witness ω:V(Tk)W for G. Moreover, W is minimal if no proper subset WW is a k-Grundy set for G. For a k-Grundy set W and a k-Grundy witness ω:V(Tk)W for G, for tV(Tk), we let W𝗌𝗎𝖻,t={ω(t)tV(Tkt)} and W𝖾𝗑𝖼,t={ω(t)tV(Tk)V(Tkt)}.

Recall that we have a graph G and a coloring χ:V(G)[k], where for z[k], we have Xz=χ1(z). For z[k] and vV(G), we define z,v:={Wz[z]XzvW,W is χ-independent and z|W|2z1}.

Description of the Algorithm.

The objective of our algorithm will be to compute, for each z[k] and vXz, a family z,vz,v; starting from z=1 (and then iteratively, for other values of z in increasing order), satisfying the following constraints:

Size Constraint.

|z,v|α2k+1.

Correctness Constraint.

For any z[k] and vXz, the following holds:

  1. 1.

    Each Az,v is a z-Grundy set in G.

  2. 2.

    Consider any minimal k-Grundy set W, such that vW (if it exists). Furthermore, let ω:V(Tk)W be a k-Grundy witness for G. For any tV(Tk) with ω(t)=v, where qt=|W𝖾𝗑𝖼,t|, there is Wz,vz,v such that W𝖾𝗑𝖼,tW is a k-Grundy set in G, i.e., z,vgrepqtz,v.

Base Case.

We are in our base case when z=1; note that [20]={1}. For each vX1, set 1,v:=1,v={{v}}. Note that 1,v satisfies both the size and the correctness constraints.

Recursive Formula.

Consider z[k]{1} and vXz. We suppose that for each z[z1] and vXz, we have computed z,v that satisfies both the size and the correctness constraints.

For each z[z1], we create a family z,v,z, initialized to as follows. For each uXzNG(v) and Wz,u, if W{v} is χ-independent and |W{v}|2z1, then add W{v} to z,v,z. Note that |z,v,z|nαp2k+1, where p=2z1. Using Lemma 27, for each vector qqz, we compute z,v,z,qgrepqz,v,z, where |z,v,z,q|α2k, and set z,v,z=qqzz,v,z,q. Note that z,v,z2(k1)kα2kα2k+1 and we can compute it in time bounded by 𝒪(α2k+12k1|z,v,z|).

Next we will iteratively “combine and reduce” the families z,v,z, for z[z], to obtain a family ^z,vz,v as follows. We set ^z,v,1:=z,v,1. Iteratively, (in increasing order), for each z[z1]{1}, we do the following:

  1. 1.

    Set ~z,v,z:=^z,v,z1z,v,z.

  2. 2.

    Compute ^z,v,z,qgrepq~z,v,z, for each qqz=γk(z^[z](γkqz^))0z, and set ^z,v,z=qqz^z,v,z,q. Note that |^z,v,z|α2k+1 and it can be computed in time bounded by 𝒪(α2k+12k1|~z,v,z|).

We add each A^z,v,z1 to z,v, which is a z-Grundy set in G (note that since the size of each set is bounded by 2k1, we can easily do it in the allowed amount of time). In the following lemma, we show that z,v satisfies the correctness constraints.

Lemma 28.

z,v satisfies the correctness constraint.

Proof.

Consider any vXz and a minimal k-Grundy set W, such that vW (if it exists) and let ω:V(Tk)W be a k-Grundy witness for G. Next consider any tV(Tk) with ω(t)=v. We will argue that, there is Wz,v such that W𝖾𝗑𝖼,tW is a k-Grundy set in G. For each z[z1], let tz be the child of t in Tk with k(tz)=z and vz=ω(tz). Note that for each z[z1], vzXz. For each z[z1], let A^z={ω(t)tV(Tktz)}, and note that |A^z|2z1. Now we iteratively take the union of the above sets as follows. For each z[z1], let Az=z^[z]A^z^. Now for each z[z1], we construct a subset, Bz of W that contains ω(t), for each tV(Tk) that does not belong to the subtrees rooted at any of the vertices t1,t2,,tz. Formally, for z[z1], let Bz={ω(t)tV(Tk)(z′′[z]V(Tktz′′))}. Furthermore, let sz be the size of Bz. Notice that for each z[z1], all of the following holds:

  1. 1.

    szqz,

  2. 2.

    |Az|z^[z]2z^1,

  3. 3.

    |A^z|2z1 and A^zz,vz,

  4. 4.

    AzBz=W, and thus, Az fits Bz.

We will now iteratively define sets A1,A2,,Az1 and functions ω1,ω2,ωz1, and we will ensure that, for each z[z1], we have: i) ωz:V(Tk)AzBz is a k-Grundy witness for G, ii) for each z[z1] and tV(Tk)(z′′[z]V(Tktz′′)), we have ωz(t)=ω(t), iii) Az^z,v,z, and iv) for each z′′[z], there is a minimal z′′-Grundy set Az,z′′Az, where the unique vertex in Az,z′′Xz′′ is a neighbor of v.

Recall that z2 and ^z,v,1=z,v,1z,v,1. Also, we have A^1=A1={u}, for some uNG(v)X1, and A1B1=W is a k-Grundy set. Thus, there must exist A1z,v,1 such that A1B1 is χ-independent. Moreover by the construction of z,v,1, A1={u}, for some uNG(v)X1. Let ω1:V(Tk)A1B1 be the function such that for each tV(Tk){t1}, we have ω1(t)=ω(t) and ω1(t1)=u. As A1B1 is χ-independent and {u,v}E(G), we can obtain that ω1 is a k-Grundy witness for G. Note that if z=2, then by the above arguments, we have constructed the desired sets and functions, which is just the set A1 and the function ω1.

We now consider the case when z2. Also, we assume that for some z^[z2], for each z[z^], we have constructed Az and ωz satisfying the desired condition. Now we prove the statement for z=z^+1. Note that Az1Bz1 is a k-Grundy set and ωz1:V(Tk)Az1Bz1 is a k-Grundy witness for G, where Az1^z,v,z. Note that A^zBz1. Let Bz={ωz1(t)tV(Tk)V(Tktz)}. Note that |Bz|qz and A^z fits Bz, and recall that A^zz,vz. As z,vzgrepqz,vz, for every qqz, there must exists A~zz,vz, such that A~z fits Bz. By the construction of z,vz, we have vzA~z and A~zBz is χ-independent, and also vBz. From the above discussions we can conclude that A~z{v}z,v,z. Moreover, as Az1^z,v,z1, Az1Bz and A~zBz is χ-independent, we can obtain that Az1A~z{v}^z,v,z1z,v,z=~z,v,z. As ^z,v,zgrepq~z,v,z, for every qqz and |Bz|qz, there must exists Az^z,v,z such that AzBz is χ-independent.

As Az^z,v,z, there must exist C^^z,v,z1 and C{v}z,v,z, such that Az=C^C{v}. By the correctness for z1, C contains for each z′′[z1], a minimal z′′-Grundy set Az1,z′′Az1, where the unique vertex in Az1,z′′Xz′′ is a neighbor of v. Also by the construction of z,v,z, C contains a minimal z-Grundy set C′′ in G, where the unique vertex in C′′Xz is a neighbor of v. From the above discussions, we can conclude that AzBz is a k-Grundy set in G.

Using the above algorithm, we can compute for each z[k] and vXz, a family z,vz,v that satisfies the correctness and the size constraints, in time bounded by α𝒪(2k+1)n𝒪(1). Note that G has a Grundy coloring using at least k colors if and only if for some vXk, z,v. This implies a proof of Theorem 3.

References

  • [1] Pierre Aboulker, Édouard Bonnet, Eun Jung Kim, and Florian Sikora. Grundy coloring and friends, half-graphs, bicliques. Algorithmica, pages 1–28, 2022. doi:10.1007/S00453-022-01001-2.
  • [2] Noga Alon, Raphael Yuster, and Uri Zwick. Color-coding. J. ACM, 42(4):844–856, 1995. doi:10.1145/210332.210337.
  • [3] Júlio César Silva Araújo and Cláudia Linhares Sales. Grundy number on p4-classes. Electron. Notes Discret. Math., 35:21–27, 2009. doi:10.1016/J.ENDM.2009.11.005.
  • [4] R. Balakrishnan and T Kavaskar. Interpolation theorem for partial grundy coloring. Discrete Mathematics, 313(8):949–950, 2013. doi:10.1016/J.DISC.2013.01.018.
  • [5] Rangaswami Balakrishnan and T. Kavaskar. Color chain of a graph. Graphs Comb., 27(4):487–493, 2011. doi:10.1007/S00373-010-0989-7.
  • [6] Rémy Belmonte, Eun Jung Kim, Michael Lampis, Valia Mitsou, and Yota Otachi. Grundy distinguishes treewidth from pathwidth. In 28th Annual European Symposium on Algorithms (ESA 2020). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020.
  • [7] Édouard Bonnet, Florent Foucaud, Eun Jung Kim, and Florian Sikora. Complexity of grundy coloring and its variants. Discret. Appl. Math., 243:99–114, 2018. doi:10.1016/J.DAM.2017.12.022.
  • [8] Gregory J. Chaitin, Marc A. Auslander, Ashok K. Chandra, John Cocke, Martin E. Hopkins, and Peter W. Markstein. Register allocation via coloring. Comput. Lang., 6(1):47–57, 1981. doi:10.1016/0096-0551(81)90048-5.
  • [9] CWK Chen and David YY Yun. Unifying graph-matching problem with a practical solution. In Proceedings of International Conference on Systems, Signals, Control, Computers, volume 55, 1998.
  • [10] C. A. Christen and S. M. Selkow. Some perfect coloring properties of graphs. Journal of Combinatorial Theory, Series B, 27(1):49–59, 1979. doi:10.1016/0095-8956(79)90067-4.
  • [11] Marek Cygan, Fedor V Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michał Pilipczuk, and Saket Saurabh. Parameterized algorithms, volume 5. Springer, 2015. doi:10.1007/978-3-319-21275-3.
  • [12] Lyes Dekar, Brice Effantin, and Hamamache Kheddouci. An incremental distributed algorithm for a partial grundy coloring of graphs. In Ivan Stojmenovic, Ruppa K. Thulasiram, Laurence Tianruo Yang, Weijia Jia, Minyi Guo, and Rodrigo Fernandes de Mello, editors, Parallel and Distributed Processing and Applications, 5th International Symposium, ISPA 2007, Niagara Falls, Canada, August 29-31, 2007, Proceedings, volume 4742 of Lecture Notes in Computer Science, pages 170–181. Springer, 2007. doi:10.1007/978-3-540-74742-0_18.
  • [13] Reinhard Diestel. Graph theory, volume 173. Springer-Verlag Heidelberg, 2017.
  • [14] Irit Dinur, Elchanan Mossel, and Oded Regev. Conditional hardness for approximate coloring. SIAM J. Comput., 39(3):843–873, 2009. doi:10.1137/07068062X.
  • [15] B. Effantin, N. Gastineau, and O. Togni. A characterization of b-chromatic and partial grundy numbers by induced subgraphs. Discrete Mathematics, 339(8):2157–2167, 2016. doi:10.1016/J.DISC.2016.03.011.
  • [16] P. Erdös, S. T. Hedetniemi, R. C. Laskar, and G. C. E. Prins. On the equality of the partial grundy and upper ochromatic numbers of graphs. Discrete Mathematics, 272(1):53–64, 2003. doi:10.1016/S0012-365X(03)00184-5.
  • [17] P Fahad. Dynamic Programming using Representative Families. PhD thesis, Homi Bhabha National Institute, 2015.
  • [18] Uriel Feige and Joe Kilian. Zero knowledge and the chromatic number. J. Comput. Syst. Sci., 57(2):187–199, 1998. doi:10.1006/JCSS.1998.1587.
  • [19] Fedor V. Fomin, Daniel Lokshtanov, Fahad Panolan, and Saket Saurabh. Efficient computation of representative families with applications in parameterized and exact algorithms. J. ACM, 63(4):29:1–29:60, 2016. doi:10.1145/2886094.
  • [20] N. Goyal and S. Vishwanathan. Np-completeness of undirected grundy numbering and related problems. Unpublished manuscript, 1997.
  • [21] P. M. Grundy. Mathematics and games. Eureka, 2:6–9, 1939.
  • [22] András Gyárfás, Zoltán Király, and Jenö Lehel. On-line 3-chromatic graphs i. triangle-free graphs. SIAM J. Discret. Math., 12(3):385–411, 1999. doi:10.1137/S089548019631030X.
  • [23] F. Havet and L. Sampaio. On the grundy and b-chromatic numbers of a graph. Algorithmica, 65(4):885–899, 2013. doi:10.1007/S00453-011-9604-4.
  • [24] S. M. Hedetniemi, S. T. Hedetniemi, and T. Beyer. A linear algorithm for the grundy (coloring) number of a tree. Congressus Numerantium, 36:351–363, 1982.
  • [25] Allen Ibiapina and Ana Silva. b-continuity and partial grundy coloring of graphs with large girth. Discrete Mathematics, 343(8):111920, 2020. doi:10.1016/J.DISC.2020.111920.
  • [26] Hal A. Kierstead and Karin Rebecca Saoub. First-fit coloring of bounded tolerance graphs. Discret. Appl. Math., 159(7):605–611, 2011. doi:10.1016/J.DAM.2010.05.002.
  • [27] Guy Kortsarz. A lower bound for approximating the grundy number. Discrete Mathematics & Theoretical Computer Science, 9, 2007.
  • [28] Daniel Lokshtanov, Fahad Panolan, Saket Saurabh, Roohani Sharma, and Meirav Zehavi. Covering small independent sets and separators with applications to parameterized algorithms. ACM Transactions on Algorithms (TALG), 16(3):1–31, 2020. doi:10.1145/3379698.
  • [29] Dániel Marx. Graph colouring problems and their applications in scheduling. Periodica Polytechnica Electrical Engineering (Archives), 48(1-2):11–16, 2004.
  • [30] Dániel Marx. A parameterized view on matroid optimization problems. Theor. Comput. Sci., 410(44):4471–4479, 2009. doi:10.1016/J.TCS.2009.07.027.
  • [31] Moni Naor, Leonard J Schulman, and Aravind Srinivasan. Splitters and near-optimal derandomization. In Proceedings of IEEE 36th Annual Foundations of Computer Science, pages 182–191. IEEE, 1995. doi:10.1109/SFCS.1995.492475.
  • [32] B. S. Panda and Shaily Verma. On partial grundy coloring of bipartite graphs and chordal graphs. Discret. Appl. Math., 271:171–183, 2019. doi:10.1016/J.DAM.2019.08.005.
  • [33] L. Sampaio. Algorithmic aspects of graph colourings heuristics. PhD thesis, University Nice Sophia Antipolis, 2012.
  • [34] Z. Shi, W. Goddard, S. T. Hedetniemi, K. Kennedy, R. Laskar, and A. McRae. An algorithm for partial grundy number on trees. Discrete Mathematics, 304(1-3):108–116, 2005. doi:10.1016/J.DISC.2005.09.008.
  • [35] Zixing Tang, Baoyindureng Wu, Lin Hu, and Manouchehr Zaker. More bounds for the grundy number of graphs. J. Comb. Optim., 33(2):580–589, 2017. doi:10.1007/S10878-015-9981-8.
  • [36] Shaily Verma and B. S. Panda. Grundy coloring in some subclasses of bipartite graphs and their complements. Information Processing Letters, 163:105999, 2020. doi:10.1016/J.IPL.2020.105999.
  • [37] M. Zaker. Grundy chromatic number of the complement of bipartite graphs. Australasian Journal of Combinatorics, 31:325–330, 2005. URL: http://ajc.maths.uq.edu.au/pdf/31/ajc_v31_p325.pdf.
  • [38] M. Zaker. Results on the grundy chromatic number of graphs. Discrete mathematics, 306(23):3166–3173, 2006. doi:10.1016/J.DISC.2005.06.044.
  • [39] Manouchehr Zaker. Inequalities for the grundy chromatic number of graphs. Discret. Appl. Math., 155(18):2567–2572, 2007. doi:10.1016/J.DAM.2007.07.002.