# Improved Dragonfly Optimization Algorithm for Detecting IoT Outlier Sensors
## 4 Optimize Coverage with an Improved Dragonfly Optimization Algorithm  
In this section, the method of using the suggested improved dragonfly optimization algorithm for solving the coverage problem in wireless sensor networks is performed. Each object is assumed to be equal to one sensor node in dragonfly relations, such that all of the sensor nodes and the sinks have a fixed location after being arranged. Nodes were homogeneous and with the same communication capacities of the range for sensing and capacities for data processing. The location of each sensor node is already recognized, and the well knows the location of all of the nodes. The radio range of the sensors is assumed to be \(r_{s}\). The proposed algorithm assumes the problem of point coverage in a certain environment. As a result, outlier sensors (sensors that are not in the coverage area) will be removed. The point of interest (POI) is the place where the event takes place. It is assumed that the event signal can always be generated in all POIs. Figure 1 shows sending events at star points by neighboring nodes to the sink. Figure 1: Events sending at star points with neighboring nodes to the sink. As can be observed from Figure 1, each POI is enclosed by some sensor nodes. If the POI is in the interior of the range of the radio radius, \(r_{s}\), of a certain sensor, the sensor node detects the event signal and sends the restrained data to the well in multistep. The target environment, is a two-dimensional surface, \(L_{x}\times L_{y}\) square meters. Some sensor nodes in \(R\) have been described by \(C=[c_{1},c_{2},\ldots,c_{M}]\), where \(i\in[1,M]\), \(c_{i}=[x_{i},\ y_{i},\ r_{s}]\) and \(M\) define the sensor nodes' quantity. The coordinates and radio beam of a sensor node are defined by \([x_{i},\ y_{i}]\) and \(r_{s}\), respectively. Some POIs distributed in region \(R\) are determined by \(P=[p_{1},p_{2},\ldots,p_{n}]\), where \(p_{k}\) has been placed at \(k\in[1,N]\) in \([x_{k},\ y_{k}]\), and \(M\) is the number of POIs. The binary variable \(LO_{i,j}\) in the following equation specifies whether \(c_{i}\) is able to cover \(P_{k}\) or not:  
\[LO_{i,j}= \begin{cases}1,&if\quad\left(x_{i}-x_{j}\right)^{2}+\left(y_{i}-y_{ j}\right)^{2}<r_{s}^{2}\\ &0,\ \ \ Otherwise\end{cases}  \tag{16}\]  
If the distance between \(p_{k}\) and \(c_{i}\) provides small value then the \(r_{s}\), then \(p_{k}\) will be covered by \(c_{i}\). Therefore, the event signal made in the POI can be identified. Although \(p_{k}\) can be simultaneously covered by \(v\) sensor nodes, if a specific \(p_{k}\) has been sheltered by more than one sensor node, then the union of \(LO_{1,j},\ LO_{2,j},\ \ldots,\ LO_{v,j}\) for \(p_{j}\) is calculated by the Boolean (binary) operator:  
\[LO_{1,j}\lor\ LO_{2,j}\vee\ldots,\ LO_{v,j}=1-\overline{LO}_{1,j}\wedge\ \overline{LO}_{2,j}\wedge\ldots,\ \overline{LO}_{v,j} \tag{17}\]  
where, \(\overline{LO}_{i,j}\) is the Boolean inverse of \(LO_{i,j}\). The operators \(\vee\) and \(\wedge\) represent the symbol of the Boolean union and intersection. The energy consumption model is shown in Figure 2. Therefore, most of the energy used in radio transmission is in the general operation of the sensor and access to the memory, so other energy-consuming matters are overlooked. In the above Figure, \(E_{el}\) represents the energy lost in the transmission circuit or the receiving circuit per bit (in nanojoules). \(E_{Amp}\) indicates the energy consumed by the power amplifier per bit and \(\beta\) is the power of the path. The value of \(\beta\) is usually taken as 2. As a result, when an H-bit packet is sent to the receiver, the total energy consumed is calculated as follows:  
\[E_{Tx}(d,H)=E_{el}\times H+E_{Amp}\times H\times d^{\beta} \tag{18}\]  
\[E_{Rx}(d,H)=E_{el}\times H \tag{19}\]  
where \(E_{Tx}\) and \(E_{Rx}\) represent, in turn, the overall energy used to send and receive an H-bit packet. Figure 2: Model of energy consumption. Since all of the sensor nodes are supposed to be homogeneous, their initial energy is the same.