# Improved Dragonfly Optimization Algorithm for Detecting IoT Outlier Sensors
## 4 Optimize Coverage with an Improved Dragonfly Optimization Algorithm
However, the energy of the sink is high and is not included in this energy consumption model. The set covering problem (SCP) is an NP-hard problem [35]. In this article, this concept is implemented on the node scheduling optimization, which contains the issue of coverage management along with energy efficiency. In fact, the SCP is the problem of finding some nodes with minimal costs, where desired points are enclosed by no less than one node. Therefore, the set covering problem can be defined as follows:  
\[\min\sum_{i}g_{i}\cdot x_{i},\ \ i\in[1,M] \tag{20}\]  
Such that:  
\[ \begin{array}{ll}\sum\limits_{i}LO_{i,j}\cdot x_{i}\geq 1,&k\in[1,N]\\ x_{i}\in(0,\ 1),\ i\in[1,M]\end{array}  \tag{21}\]  
where, \(g_{i}\) is the activation cost of each node and \(x_{i}=1\) means activation and \(x_{i}=0\) means inactive (for outlier sensors). The constraint of the equation above states that every \(p_{k}\) is enclosed by no less than one node. After the network activates, it is necessary to use the optimization model described in the above relation, because this model optimizes energy consumption in the network. In the prosed improved dragonfly optimization algorithm, each dragonfly signifies a solution with a conforming cost value, which results in the cost function. The cost function (objective function) is utilized to find the quality of the solution. After applying the algorithm, a new population with better members is produced. Additionally, the process stops when it reaches the stopping condition. The better coding of individuals can increase the algorithm's efficiency. To optimize the energy-aware coverage, it is necessary to code the scheduling of the nodes. This research employs optimal node scheduling to activate and deactivate wireless sensor nodes at a definite time in such a way as to raise the network's lifetime. For programming, the solutions are displayed as binary strings. For instance, 0 indicates that the sensor node is inactive (eliminated), and 1 indicates that the node is active. The binary illustration of individuals in the improved dragonfly optimization algorithm for energy-aware coverage optimization is shown in Figure 3.  
In this figure, \(\Gamma\) represents the total quantity of members (candidates) and \(\ell_{ij}\) signifies the state of the node \(c_{i}\) in individual \(k\). It should be noted that the length of each individual is equal to \(N\), which means the number of sensor nodes. Since the size of the population causes the production of diverse communities, it is necessary to choose an appropriate size of the population. For the sake of simplification, the population si  
Figure 3: Binary definition of individuals in the improved dragonfly optimization algorithm for energy-aware coverage optimization. running the algorithm; therefore, the size of the population is constant in each iteration of the algorithm. In Figure 4, 16 nodes are used to sense the environment, and there are several additional nodes (15) (red circles). To conserve energy and obtain the optimal coverage ratio, there is an optimal scheduling of nodes in the algorithm, which disables the redundant nodes. From the point of view of encoding particles, string \(11111111100000\) represents the example in Figure 4.  
The fitness function has been utilized to measure the quality of the candidates. The purpose of the algorithm is to obtain the optimal coverage ratio using the least amount of sensor nodes. For nodes, a coverage vector has been suggested that represents the POIs' coverage. As stated by the coverage model defined previously, the coverage vector of a specific node \(c_{i}\) is demarcated by \(\pi=[LO_{i,1},\ LO_{i,2},\ldots,\ LO_{i,M}]\). A binary model is used to know the coverage of a POI by a wireless sensor. Boolean operators are applied to vectors.