The firefighter problem with more than one firefighter on trees
aa r X i v : . [ c s . D M ] O c t The firefighter problem with more than onefirefighter on trees
Cristina Bazgan Morgan ChopinBernard Ries
Universit´e Paris-Dauphine, LAMSADE,Place du Marchal de Lattre de Tassigny, 75775 Paris Cedex 16, France. { bazgan, chopin, ries } @lamsade.dauphine.fr Abstract
In this paper we study the complexity of the firefighter problem and related problemson trees when more than one firefighter is available at each time step, and answer severalopen questions of [8]. More precisely, when b ≥ b + 2 and polynomial-time solvablefor trees of maximum degree b + 2 when the fire breaks out at a vertex of degree at most b + 1. Moreover we present a polynomial-time algorithm for a subclass of trees, namely k -caterpillars. Modeling a spreading process in a network is a widely studied topic and often relies on a graphtheoretical approach (see [4, 6, 8, 12, 15, 16]). Such processes occur for instance in epidemiologyand social sciences. Indeed, the spreading process could be the spread of an infectious disease ina population or the spread of opinions through a social network. Different objectives may then beof interest, for instance minimizing the total number of infected persons by vaccinating at eachtime step some particular individuals, or making sure that some specific subset of individuals doesnot get infected at all, etc...The spreading process may also represent the spread of a fire. The associated firefighterproblem, introduced in [9], has been studied intensively in the literature (see for instance [2, 3, 5,7, 8, 9, 10, 11, 13, 14, 15]). In this paper, we consider some generalizations and variants of thisproblem which is defined as follows. Initially, a fire breaks out at some special vertex s of a graph.At each time step, we have to choose one vertex which will be protected by a firefighter. Thenthe fire spreads to all unprotected neighbors of the vertices on fire. The process ends when thefire can no longer spread, and then all vertices that are not on fire are considered as saved. Theobjective consists of choosing, at each time step, a vertex which will be protected by a firefightersuch that a maximum number of vertices in the graph is saved at the end of the process.The firefighter problem was proved to be NP-hard for bipartite graphs [14]. Much strongerresults were proved later [7] implying a dichotomy: the firefighter problem is NP-hard even fortrees of maximum degree three and it is solvable in polynomial-time for graphs with maximumdegree three, provided that the fire breaks out at a vertex of degree at most two. Moreover, thefirefighter problem is NP-hard for cubic graphs [13]. From the approximation point of view, thefirefighter problem is ee − -approximable on trees [3] and it is not n − ε -approximable on generalgraphs for any ǫ ∈ (0 ,
1) [2], if P = NP. Moreover for trees where vertices have at most threechildren, the firefighter problem is 1 . S -Fire , was introduced in [13]. Itconsists of deciding if there is a strategy of choosing a vertex to be protected at each time step1uch that all vertices of a given set S are saved. S -Fire was proved to be NP-complete for treesof maximum degree three in which every leaf is at the same distance from the vertex where thefire starts and S is the set of leaves.In this paper, we consider a generalized version of S -Fire . We denote by b -Save , where b ≥ b vertices to beprotected by firefighters at each time step and save all the vertices from a given set S . Thus, S -Fire is equivalent to 1 -Save . The optimization version of b -Save will be denoted by Max b -Save . This problem consists of choosing at most b vertices to be protected at each time stepand saving as many vertices as possible from a given set S . Hence, Max -Save corresponds tothe firefighter problem when S is the set of all vertices of the graph. Max b -Save is known to be2-approximable for trees when S is the set of all vertices [10].A survey on the firefighter problem and related problems can be found in [8]. In this survey,the authors presented a list of open problems. Here, we will answer three of these open questions(questions 2, 4, and 8).The first question asks for finding algorithms and complexity results of b -Save when b ≥ b ≥ b -Save is NP-complete for trees of maximum degree b + 2 when S is the set of all leaves. Moreover, we show that for any fixed b ≥ Max b -Save is NP-hardfor trees of maximum degree b + 3 when S is the set of all vertices. Finally, we show that for any b ≥ b -Save is polynomial-time solvable for trees of maximum degree b + 2 when the fire breaksout at a vertex of degree at most b + 1.The second question asks if there exists a constant c > c -approximation for the firefighter problem on trees. We give a negative answerto this question.Finally, the third question asks for finding classes of trees for which the firefighter problemcan be solved in polynomial time. We present a polynomial-time algorithm to solve Max b -Save , b ≥
1, in k -caterpillars a subclass of trees.Our paper is organized as follows. Definitions, terminology and preliminaries are given inSection 2. In Section 3 we establish a dichotomy on the complexity of b -Save and show that thegreedy strategy mentioned above gives no approximation guarantee. In Section 4 we show that Max b -Save is polynomial-time solvable for k -caterpillars. Some variants of the Max b -Save problem are considered in Section 5. Conclusions are given in Section 6. All graphs in this paper are undirected, connected, finite and simple. Let G = ( V, E ) be a graph.An edge in E between vertices u, v ∈ V will be denoted by uv . The degree of a vertex u ∈ V ,denoted by deg ( v ), is the number of edges incident to u . We write G − v for the subgraph obtainedby deleting a vertex v and all the edges incident to v . Similarly, for A ⊆ V , we denote by G − A the subgraph of G obtained by deleting the set A and all the edges incident to some vertex in A .In order to define the firefighter problem, we use an undirected graph G = ( V, E ) and notationsof [2]. Each vertex in the graph can be in exactly one of the following states: burned , saved or vulnerable . A vertex is said to be burned if it is on fire. We call a vertex saved if it is eitherprotected by a firefighter — that is the vertex cannot be burned in subsequent time steps — or ifall paths from any burned vertex to it contains at least one protected vertex. Any vertex whichis neither saved nor burned is called vulnerable. At time step t = 0, all vertices are vulnerable,except vertex s , which is burned. At each time t >
0, at most b vertices can be protected byfirefighters and any vulnerable vertex v which is adjacent to a burned vertex u becomes burnedat time t + 1, unless it is protected at time step t . Burned and saved vertices remain burned andsaved, respectively.Given a graph G = ( V, E ) and a vertex s initially on fire, a protection strategy is a set Φ ⊆ V × T where T = { , , . . . , | V |} . We say that a vertex v is protected at time t ∈ T according to the2rotection strategy Φ if ( v, t ) ∈ Φ. A protection strategy is valid with respect to a budget b , ifthe following two conditions are satisfied:1. if ( v, t ) ∈ Φ then v is not burned at time t ;2. let Φ t = { ( v, t ) ∈ Φ } ; then | Φ t | ≤ b for t = 1 , . . . , | V | .Thus at each time t >
0, if a vulnerable vertex v is adjacent to at least one burned vertex and( v, t ) / ∈ Φ, then v gets burned at time t + 1.We define in the following the problems we study. b -Save Input : An undirected graph G = ( V, E ), a burned vertex s ∈ V , and a subset S ⊆ V . Question : Is there a valid strategy Φ with respect to budget b such that all vertices from S aresaved? Max b -Save Input : An undirected graph G = ( V, E ), a burned vertex s ∈ V , and a subset S ⊆ V . Output : A valid strategy Φ with respect to budget b which maximizes the number of saved ver-tices that belong to S .In the figures of the paper, the burned vertices are represented by black vertices and the verticesfrom S are represented by (cid:3) . A protected vertex is represented by ⊕ .Notice that the NP-hardness of b -Save implies the NP-hardness of Max b -Save . Furthermore,if Max b -Save is solvable in polynomial-time then so is b -Save . It has been shown in [7] that 1 -Save is NP-complete for trees of maximum degree three using areduction from not-all-equal 3SAT. Furthermore, 1 -Save is polynomial-time solvable for graphsof maximum degree three if the fire breaks out at a vertex of maximum degree two. In this sectionwe generalize these results for any fixed b ≥ T be a tree and let s be the vertex which isinitially burned. From now on, s will be considered as the root of T . We define the level k of T to be the set of vertices that are at distance exactly k from s . The height of T is the length of alongest path from s to a leaf. An ancestor (resp. descendant ) of a vertex v in T is any vertex onthe path from s to v (resp. from v to a leaf). A child of a vertex v in T is an adjacent descendantof v . The tree T is said complete if every non-leaf vertex has exactly the same number of children. Remark 1.
Without loss of generality, we may assume that strategies do not protect a vertex thathas a protected ancestor in a tree.
Remark 2.
For b -Save on trees, we may assume without loss of generality that S is the set ofleaves. Otherwise for each non-leaf vertex v ∈ S , since we have to save v , we can remove thesubtree rooted at v such that v becomes a leaf. We denote by T ( r, h, d ) a complete tree of height h and root r such that every non-leaf vertexhas exactly d children and every leaf is at the same distance from the root (see Figure 1).For such a tree we obtain the following property. Lemma 1.
Let b be the number of available firefighters at each time step. Consider a completetree T ( r, h, b + 1) . If the fire breaks out at r , then at least one leaf will not be saved.Proof. Since each non-leaf vertex has exactly b + 1 children, it follows that at each time step therewill be at least one new burning vertex. Thus at the end of the process, at least one leaf will beburned. 3 Figure 1: T ( r, , Lemma 2.
Among the strategies that save all the leaves (resp. a maximum number of a givensubset of vertices) of a tree, there exists one such that each protected vertex is adjacent to a burningvertex.Proof.
This is a straightforward adaptation of observation 4.1 in [14].
Lemma 3.
Let T be a tree and let Φ be a strategy that saves all the leaves of T using at most b firefighters at each time step. Suppose there exists levels k and k ′ > k containing b k ≤ b − and b k ′ ≥ firefighters, respectively. Then there exists a strategy Φ ′ saving all the leaves of T and suchthat levels k and k ′ contain b k + 1 and b k ′ − firefighters, respectively.Proof. Let v k ′ be a protected vertex by strategy Φ at a level k ′ > k , and let v k be the ancestorof v k ′ at level k . It follows from Remark 1 that we may assume that v k is not protected. Wetransform strategy Φ into a strategy Φ ′ as follows (see Figure 2): protect v k at time step k and donot protect v k ′ at time step k ′ , that is Φ ′ = (Φ − { ( v k ′ , k ′ ) } ) ∪ { ( v k , k ) } . Since v k is an ancestor of v k ′ , it follows that using strategy Φ ′ , we save a subset of vertices that contains the vertices savedby using Φ. Since level k contains at most b − ′ is a valid strategythat saves all the leaves of T and levels k and k ′ contain respectively b k + 1 and b k ′ − Saved Saved s level k s level k level k ′ level k ′ v k v k ′ Figure 2: Moving up a firefighter leads to a strategy that saves at least the same set of leaves.We now give the main result of this section.
Theorem 1.
For any fixed b ≥ , b -Save is NP-complete for trees of maximum degree b + 2 .Proof. Clearly, b -Save belongs to NP. In order to prove its NP-hardness, we use a polynomial-timereduction from b -Save for trees of maximum degree b + 2 to ( b + 1) -Save for trees of maximumdegree b + 3, for any b ≥
1. Since b -Save is NP-hard for b = 1 (see [13]), it follows that b -Save isNP-complete for any fixed b ≥ I be an instance of b -Save consisting of a tree T = ( V, E ) of maximum degree b + 2 rootedat some vertex s and a subset S ⊂ V which corresponds to the set of leaves. Let h be the heightof T . We construct an instance I ′ of ( b + 1) -Save consisting of a tree T ′ = ( V ′ , E ′ ) of maximumdegree b + 3 rooted at some vertex s ′ and a subset S ′ ⊂ V ′ which corresponds to the leaves of T ′ asfollows (see Figure 3): add a vertex s ′ ; add two paths { y y , . . . , y h − y h − } , { x x , . . . , x h − x h } ,4ake y , x adjacent to s ′ and make y h − adjacent to s ; add vertices v , . . . , v b +1 and make themadjacent to s ′ ; for every vertex y i , i = 1 . . . , h −
1, add vertices v i, , . . . , v i,b +1 and make themadjacent to y i ; for i = 1 , . . . , h add a path { w i, w i, , . . . , w i,h − w i,h } and make w i, adjacent to x i .This clearly gives us a tree T ′ = ( V ′ , E ′ ) of maximum degree b + 3 rooted at vertex s ′ and the setof leaves S ′ ⊂ V ′ is given by S ′ = S ∪ S h − i =1 { v i, , . . . , v i,b +1 } ∪ { w ,h , . . . , w h,h } ∪ { v , . . . , v b +1 } .We prove now that there exists a strategy Φ for I that saves all the vertices in S if and onlyif there exists a strategy Φ ′ for I ′ that saves all the vertices in S ′ .Suppose there exists a strategy Φ for I that saves all the vertices in S . In order to saveall vertices in S ′ , we will apply strategy Φ ′ defined as follows: at time step t = 1, we haveto protect the vertices v , . . . , v b +1 ; at each time step 2 ≤ t ≤ h , we have to protect the vertices v t − , , . . . , v t − ,b +1 ; thus after time step h , vertex s is burning as well as vertices w ,h − , w ,h − , . . . ,w h − , , x h ; at each time step h + 1 ≤ t ≤ h , we protect the vertices in T according to Φ t − h andwe use the additional firefighter to protect the leaf w t − h,h . This clearly gives us a valid strategyΦ ′ saving all the vertices in S ′ .Suppose now that there exists a strategy Φ ′ for I ′ that saves all the vertices in S ′ . At time step t = 1, this strategy necessarily consists in protecting vertices v , . . . , v b +1 . Furthermore, at eachtime step 2 ≤ t ≤ h , we have to protect the vertices v t − , , . . . , v t − ,b +1 . It follows from Lemma 2that we may assume that Φ ′ is a strategy which, at each time step, protects vertices adjacent toburning vertices. Thus Φ ′ protects, at each time step k , at most b + 1 vertices at level k in T ′ for k = h + 1 , . . . , h . Let b T ( k ) be the number of firefighters in the subtree T of T ′ at level k used by Φ ′ and let B T = { k : b T ( k ) = b + 1 } . If B T = ∅ , then for any k , b T ( k ) ≤ b and thus thestrategy Φ ′ , restricted to the tree T , is a valid strategy for I that saves all the leaves of T . So wemay assume now that B T = ∅ .Let i ℓ be the ℓ th smallest value in B T . Consider the case ℓ = 1. Suppose that for any i < i , b T ( i ) ≥ b . From the definition of i ℓ , it follows that we cannot have b T ( i ) = b + 1, thus b T ( i ) = b forany i < i . By construction, this means that, at each time step i < i , the additional firefighterprotects the vertex w i − h,h , i ≥ h + 1. At time step i , since b T ( i ) = b + 1, the vertex w i − h,h is not protected and burns which is a contradiction. Thus there exists a level i < i such that b T ( i ) < b . It follows from Lemma 3 that there exists a strategy saving the leaves of T ′ such that b T ( i ) ≤ b and b T ( i ) = b . Applying this argument iteratively for i , . . . , i |B T | , we obtain a strategyΦ ′′ that saves all the vertices in S ′ and such that for any level k , b T ( k ) ≤ b . Thus, the strategyΦ ′′ restricted to the tree T is a valid strategy that saves all the leaves of T . x level 2level h level h + 1level 2 hv , v ,b +1 T y y level 1 v v b +1 s ′ sv h - , v h - ,b +1 x y h - level h − x hw ,h w h,h w ,h w , w , w h, w h - , w h - ,h Figure 3: The construction of T ′ .Theorem 1 implies that Max b -Save is NP-hard for trees of maximum degree b + 2 when S is5he set of leaves. Notice that Theorem 1 does not imply that Max b -Save is NP-hard when S isthe set of all vertices. However, the following theorem shows that this is indeed the case. Proposition 1.
For any fixed b ≥ , Max b -Save is NP-hard for trees of maximum degree b + 3 when S is the set of all vertices.Proof. We construct a polynomial-time reduction from b -Save to Max b -Save where b ≥
2. Let I be an instance of b -Save consisting of a tree T = ( V, E ) of maximum degree b + 2 with | V | = n ,a burned vertex s ∈ V , and a subset S ⊆ V which corresponds to the set of leaves. We constructan instance I ′ of Max b -Save consisting of a tree T ′ = ( V ′ , E ′ ), a set S ′ = V ′ , and a positiveinteger k as follows (see Figure 4). For every leaf ℓ of T , add b + 2 copies T ,ℓ , . . . , T b +2 ,ℓ of the tree T ( r, ⌈ log b +1 n + 1 ⌉ , b + 1) such that the root r i,ℓ of T i,ℓ is adjacent to ℓ , for i ∈ { , . . . , b + 2 } . Let |T | denote the cardinality of each of those trees. Notice that each tree T i,ℓ has |T | ≥ n vertices.Set k = ( b + 2) | S ||T | . We will prove that there exists a strategy for I that saves all the verticesin S if and only if there exists a strategy for I ′ that saves at least k vertices in S ′ .Suppose there exists a strategy Φ for I that saves all the vertices in S . Since S is the set ofall leaves in T , it follows that the strategy Φ applied to T ′ saves all the vertices of the trees T i,ℓ .Notice that we have ( b + 2) | S | such trees. Thus Φ saves at least k = ( b + 2) | S ||T | vertices in T ′ .Conversely, suppose that no strategy Φ for I can save all the vertices in S . Thus, at least oneleaf of T is burned at the end. This necessarily implies that for any strategy Φ ′ for I ′ there is atleast one vertex, say ℓ , of S which is burned. It follows from the construction of T ′ , that in thiscase there are at least |T | vertices which will be burned for strategy Φ ′ . Thus Φ ′ saves at most n − b + 2) | S ||T | − |T | ≤ ( b + 2) | S ||T | − < k vertices. ℓ T ,ℓ T ,ℓ T ,ℓ s T Figure 4: Construction of T ′ from the tree T for the case b = 1.The following proposition shows that the sharp separation between the NP-hardness and poly-nomiality of b -Save on trees pointed out in [13] is preserved for any fixed b ≥ Proposition 2.
Let b ≥ be any fixed integer and T a tree of maximum degree b + 2 . If the firebreaks out at a vertex of degree at most b + 1 then all the leaves of T can be saved if and only if T is not complete. Thus b -Save is polynomial-time solvable for trees of maximum degree b + 2 ifthe fire breaks out at a vertex of degree at most b + 1 .Proof. Notice that in this case we protect the vertices such that there is at most one new burningvertex v at each time step. Moreover, the fire stops when the vertex v has degree at most b + 1.Suppose that T is not complete. Then there exists a non-leaf vertex v of degree at most b + 1.From the previous remark we can direct the fire from s to v and stop it. Hence all the leaves of T are saved.Suppose that T is complete. Then at each time step, there is at least one new burning vertex.Thus there will be a leave which will burn at the end of the process.Clearly, verifying whether a tree is complete can be done in polynomial-time. Remark 3.
Notice that Proposition 2 also holds for
Max b -Save . Given a subset S of vertices,we direct the fire to a vertex of degree at most b + 1 such that the number of burned vertices in S is minimum.
6n [8], the authors asked whether there exists a constant c > c -approximation for Max -Save for trees. The following propo-sition answers this question in the case when b firefighters are available at each time step for any b ≥ Proposition 3.
For any b ≥ , there exists no function f : N → (1 , + ∞ ) such that the degreegreedy algorithm is an f ( n ) -approximation algorithm for Max b -Save for trees where S is the setof all vertices.Proof. Consider a tree T ( r, h − , b + 1) where h is a positive integer. Add a vertex s adjacent to r and a vertex v adjacent to s ; for i = 2 , . . . , h −
1, add a path of length i − u i and v i such that u i is adjacent to s ; finally, for i = 1 , . . . , h −
1, add b + 2 vertices adjacent to v i (see Figure 5).Notice that the degree greedy algorithm protects vertices in the following order: v , . . . , v h − .Thus it saves g h = ( h − b + 2) vertices. However, it is not difficult to see that the optimalsolution protects vertices in the following order: r, v , . . . , v h − . Thus, in an optimal solution wesave opt h = ( h − b + 2) + P h − i =0 ( b + 1) i vertices. Since opt h g h → + ∞ when h → + ∞ , the resultfollows. s level 1level k − ku k − v v k − u v r Figure 5: Instance where the degree greedy algorithm gives no approximation guarantee for thecase b = 1. Since here S = V , we did not represent vertices in S by squares. k -caterpillars In this section, we will present a subclass of trees for which
Max b -Save is polynomial-timesolvable for b ≥ caterpillar is a tree T such that the vertices of T with degree at least 2 induce a path. Inother words, a caterpillar T consists of a path P such that all edges have at least one endpoint in P . A k -caterpillar , k ≥
1, is a caterpillar in which any pending edge uv , with u ∈ V ( P ), v V ( P )( i.e., any edge with exactly one endpoint in P ) may be replaced by a path of length at most k (see Figure 6). This path is then called a leg of the k -caterpillar at vertex u . Thus a caterpillar isa 1-caterpillar.A star is a tree consisting of one vertex, called the center of the star, adjacent to all the others.Thus a star on n vertices is isomorphic to the complete bipartite graph K ,n − . A k -star , k ≥ k (see Figure 6). Thus a star is a 1-star. Notice that a k -star is a special case of a k -caterpillarIn [14], the authors showed that the degree greedy algorithm gives an optimal solution for Max -Save on caterpillars when S = V . However, this result does not hold for k -caterpillars, see forinstance Figure 7. 7igure 6: A 3-star (left) and a 2-caterpillar (right). ss Figure 7: A k -caterpillar for which the degree greedy algorithm (left) does not give the optimalsolution (right). Since here S = V , we did not represent vertices in S by squares.In this section, we give a polynomial-time algorithm for Max b -Save for k -caterpillars for any b ≥ S ⊆ V . In order to prove our main result of this section we first need to show thefollowing. Theorem 2.
For any k ≥ , b ≥ , Max b -Save is polynomial-time solvable for k -stars.Proof. We construct a polynomial-time reduction from
Max b -Save to the Min Cost Flow problem which is known to be polynomial-time solvable (see for instance [1]). Let G = ( V, E ) bea k -star. First assume that s ∈ V is the center of G . Let d = deg ( s ). Let P = { sv , v v , . . . ,v ( p − v p } , . . . , P d = { sv d , v d v d , . . . , v ( p d − d v p d d } be the maximal paths of G starting atvertex s , with p , . . . , p d ≤ k and v j = s , for j = 1 , . . . , d , if it exists. Let p = max { p , . . . , p d } .For each vertex v ij in these paths, we define S ij = { v ij , v ( i +1) j , . . . v p j j } ∩ S . Notice that we mayassume that every path P j contains at least one vertex of S (otherwise we may delete V ( P j ) \ { s } ).We construct an auxiliary digraph G ′ = ( V ′ , U ′ ) (see Figure 8), where V ′ = { L , . . . , L p } ∪{ C , . . . , C d } ∪{ ℓ, r } and U ′ = { ( L i , C j ) | v ij ∈ P j } ∪ { ( ℓ, L i ) | i = 1 , . . . , p } ∪ { ( C j , r ) | j = 1 , . . . , d } .In this digraph G ′ , we associate with each arc ( L i , C j ), a cost u ( i, j ) = −| S ij | . All other arcshave cost zero. Furthermore we associate with each arc ( ℓ, L i ) a capacity c ( ℓ, i ) = b , with each arc( L i , C j ) a capacity c ( i, j ) = 1 and with each arc ( C j , r ) a capacity c ( j, r ) = 1. Finally we associatea supply of value d with vertex ℓ and a demand of value − d with vertex r (all other vertices havea supply and a demand equal to zero). Thus we obtain an instance of Min Cost Flow (we wantto satisfy the supply and demand of each vertex with a minimum total cost and such that thecapacity constraints are respected) and clearly G ′ can be obtained from G in polynomial-time.
211 2 21 11 C C C L L L s [ b ] -2 L C L L C C -1-1-1-1-2 -2-1 ℓ r [ b ][ b ] [1][1][1] Figure 8: The auxiliary digraph G ′ .8e show now that solving Max b -Save in G is equivalent to solving Min Cost Flow in G ′ . Consider a feasible solution of Max b -Save in G of value ν . We may assume without loss ofgenerality (see Remark 1) that at most one vertex is protected in each path P j , j ∈ { , . . . , d } ,and (see Lemma 2) that at most b vertices are protected in each set V i = { v i , v i, , . . . , v id } , i ∈ { , . . . , p } (notice that some of these vertices v ij , j = 1 , . . . , d , may not exist in G ). Let D = { v ij | v ij is protected , i ∈ { , . . . , p } , j ∈ { , . . . , d }} . Thus ν = P v ij ∈D | S ij | . Consider nowsome vertex v ij ∈ D . Then in G ′ , we will use one flow unit on the path ℓ - L i - C j - r . Repeating thisprocedure for every vertex in D , we obtain a flow in G ′ of value |D| and of cost P v ij ∈D u ( i, j ) = P v ij ∈D −| S ij | = − ν . Since at most b vertices are protected in each set V i , it follows that atmost b units of flow use the arc ( ℓ, L i ), for i ∈ { , . . . , p } . Furthermore, since exactly one vertex isprotected in each path P j , it follows that exactly one flow unit uses the arc ( C j , r ) for j ∈ { , . . . , d } .Hence, we obtain a feasible solution of Min Cost Flow in G ′ .Conversely, consider now a feasible solution of Min Cost Flow in G ′ of value − µ . Let A be the set of arcs ( L i , C j ) used by a flow unit, i ∈ { , . . . , p } , j ∈ { , . . . , d } . Thus − µ = P ( L i ,C j ) ∈A −| S ij | . For each flow unit on a path ℓ - L i - C j - r , we choose vertex v ij in G to be pro-tected, for i ∈ { , . . . , p } , j ∈ { , . . . , d } . Since the capacity of an arc ( ℓ, L i ) is b , at most b verticesin V i will be chosen to be protected, i ∈ { , . . . , p } . Let us denote by V ∗ i the set of vertices in V i chosen to be protected. Furthermore, since the capacity of an arc ( C j , r ) is one, exactly onevertex in each path P j will be chosen to be protected, j ∈ { , . . . , d } . Thus, if we protect ateach time step i the vertices in V ∗ i , we obtain a feasible solution of Max b -Save in G of value P i P v ij ∈ V ∗ i | S ij | = µ .Finally, we have to consider the case when s is not the center of G . The case when s has degreeone is trivial. Thus we may assume now that deg ( s ) = 2. If b ≥
2, we are done. Thus we mayassume now that b = 1. If both neighbors of s are in S , then the optimal solution is clearly | S | − s are not in S , then the optimal solution is clearly | S | . Hence the only caseremaining is when exactly one neighbor of s is in S . Let u , u be the neighbors of s such that u ∈ S, u S . If u is not the center of G , the optimal solution is clearly | S | . Thus we mayassume now that u is the center of G . Let Q denote the set of vertices of the unique maximal pathstarting at vertex u and containg u . In that case we have to compare the value of two solutions:(i) | S | − u and then, during thesecond time step, we protect the neighbor of u which is not s (if it exists); (ii) the value of thesolution obtained by protecting first u and then applying our algorithm described above to thegraph G − ( Q \ { u } ) ( i.e., by reducing our problem to a Min Cost Flow problem).
Remark 4.
Notice that the polynomial reduction from
Max b -Save to Min Cost Flow describedin the proof of Theorem 2 is still valid if the number of vertices that can be protected at each timestep is not constant (for instance if we are allowed to protect at most b vertices during the firsttime step, b vertices during the second time step, etc...). In that case we just need to adapt thecapacity of the arcs ( ℓ, L i ) accordingly.Furthermore the polynomial reduction remains valid in the case where some of the vertices ina set V i are not allowed to be protected during time step i . In this case we simply do not put anarc from L i to the corresponding vertices C j in G ′ . Consider now a k -caterpillar G = ( V, E ). Let P be the path in the caterpillar from which G has been obtained, which is induced by vertices of degree at least two. We will call P the spine of the k -caterpillar.We are now ready to prove the main result of this section. Theorem 3.
For any k ≥ , b ≥ , Max b -Save is polynomial-time solvable for k -caterpillars.Proof. Let G = ( V, E ) be a k -caterpillar and let P = { v v , v v , . . . , v p − v p } be the spine of G .First assume that s is a vertex of P , say s = v i , i ∈ { , . . . , p } . Let P = { v v , . . . , v i − v i − } and P = { v i +1 v i +2 , . . . , v p − v p } . It follows from Remark 1 that we may assume that at mostone vertex is protected in P and at most one vertex is protected in P . Consider a strategy9n which we decide to protect exactly two vertices of P , say vertex v j , for j ∈ { , . . . , i − } and vertex v q , for q ∈ { i + 1 , . . . , p } . We may assume that v j is protected during time step i − j and vertex v q is protected during time step q − i (see Lemma 2). Notice that the vertices v j +1 , . . . , v i − , v i +1 , . . . , v q − will not be protected in this strategy. Construct a ( k + p )-star G ′ asfollows (see Figure 9):(a) delete all vertices v , . . . , v j as well as the legs at these vertices (all these vertices are savedin our strategy);(b) delete all vertices v q , . . . , v p as well as the legs at these vertices (all these vertices are savedin our strategy);(c) delete all edges of P ;(d) for every r ∈ { j + 1 , . . . , i − , i + 1 , . . . , q − } , let u r , . . . , u rd ( v r ) − be the neighbors of v r notbelonging to P ; delete v r and replace it by d ( v r ) − v r , . . . , v rd ( v r ) − such that v rl isadjacent to u rl for l ∈ { , . . . , d ( v r ) − } ;(e) join every vertex v rℓ , for r ∈ { j + 1 , . . . , i − } and ℓ ∈ { , . . . , d ( v r ) − } , to v i by a path P rℓ of length i − r ;(f) join every vertex v rℓ , for r ∈ { i + 1 , . . . , q − } and ℓ ∈ { , . . . , d ( v r ) − } , to v i by a path P rℓ of length r − i ; v v v v u u u u u u v v u u v u u v u u v v v Figure 9: The construction of G ′ with i = 5, j = 2, and q = 7.From the above construction it follows that G ′ is a ( k + p )-star with center v i . Now in orderto solve our initial problem, we need to solve Max b -Save in G ′ with the following additionalconstraints: for every r ∈ { j + 1 , . . . , i − , i + 1 , . . . , q − } and every ℓ ∈ { , . . . , d ( v r ) − } we arenot allowed to protect the vertices of V ( P rℓ ). Indeed, since we decided to protect v j and v q , thevertices v j +1 , . . . , v i − , v i +1 , . . . , v q − will not be saved. Notice that these vertices are representedby the vertices of paths P rℓ in G ′ . Moreover, if i − j = q − j then at time steps i − j and q − j only b − v j and v q at these time steps); if i − j = q − j then only b − i − j . It follows from Theorem 2 and Remark4 that this problem can be solved in polynomial-time.Since the number of choices of a pair of vertices ( v j , v q ) to be protected on P is ( i − × ( p − i ),we can determine in polynomial-time the best strategy to adopt if we want to protect exactly twovertices on P . Notice that a similar procedure to the one described above can be used if we decideto protect exactly one vertex on P respectively if we decide not to protect any vertex of P . Clearlythe number of choices of exactly one vertex v j , j ∈ { , . . . , i − , i +1 , . . . , p } , to be protected on P is p −
1. Thus we conclude that if s ∈ V ( P ) we can determine an optimal strategy in polynomial-time.It remains the case when s V ( P ). Similar to the proof of Theorem 2, we will distinguishseveral cases. The case when s has degree one is trivial. Thus we may assume now that deg ( s ) = 2.If b ≥
2, we are done. Thus we may assume now that b = 1. If both neighbors of s are in S ,then the optimal solution is clearly | S | −
1. If both neighbors of s are not in S , then the optimal10olution is clearly | S | . Hence the only case remaining is when exactly one neighbor of s is in S .Let u , u be the neighbors of s such that u ∈ S, u S . If u V ( P ), the optimal solution isclearly | S | . Thus we may assume now that u ∈ V ( P ). In this case we have to compare the valueof two solutions: (i) | S | − u andthen, during the second time step, we protect the neighbor of u which is not s (if it exists); (ii)the value of the solution obtained by protecting first u and then applying our algorithm describedabove to the graph G − ( Q \ { u } ), where Q is the set of vertices of the unique maximal pathstarting at u and containing u . Max b -Save In this section, we give some results for a weighted version of
Max b -Save as well as for itscomplementary version. We would like to mention that our positive results (Proposition 2, Theorem 2, and Theorem 3)may be generalized to a weighted version of
Max b -Save .Suppose that we are given a weight w ( v ) for each vertex v ∈ S ⊆ V . These weights may forinstance reflect the importance of the vertices: if w ( v ) > w ( v ), vertex v is considered as moreimportant than vertex v . Then we may define the following problem: Max Weighted b -Save Input : An undirected graph G = ( V, E ), a burned vertex s ∈ V , a subset S ⊆ V , and a weightfunction w : S → N . Output : A valid strategy Φ with respect to budget b which maximizes the total weight of thesaved vertices that belong to S .In the proof of Proposition 2, if we direct the fire to a vertex of degree at most b + 1 such thatthe total weight of the burned vertices in S is minimum then we get the following result. Proposition 4.
For any b ≥ , Max Weighted b -Save is polynomial-time solvable for trees ofmaximum degree b + 2 if the fire breaks out at a vertex of degree at most b + 1 . Now by replacing the costs u ( i, j ) in the proof of Theorem 2 by u ( i, j ) = −| P v ∈ S ij w ( v ) | andadapting the case when s is not the center of G according to the weights, it is not difficult to seethat we obtain the following. Theorem 4.
For any k ≥ , b ≥ , Max Weighted b -Save is polynomial-time solvable for k -stars. Using this result and adapting the case when s / ∈ V ( P ) according to the weights, it is straight-forward that we obtain the following result. Theorem 5.
For any k ≥ , b ≥ , Max Weighted b -Save is polynomial-time solvable for k -caterpillars. Although the results above are more general than the results in Sections 3 and 4, we decidedto present in detail the results concerning
Max b -Save in this paper, since this corresponds tothe version which has been widely studied in the literature. Let us consider now the minimum version of the
Max b -Save problem which is defined as follows. Min b -Save nput : An undirected graph G = ( V, E ), a burned vertex s ∈ V , a subset S ⊆ V . Output : A valid strategy Φ with respect to budget b which minimizes the number of burnedvertices that belong to S .In contrast to Max b -Save which is constant approximable on trees, the following theoremshows a strong inapproximability result for Min b -Save even when restricted to trees. Theorem 6.
For any ǫ ∈ (0 , and any b ≥ , Min b -Save is not n − ǫ -approximable even fortrees on n vertices when S is the set of all vertices, unless P = N P .Proof.
We construct a polynomial-time reduction from b -Save to Min b -Save . Let I be aninstance of b -Save consisting of a tree T = ( V, E ) with | V | = n , a burned vertex s ∈ V , anda subset S ⊆ V which corresponds to the set of leaves. We construct an instance I ′ of Min b -Save consisting of a tree T ′ = ( V ′ , E ′ ) with | V ′ | = n , a burned vertex s ′ , and S ′ = V ′ asfollows. For every leaf ℓ of T , add ⌊ n β + b ⌋ vertices adjacent to ℓ where β = ǫ −
3. Notice that n = ⌊ n β + b ⌋| S | + n < n β +31 .If there exists a strategy that saves all the vertices in S then at most n vertices are burned in V ′ . Conversely, if there is no strategy that saves all the vertices in S then at least n β vertices areburned in V ′ .Suppose that there exists a polynomial-time n − ǫ -approximation algorithm A for Min b -Save . Thus, if I is a yes -instance, the algorithm gives a solution of value A ( I ′ ) ≤ n − ǫ n Network Flows: Theory, Algorithms, and Applications .Prentice Hall, 1993.[2] E. Anshelevich, D. Chakrabarty, A. Hate, and C. Swamy. Approximation algorithms for thefirefighter problem: Cuts over time and submodularity. In Proceedings of the 20th Interna-tional Symposium on Algorithms and Computation (ISAAC ’09) , LNCS 5878, pages 974–983,2009.[3] L. Cai, E. Verbin, and L. Yang. Firefighting on trees: (1 - 1/e)-approximation, fixed param-eter tractability and a subexponential algorithm. In Proceedings of the 19th InternationalSymposium on Algorithms and Computation (ISAAC ’08) , LNCS 5369, pages 258–269, 2008.[4] N. Chen. On the approximability of influence in social networks. In Proceedings of the 19thannual ACM-SIAM symposium on Discrete algorithms (SODA ’08) , pages 1029–1037, 2008.[5] M. Develin and S. G. Hartke. Fire containment in grids of dimension three and higher. Discrete Applied Mathematics , 155(17):2257 – 2268, 2007.126] P. A. Dreyer and F. S. Roberts. Irreversible k-threshold processes: Graph-theoretical thresh-old models of the spread of disease and of opinion. Discrete Applied Mathematics , 157(7):1615– 1627, 2009.[7] S. Finbow, A. King, G. MacGillivray, and R. Rizzi. The firefighter problem for graphs ofmaximum degree three. Discrete Mathematics , 307(16):2094 – 2105, 2007.[8] S. Finbow and G. MacGillivray. The firefighter problem: a survey of results, directions andquestions. The Australasian Journal of Combinatorics , 43:57–77, 2009.[9] B. Hartnell. Firefighter! an application of domination, Presentation. In , 1995.[10] B. Hartnell and Q. Li. Firefighting on trees: how bad is the greedy algorithm? CongressusNumerantium , 145:187–192, 2000.[11] Y. Iwaikawa, N. Kamiyama, and T. Matsui. Improved approximation algorithms for firefighterproblem on trees. IEICE Transactions on Information ans Systems , E94.D(2):196–199, 2011.[12] D. Kempe, J. Kleinberg, and ´E. Tardos. Maximizing the spread of influence through a socialnetwork. In Proceedings of the 9th ACM SIGKDD international conference on Knowledgediscovery and data mining (KDD ’03) , pages 137–146, 2003.[13] A. King and G. MacGillivray. The firefighter problem for cubic graphs. Discrete Mathematics ,310(3):614 – 621, 2010.[14] G. MacGillivray and P. Wang. On the firefighter problem. Journal of Combinatorial Mathe-matics and Combinatorial Computing , 47:83–96, 2003.[15] K. L. Ng and P. Raff. A generalization of the firefighter problem on ZxZ. Discrete AppliedMathematics , 156(5):730–745, 2008.[16] A. E. Scott, U. Stege, and N. Zeh. Politicians firefighting. In