Locating Sensors to Detect Chem, Bio, or Nuclear Threats Fred Roberts DyDAn 1 Sensors are finding many uses in homeland security. We place sensors in buildings, on bridges, at border crossings, and even on uniforms of police. They sense radiation, dangerous chemicals, biological agents, etc. 2 The Bioterrorism Sensor Location Problem 3 The Bioterrorism Sensor Location Problem Great concerns about deliberate release of disease-causing pathogens has caused us to Worry about “bioterrorism.” anthrax 4 • Early warning is critical in defense against terrorism • This is a crucial factor underlying the government’s plans to place networks of sensors/detectors to warn of a bioterrorist attack 5 The BASIS System – Salt Lake City Types of Sensor Problems • I first got involved in sensor placement for biological attacks when I was approached by the Defense Threat Reduction Agency. • I ended up learning a lot about the problem from the Institute for Defense Analyses. • And from the NYC Department of Health • Similar issues arise in placing sensors to protect against or give early warning about attacks with chemical or nuclear weapons. • Or attacks on our networks: communication, financial, etc. 6 Types of Sensor Problems • Similar sensor placement problems arise in applications in: – Civil engineering: monitoring temperature, humidity, structural stability in a building, bridge, etc. – Manufacturing – Fault detection in distributed or multiprocessor computer systems 7 Locating Sensors is not Easy • Sensors are expensive • How do we select them and where do we place them to maximize “coverage,” expedite an alarm, and keep the cost down? • Approaches that improve upon existing, ad hoc location methods could save countless lives in the case of an attack and also money in capital and operational costs. 8 Two Fundamental Problems • Sensor Location Problem – Choose an appropriate mix of kinds of sensors – decide where to locate them for best protection and early warning 9 Two Fundamental Problems • Pattern Interpretation Problem: When sensors set off an alarm, help public health decision makers decide – Has an attack taken place? – What additional monitoring is needed? – What was its extent and location? – What is an appropriate response? 10 The SLP: What is a Measure of Success of a Solution? • • • • A modeling problem. Needs to be made precise. Many possible formulations. Good explorations for your students. 11 The SLP: What is a Measure of Success of a Solution? • Identify and ameliorate false alarms. • Defending against a “worst case” attack or an “average case” attack. • Minimize time to first alarm? (Worst case? (Average case?) • Maximize “coverage” of the area. – Minimize geographical area not covered – Minimize size of population not covered – Minimize probability of missing an attack 12 The SLP: What is a Measure of Success of a Solution? •Cost: Given a mix of available sensors and a fixed budget, what mix will best accomplish our other goals? 13 The SLP: What is a Measure of Success of a Solution? •It’s hard to separate the goals. •Even a small number of sensors might detect an attack if there is no constraint on time to alarm. •Without budgetary restrictions, a lot more can be accomplished. 14 The Sensor Location Problem •Approach is to develop new algorithmic methods. •Developing new algorithms involves fundamental mathematical analysis. •Analyzing how efficient algorithms are involves fundamental mathematical methods. •Implementing the algorithms on a computer is often a separate problem – which needs to go hand in hand with the basic mathematics of algorithm development. 15 Algorithmic Approaches I : Greedy Algorithms 16 Greedy Algorithms • Find the “most important” location to place a sensor first and locate a sensor there. • What things could “most important” mean? • Find second-most important location. • Etc. • Builds on earlier mathematical work at Institute for Defense Analyses (Grotte, Platt) • “Steepest ascent approach.’’ • No guarantee of “optimal” or best solution. • In practice, gets pretty close to optimal solution. 17 Algorithmic Approaches II : Variants of Classic Facility Location Theory Methods 18 Location Theory • Old problem in Operations research: Where to locate facilities (fire houses, garbage dumps, etc.) to best serve “users” • Often deal with a network with vertices, edges, and distances along edges • Users u1, u2, …, un are located at vertices • One approach: locate the facility at vertex x chosen so that sum of distances to users is minimized. n d ( x, ui ) • Minimize: i 1 19 Location Theory: A Network f 1 a 1 1 e b 1 1 d Vertices are places for users or facilities 1 c 1’s represent distances along 20 edges Location Theory: A Network f 1 a 1 1 e b 1 1 d 1 d(x,y) = length of shortest route from x to y So, d(a,c) = 2. c 1’s represent distances along 21 edges 1 f 1 a 1 u1 e b u2 1 1 d 1 c u3 Given users at u1, u2, u3, where do we place a facility to minimize the sum of distances to the users? 22 1 f 1 a 1 u1 e b u2 1 1 d 1 c x=a: d(x,ui)=1+1+2=4 u3 x=b: d(x,ui)=2+0+1=3 x=c: d(x,ui)=3+1+0=4 x=d: d(x,ui)=2+2+1=5 x=e: d(x,ui)=1+3+2=6 x=f: d(x,ui)=0+2+3=5 x=b is optimal 23 Location Theory • Users u1, u2, …, un are located at vertices • Alternative approach: Locate the facility at vertex x chosen so that maximum distance to one of the users is minimized. 24 1 f 1 a 1 u1 e b u2 1 1 d 1 c u3 Given users at u1, u2, u3, where do we place a facility to minimize the maximum distance a user has to travel to get to the facility? 25 1 f 1 a 1 u1 e b u2 1 1 d x = a: maxid(ui,x) = 2 x = c: maxid(ui,c) = 3 x = e: maxid(ui,e) = 3 1 c u3 x = b: maxid(ui,b) = 2 x = d: maxid(ui,d) = 2 x = f: maxid(ui,f) = 3 There are three optimal solutions: a, b, d 26 Variants of Classic Facility Location Theory Methods: Complications • We don’t have a network with vertices and edges; we have points in a city • Sensors can only be at certain locations (size, weight, power source, hiding place) • We need to place more than one sensor • Instead of “users,” we have places where potential attacks take place. • Potential attacks take place with certain probabilities. • Wind, buildings, mountains, etc. add 27 complications. The Pattern Interpretation Problem 28 The Pattern Interpretation Problem (PIP) • It will be up to the Decision Maker to decide how to respond to an alarm from the sensor network. 29 Approaching the PIP: Minimizing False Alarms 30 Approaching the PIP: Minimizing False Alarms One approach: Redundancy. • Could require two or more sensors to make a detection before an alarm is considered confirmed • Could require same sensor to register two alarms: Biosensor “Portal Shield” requires two positives for the same agent during a specific time period. 31 Approaching the PIP: Minimizing False Alarms • Could place two or more sensors at or near the same location. Require two proximate sensors to give off an alarm before we consider it confirmed. • Redundancy has drawbacks: cost, delay in confirming an alarm. • We need mathematical methods to analyze the tradeoff between lowered false alarm rate and extra cost/delay 32 Sensor Placement in Networks • From now on, we will concentrate on networks or graphs. • G = (V,E) = graph; V = vertices, E = edges • Assume all edges have distance 1 • Limit to “attacks” on vertices • Assume detectors can only be placed at vertices • Two goals: – Detection: Detect that an attack on a vertex has taken place – Identification: Identify where the attack 33 took place Sensor Placement in Networks (Joint work with David L. Roberts) • Assume that a detector can detect an attack up to distance r away. • We often think of distance = time. • Assume that there are no errors in detection: If there is an attack up to distance r away, the detector will detect it with 100% certainty. • Nr[x] = set of all vertices in V to which there is a path in the graph of length at most r from x. (r-neighborhood of x) 34 Sensor Placement in Networks f a e b d c • N2(c) = ? • N2(c) = {c, b, d, a, e} 35 Sensor Placement in Networks • Let D be the set of vertices where we place a detector. • Let Dr(x) = Nr(x) D 36 Sensor Placement in Networks f a e b d D = {a, b, f} D2(d) = ? D2(d) = {b, f} c 37 Sensor Placement in Networks • Detection: D is an r-dominating set in G if for every vertex x of G, Dr(x) . • That is, for all x, there is a path of length at most r from x to some y in D. 38 Sensor Placement in Networks f a e b d D = {a, b, f} D is a 2-dominating set. It is not a 1-dominating set. c 39 Sensor Placement in Networks • Unique Identification: D is an ridentifying code (r-IC) in G if it is an rdominating set and if, whenever x y are vertices, Dr(x) Dr(y). • In an r-IC, the set of detectors activated by an attack provides a unique signature that allows us to determine where the attack took place. • We shall look for the smallest d so that there is an r-IC of d vertices 40 Sensor Placement in Networks f a e b d D = {a, b, f} D is a 2-dominating set. Is D a 2-IC? c 41 Sensor Placement in Networks f a e b d c D = {a, b, f} D2(a) = {a, b, f} D2(b) = {a, b, f} So: D is not a 2-IC 42 Sensor Placement in Networks f a e b d c Can you find a 2-IC? 43 Sensor Placement in Networks f a e b d c Can you find a 2-IC? D = {b, d, f} is not a 2-IC. Why? 44 Sensor Placement in Networks f a e b d c Can you find a 2-IC? D = {b, d, f} is not a 2-IC. Why? D2(b) = D2(d) 45 Sensor Placement in Networks f a e d D = {a, b, c, d, e} is a 2-IC. D2(a) = {a, b, c, e} D2(c) = {a, b, c, d, e} D2(e) = {a, c, d, e} b c D2(b) = {a, b, c, d} D2(d) = {b, c, d, e} D2(f) = {a, b, d, e} 46 Sensor Placement in Networks f a e b d c D = {a, b, c, d, e} is a 2-IC. Can you find a smaller one? 47 Sensor Placement in Networks f a e b d c Can you find a smaller one? Answer: No. But the proof is a bit complicated. 48 Sensor Placement in Networks In general, the problem of finding optimal rICs is difficult in a precise sense: It is NP-complete in general and for many special classes of graphs 49 Sensor Placement in Networks: 1-Identifying Codes Let us concentrate first on 1-IC’s. • Many network structures have been studied: – Paths and cycles – Binary cubes and nonbinary cubes and hypercubes and meshes (of interest in CS applications) – Trees – Square lattices – Hexagonal and triangular grids – Complete multipartite graphs 50 – Planar and outerplanar graphs Sensor Placement in Networks: 1-Identifying Codes • We will study paths and cycles. P6 a b c d e f f a e b Path Pk has k vertices Cycle Ck has k vertices C6 c 51 Sensor Placement in Networks: 1-Identifying Codes • We will study paths and cycles. • Why are these important? • Typical application: subway tunnels are paths • We use undirected graphs: Trains go in one direction, but chemicals or biological agents used in an attack go in both directions. • Another application: airport trams go in cycles or paths. 52 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C4? 53 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C4? a b D = {a, b, c} is a 1-IC d c D1(a) = {a, b} D1(b) = {a, b, c} D1(c) = {b, c} D1(d) = {a, c} 54 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C4? a b No 2-element set D is a 1-IC d c If D = {a,c}, then D1(b) = D1(d) 55 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C4? a b No 2-element set D is a 1-IC d c If D = {a,b}, then D1(a) = D1(b) 56 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C6? f a e b d c 57 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C6? f a This is a 1-IC e b d c 58 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C6? f a This is a 1-IC e b d Similarly, for C2k, k > 2, there is a 1-IC of k vertices. c 59 1-Identifying Codes in Cycles • Exercise: What is the smallest 1-IC for C6? f a e b d Let us prove that there can be no 1-IC of less than k vertices. c 60 1-Identifying Codes in Cycles Lemma: Suppose no vertex of G has more than 2 neighbors. Suppose y1,y2,y3,y4 is a path in G and D is a 1-IC for G. Then it is not possible to have y1 not in D and y4 not in D. Proof: If y1 and y4 are not in D, then D1(y2) = D1(y3). This is a contradiction. Q.E.D. a y1 y2 y3 y4 f 61 1-Identifying Codes in Cycles Suppose that D is a 1-IC in C2k, k > 2. We show that D has at least k vertices. Label vertices around the cycle as x1, x2, …, x2k. By the lemma: x1 D or x4 D x2 D or x5 D x3 D or x6 D … x2k-2 D or x1 D x2k-1 D or x2 D x2k D or x3 D There are 2k constraints. Each xi is in only 2 of them. Thus, D has at least k vertices. 62 1-Identifying Codes in Cycles Thus: Theorem: In C2k, k > 2, the smallest 1-IC has k vertices. In C4, the smallest 1-IC has 3 vertices. (First proved by Bertrand, Charon, Hudry, and Lobstein 2004) 63 1-Identifying Codes in Cycles For odd length cycles, we have the following theorem: Theorem: In C2k+1, k > 2, the smallest 1-IC has k+2 vertices. In C5, the smallest 1-IC has 3 vertices. First proved by Daniel (2003) and Gravier, Moncel, and Semri (2007). 64 1-Identifying Codes in Cycles Exercise: For C5, find a 1-IC of 3 vertices. 65 1-Identifying Codes in Cycles Exercise: For C5, find a 1-IC of 3 vertices. 66 1-Identifying Codes in Cycles For C2k+1, k > 2, the following gives an optimal 1-IC: {x1, x2, x3, x5, x7, x9, …., x2k+1} 67 1-Identifying Codes in Cycles A key idea in the proof that the minimum 1IC is at least this big is the following lemma. Lemma: If n > 4, then D is a 1-IC for a cycle Cn if and only if: (1) There are no four consecutive vertices with the first and last not in D (2) There are no three consecutive vertices none of which is in D. 68 1-Identifying Codes in Cycles Lemma: If n > 4, then D is a 1-IC for a cycle Cn if and only if: (1) There are no four consecutive vertices with the first and last not in D (2) There are no three consecutive vertices none of which is in D. Partial Proof: If condition (2) holds, then D1(x) for every x. If (2) fails, then D1(x) = for some x. 69 1-Identifying Codes in Paths Turning next to paths: What is the smallest 1-IC for P4? 70 1-Identifying Codes in Paths Turning next to paths: What is the smallest 1-IC for P4? a b c d This 1-IC has 3 vertices. By considering cases, it is easy to show that no 1-IC can have 2 vertices. 71 1-Identifying Codes in Paths A more formal proof uses the following lemma. Lemma: Let Pn be the path of n vertices, labeled in order x1, x2, …, xn. If D is a 1IC for Pn, then x3 is in D and xn-2 is in D. Proof: Do you see why? 72 1-Identifying Codes in Paths A more formal proof uses the following lemma. Lemma: Let Pn be the path of n vertices, labeled in order x1, x2, …, xn. If D is a 1IC for Pn, then x3 is in D and xn-2 is in D. Proof: If x3 is not in D, then D1(x1) = D1(x2). Similarly for xn-2. Q.E.D. … x1 x2 x3 x4 xn-2 xn-1 xn73 1-Identifying Codes in Paths What is the smallest 1-IC in P4? Solution using the lemma: Lemma: Let Pn be the path of n vertices, labeled in order x1, x2, …, xn. If D is a 1IC for Pn, then x3 is in D and xn-2 is in D. By the lemma, c and b are in D. a b c d 74 1-Identifying Codes in Paths Now use another lemma we already saw: Lemma: Suppose no vertex of G has more than 2 neighbors. Suppose y1,y2,y3,y4 is a path in G and D has is a 1-IC for G. Then it is not possible to have y1 not in D and y4 not in D. Thus, a or d is in D. By symmetry, say d. a b c d 75 1-Identifying Codes in Paths Lemma: Suppose no vertex of G has more than 2 neighbors. Suppose y1,y2,y3,y4 is a path in G and D has is a 1-IC for G. Then it is not possible to have y1 not in D and y4 not in D. Thus, a or d is in D. By symmetry, say d. Thus, D has at least 3 vertices. These 3 suffice. a b c d 76 1-Identifying Codes in Paths This result generalizes: Theorem: For P2k, k > 1, a smallest 1-IC is obtained by using x2, x3, x4, x6, x8, x10, …, x2k Thus, it has k+1 vertices. 77 1-Identifying Codes in Paths Exercise: For P2k+1, find a 1-IC. 78 1-Identifying Codes in Paths Exercise: For P2k+1, find a 1-IC. Solution: Use x1, x3, …, x2k+1 This turns out to be optimal. So, k+1 is the size of the smallest 1-IC, as it is for P2k. 79 2-Identifying Codes in Cycles So far, 1-ICs. Try 2-ICs. Note that C4 cannot have a 2-IC. Why?? 80 2-Identifying Codes in Cycles So far, 1-ICs. Try 2-ICs. Note that C4 cannot have a 2-IC. Why?? Note that N2(a) = N2(c), so D2(a) = D2(c). a b d c 81 2-Identifying Codes in Cycles C6 is an interesting case. We will see that the smallest 2-IC has 5 vertices. Assume that it has a 2-IC of at most 4 vertices. 82 2-Identifying Codes in Cycles C6 is an interesting case. Lemma: Suppose no vertex in G has more than 2 neighbors. Suppose y1, y2, …, y6 is a path in G and D is a 2-IC for G. Then it is not possible to have y1 not in D and y6 not in D. Proof: If y1 is not in D and y6 is not in D, then D2(y3) = D2(y4). Q.E.D. a y1 y2 y3 y4 y5 y6 83 h 2-Identifying Codes in Cycles f e • • • • a b c d Suppose D is a 2-IC of at most 4 vertices. Without loss of generality a is not in D. By the Lemma, f is in D. Also by the lemma, b is in D. 84 2-Identifying Codes in Cycles f a e b d • • c If d is not in D, then D2(a) = D2(d). So, d is in D. 85 2-Identifying Codes in Cycles f a e b d • • c Since D has at most 4 vertices, either c or e is not in D. By symmetry, assume c is not in D. 86 2-Identifying Codes in Cycles f a e b d • c It follows that D2(d) = D2(f). 87 2-Identifying Codes in Cycles f a e b d • • c Hence the smallest 2-IC in C6 has at least 5 vertices. Can you find one with 5 vertices? 88 2-Identifying Codes in Cycles f a e b d • c Here is a 2-IC of 5 vertices. 89 2-Identifying Codes in Cycles However, for C2k, k > 3, things are much easier. The optimal 2-IC is obtained using alternate vertices. Thus, the optimal 2-IC has k vertices. 90 2-Identifying Codes in Cycles For C2k+1, we find that the result is more complicated. Let k = 5p+q, where 0 q 4. Then: the smallest 2-IC in C2k+1 is given by: k+2 if q = 0, p > 0 k+1 if q = 1, p > 0 k+3 if q = 2, p > 0 k+1 if q = 3, p 0 k+2 if q = 4, p > 0. 91 2-Identifying Codes in Cycles Let k = 5p+q, where 0 q 4. Then: the smallest 2-IC in C2k+1 is given by: k+2 if q = 0, p > 0 k+1 if q = 1, p > 0 k+3 if q = 2, p > 0 k+1 if q = 3, p 0 k+2 if q = 4, p > 0. This covers all cases of C2k+1 except C9. 9 = 2(4) + 1, so k = 4. k = 5(0) + 4, so p = 0, q = 4. For C9 the smallest 2-IC has 5 elements. 92 2-Identifying Codes in Paths Consider the path Pn with n vertices x1, x2, …, xn in order. Lemma: Suppose D is a 2-IC for Pn. Then x4, x5, xn-3, xn-4 are in D. Proof: Do you see why?? 93 2-Identifying Codes in Paths Consider the path Pn with n vertices x1, x2, …, xn in order. Lemma: Suppose D is a 2-IC for Pn. Then x4, x5, xn-3, xn-4 are in D. Proof: If x4 is not in D, then D2(x1) = D2(x2). Similarly for xn-3. If x5 is not in D, then D2(x2) = D2(x3). Similarly for xn-4. Q.E.D. … x1 x2 x3 x4 x5 xn-2 xn-1 xn 94 2-Identifying Codes in Paths Let us apply what we know to calculate the smallest 2-IC for P6. First, we have Lemma: Suppose no vertex in G has more than 2 neighbors. Suppose y1, y2, …, y6 is a path in G and D is a 2-IC for G. Then it is not possible to have y1 not in D and y6 not in D. 95 2-Identifying Codes in Paths For P6. First, we have Lemma: Suppose no vertex in G has more than 2 neighbors. Suppose y1, y2, …, y6 is a path in G and D is a 2-IC for G. Then it is not possible to have y1 not in D and y6 not in D. Thus, a or f is in D, without loss of generality a. a b c d e f 96 2-Identifying Codes in Paths For P6. Now, use: Lemma: Suppose D is a 2-IC for Pn. Then x4, x5, xn-3, xn-4 are in D. x4 = d, x5 = e, xn-3 = c, xn-4 = b. a b c d e f 97 2-Identifying Codes in Paths a b c d e f If this is D, then D2(c) = D2(d). So, D has at least one more element, either a or f. By symmetry, we may assume a is in D. (So, we don’t really need the earlier argument that a or f is in D. Sometimes good to do arguments in two ways.) a b c d e f 98 2-Identifying Codes in Paths This is a 2-IC. Easy to check. It follows that this is the smallest 2-IC and it has 5 elements. a b c d e f 99 2-Identifying Codes in Paths Generalization of this result: Suppose n = 5p+q, 0 q 4. If q = 1 and p is odd, then the smallest 2-IC for Pn has 5(p-1)/2 + 5 vertices. If n = 6, then p = 1, q = 1, and we get 5(p-1)/2 + 5 = 5. 100 2-Identifying Codes in Paths The previous result gives the size of the smallest 2-IC for Pn for one case of values for p and q if n = 5p + q. Similar results hold for other values of p and q. 101 Identifying Codes in Other Graphs Let’s find a smallest 2-IC in the 3x3 grid: 102 Identifying Codes in Other Graphs Let’s find a smallest 2-IC in the 3x3 grid. Suppose D has 3 elements. The number of subsets of a 3-element set is 23. There are 23-1 = 7 nonempty subsets. 103 Identifying Codes in Other Graphs Let’s find a smallest 2-IC in the 3x3 grid. Suppose D has 3 elements. The number of subsets of a 3-element set is 23. There are 23-1 = 7 nonempty subsets. Set = {1,2,3} Nonempty subsets: {1,2,3}, {1,2}, {1,3}, {2,3}, {1}, {2}, {3}. 104 Identifying Codes in Other Graphs Let’s find a smallest 2-IC in the 3x3 grid. Suppose D has 3 elements. There are 23-1 = 7 nonempty subsets. Since D2(x) D2(y) for all x y, each vertex of the grid gets a different nonempty subset of D. But there are 9 vertices and only 7 subsets. 105 So, D has to have at least 4 vertices. Identifying Codes in Other Graphs Let’s find a smallest 2-IC in the 3x3 grid. So, D has to have at least 4 vertices. A 4-vertex 2-IC is shown. 106 Some Paradoxes Our intuition about sensor location is not very good. Even for paths and cycles, some rather strange things can happen. 107 Some Paradoxes Paradox 1: For k > 2, the smallest 1-IC for C2k+1 is larger than the smallest 1-IC for C2k+2. For instance, for C7, the smallest 1-IC has 5 vertices, while for C8, it has 4 vertices. Thus, we take the same “topology” of a network, make it longer, but require fewer detectors! 108 Some Paradoxes Paradox 2: For n = 6, 11, 10p+5, 10p+9, 10p+11, p 1, the smallest 2-IC for Cn is larger than the smallest 2-IC for Cn+1. For instance, for C11, the smallest 2-IC has 7 vertices, while for C12, it has 6 vertices. Thus, we take the same “topology” of a network, make it longer, but require fewer detectors! 109 Some Paradoxes Paradox 3: For p > 0, the smallest 2-IC for C10p+5 is larger than the smallest 1-IC for C10p+5. For instance, for C15, the smallest 2-IC has 10 vertices, while the smallest 1-IC has 9 vertices. Thus, using detectors of greater range can actually require more detectors! 110 Some Paradoxes Paradox 4: For n = 5, 6, 7, 10p+3, 10p+5, 10p+6, 10p+7, p > 0, the smallest 2-IC for Pn is larger than the smallest 1-IC for Pn. For instance, for P5, the smallest 2-IC has 4 vertices while the smallest 1-IC has 3 vertices. As with last example, using stronger detectors may require more detectors. 111 Mathematics and Homeland Security Our intuition about sensor location is not very good. Even for paths and cycles, some rather strange things can happen. This shows why you really need precise mathematical analysis. 112