# Design and Analysis of an Efficient Energy Algorithm in Wireless Social Sensor Networks
## 6 Checkpointing and Recovery Algorithms
### Algorithm for Failure Recovery
What is more, the time for checkpoints coordination of HCP is sure to be less than the SCP, because the checkpoints coordination of HCP is limited in one cluster. Figure 10: Impact of R on ACT. Figure 9: Test for a suitable value of K.

#### 8.2.3 Experiment 3 Test of \(Art\)

Because there are major cascade rollbacks in ACP, so the \(ART\) of ACP is greatly large than the one of HCP and SCP. In order to clearly describe the difference between HCP and SCP, this experiment just compares the effect on \(ART\) of HCP and ACP for varying \(M\) and \(F\). The results are displayed in Figures 11 and 12. As Figure 11 shows, the \(ART\) of SCP is lower than the one of HCP when \(M\) is 2. This is because the extent of change of the rollback caused by the cascade rollback of HCP is larger than the one brought by the rollback request of SCP, but the \(ART\) of these two protocols all increase as \(M\) augments and the time of HCP is lower than SCP when \(M\) is 3 and \(M\) is 4. The reason for the augment of two algorithms is that there are rollback requests sent to different clusters. Thus, the rollback extent increases when processes in different clusters receive the rollback requests as \(M\) augments. By contrast, the rollback requests sent to different clusters of SCP are greatly larger than the ones of HCP because the rollback of SCP is global. Hence, the rollback extent change of SCP caused by \(M\) is greater than the rollback extent change of HCP brought by the cascade rollback when \(M\) is larger. It can be seen from Figure 12, the recovery time of HCP and SCP all increase when \(F\) augments but the recovery time of HCP is less than the one of SCP. This is because the communications between the checkpoint and failure point decrease and then the related rollback processes reduce. Hence, the rollback extents of processes that do not fail have larger rollback extents when they roll back next time. This situation causes the increment of recovery time. Because the rollback notifications sent to different clusters of HCP is lesser, so the \(ART\) of HCP is less than the one of SCP. Figure 11: Impact of M on ART. Figure 12: Impact of F on ART. #### 8.2.4 Experiment 4 Test of \(Ass\)

In order to test the \(ASS\), this experiment compares the occupation of storage space of different protocols by testing the change of \(SCN\). Figure 13 shows the results of tests. It can be seen, the \(ASS\) of SCP does not change basically. This is because each process in SCP just needs to store one checkpoint and a handful of message logs. However, each process in HCP and ACP has to store multiple checkpoints and many message logs, and so the occupation of storage space increases as the successive checkpoints number augments. But the \(ASS\) of HCP is less than the \(ASS\) of ACP greatly because the \(DC_{s}\) of HCP will be cleared away in advance. #### 8.2.5 Experiment 5 Test of \(Aam\)

In order to test the \(AAM\), this experiment compares the effect of change created by \(F\) and \(R\) respectively. The performance results of this experiment are described in Figures 14 and 15. It can be seen from Figure 14 that the additional messages increase along with the increment of \(F\). This is because the larger the \(F\) is, the more additional messages related to rollbacks exist, but only the \(AAM\) of SCP shows a downtrend as \(R\) augments. The reason is that the processes which participate in the coordination decrease with the reduction of number of \(DM_{s}\) when \(R\) increases, but for the HCP and ACP, the increment of \(R\) causes the dependence relations among checkpoints of processes to become tighter and so the additional messages created by the rollbacks of failure processes augment. In general, the \(AAM\) of SCP is greatly larger than the one of HCP and ACP. This is because the SCP has the global rollback despite the global coordination, but for the HCP, though there are additional messages caused by coordination and rollback together, the coordination and rollback are limited in the same cluster.