## 7 Quadratic Adaptive Replication (QAR)
### Performance Evaluation  
This section first compares the network cost in terms of hops when the most relevant multi-replication solutions, ToW and multi-replication GHT, are compared with QAR. To be fair we need to compare ToW write-one-query-all mode and QAR production-dominates-consumption mode to the multi-replication GHT functionality. We remember that in GHT with multiple replicas producers push the event data to the closest replica, then consumer queries need to reach all the replicas in order to retrieve the information. In addition, it must be highlighted that GHT with multiple replicas uses the hierarchical routing described in Section 5.1., whereas ToW and GHT use the combing routing introduced in Section 5.3..  
We simulate a sensornet with an area \(A\) = 1,000 \(\times\) 1,000 square units, \(N\) = 5,000 sensors deployed at random and a transmission range \(Tx\) = 60 distance units. In order to simulate the traffic load among the 5,000 sensors, we randomly select 20 consumers and 2,000 producers. Consumers and producers generate traffic in a regular basis, that is, each consumer produces 1 query per unit time and each producer generates 1 data event per unit time. So that, we measure the traffic load in total number of hops in the sensornet per unit time using different number of replicas for each solution (_i.e._, 1, 4, 16, 64 and 256 for ToW and GHT with multiple replicas, and 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225 and 256 for QAR that, as it has already been described, has more granularity). The results shown in Figure 8 are the average traffic values (in number of hops per unit time) over 50 different scenarios for each number of replicas being evaluated. The first conclusion is that GHT with multiple replicas is the worst solution. The hierarchical routing when using several replicas incurs in a higher cost than the combing routing, that is why in all the cases GHT with multiple replicas has the highest traffic cost. On the other hand, the figure shows a first approach to the granularity of QAR compared to the other solutions. QAR can choose up to 9 different number of replicas between 64 and 256, whereas ToW and GHT with multiple replicas only 2. Finally, it can be seen that in case of choosing the best number of replicas that minimizes the overall traffic (16 for ToW and 25 for QAR), QAR is the best solution. After, demonstrating that QAR and ToW outperforms GHT with multiple replicas. We will analyze and compare the performance for different \(\lambda_{c}/\lambda_{p}\) and \(\lambda_{p}/\lambda_{c}\) ratios using the optimal number of replicas,\(N_{r}^{*}\), provided by ToW and QAR analytical models. We compare the traffic load in number of hops for GHT with a single replica, ToW (with \(k=1\)) and QAR in the same scenario. We cannot include GHT with multiple replicas in this evaluation because the authors do not propose any model or heuristic mechanism to calculate the optimal number of replicas to be used. **Consumption Dominates Production (\(\lambda_{c}>\lambda_{p}\))**  
We evaluate a scenario with an area \(A\) = 1,000 x 1,000 square units, where \(N\) = 5,000 sensors have been deployed at random, and a transmission range \(Tx\) = 60 distance units. The ratio \(\lambda_{c}/\lambda_{p}\) is varied from 1 to 200. For each particular value we provide the average result obtained from 100 simulated scenarios. Finally, we consider the value of \(\alpha\) to be twice of \(\beta\), since each query needs a reply message, while production events just generate a single message. Under these conditions, we measure the extra overall network traffic (in number of hops) generated by ToW in front of QAR. Figure 9 clearly shows that QAR is more adaptive than ToW because the number or replicas increases in smaller steps than ToW. Moreover, QAR is the one that minimizes the communication cost. ToW needs in average 7.56% more extra hops in the communications.