# Investigation of Energy Cost of Data Compression Algorithms in WSN for IoT Applications
## 4 Hybrid Model for Run Length Encoding with Adaptive Huffman Encoding
### Hybrid Algorithm
## 7 Comparative Analysis with Respect to Alive Nodes

A comparative analysis of alive nodes for the various scenarios is illustrated in Figure 5:5

From the graphical representation, it is evident that RLE data compression technique outperforms the other models (Without compression, AHE and H-RLEAHE) for all the scenarios. This strengthens the effectiveness and efficiency of RLE data compression model thus advocating its widespread deployment. Figure 5:6 Results of BS at Centre, 2 \(\times\) 4 100 nodes with ECC. (**a**) Alive Nodes for Case Study 6, (**b**) Energy for Case Study 6, (**c**) PDR for Case Study 6, (**d**) Throughput for Case Study 6, (**e**) Packets sent to BS for Case Study 6. ## 8 Conclusions and Future Work

In this paper we have reported the investigative analysis of energy cost of data compression algorithms in WSN for IoT applications. The study includes evaluation of the effectiveness of the established compression techniques, Run Length Encoding (RLE) and Adaptive Huffman Encoding (AHE) for saving energy and thus prolonging lifetime of WSNs. While evaluating energy costs, other metrics such as Packet Delivery Rate (PDR) and throughput have also been considered for the various compression techniques. While RLE and AHE compression techniques have different strengths and advantages, they also have some drawbacks. This has motivated the authors to embark on proposing and evaluating a hybrid model combining RLE and AHE, named H-RLEAHE. After the compressed data is obtained from RLE, adaptive Huffman encoding is applied to further compress it. The application of RLE ensures that the correlation of data is considered which AHE does not. It is evident from analysis that AHE consumes more energy for compression. Simulation was carried out for different scenarios wherein the total number of sensor nodes, number of grids and the position of the base station was varied. Compressing the data before transmitting, using any technique, increases the network lifetime when compared to uncompressed data. This is in spite of the extra energy cost of the compression algorithm itself, establishing the efficacy of compression. Our findings about RLE and AHE conforms with the findings of other researchers who have compared RLE with AHE [50]. RLE requires much smaller memory than AHE. To derive the benefits of each method, in our research we have extended previous research by evaluating the efficacy of combining RLE with AHE. We conclude that for H-RLEAHE the performance metrics are vastly improved over AHE; however, RLE shows the best performance for all the metrics that have been measured. In those scenarios where the sensor data does not have repeatability, AHE performs better that RLE. Hence in applications where data repeatability is less, but the sensor node has sufficient memory, the proposed hybrid model will be most effective. The modern era of IoT has brought new obstacles for WSNs. Critical information is shared between a wide variety of networked devices, each of which may use a different set of resources that are, in general, limited. The need to meet stringent constraints, such as real-time reaction, high compression ratio, and data transmission efficiency, has motivated designers to create hybrid algorithms that make the most of the devices' limited resources [51]. This research aims to offer a hybrid data compression approach by fusing Run-Length Encoding and Adaptive Huffman Coding, two well-known loss-less compression methods. If you are trying to cut down on the quantity of data you have to send across a network for medical purposes, this integrated solution is a great option [52]. Figure 5:7 Comparative analysis of various scenarios. In addition to efficiency of data transmission, the protection and security of these IoT based sensor applications from malicious adversary are also important. The study is completed by incorporating data encryption and evaluating its implications on energy costs and network lifetime.