## 4 Data Aggregation
### Spatiotemporal  
Adaptive Data Aggregation (ADA) for clustered WSNs is proposed by [118]. The paper addresses the existing constraints in sensor nodes regarding sensing range, computing and wireless communication capabilities by shifting the main portion of data aggregation to sink node, with a little function at CHs and common nodes. The main objective of the algorithm is to achieve the desired reliability of the aggregated data at the sink node, while limits the imposed cost on the CHs and sensor nodes. In this respect, the paper points out the overlaps of the sensing ranges of sensor nodes in dense networks and addresses this issue at sensor nodes' scale by controlling the reporting frequency (_f_). At CHs level, ADA introduces aggregation ratio (_d_) for spatial redundancy of the sensing data of the same or analogical events received at CHs. Therefore, the paper controls the report frequency and aggregation ratio to improve the observed reliability to the desired level of reliability in the duration of a decision interval (t). To quantify the level of reliability, ADA defines the total number of received data (_N_) by the sink node as \(N\) = _n_rf/_d_, where n is the number of source nodes. For different applications, according to the desired level of reliability, the sink node sets the f\({}_{0}\) and d\({}_{0}\), and the desired and observed reliabilities converge, using a heuristic method. [PERSON] and [PERSON] in [119,120] provide an algorithm to compute aggregates using CH values. The Cluster AGgregation (CAG) algorithm forms clusters of nodes that sense similar values using the spatial correlation in [119] and the combination of spatial and temporal correlation in [120]. According to the cluster formation stage in CAG, each node decides to join a cluster, based on the level of the correlation of its sensed data, called My local sensor Reading (MR), to the CH sensor Reading (CR) measurement. In other words, considering the user-provided error threshold \(\tau\), a node joins a cluster if (\(|\text{MR}\,-\,\text{CR}|\leq\text{Range}\times\tau\)) is satisfied, where _Range_ defined as the difference of the _Max_ and _Min_ value of the entire dataset that is defined by the user or ADC sensor provides. CAG algorithm operation consists of two phases: query and response. During the query phase, the algorithm forms clusters and data forwarding tree, using the same algorithm in Tiny AGgregation (TAG) [121]. Throughout the response phase, CAG transmits a single set of value per cluster. An injected user query with a specified threshold \(\tau\) followed by the broadcast of the query packet initiates the query phase. The broadcasted query packet contains _user query_, _ParentID_, _NodelId_, _Level_ (depth of the current node in the forwarding tree) and _CR_. Then in the response phase, the aggregated value is forwarded back along the reverse direction of the query propagation. In situations of two CHs in the path of data forwarding unable to communicate with each other, the algorithm exploits bridge nodes, which do not participate in the aggregation process, and only forward received packets. Based on the level of data correlation, CAG algorithm is designed for two modes of operation: Interactive mode (spatial correlation) and streaming mode (spatiotemporal correlation). Having two customization modes improve the applicability of the algorithm for variant environments and applications according to the user expectations. * Interactive mode is well suited for environments with dynamic changes in sensor readings. In this mode, for each user-shot query, the network responds with one set of responses. Thus for scenarios with frequent changes in network's topology or the sensor readings, the spatial correlation of data varies dynamically, and hence new query packets should be initiated each time by the user to repair clusters and the forwarding tree to retain the accuracy of aggregated data within the user-provided threshold.