Dynamic F-free Coloring of Graphs

A problem of graph F-free coloring consists in partitioning the vertex set of a graph such that none of the resulting sets induces a graph containing a fixed graph F as an induced subgraph. In this paper we consider dynamic F-free coloring in which, similarly as in online coloring, the graph to be colored is not known in advance; it is gradually revealed to the coloring algorithm that has to color each vertex upon request as well as handle any vertex recoloring requests. Our main concern is the greedy approach and characterization of graph classes for which it is possible to decide in polynomial time whether for the fixed forbidden graph F and positive integer k the greedy algorithm ever uses more than k colors in dynamic F-free coloring. For various classes of graphs we give such characterizations in terms of a finite number of minimal forbidden graphs thus solving the above-mentioned problem for the so-called F-trees when F is 2-connected, and for classical trees, when F is a path of order 3 (the latter variant is also known as subcoloring or 1-improper coloring).


Introduction
Graphs have proven to be a powerful model of complex networks in various domains, ranging from telecommunication to chemistry and social networks. In their earlier studies researches usually focused on static networks rather than their dynamic behavior. However, many real world networks are not static but inherently evolve over time (see, e.g., Newman [27]); each and every minute, new web pages are added, people become members of new social networks thereby creating new nodes and forming new groups (clusters) having certain properties. In this paper we join the concept of evolving graph structure with the dynamic maintenance of temporal partitions of its vertex set into the subsets that induce graphs with specified structural properties. In addition to practical applications, significant motivation for our research on the dynamic variant of graph partitioning comes from the area of designing of graph classes along with polynomialtime approximation algorithms (see, e.g., Borowiecki [6]). In the above context, as a model for dynamic partitioning, we use the dynamic F-free coloring of graphs.

Dynamic F-free Coloring
We consider simple, finite, undirected graphs G = (V, E) with the vertex set V , edge set E and order n = |V (G)|. For graphs G and F we say that G contains F if there exists an induced subgraph of G isomorphic to F. Otherwise, we say that G is F-free. It is known that every class of F-free graphs is hereditary, i.e., every induced subgraph of an F-free graph is F-free. If from the fact that connected components of a graph G are F-free it follows that G is F-free, then the class of F-free graphs is additive. We will also use the fact that if a class of F-free graphs is additive, then F is connected. All classes of graphs that we consider are additive and hereditary.
An F-free coloring of a graph is a partition of its vertex set into subsets called color classes such that each color class induces an F-free graph. In the classical coloring, called proper coloring, adjacent vertices cannot be colored with the same color, which is equivalent to K 2 -free coloring (K p denotes the complete graph of order p). Indeed, in proper coloring each color class is an independent set, or equivalently, induces a K 2 -free graph.
In this paper we consider the dynamic F-free coloring. The dynamic model of F-free coloring can be interpreted as a game of Presenter and Painter; the two uncooperative players. According to [7] the game can be described as follows. In a sequence of moves, Presenter gradually reveals the structure of a graph, i.e., in each move Presenter presents some number of new vertices along with the edges between them as well as the edges between new vertices and previously known ones. In the same move Presenter can also discolor arbitrary vertices, and then request Painter to immediately color the vertices of Presenter's choice. More formally, let r > 0 and let σ 1 , . . . , σ r denote subsequent moves of Presenter. Let G 1 be an empty graph. For i > 1, by G i and G i+1 we denote the graphs known to Painter before and after σ i , respectively. The move σ i is defined by Fig. 1 Examples of greedy dynamic F-free colorings: a F = K 2 (proper coloring), and b F = K 3 (triangle-free coloring) lose their colors, U i is the set of new vertices, E i is the set of edges uv such that u ∈ U i , v ∈ V (G i ) ∪ U i , and C i is the set of vertices that have to be immediately colored by Painter in response to σ i . Naturally, Note that there is no loss of generality in assuming that C i = ∅. We also allow U i to be empty, i.e., at some stage of the game Presenter and Painter may continue discoloring and coloring the same graph. Similarly, Presenter does not have to discolor vertices, i.e., D i = ∅ is allowed. In our setting Painter does not know the graph in advance, nor the order in which vertices will be colored or discolored. The goal of Presenter is to find a sequence of moves that force Painter to use as many colors as possible, while Painter aims at minimizing the number of colors.
Example 1.1 Consider dynamic F-free coloring of graphs in Fig. 1 under assumption that Painter acts greedily, i.e., always uses the smallest possible color. Note that in proper coloring of a graph presented in Fig. 1a Painter is forced to color each vertex with a different color. To achieve this goal Presenter reveals vertices v 1 , . . . , v 4 and requests Painter to color each vertex as soon as it is revealed (in other words U i = C i = {v i } for i ∈ {1, . . . , 4}). In his next move, Presenter discolors v 2 and asks for coloring of just revealed vertex v 5 . Now, if Presenter requests coloring of v 2 (for the second time), then since v 5 is already colored 2, the vertex v 2 will be colored 5. Next, Presenter discolors v 1 and asks for coloring of the new vertex v 6 . Finally, the request for coloring of v 1 forces Painter to introduce color 6. The example in Fig. 1b presents K 3 -free coloring with 3 colors. Consider the following sequence of coloring and discoloring requests (we assume that each vertex is revealed just before it is colored for the first time). Namely, requests for coloring of v 1 , v 2 and v 3 (in order) result in the assignment of color 1 to v 1 and v 2 , and forces Painter to use color 2 for v 3 (for otherwise we would have a monochromatic K 3 induced by {v 1 , v 2 , v 3 }). Next, after discoloring of v 1 and v 2 , Painter is asked to color v 4 , . . . , v 7 (naturally, the first color will be used for all of them). Consequently, v 1 will be colored 2 and because of the two triangles induced by {v 1 , v 2 , v 3 } and {v 2 , v 6 , v 7 } the third color will be forced in v 2 .
Dynamic F-free coloring is a natural generalization of both offline and online Ffree coloring models. Namely, the problem of offline coloring of a graph G = (V, E) can be seen as a one-move game with σ 1 = (∅, V, E, V ), while online coloring is a game such that for every move: D i = ∅, the set U i is a singleton, and C i = U i . In the above-mentioned setting, the dynamic K 2 -free coloring has been considered in [7].

Related Research and Our Results
The idea of F-free coloring goes back at least as far as to a paper of Chartrand et al. [11]. Many variants and generalizations of basic concepts have been introduced and intensively studied over the years. Since this subject is too wide to be surveyed in a short paper, we mention just a few examples like subcoloring known also as P 3 -free coloring (where P p denotes the chordless path on p vertices), P 4 -free coloring and improper coloring, and we refer to appropriate literature on other variants, e.g., many results on subcoloring can be found in Albertson et al. [2], Broere and Mynhardt [8], Fiala et al. [16] as well as in work of Gimbel and Hartman [17]. For results on P 4 -free coloring see, e.g., Gimbel and Nešetřil [18] and a paper of Hoàng and Le [23], while for improper coloring we refer the reader to papers of Bermond et al. [4], Cowen et al. [15] and Havet et al. [21]. Concerning the computational complexity of F-free k-coloring problem we mention the result of Achlioptas [1] who proved that for any fixed graph F, except K 2 , the problem of deciding if a given graph admits an F-free coloring with at most k-colors is NP-complete (for a detailed study of the computational complexity of many variants of offline generalized colorings see, e.g., Broersma et al. [9]).
As we have already mentioned, dynamic coloring can be seen as a generalization of offline and online colorings, but it is also closely related to the iterative coloring, in which the coloring algorithm is allowed to decide on improvements of subsequent solutions obtained by recoloring some vertices of a known graph (see, e.g., Caramia and Dell'Olmo [10], Molloy and Reed [26]). Since in iterative approach the graph is given in advance and the coloring algorithm can decide on which part of the solution to improve, the results on greedy dynamic F-free coloring seem to be applicable in the analysis and development of vertex recoloring rules for iterative greedy F-free coloring.
In context of online model special attention was paid to the analysis of colorings that can be obtained with the greedy algorithm. For proper coloring the largest number of colors used by the greedy algorithm is a well known graph invariant, denoted by Γ(G) and called the Grundy number of a graph. In this sense, Goyal and Vishwanathan [20], and Zaker [28] determined the computational complexity of a long-standing open problem posed by Hedetniemi et al. [22] (cf. Jensen and Toft [25]). Namely, they proved that given a graph G and a positive integer k it is NP-complete to decide if Γ(G) ≥ k. Recently, their result has been extended by Borowiecki [6] who proved that for F-free coloring an analogous problem is NP-complete for every F = K p with p ≥ 3. Despite vast literature devoted to the Grundy number, we know only few graph classes for which the greedy algorithm always outputs optimal colorings (see, e.g., Borowiecki and Rautenbach [5], and Christen and Selkow [13] for more details). As of today, determining the Grundy number is known to be polynomial for P 4 -laden graphs and trees (see Araujo et al. [3] and Hedetniemi et al. [22], respectively).
In this paper we continue the above-mentioned line of investigation by considering the classes of graphs for which a "dynamic variant" of the above-mentioned problem can be solved in polynomial time. More formally, let F denote the class of F-free graphs. The dynamic F-Grundy number of a graph G, denoted by Γ d (G, F), is the largest number of colors that may be required by the greedy algorithm during some dynamic F-free coloring of G. The main problem considered in this paper can be stated as follows.
The current knowledge on minimal forbidden subgraphs characterizing the classes of F-free k-colorable graphs is very far from being complete even if we consider offline proper coloring (in this sense, some recent results in selected classes of graphs, mainly for k ∈ {3, 4}, can be found in Chudnovsky et al. [14], Goedgebeur and Schaudt [19] and Hoàng et al. [24]). On the other hand, for every fixed k ≥ 2 and connected graph F, the class of graphs F-free k-colorable with the greedy algorithm can be characterized by a finite number of minimal forbidden graphs (see, Borowiecki [6]) and hence the online variant of greedy F-free k-coloring can be solved in polynomial time. Despite the fact that the structure of minimal graphs for greedy dynamic F-free coloring seems to be more involved than in the case considered in [6], we strongly believe that Problem 1.1 can also be solved in polynomial time.
In this paper, we show that for every forbidden graph F and every integer k ≥ 1 there exists an infinite number of F-free 2-colorable graphs G for which Γ d (G, F) > k. Consequently, the performance ratio of the greedy algorithm cannot be bounded by any constant, even if we restrict the input to F-free 2-colorable graphs. This negative result motivates our investigations in the direction of characterizing the subclasses of F-free 2-colorable graphs for which the greedy algorithm uses no more than k colors. In Sect. 2, under the assumption that F is 2-connected, for every fixed k ≥ 1 we characterize the class of F-trees for which the greedy algorithm uses at most k colors. This leads to a polynomial-time algorithm for Problem 1.1 for F-trees. Next, in Sect. 3, assuming that F = P 3 , we prove analogous results for the class of all trees. For proper coloring of trees (recall F = P 2 ) the problem was solved in [7], while an intriguing problem for trees, when F is a tree of order greater than 3 constitutes an open problem presented in the last section of this paper.

Dynamic F-free Coloring, when F is 2-Connected
In this section, under the assumption that F is 2-connected, we consider Greedy Dynamic Ffree kcoloring for F-trees.
In order to define F-trees we need some additional notions. Namely, by G − v we denote the graph obtained from G by removal of vertex v. Given two disjoint graphs G 1 , G 2 and vertices v 1 ∈ V (G 1 ), v 2 ∈ V (G 2 ), we say that a graph G is obtained from G 1 and G 2 by the identification of v 1 and v 2 if the following hold: (i) , then the graph obtained by the identification of v 1 and v 2 is an F-tree.
Clearly, if F is a tree (in the classical sense), then any F-tree is a tree. Concerning simple properties of F-trees note that if F is 2-connected, then every block (i.e., maximal 2-connected subgraph) of an F-tree is isomorphic to F. It is also not hard to see that independently of F, every F-tree admits an F-free coloring with at most two colors.
In what follows, since F is always clear from the context, it is usually omitted to simplify notation. In particular in this section we write k-forcing tree instead of kforcing F-tree (this resembles omitting prefix hyper-, which is quite common practice in papers dealing with hypergraphs). Let η = |V (F)|.

Definition 2.2
Let k ≥ 1. A k-forcing tree T k is a rooted graph defined as follows: A k-forcing tree T k can be obtained by adding the edges between the roots of For an illustration of a k-forcing tree T k see Fig. 2a, where appropriate forcing trees are marked with solid lines. In order to prove minimality of forcing trees with respect to the dynamic F-Grundy number we introduce the notion of a k-branch, which, despite significant differences between the cases in which F is 1-and 2-connected, allows a unified description of structural properties of k-forcing trees.

Definition 2.3
Let k ≥ 1. A k-branch B k is a rooted graph defined as follows: (a) B 1 = F with the root in any vertex, (b) for k ≥ 2, let T 1 be the 1-forcing tree and let T k−1 be a (k − 1)-forcing tree. Moreover, let adding the edges between the roots of , T k−1 such that the graph H induced by the roots is isomorphic to F, and setting the root of T 1 as the root of B k .
In Definition 2.2 (Definition 2.3) the subgraph H , induced by the roots, is called the base of k-forcing tree T k (of k-branch B k ). Note that the root of any branch belongs to exactly one block of this branch. For an illustration see Fig. 2a, where B k−1 is marked with a dashed line. Lemma 2.1 Let k ≥ 2 and for each i < k let B i be an i-branch. If we identify the roots of the branches B 1 , . . . , B k−1 , then we obtain a k-forcing tree T k . Proof For the base step of the induction, observe that if k = 2, then the assertion follows from the definitions of 2-forcing tree and 1-branch. Assume k > 2 and that the assertion holds for all i ≤ k − 1.
Let T be a k-forcing tree with the root x and the base H . By the definition of k-forcing tree, x is the root of the (k − 1)-forcing tree T that does not contain H . Using the same definition, let H 1 , . . . , H η−1 denote η − 1 forcing trees obtained from T by removal of T and all edges of H . By the induction hypothesis, we see that T can be obtained by the identification of the roots of the branches B 1 , . . . , B k−2 . Now, the assertion follows from the observation that H and H 1 , . . . , H η−1 form B k−1 , and that by Lemma 2.1 the branches B 1 , . . .
In what follows we need a slightly deeper insight into the structure of k-forcing trees and their branches.

Property 2.1
If T k is a k-forcing tree with the root x, then for each i ∈ {1, . . . , k} the k-forcing tree T k contains some i-forcing tree T i with the vertex x as its root.

Property 2.2 If B k is a k-branch with the root x, then for each i ∈ {1, . . . , k} the branch B k contains some i-branch B i with the vertex x as its root.
Let k be a positive integer and let F 1 , . . . , F k be disjoint rooted copies of a given graph F and let x 1 , . . . , x k be their roots, respectively. An (F, k)-star with the center x and rays F 1 , . . . , F k is a graph obtained from the graphs F 1 , . . . , F k by the identification of their roots and setting the resulting common vertex as the center x. Similarly as for k-forcing trees, F is always clear from the context and hence it is omitted. Consequently, an (F, k)-star is briefly called a k-star, and it is denoted by S k (x).
For an uncolored vertex v we say that colored vertex u is fixed colored with respect to v if Presenter will never discolor u before v becomes colored. To express this fact we write u ≺ v. We also say that S k (v) is k-precolored if its center v is not colored but for each ray F i all vertices in V (F i )\{v} are already fixed colored i with respect to v. Observe that the greedy algorithm uses color k for a vertex v if and only if v is the center of a (k − 1)-precolored star S k−1 (v). Thus we have the following property.

Property 2.3 For every k > 1 Presenter has a strategy that forces the greedy algorithm to use color k for vertex v of a graph G if and only if G contains S k−1 (v) and
Presenter has a strategy (realized on G) that forces the greedy algorithm to produce a (k − 1)-precoloring of S k−1 (v).

Lemma 2.3 Let F be 2-connected. For every k-forcing tree T k , we have
Proof The proof is by induction on k. It is easy to check that the assertion holds for k ≤ 2. Assume k > 2 and that our lemma holds for all T i with i ≤ k − 1.
Following the notation introduced in the definition of k-forcing trees, let u 1 , . . . , u η−1 denote the roots of T 1 k−1 , . . . , T η−1 k−1 and let u η stand for the root of T k−2 . Moreover, set x = u 1 , and let x be the root and H the base of T k (for an illustration see Fig. 2a).
First, we prove that T k contains a (k − 1)-forcing tree (we denote it by T ) with the root u η . From Property 2.1 it follows that with the roots u 1 , . . . , u η−2 , respectively, and that T T are disjoint and since their roots are the vertices of H , a (k − 1)-forcing tree T with the root u η is formed. Hence, by the induction hypothesis and Property 2.3 Presenter has a strategy that forces the greedy algorithm to use color k − 1 for u η . Now, without loss of generality we may assume that Presenter discolors all vertices, except the vertex u η . Let u η be fixed colored k − 1 with respect to x, i.e., u η ≺ x (see Fig. 3a for an example with F = K 3 , k = 4 and vertex u η colored 3).
Next, since u 2 , . . . , u η−1 are the roots of disjoint (k − 1)-forcing trees assume that u 2 , . . . , u η−1 are fixed colored k − 1 with respect to x, i.e., u j ≺ x for all j ∈ {2, . . . , η − 1} (see Fig. 3b for an illustration of T 2 3 with the root colored 3). By the induction hypothesis, since x is the root of T 1 k−1 , Presenter has a strategy forcing the greedy algorithm to use color k − 1 for x. By Property 2.3 this is equivalent to the existence of a (k − 2)-precolored star S k−2 (x), contained in T 1 k−1 , and sharing a single vertex with H whose vertices (except x) are already colored k − 1 (see Fig.  3b for an illustration of T 1 3 with gray circles denoting precolored vertices of S 2 (x); recall k = 4). Thus, the base H and S k−2 (x) form a (k − 1)-precolored star S k−1 (x). Consequently, by the induction hypothesis and Property 2.3, this implies the existence of a strategy that forces the greedy algorithm to use color k for x.

Theorem 2.1 Let F be 2-connected and let k ≥ 1. If T is an F-tree, then Γ d (T, F) ≥ k if and only if T contains a k-forcing tree T k . Proof
By Lemma 2.3 we have Γ d (T k , F) ≥ k, and since T k ≤ T , we get Γ d (T, F) ≥ k. It is not hard to see that the theorem holds for k ≤ 2. Assume k > 2 and that the assertion holds for all T i with i ≤ k − 1. If Γ d (T, F) ≥ k, then Presenter has a dynamic presentation that forces the greedy algorithm to assign color k to some vertex x of T . Hence, by Property 2.3, just before x gets colored k the tree T contains a (k −1)-precolored star S k−1 (x). Let H 1 , . . . , H k−1 be the rays of S k−1 (x) and for all i ≤ k −1 let u i 1 , . . . , u i η denote the vertices of H i with

Dynamic Subcoloring
In this section we consider Greedy Dynamic Ffree kcoloring when F = P 3 . The results in this section are of more general character than those of Sect. 2, in the sense that instead of considering our problem for F-trees we solve it for the class of all trees. As previously, with a small abuse of notation we usually omit F. Definition 3.1 Let k ≥ 1. A k-forcing tree T k is a rooted graph defined as follows: (a) T 1 = K 1 , while T 2 = P 3 with the root in any vertex, (b) for k ≥ 3, let T k−1 be an arbitrary (k − 1)-forcing tree and let T 1 k−2 , T 2 k−2 denote arbitrary (k − 2)-forcing trees such that T 1 k−2 , T 2 k−2 , T k−1 are pairwise disjoint. Moreover, let x 1 , x 2 , x 3 denote the roots of T 1 k−2 , T 2 k−2 and T k−1 , respectively. A k-forcing tree T k can be obtained by adding the edges between x 1 , x 2 , x 3 such that the graph H induced by x 1 , x 2 , x 3 is isomorphic to P 3 , and setting x 3 as the root of T k , (c) for k ≥ 4, let T k−3 be an arbitrary (k − 3)-forcing tree and let T 1 k−1 , T 2 k−1 denote arbitrary (k − 1)-forcing trees such that T 1 k−1 , T 2 k−1 , T k−3 are pairwise disjoint. Moreover, let x 1 , x 2 , x 3 denote the roots of T 1 k−1 , T k−3 and T 2 k−1 , respectively. A k-forcing tree T k can be obtained by adding the edges x 1 x 2 , x 2 x 3 and setting either x 1 or x 3 as the root of T k . Note that Definition 3.1(b), in contrast to (c) allows x 3 in the middle as well as at the end of P 3 (see the upper row in Fig. 4).
where T 1 is the 1-forcing tree and T 1 k−1 , T 2 k−1 denote arbitrary (k − 1)-forcing trees) such that the graph H induced by the roots is isomorphic to P 3 , or (b2) T 1 , T k−2 , T k (where T 1 is the 1-forcing tree, T k−2 is an arbitrary (k −2)-forcing tree and T k is an arbitrary k-forcing tree) such that the graph H induced by the roots is isomorphic to P 3 with x 2 as the middle vertex, then setting x 1 as the root.
Note that in the above definition, in contrast to Definition 2.3, the root of a branch may belong to more than one subgraph isomorphic to F and contained in the branch. Analogously as in previous section, in Definition 3.1 (Definition 3.2) the subgraph H , induced by the roots, is called the base of k-forcing tree (of k-branch).
To keep our paper concise, instead of proving basic lemmas for F = P 3 we shortly remark on similarities to their counterparts in Sect. 2. To see that an analogue of Lemma 2.1 holds for F = P 3 it is enough to observe that if H is the base, then by Definition 3.2, the vertices in V (H )\{x} are either the roots of two (k − 1)-forcing trees or one k-forcing tree and one (k − 2)-forcing tree, instead of η − 1 forcing trees as in Definition 2.3. Also note that we need no changes in the proof of Lemma 2.2. Similarly, it is not hard to see that if F = P 3 , then Properties 2.1, 2.2 and 2.3 can be applied directly. On the other hand, the assumption on 2-connectivity of F in the proof of Theorem 2.1 is crucial. Similarly, Presenter's strategy given in the proof of Lemma 2.3 has to be modified. Therefore, our main results for subcoloring, stated as Lemma 3.1 and Theorem 3.1, need their own proofs.

Lemma 3.1 For every k-forcing tree T k , we have
Proof It is not hard to see that our lemma holds for k ≤ 3. Recall that by Lemma 2.2 every k-forcing tree T k with k ≥ 2 can be obtained by the identification of the roots of branches B 1 , . . . , B k−1 . Let x be the root of T k and let u 1 , u 2 and x denote the vertices of the base of B k−1 . We prove that Presenter has a strategy that forces the greedy algorithm to use color k for the vertex x. In fact, we prove even more, i.e., we show that there exists a strategy resulting in a coloring such that for each branch B i with i ∈ {1, . . . , k − 1} all vertices of the base H i of B i (except x) are colored i, which clearly implies the existence of a (k − 1)-forcing star S k−1 (x) with the rays H 1 , . . . , H k−1 that allows forcing color k in x.
The above assertion easily holds for small values of k. Now, let us assume that it holds for all B i with i < k − 1 and that our lemma holds for all T i with i ≤ k − 1.
In what follows we argue that Presenter can force color k − 1 in u 1 and u 2 of B k−1 and that both vertices can be set as fixed colored with respect to the vertex x in which Presenter is going to force color k.
Case 1 Let T k be a k-forcing tree as in Definition 3.1(c), and let u 1 , u 2 and x be the roots of forcing trees T k−3 , T 1 k−1 and T 2 k−1 , respectively (see Fig. 5a for an example with k = 5). Clearly, according to the definition u 1 u 2 , u 1 x ∈ E(T k ) and k ≥ 4 while from Lemmas 2.1 and 2.2 we see that T k−3 and T 1 k−1 are contained in B k−1 . First, we argue that Presenter can force the greedy algorithm to use color k − 1 for u 1 (see Fig. 5b for an illustration). Recall that B 1 , . . . , B k−2 are the branches that form T 2 k−1 . By the induction hypothesis, Presenter has a strategy that can be played on T 2 k−1 to force color k − 2 in non-root vertices of the base H k−2 of B k−2 . Without loss of generality let v be a vertex of H k−2 that is adjacent to x and assume that after coloring v with color k − 2 Presenter discolors all vertices of T 2 k−1 except v. Since B 1 , . . . , B k−3 form a (k − 2)-forcing tree (we denote it by T ) with the root x, by the induction hypothesis Presenter has a strategy that can be played on T to force color k − 2 in the vertex x (note that v / ∈ V (T )). From now on, assume that v and x are fixed colored k − 2 with respect to u 1 , i.e., v ≺ u 1 and x ≺ u 1 (see gray vertices in the figure).
Next, let B 1 , . . . , B k−2 be the branches that form T 1 k−1 and let v be a neighbor of u 2 in the base of B k−3 . Similarly as above, by the induction hypothesis Presenter can easily use the (k − 3)-forcing tree formed by B 1 , . . . , B k−2 (we denote it by T ) to force color k − 3 in v and u 2 . Let v ≺ u 1 and u 2 ≺ u 1 .
Assume first that k ≥ 5. Since by the induction hypothesis Presenter has a strategy that can be played on T k−3 to force color k − 3 in u 1 , we know that just before coloring u 1 there is a (k − 4)-precolored star S k−4 (u 1 ). Moreover, S k−4 (u 1 ) and the subgraphs induced by the already colored vertices v, x and v , u 2 form a (k − 2)-precolored star S k−2 (u 1 ) (see Fig. 5b for S 3 (u 1 ) with precolored vertices represented by gray circles). On the other hand if k = 4 it is enough to observe that u 1 together with the precolored vertices v, x and v , u 2 form a 2-precolored star S 2 (u 1 ). This implies the existence of a strategy of forcing color k − 1 in u 1 . Let u 1 be fixed colored k − 1 with respect to x. Now, assume that u 1 is the only colored vertex of T k (recall that u 1 does not belong to V (T 1 k−1 )). Since u 2 is the root of T 1 k−1 , by the induction hypothesis it follows that u 2 can be colored k − 1. Thus, u 1 and u 2 can be fixed colored k − 1 with respect to x, i.e., u 1 ≺ x and u 2 ≺ x.
Case 2 Let T k be a k-forcing tree as in Definition 3.1(b), and let let u 1 , u 2 and x be the roots of forcing trees T 1 k−2 , T 2 k−2 and T k−1 , respectively (see Fig. 6a for an example with k = 4). Since our lemma holds for small k, we assume that k ≥ 4. By Lemmas 2.1 and 2.2 it follows that T 1 k−2 and T 2 k−2 are contained in B k−1 . Without loss of generality we can assume that u 1 is a pendant vertex of the base H k−1 of B k−1 . Hence, according to the definition of T k , we have u 2 x ∈ E(T k ). Consequently, either x or u 2 is the second pending vertex of H k−1 .
First, we argue that Presenter has a strategy of forcing the greedy algorithm to use color k − 1 for u 1 (see Fig. 6b for an illustration). By Property 2.1 both T k−1 and T 2 k−2 contain (k − 3)-forcing tree T rooted at x and T with the root u 2 , respectively. Since the roots of T , T and T 1 k−2 are exactly the vertices of H k−1 , by Definition 3.1(b) the base H k−1 and the above trees form a (k − 1)-forcing tree, say T k−1 , with root u 1 . Hence, by the induction hypothesis there exists Presenter's strategy forcing color k − 1 in u 1 . Let u 1 be fixed colored k − 1 with respect to x. Now, assume that u 1 is the only colored vertex of T k . We argue that Presenter can force color k − 1 in vertex u 2 (see Fig. 6c). Similarly as in Case 1, by the induction hypothesis Presenter can easily use the tree T k−1 formed by B 1 , . . . , B k−2 to force color k − 2 in the root x and its neighbor v in B k−2 . Let x and v be fixed colored k − 2 with respect to u 2 , i.e., x ≺ u 2 and v ≺ u 2 . Naturally, u 2 / ∈ V (T k−1 ) and since u 2 is the root of T 2 k−2 , by the induction hypothesis Presenter can force color k − 2 in u 2 . Following Property 2.3, this implies that T 2 k−2 contains a (k − 3)-precolored star S k−3 (u 2 ). Observe that S k−3 (u 2 ) together with the subgraph induced by v, x, u 2 forms a (k − 2)-forcing star S k−2 (u 2 ), which by Property 2.3 implies the possibility of forcing color k − 1 in u 2 (see Fig. 6c for S 2 (u 2 ) with precolored vertices represented by gray circles). Thus u 1 and u 2 can be fixed colored k − 1 with respect to x, i.e., u 1 ≺ x and u 2 ≺ x.
Finally, observe that in both cases x is the root of a (k − 1)-forcing tree T k−1 containing neither u 1 nor u 2 (see Figs. 5c and 6d) and hence by the induction hypothesis Presenter can use this tree to realize his strategy of forcing color k − 1 in x. This, in turn, implies the existence of a (k − 2)-precolored star S k−2 (x) such that u 1 , u 2 / ∈ V (S k−2 (x)). The star S k−2 (x), together with the subgraph induced by u 1 , u 2 and x, form a (k − 1)-precolored star S k−1 (x), which clearly implies Γ d (T k , P 3 ) ≥ k.

Theorem 3.1 If T is a tree, then Γ d (T, P 3 ) ≥ k if and only if T contains a k-forcing tree T k . Proof
By Presenter has a dynamic presentation that forces the greedy algorithm to assign color k to some vertex x of T . Hence, by Property 2.3 before x gets colored k the tree T contains a (k − 1)-precolored star S k−1 (x). Let H 1 , . . . , H k−1 be the rays of S k−1 (x) and for all i ≤ k − 1 let u i 1 , u i 2 , u i 3 denote the vertices of H i with u i 1 = x. Since S k−1 (x) is (k − 1)precolored, for each ray H i the vertices u i 2 and u i 3 are fixed colored i with respect to x, i.e., u i j ≺ x, j ∈ {2, 3}. In what follows we assume that u i 2 becomes fixed colored before u i 3 , i.e., u i 2 ≺ u i 3 . We continue by proving that if Presenter has a strategy to force color k in x, then T contains a k-forcing tree T k with the root x, and T k can be obtained by the identification . . , k − 1} performed in such a way that the rays of S k−1 (x) are the bases of the appropriate branches. It is not hard to see that the theorem holds for k ≤ 3 (see, e.g., Fig. 4). Assume k > 3 and that the above assertion holds for all T i with i ≤ k − 1.
Considering an arbitrary ray H i of S k−1 (x) we prove that H i is the base of an i-branch. Clearly, H 1 and H 2 are 1-and 2-branches, respectively. Let i ≥ 3.
Since u i 2 is fixed colored i, by our assumptions we know that Presenter has a strategy of forcing color i in u i 2 which results in (i − 1)-precolored star S i−1 (u i 2 ). Moreover, by the induction hypothesis T contains an i-forcing tree T i with the root u i 2 , and T i can be obtained by the identification of the roots of j-branches B j , j ∈ {1, . . . , i − 1} such that the rays of S i−1 (u i 2 ) are the bases of appropriate branches. An analogous observation holds for vertex u i 3 for which there is a tree T i rooted at u i 3 and obtained by the identification of the roots of appropriate j-branches with the rays of S i−1 (u i 3 ) as their bases. In what follows we analyze the relationships between the branches that form T i and T i . Recall that u i 2 ≺ u i 3 .
polynomial-time algorithm for F-trees, and it admits such an algorithm for trees when F = P 3 .
Proof From the definitions of k-forcing trees it easily follows that the order of any k-forcing tree is at most |V (F)| k−1 . Since for a given graph G of order n checking if a graph H of order p is an induced subgraph of G can be done by a simple brute force algorithm in time O(n p ) and the number of k-forcing F-trees that we have to consider is finite, it follows that checking if Γ d (T, F) ≥ k can be done in time O(n |V (F)| k−1 ).
Given two graphs G 1 and G 2 (not necessarily disjoint) by G 1 ∪ G 2 we denote the graph with the vertex set V (G 1 ) ∪ V (G 2 ) and edge set E(G 1 ) ∪ E(G 2 ). G be a graph and let {G 1 , . . . , G p } be the set of induced subgraphs of G such that G i = F for all i ∈ {1, . . . , p}. The graph B = G 1 ∪ · · · ∪ G p is called the backbone of G. Let B F be an arbitrary class of graphs for which Problem 1.1 admits a polynomialtime solution, and let G F be the class of graphs with backbones in B F . By arguments similar to those used in the proof of Theorem 4.1, for any fixed F and k appropriate backbone can be determined in polynomial-time. Together with Theorems 4.1 and 4.2 this leads to the following corollary.

Corollary 4.1 If k is a fixed positive integer and F is a fixed graph, then the problem
Greedy Dynamic Ffree kcoloring is polynomial-time solvable for graphs in G F . Consider Problem 1.1 with inputs in the class of classical trees. In this context we already know polynomial-time algorithms when F ∈ {K 2 , P 3 } (see [7] and Sect. 3, respectively). Hence, a natural question to ask is about similar results for F being a tree of order at least 4. One of the possibilities is to forbid paths P p with p ≥ 4. Another natural extension is to forbid certain monochromatic stars, which for trees comes down to an m-improper coloring, i.e., a partition of the vertex set in which each color class induces a graph of maximum degree at most m (in other words, no vertex x has more than m neighbors colored with the same color as x). In the class of trees, an m-improper coloring is equivalent to K 1,m+1 -free coloring, where K 1,m+1 denotes the star with m + 1 rays. Problem 4.1 Let F ∈ {P p , K 1,m+1 } where p ≥ 4 and m ≥ 2, and let k ≥ 1 be a fixed integer. For a given tree T decide whether Γ d (T, F) ≥ k.