# Advancing Multi-UAV Inspection Dispatch Based on Bilevel Optimization and GA-NSGA-II
## 2 Problem Description
### Constraint Establishment  
This paper takes the total flight distance of UAVs and the standard deviation of flight distances among UAVs as optimization objectives. It aims to ensure that the total flight distance of UAVs is minimized while balancing the flight distances of each UAV, thereby guaranteeing the feasibility of multi-UAV task assignment and path planning. The objective functions are defined as follows: \begin{table}
\begin{tabular}{c c} \hline
**Element** & **Definition** \\ \hline H & The set of hives \\ |H| & Number of hives \\ U & The set of UAVs \\ |U| & Number of UAVs \\ P & UAV \\ M & The set of all tasks \\ V & Total set of task points \\ |V| & Number of tasks \\ |M| & Number of task points \\ q & Subtasks divided by UAV power and constraints \\ L & The set of power grid lines \\ |L| & Number of power grid lines \\ |1 & Towers in power grid lines \\ |11| & The number of towers in power grid lines \\ S & Total set of sorties \\ S\({}_{\text{P}}\) & The set of sorties for UAV p \\ R\({}_{\text{ps}}\) & The node set of the s-th sortie of UAV p \\ FT\({}_{\text{ps}}\) & The hive from which UAV p takes off on its s-th sortie \\ FL\({}_{\text{ps}}\) & The hive where UAV p lands on its s-th sortie \\ \hline \end{tabular}
\end{table} 
Table 1: Element symbols and definitions. \begin{table}
\begin{tabular}{c c} \hline
**Variable and Parameter** & **Definition** \\ \hline \(\text{x}_{\text{j}}^{\text{k}}\) & Whether the j-th tower of the i-th transmission line has been assigned to the k-th \\ \(\text{s}_{\text{j}}^{\text{p}\text{q}}\) & Whether the p-th UAV performs the q-th task, 1 for yes, 0 for no. \\ \(\text{z}_{\text{nn}}^{\text{z}}\) & Whether UAV p flies from node m to node n, 1 for yes, 0 for no. \\ \hline \(\text{C}_{\text{pq}}\) & The flight distance of the p-th UAV performing the q-th subtask. \\ \(\text{L}_{\text{pq}}\) & The total distance matrix of the UAV. \\ E & UAV battery power. \\ \(\text{P}_{\text{ij}}\) & The power consumption for inspecting the j-th tower of the i-th transmission line. \\ \(\text{F}_{\text{ij}}\) & The power consumption for flying between the j-th tower and the (j + 1)-th tower of \\ \(\text{e}\) & & Loss of UAVs in hives. \\ \(\beta\) & Flight margin for UAVs \\ \(\text{w}_{\text{m}}\) & Power grid line to which task point m belongs. \\ \hline \end{tabular}
\end{table} 
Table 2: Variables, parameter symbols, and their definitions. The total flight distance D represents the combined flight distance of all UAVs, which is calculated as follows:  
\[\mathrm{D}=\sum_{p=1}^{|U|}\sum_{q=1}^{|M|}L_{pq}Y_{pq} \tag{1}\]  
The standard deviation of multi-UAV flight distance, denoted as \(\mu\), is defined as a measure of the variation in flight distances among individual UAVs. A smaller value of \(\mu\) indicates that the flight distances of the UAVs are closer to each other, suggesting a more balanced task assignment and higher efficiency in path planning. Conversely, a larger value of \(\mu\) may imply uneven task distribution, with some UAVs having to fly longer distances. The mathematical expression for \(\mu\) is as follows:  
\[\mu=\sqrt{\frac{\sum\limits_{q=1}^{|M|}L_{pq}Y_{pq}-\frac{D^{2}}{|U|}}{|U|}} \tag{2}\]  
Figure 2 clearly illustrates the impact of task balance constraints on the flight path planning of UAVs. The left diagram represents the flight routes of the two UAVs without considering task balance constraints. In contrast, the right diagram shows the flight routes after the introduction of task balance constraints. By comparison, it is evident that the difference in flight distances between the two UAVs has been significantly reduced following the optimization with task balance constraints. This change not only enhances the overall flight efficiency but also effectively minimizes the waiting time incurred when one UAV completes its tasks ahead of the other, thereby improving the collaborative efficiency of the UAVs.