# Event Coverage Detection and Event Source Determination in Underwater Wireless Sensor Networks
## 3 Event Detection and Sensory Data Aggregation
```
1:
2:- \(SRYDT\) : a set of sensory data received by \(SN\)
3:
4:- \(g_{eet}=(UV_{eet},\)\(EG_{eet},\)\(WGT_{eet})\) : a weighted graph representing the event coverage
5:for each \(sryDt_{uv1}\in SRYDT\)do
6:for each \(sryDt_{uv2}\in SRYDT\) - \([sryDt_{uv1}]\)do
7:if\(||sryDt_{uv1}.crd_{uv1}\) - \(sryDt_{uv2}.crd_{uv2}||>r\)then
8:endif
9:\(g_{eet}\leftarrow\) make an edge connecting \(sryDt_{uv1}.id_{uv1}\) and \(sryDt_{uv2}.id_{uv2}\)
10:if\(g_{eet}\in g_{eet}.E_{eet}\)then
11:endfor
12:endif
13:\(g_{eet}\leftarrow\)\(g_{eet}.I_{eet}\)\(\leftarrow\)\(g_{eet}.I_{eet}\)\(\cup\)\([sryDt_{uv1}.id_{uv1},sryDt_{uv2}.id_{uv2}]\)
14:\(g_{eet}\leftarrow\)\(g_{eet}.I_{eet}\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)\([g_{eet}.I_{eet}]\)\(\cup\)
15:endfor
16:endfor
17:endfor
```

**Algorithm 4** Event coverage detection. Given two sensor nodes \(sryDt_{uv1}.id_{uv1}\) and \(sryDt_{uv2}.id_{uv2}\), if the Euclidean distance between them is larger than the communication radius of sensor nodes (denoted by the symbol \(r\) in Line 3), no edge can connect these two sensor nodes (Lines 3-5). The symbol \(\|.\|\) means the computation of the Euclidean distance. When an edge \(eg_{eet}\) (Line 6) connecting these two sensor nodes has been studied, another pair of sensor nodes are to be explored afterwards (Lines 7-9). Otherwise, these two sensor nodes are inserted into \(g_{eet}.UV_{eet}\) (Line 10), and \(eg_{eet}\) is inserted into \(g_{eet}.E_{eet}\) (Line 11), accordingly. The weight specified upon \(eg_{eet}\) is computed as the average of sensory data value by these two sensor nodes (Lines 12-13). Consequently, a weighted graph (_i.e._, \(g_{eet}\)) that represents the event coverage has been established. The coverage of potential event(s) corresponds to the merger of the spherical space, which is prescribed by the location of each sensor node (denoted \(sryDt_{uv}.id_{uv}\)) and the communication radius \(r\) of \(sryDt_{uv}.id_{uv}\). It is worth noting that \(g_{eet}\) may comprise several smaller connected components, and each connected component corresponds to the coverage of a single event. This is due to the fact that several events may occur concurrently at different geographical sub-regions in the network in a certain time slot, and geographical gaps may exist between the coverage of these events. An example of event coverage is shown in Figure 1, where two events (denoted as \(E1\) and \(E2\)) are detected, for sensor nodes with marks of (84, 62, 86, 85, 66, 88)and (90, 80, 82, 70), respectively. They correspond to the two connected components in this graph. The coverage of an event (for instance, \(E1\)) is the merger of the spheres in which sensor nodes are contained (for instance, the sensor nodes with marks of 84, 62, 86, 85, 66 and 88 for \(E1\)). After the detection of event coverage, the sources of events need to be determined, which usually correspond to the pivots for responses to be taken. Intuitively, event sources reflect sensor nodes whose sensory data deviate the most in value from the normal sensing range. Without loss of generality, the barycenters [25] are identified in \(g_{evt}\) to represent event sources. A barycenter in a weighted graph refers to a node in this graph, such that the sum of the weights specified upon the edges connecting this node is the largest. Generally, around \(k\%\) sensor nodes in \(g_{evt}.UV_{evt}\) are selected

Figure 1: An example of event coverage and event sources. Specifically, the sensor node with the mark of 86 is the relay node for the sensor nodes with marks of 66, 88 and 85, and the sensor node with the mark of 84 is the relay node for the sensor nodes with marks of 62, 86 and itself. There are two events (_i.e._, \(E1\) and \(E2\)), corresponding to two connected components in this graph, and event sources are the sensor nodes with marks of 84 and 86 for \(E1\) and with the mark 90 for \(E2\), respectively.