# Fuzzy-Logic Based Distributed Energy-Efficient Clustering Algorithm for Wireless Sensor Networks
## 5 Simulation and Analysis  
We evaluated the performance of the proposed EEDCF algorithm by MATLAB simulation and compared with the EADEEG algorithm and DFLC algorithm in aspects of network lifetime, data transmission efficiency and system energy consumption respectively. To evaluate our scheme, two different scenarios were developed for the simulations. The area size of the two scenarios remains the same while the number of nodes in the network is chosen to be different. According to the network model and energy model in Section 3, we define the simulation parameters in the two scenarios in Table 3[20; 32]. As the nodes are randomly generated in the simulation, some coincidence factors might have some influence on the experiment results. Thus, we selected the average result of 50 experiments as the support to our conclusion in this paper. The node deployment situations in the two scenarios are shown in Figures 5 and 6. The region size of the two scenarios is the same while the node density in Scenario 2 is higher than that in Scenario 1. In other words, compared to Scenario 1, the number of nodes in each cluster in Scenario 2 is more intensive, and the communication condition is more complex. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Parameter** & **Scenario 1** & **Scenario 2** \\ \hline Sensor field & 100 m \(\times\) 100 m & 100 m \(\times\) 100 m \\ Number of nodes & 100 & 150 \\ BS location & (50, 50) & (50, 50) \\ Initial energy & 0.5 \(\sim\)1 J & 0.5 \(\sim\)1 J \\ \(E_{elc}\) & \(5\times 10^{-8}\) J & \(5\times 10^{-8}\) J \\ \(\xi_{fs}\) & \(10^{-11}\) J & \(10^{-11}\) J \\ \(\xi_{mp}\) & \(1.3\times 10^{-13}\) J & \(1.3\times 10^{-13}\) J \\ \(E_{DA}\) & \(5\times 10^{-9}\) J & \(5\times 10^{-9}\) J \\ Round & 4000 & 4000 \\ Data packet size & 500 bytes & 500 bytes \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation parameters. Network lifetime is a very important index to compare the performance of clustering routing protocol. There are various definitions to describe network lifetime of WSNs. The time at which half nodes die (HND), or all the nodes die (AND), in the network, can all be regarded as the network lifetime index. As the inflection point of network lifetime, the first node death (FND) destroys the integrity of the entire network, which also plays a significant role in network lifetime analysis. Figure 7 compares the network system lifetime of the three algorithms in Scenario 1. We can see that the FND of EADEEG algorithm is at 1382 nd round, FND of DFLC is at 1429 th round, and FND of EEDCF is at 1505 th round. Because it is at the beginning of the death of nodes, the performance of the network system is not so bad, so the gaps among the three algorithms are not very obvious. As the rounds increase, the number of survival nodes becomes less and less, and the gap between the three algorithms will gradually enlarge. In Scenario 1, EADEEG algorithm runs out system energy (AND) in 2793 rd round because it only considers the nodes residual energies and the distance from the nodes to BS in the phase of CH election. Different from EADEEG, DFLC and EEDCF take advantage of fuzzy logic system to make the measure of node's performance more reasonable. DFLC takes node energy, node density, and distance to the base station as clustering factors which can avoid \"isolate points\" problem effectively, reduce extra energy consumption, and extend the network lifetime of AND to 3407 rounds. While the proposed EEDCF not only takes the nodes' residual energies and degrees into account, but also introduces the neighbor nodes' residual energies as the new input parameter additionally, it assigns the data forwarding tasks evenly to each node as much as possible, thus effectively alleviate the load balance problem in the network. The final network lifetime of AND by the proposed EEDCF is 3783 rounds, which is much better than the other two algorithms. Figure 5: Nodes Deployment in Scenario 1. Figure 6: Nodes Deployment in Scenario 2.