A survey of some results on the Firefighter Problem Wow! I need reinforcements! Kah Loon Ng DIMACS A simple model A simple model A simple model A simple model A simple model A simple model A simple model A simple model Some questions that can be asked (but not necessarily answered!) • • • • • • • • Can the fire be contained? How many time steps is required before fire is contained? How many firefighters per time step are necessary? What fraction of all vertices will be saved (burnt)? Does where the fire breaks out matter? “Smart fires”? Fire starting at more than 1 vertex? Consider different graphs. Construction of (connected) graphs to minimize damage. • Complexity/Algorithmic issues Some references 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. The firefighter problem for graphs of maximum of degree three (Finbow, King, MacGillivray, Rizzi) Graph-theoretic models of spread and competition (Hartke) On the firefighter problem (MacGillivray, Wang) Catching the fire on grids (Fogarty) Fire control on graphs (Wang, Moeller) Firefighting on trees: How bad is the greedy algorithm? (Hartnell, Li) On minimizing the effects of fire or a virus on a network (Finbow, Hartnell, Li, Schmeisser) On designing a network to defend against random attacks of radius two (Finbow, Hartnell) The optimum defense against random subversions in a network (Hartnell) On minimizing the effects of betrayals in a resistance movement (Gunther, Hartnell) Four general classes of problems 1. Containing fires in infinite grids dimension. Ld where d is the Four general classes of problems 2. Saving vertices in finite grids of dimension 2 or 3. Four general classes of problems 3. Firefighting on trees. Algorithmic and complexity issues. Four general classes of problems 4. Construction of graphs that minimizes damage. Containing fires in infinite grids Ld Fire starts at only one vertex: d= 1: Trivial. d = 2: Impossible to contain the fire with 1 firefighter per time step Containing fires in infinite grids Ld d = 2: Two firefighters per time step needed to contain the fire. 8 time steps 18 burnt vertices Containing fires in infinite grids Ld d 3: Fact: If G is a k-regular graph, k – 1 firefighters per time step is always sufficient to contain any fire outbreak (at a single vertex) in G. …… .…. Containing fires in infinite grids Ld d 3: Fact: If G is a k-regular graph, k – 1 firefighters per time step is always sufficient to contain any fire outbreak (at a single vertex) in G. Shown: 2d – 2 firefighters per time step are not enough to contain an outbreak in Ld Thus, 2d – 1 firefighters per time step is the minimum number required to contain an outbreak in Ld and containment can be attained in 2 time steps. Containing fires in infinite grids Ld Theorem (Hartke): Let G be a rooted graph, h a positive integer, and a0 , a1 ,..., ah positive integers each at least f such that the following holds: 1. Every nonempty A D0 satisfies | N ( A) D1 || A | a0 k 1 2. For 1 k h , every A Dk where | A | 1 i 0 ( ai f ) satisfies| N ( A) Dk 1 || A | ak h 3. For k h , every A Dk such that| A | 1 i 0 ( ai f ) satisfies | N ( A) Dk 1 || A | f Containing fires in infinite grids Ld Theorem (Hartke): Suppose that at most f firefighters per time step are deployed. Then 1 n0 n 1 | Bn | 1 rn i 0 ( ai f ) 1 n h 1 1 r h ( a f ) n h 1 n i i 0 regardless of the sequence of firefighter placements. Specifically, f firefighters per time step are insufficient to contain an outbreak that starts at the root vertex. Containing fires in infinite grids Ld Fire can start at more than one vertex. d = 2: Two firefighters per time step are sufficient to contain any outbreak at a finite number of vertices. d 3: For any d 3, and any positive integer f , f firefighters per time step is not sufficient to contain all finite outbreaks in Ld. In other words, for d 3 and any positive integer f , there is an outbreak such that f firefighters per time step cannot contain the outbreak. Saving vertices in finite grids G Assumptions: 1. 1 firefighter is deployed per time step 2. Fire starts at one vertex Let MVS(G, v) = maximum number of vertices that can can be saved in G if fire starts at v. Saving vertices in finite grids G G Pn Pn n2 V (G ) {( a, b) | 1 a, b n} (1,1) (1, n) n2 MVS ( Pn Pn , (a, b)) n(n b) (a 1)( n a) 1 b a n2 Saving vertices in finite grids G G Pn Pn V (G ) {( a, b) | 1 a, b n} MVS ( Pn Pn , (a, b)) n(n b) (a 1)( n a) 1 b a n2 Saving vertices in finite grids G G Pn Pn V (G ) {( a, b) | 1 a, b n} na nb MVS ( Pn Pn , (a, b)) n(n b) (a 1)( n a) 1 b a n2 Saving vertices in finite grids G G Pn Pn V (G ) {( a, b) | 1 a, b n} MVS( Pn Pn , (1,1)) n(n 1) n2 n Saving vertices in finite grids G G Pn Pn V (G ) {( a, b) | 1 a, b n} Saving vertices in finite grids G G Pn Pn V (G ) {( a, b) | 1 a, b n} n r 1 n c 1 MVS ( Pn Pn , ( r , c )) ( r 1) 2 2 (2 r c n2 ) c 2r c 1 2r c n 2 2 2 2 Saving vertices in Pl Pm Pn MVS ( P3 P3 P6 , (1,1,1)) 21 MVS ( P3 P3 Pn , (1,1,1)) 9n 33, n 6 Saving vertices in Pl Pm Pn p p n If n p 2 2( p 1) 1, p 3 p 2 ( p 1) p( p 1)( p 2) MVS ( Pp Pp Pn , (1,1,1)) 2 2 Some asymptotic results Let R(G, v) number of vertices that can be saved if fire starts at v number of vertices in G For example, Some asymptotic results Let R(G, v) number of vertices that can be saved if fire starts at v number of vertices in G For example, So 2 1 R( Pn , v ) 1 for any v n Some asymptotic results Fire starts at ( a, b) na nb Some asymptotic results ( a, b) (1,1) 1 R( Pn Pn , (1,1)) 1 n Some asymptotic results (a, b) ( n2 , n2 ) 1 R( Pn Pn , ( , )) 4 n 2 1 2n1 4n 2 n 2 n is even n is odd Some asymptotic results Pn Pn Pn Conjecture: lim R( Pn Pn Pn , v ) 0 n Some asymptotic results Let v be any vertex of Pn Pn Pn , n 1. Then the maximum number of vertices which can be saved by deploying one firefighter per time step with an initial outbreak at v grows at most as O(n 2 ). In particular, lim R( Pn Pn Pn , v ) 0 n In fact, the optimal number of vertices that can be saved given an initial outbreak at (0,0,0) in Pn Pn Pn when deploying one firefighter per time step is between O(n3/ 2 ) and O(n2 ) Algorithmic and Complexity matters FIREFIGHTER Instance: A rooted graph (G, r ) and an integer k 1 Question: Is MVS (G, r ) k ? That is, is there a finite sequence d1 , d 2 ,..., dt of vertices of G such that if the fire breaks out at r then, 1. vertex d i is neither burning nor defended at time i 2. At time t no undefended vertex is adjacent to a burning vertex, and 3. At least k vertices are saved at the end of time t Algorithmic and Complexity matters FIREFIGHTER is NP-complete for bipartite graphs. EXACT COVER BY 3-SETS (X3C) Instance: A set X with | X | 3q and a collection C of 3element subsets of X Question: Does C contain an exact cover for X ? That is, is there a sub-collection C’ C such that each element of X occurs in exactly one member of C’ ? Algorithmic and Complexity matters Suppose an instance of X3C ( X , | X | 3q, C ) is given. We construct a rooted bipartite graph (G, r ) and a positive integer k such that At least k vertices of G can be saved There is an exact cover of X by elements of C Algorithmic and Complexity matters Pq Ci q k q (10q 5 ) 2 Note that the graph is bipartite. for each element in C Cj : : 10q 5 For each pair of Ci , Cj such that (Ci Cj = ) join their respective vertices ( ) by paths of length two ( ) Algorithmic and Complexity matters q k q (10q 5 ) 2 Pq Ci If X has an exact cover… Cj : : 10q 5 … save the vertices that corresponds to the subsets ( ) in the exact cover. Algorithmic and Complexity matters q k q (10q 5 ) 2 Pq Ci Cj : : 10q 5 If at least k vertices can be saved… …at most q of the vertices ( ) can be saved by time q … …if q , at most q 1 (10q 5 ) q | C | k 2 ( + ) ( ) can be saved… Algorithmic and Complexity matters Firefighting on Trees: Algorithmic and Complexity matters Greedy algorithm: For each v V (T ), define weight (v) desc(v) 1 At each time step, save place firefighter at vertex that has not been saved such that weight (v) is maximized. Algorithmic and Complexity matters 26 22 Firefighting on Trees: 12 8 9 2 6 1 1 3 1 1 7 5 1 3 1 6 11 1 4 1 2 1 2 3 1 1 Algorithmic and Complexity matters Greedy =7 Optimal =9 Algorithmic and Complexity matters Theorem: For any tree with one fire starting at the root and one firefighter to be deployed per time step, the greedy algorithm always saves more than ½ of the vertices that any algorithm saves. Sgreedy = number of vertices saved by greedy algorithm Soptimal = number of vertices saved by optimal algorithm number of vertices saved by optimal moves whose corresponding greedy moves performs no worse Soptimal A Soptimal + B Soptimal Algorithmic and Complexity matters A Soptimal * B Soptimal Greedy Optimal B why was this vertex chosen on second move and not this? Sgreedy Soptimal A …because *’s ancestor has already been selected… …vertices saved by moves Sgreedy > Soptimal B B Soptimal A Soptimal B Soptimal = Soptimal + Soptimal have already been saved by Sgreedy Sgreedy > ½ Soptimal Algorithmic and Complexity matters Assume p k … p vertices Pk Greedy: k 2 ( k2 1) kp2 1 if k is even ( 1) p k 2 k 2 k 2 Optimal: ( kp k ) k 2 if k is odd : : Algorithmic and Complexity matters Slight modification: Suppose we are allowed to defend one vertex per time step for every burnt vertex there are at the end of the previous time step. • Greedy algorithm saves at least ½ as many vertices as the optimum algorithm • (Integer) Linear Programming and Dynamic Programming can be used Algorithmic and Complexity matters 0-1 integer program for trees: max subject to: xv wt (v ) vT { r } xv 1 for each level i level( v )i xv xu all ancestorsu of v xv 0 or 1 1 for every leaf v of T Algorithmic and Complexity matters max xv wt (v ) vT { r } xv 1 for each level i level( v )i xv xu 1 for every leaf v of T all ancestorsu of v xv 0 or 1 Additional linearv constraints candescendant also be added For each vertex r, and each w oftov,narrow add thethe constraint integrality gap. xv xw 0 Algorithmic and Complexity matters A class of trees (T , r ) whose MVS(T , r ) can be computed in polynomial time. First, recall the definition of a perfect graph: G is a perfect graph if (G) (G) If G is a perfect graph, we can find a maximum weight independent set of G in polynomial time. Algorithmic and Complexity matters A class of trees (T , r ) whose MVS(T , r ) can be computed in polynomial time. A rooted tree (T , r )is said to be a P-tree if it does not contain the following configuration: level i level i+1 level i+2 No requirement for this to be an induced subgraph nota aP-tree P-tree Algorithmic and Complexity matters A class of trees (T , r ) whose MVS(T , r ) can be computed in polynomial time. Given (T , r ) , let P(T , r ) be the graph obtained from T by: 1. Adding edges joining each vertex to all its descendants 2. Adding edges joining each vertex to all vertices at the same level Now assign a weight to each vertex defined by: wt(r) = 0; wt(v) = desc(v) +1. Algorithmic and Complexity matters A class of trees (T , r ) whose MVS(T , r ) can be computed in polynomial time. Theorem (MacGillivray, Wang) A rooted tree (T , r ) is a P-tree if and only if P(T , r ) is a perfect graph Note that an independent set in P(T , r ) corresponds to a subset of vertices in (T , r ) with at most one vertex in each level. So, can find max. can compute (T,r) is a P(T,r) is a wt. indep set MVS(T,r) in perfect graph P-tree in poly. time poly. time Some further questions to ponder… 1. For infinite graphs (like what we did for infinite grids), what is the minimum number of firefighters per time step so that only a finite number of vertices are burned? (Percolation theory?) 2. (For trees) Characterization of when the greedy algorithm is optimal. 3. Narrowing integrality gap. 4. Determination of MVP for pre-emptive vaccination. 5. Construction of networks that are resistant to attacks. 6. Can we include weight on edges to represent rate of transmission? 7. Game theory? THE END One firefighter is enough!