# 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
Finally, packets sent to the BS is also increased for a greater number of rounds in RLE as compared to AHE, no compression and H-RLEAHE, respectively, as shown in Figure 9e. Comparing Case study 1: 2 \(\times\) 4 grids, 100 nodes to this, it is clear that while the total number of nodes in both cases is the same, there is a significant distinction in the grid layout. The network performs better in terms of the examined parameters when it is constructed with a 4 \(\times\) 4 grid. For example, data compression extends network life by

Figure 9: Results of Case Study 2: 4 \(\times\) 4, 100 Nodes, BS at Center. (**a**) Alive Nodes for Case Study 2, (**b**) Energy for Case Study 2, (**c**) PDR for Case Study 2, (**d**) Throughput for Case Study 2, (**e**) Packets send to BS for Case Study 2. 980 rounds as compared to no data compression. Additionally, the network's topology has shown some improvement in other metrics. ### Case Study 3-1: 4 \(\times\) 4, 200 Nodes, BS at Center

Results from Case Study 3-1: 4 \(\times\) 4 grids, 200 nodes with the BS at the center of the network are shown in Figure 10. For RLE compression technique the network is alive for 968 rounds compared to 118 rounds, 478 rounds and 722 rounds for AHE, no compression and H-RLEAHE, respectively. This shows alive nodes in Figure 10a for AHE, without compression (WC) and H-RLEAHE reduces by 87.80%, 50.61% and 25.41%, respectively, compared to RLE. Further, the average energy in the network is improved as the compression technique reduces the data leading to lesser transmission of data and thereby more energy in the network Figure 10b. Figure 10c,d also demonstrate similar trends with respect to PDR and throughput. Figure 10e further demonstrates the efficacy of RLE in terms of average packets sent to the BS compared to AHE, no compression and H-RLEAHE techniques, respectively. Figure 10: Results of Case Study 3-1: 4 \(\times\) 4, 200 Nodes, BS at Centre. (**a**) Alive Nodes for Case Study 3-1, (**b**) Energy for Case Study 3-1, (**c**) PDR for Case Study 3-1, (**d**) Throughput for Case Study 3-1, (**e**) Packets sent to BS for Case Study 3-1. To draw the comparison of performance metrics with respect to the case study 2, where the number of grids is same, i.e., 16 but the number of nodes is higher, i.e., 200 nodes, the network remains alive for 968 rounds. Moreover, from Figure 8c-e, minimal improvement in other parameters is witnessed. ### Case Study 3-2: 4 \(\times\) 4, 200 Nodes, BS at Top Edge

The scenario demonstrated in Figure 11 places BS at top edge. Here, the network stays alive for 111 (AHE), 474 (without compression), 722 (H-RLEAHE), and 971 (RLE) rounds. The network lifetime reduces by 88.56%, 51.18% and 25.64% for AHE, WC and H-RLEAHE, respectively, compared to RLE. In addition, the throughput for AHE, without compression and H-RLEAHE technique reduces by 87.95%, 51.69% and 25.95%, respectively, compared to RLE. Figure 11: Results of Case Study 3-2: 4 \(\times\) 4, 200 Nodes, BS at top edge. (**a**) Alive Nodes for Case Study 3-2, (**b**) Energy for Case Study 3-2, (**c**) PDR for Case Study 3-2, (**d**) Throughput for Case Study 3-2, (**e**) Packets sent to BS for Case Study 3-2. ### Case Study 3-3: 4 \(\times\) 4, 200 Nodes, BS at Left Edge

The scenario demonstrated in Figure 12 places BS at the left edge. Here, the network lifetime for AHE, without compression and H-RLEAHE techniques reduces by 87.89%, 50.05% and 25.12%, respectively, when compared to RLE. In addition, the throughput for AHE, without compression and H-RLEAHE model is reduced by 88.33%, 51.97% and 25.10%, respectively, compared to RLE. ### Case Study 3-4: 4 \(\times\) 4, 200 Nodes, BS at Corner

The scenario demonstrated in Figure 13 places BS at a corner. Here, the network lifetime for AHE, without compression and H-RLEAHE techniques reduces by 87.80%, 51.01% and 25.80%, respectively, compared to RLE. In addition, the throughput for AHE,

Figure 5:0 Results of Case Study 3-3: 4 \(\times\) 4, 200 Nodes, BS at left edge.