# A PSO-Based Uneven Dynamic Clustering Multi-Hop Routing Protocol for Wireless Sensor Networks
## 5 Proposed Algorithm
### Derivation of Fitness Function
#### 5.3.2 Intersection-Over-Universal  
Based on the concept of Intersection-over-Union in target detection [36], we propose an Intersection-over-Universal (_IoU_). _IoU_ is the ratio of the number of candidate CH nodes in the overlapping portion of the circular area to another circular area to the total number in the network. Figure 5 shows the intersection set \(I\) and universal set \(U\). The more nodes in the overlapping portion among the circular areas where candidate CH nodes are located, the more likely that only one shared CH node is selected among these circular areas. It causes the CH node to bear a heavy forwarding load during the transmission phase. Excessive overlap of the circular areas also reduces the coverage of the candidate CH nodes. Therefore, it is wise to minimize _IoU_. That is, we need to maximize its reciprocal.  
\[IoU=\frac{n_{Inter}}{n} \tag{14}\]  
where, \(n_{Inter}\) is the number of nodes in the overlapping portion of the circular areas.  
Figure 4: Different location of the BS in the monitoring area. (**a**) the BS is located on the boundary of the monitoring area, (**b**) the BS is located in the monitor area, (**c**) the BS is located on a vertex of the rectangle network area.  
After iterations, if a circular area's _loU_ is greater than a certain threshold \(T\) (\(0<T<1\), \(T=0.7\) in this paper), the center of this circular area should be deleted from the global best positions. The circular area where the center is located will also be deleted. Hence, the number of CH nodes is less than or equal to \(C\). Figure 6 is the schematic diagram of the distribution of the circular areas. The circular areas cannot cover all the nodes in the network. We select CH nodes based on these circular areas. Since the circular areas are formed according to the number of nodes, the area of the whole network and the distribution of nodes, we can achieve a reasonable distribution of CH nodes. The reasonable distribution can efficiently balance the energy consumption of the whole network.  
Figure 7 shows the circular area distribution of the proposed algorithm in simulation experiments. The network environment is a 200 m \(\times\) 200 m area with 100 nodes. The dotted circle in Figure 7 is the circular area that needs to be deleted because their _loU_ is greater than 0.7. The solid circles are the circular areas obtained after iterations. The number 0.86 at the top of the figure is the final node coverage after iterations. Figure 8 shows the circular areas with _loU_ less than 0.7 in the network after iterations. As can be seen from Figures 7 and 8, the circular areas cover as many nodes as possible. The distribution of the circular areas is based on the distribution of nodes. The selection of CH nodes is based on the distribution of the circular areas, the residual energy of the nodes, the distance from the nodes to the BS, and the number of neighbor nodes covered in the communication range. The distribution of CH nodes directly selected by multi-objective functions [37] may be too dense or too sparse. In addition, the circular areas close to the BS are smaller than the ones farther away from the BS, which is beneficial to balance the energy consumption of the network.  
Figure 5: Intersection set \(I\) and universal set \(U\).  
Figure 6: Schematic diagram of the distribution of circular areas.