# Energy-Efficient Internet of Drones Path-Planning Study Using Meta-Heuristic Algorithms
## 3 Meta-Heuristic Algorithms for Energy-Efficient IoD Path-Planning Description
### Objective Function and Constraints  
The primary source of UAV power is its onboard battery, which supports all activities, including processing, flight, and communication. However, the battery capacity is not adequate for extended flight missions. To cope with this problem, the UAV trajectory is formulated as an optimization problem, where the energy consumption is the objective to be minimized. Thus, the optimal trajectory is the collision-free path that requires minimum energy. To plan the path of the UAV, the sequence of waypoints is chosen to satisfy all constraints and achieve the minimum energy consumption for the case of energy optimization or achieve minimum path length for the case of path length optimization. It has to be stressed that trying all possibilities to select the best sequence of waypoints is considered a nondeterministic polynomial (NP)-hard problem that requires lots of resources and unbounded execution time. That is, this problem is difficult to solve using a deterministic approach in a reasonable time. The problem is formulated as a single objective optimization problem, and the total energy for each path is calculated using Equation (11). \[F_{Energy}=\sum_{i=1}^{N_{w}-1}E_{Si}, \tag{11}\]  
where \(N_{w}\) is the number of path waypoints, and \(E_{Si}\) is the energy of segment \(i\). Another important objective is the path length. In some missions, a longer path is not desirable because of the drone's limited power. Thus, the shortest path is preferable. The path length can be calculated as follows. \[F_{pl}=\sum_{i=1}^{N_{w}-1}\sqrt{(x_{i+1}-x_{i})^{2}+(y_{i+1}-y_{i})^{2}+(z_{ i+1}-z_{i})^{2}}, \tag{12}\]  
where \(N_{w}\) is the number of waypoints, and \((x_{i},y_{i},z_{i})\) is the \(i^{th}\) path waypoint. In this study, we consider both objectives: energy consumption and path length. Since the problem is formulated as a single objective optimization problem, we study each objective individually. Moreover, in a threat-prone environment, the path is constrained to avoid colliding with surrounding obstacles, and with other drones in the formation. To avoid colliding with obstacles, the distance from all waypoints to the center of any obstacle should be greater than the size of the obstacle. If even one waypoint goes through the obstacle, the path is considered not feasible and is penalized with high cost, \(\eta\). Furthermore, the drones in the IoD formation should not fly to the same location at the same time. To accomplish this, a safety distance between drones should be maintained. In light of the above description, the objective function for energy consumption and path length is a minimization optimization problem and can be expressed as in Equation (13). It has to be stressed that the proposed objective function either minimizes the energy consumption or the path length, but not both objectives at the same time. \[F_{-}Obj=\left\{ \begin{aligned} F_{Energy}+\lambda(F_{Oc}+F_{Mc}), &\text{for energy},\\ F_{Pl}+\lambda(F_{Oc}+F_{Mc}),&\text{for path length}, \end{aligned} \right. \tag{13}\]subject to the following constraints:  
\[D_{T_{0}}(i,j)=\sqrt{(x(i)-x_{o}(j))^{2}+(y(i)-y_{o}(j))^{2}+(z(i)-z_{o}(j))^{2}} \geq R_{j}, \tag{14}\]  
\[D_{T_{0}}(i,j)=\sqrt{(x_{i}-x_{j})^{2}+(y_{i}-y_{j})^{2}+(z_{i}-z_{j})^{2}}\geq SD, \tag{15}\]  
where \(D_{T_{0}}(i,j)\) is the distance between \(drone_{i}\) and \(obstacle_{j}\) and should be greater than the size of \(obstacle_{j}(R_{j})\) for \(i=1\), \(2\),..., \(N_{U}\), and \(j=1\), \(2\),..., \(N_{obs}\). \(D_{T_{0}}(i,j)\) for \(i\), \(j=1\), \(2\),..., \(N_{U}\), \(i\
eq j\) is the distance between UAVs and should be greater than the safety distance, denoted by \(SD\). \(F_{Energy}\), \(F_{Oc}\), and \(F_{Mc}\) are functions that account for energy consumption, the likelihood of colliding, and member collision, respectively. The coordinate points \((x_{i},y_{i},z_{i})\) are the waypoints of path\({}_{i}\), while \((x_{o},y_{o},z_{o})\) are the centers of obstacles. \(F_{Oc}\) and \(F_{Mc}\) can be expressed as follows:  
\[F_{Oc}=\left\{