# 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
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Case Study** & **Network Area** & **Number of Grids** & **Total Number of Nodes** \\ \hline
1 & \(100\text{ m}\times 100\text{ m}\) & \(2\times 4\) & 100 \\
2 & \(100\text{ m}\times 100\text{ m}\) & \(4\times 4\) & 100 \\
3 & \(200\text{ m}\times 200\text{ m}\) & \(4\times 4\) & 200 \\
4 & \(500\text{ m}\times 500\text{ m}\) & \(10\times 10\) & 650 \\
5 & \(500\text{ m}\times 500\text{ m}\) & \(10\times 10\) & 1250 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Different simulation network configurations [47]. Figure 5: _Cont._

### Case Study 1-2: 2 \(\times\) 4, 100 Nodes, BS at Top Edge

This scenario demonstrated in Figure 6 considers placement of BS at top edge. Here, the alive nodes show that with 100 nodes, the network remains alive up to 111 (AHE), 480 (without compression), 733 (H-RLEAHE) and 968 (RLE) rounds, respectively. Compared to RLE, the network lifetime reduces by 88.53%, 50.41% and 24.27%, respectively for AHE, WC and H-RLEAHE. In addition, the throughput reduces for AHE by 88.25%, without compression by 51.28% and for H-RLEAHE it reduces by 25.64% compared to RLE. Figure 5: (**a**) Network Structure, (**b**) Alive Node in Case Study 1-1, (**c**) Energy in Case Study 1-1, (**d**) PDR in Case Study 1-1, (**e**) Throughput in Case Study 1-1, (**f**) Packets sent to BS in Case Study 1-1. Figure 6: Results of Case Study 1-2: 2 \(\times\) 4, 100 Nodes, BS at top edge. (**a**) Alive Nodes in Case Study 1-2, (**b**) Energy in Case Study 1-2. (**c**) PDR in Case Study 1-2, (**d**) Throughput in Case Study 1-2, (**e**) Packets sent to BS in Case Study 1-2. ### Case Study 1-3: 2 \(\times\) 4, 100 Nodes, BS at Left Edge

The scenario demonstrated in Figure 7 considers placement of BS at left edge. Here, the alive nodes for AHE, without compression and H-RLEAHE techniques reduces by 88.56%, 49.84% and 24.51% rounds, respectively, compared to RLE. In addition, the throughput for AHE, without compression and H-RLEAHE technique is reduced by 88.36%, 50.67% and 25.10%, respectively, compared to RLE. Figure 7: Results of Case Study 1-3: 2 \(\times\) 4, 100 Nodes, BS at left edge. (**a**) Alive Nodes in Case Study 1-3, (**b**) Energy in Case Study 1-3, (**c**) PDR in Case Study 1-3, (**d**) Throughput in Case Study 1-3, (**e**) Packets sent to BS in Case Study 1-3. ### Case Study 1-4: 2 \(\times\) 4 Grids, 100 Nodes, BS at Corner

The scenario demonstrated in Figure 8 places BS at a corner. Here, the network lifetime for AHE, without compression and H-RLEAHE techniques reduces by 88.02%, 48.63% and 21.81%, respectively, compared to RLE. In addition, the throughput for AHE, without compression and H-RLEAHE technique is 88.01%, 50.82% and 24.89%, respectively, compared to RLE. ### Case Study 2: 4 \(\times\) 4 Grids, 100 Nodes, BS at Corner

Figure 9 shows the results of Case Study 2: 4 \(\times\) 4 grids, 100 nodes, where the network structure is divided into 16 grids with the different cluster heads deployed at random locations and connected to the BS at the center. The results of alive nodes in Figure 9a shows that with 100 nodes, the network remains alive up to 111 (AHE), 475 (without compression), 719 (H-RLEAHE) and 964 (RLE) rounds, respectively. Compared to RLE,

Figure 8: Results of Case Study 1-4: 2 \(\times\) 4, 100 Nodes, BS at corner. (**a**) Alive Nodes in Case Study 1-4, (**b**) Energy in Case Study 1-4, (**c**) PDR in Case Study 1-4, (**d**) Throughput in Case Study 1-4, (**e**) Packets sent to BS in Case Study 1-4.

the network lifetime reduces by 88.48%, 50.62% and 25.41%, respectively, for AHE, WC and H-RLEAHE. Further, RLE demonstrates an overall increase in the average energy of the network as shown in Figure 9b. The results in Figure 9c illustrates that packet delivery ratio is higher in RLE as compared to other techniques. Similarly, the total throughput in the network is improved in the RLE as can be visualized in Figure 9d.