# Advancing Multi-UAV Inspection Dispatch Based on Bilevel Optimization and GA-NSGA-II
## 2 Problem Description
### Constraint Establishment
Furthermore, this optimization approach helps to equalize the workload of the two UAVs, preventing the waste of resources and further enhancing the overall efficiency of task execution. The constraints are as follows:  
\[|H|=|T| \tag{3}\]  
\[\sum_{k=1}^{|M|}\sum_{i=1}^{|L|}\sum_{j=1}^{|I|}x_{ij}^{k}=|L|\times|I| \tag{4}\]  
\[\sum_{k=1}^{|M|}x_{ij}^{k}=1 \tag{5}\]  
Figure 2: Comparison of task distribution before and after balancing. \[\sum_{i=1}^{|\parallel}\sum_{j=1}^{\omega}x_{ij}^{k}(F_{ij}+P_{ij})+x_{i\omega+1}^{ k}(F_{i\omega+1}+P_{i\omega+1})\geq\beta E,\omega=1,2,\ldots,|\parallel \tag{7}\]  
\[\sum_{i=1}^{|\parallel}\sum_{j=1}^{\omega}x_{ij}^{k}(F_{ij}+P_{ij})+x_{i\omega +1}^{k}(F_{i\omega+1}+P_{i\omega+1})>0,\omega=|\parallel \tag{8}\]  
\[\sum_{q=1}^{|M|}y_{pq}\geq 1 \tag{9}\]  
\[\mathrm{D}=\sum_{p=1}^{|U|}\sum_{q=1}^{|M|}L_{pq}Y_{pq} \tag{1}\]0  
\[\mathrm{D}=\sum_{p=1}^{|U|}\sum_{q=1}^{|M|}L_{pq}Y_{pq} \tag{1}\]1  
\[\mathrm{D}=\sum_{p=1}^{|U|}\sum_{q=1}^{|M|}L_{pq}Y_{pq} \tag{1}\]2  
\[\mathrm{D}=\sum_{p=1}^{|U|}\sum_{q=1}^{|M|}L_{pq}Y_{pq} \tag{1}\]3  
\[\prod_{ \begin{subarray}{c}m,n\in U\\ m\
eq n\end{subarray} }\left(FT_{m1}-FT_{n1}\right)\left(FL_{m|S_{m}|}-FL_{n|S_{ n}|}\right)=0 \tag{13}\]  
\[x_{ij}^{k}=\{0,1\},\forall k\in M,\forall i\in L,\forall j\in 1 \tag{14}\]  
\[y_{pq}=\{0,1\},\forall p\in U,\forall q\in M \tag{15}\]  
\[z_{mn}^{P}=\{0,1\},\forall p\in U,\forall m,n\in V \tag{16}\]  
Among them, Constraint (3) is the matching constraint between UAVs and hives, ensuring that the number of UAVs is equal to the number of hives; Constraints (4-8) are constraints on power grid line segmentation, and Constraint (4) ensures that all transmission towers are assigned to the task to ensure the comprehensiveness of the inspection; Constraint (5) ensures that each transmission tower is only assigned to a single UAV unit task to avoid repetitive inspection tasks, while Constraints (6-7) are used to restrict the cumulative power consumption of a single takeoff and landing of the UAV so that it does not exceed its endurance margin; Constraint (8) ensures that the generation of new unit tasks is stopped when the task is segmented to the end of each transmission line and ensures the continuity of task assignment; Constraints (9-11) are the outer task assignment constraint, and Constraint (9) ensures that each UAV is assigned at least one small task; Constraint (10) ensures that any unit task is performed by one UAV, ensuring that the task is performed exclusively. Constraint (11) emphasizes the balance of task assignment; that is, the task quantity of each UAV matches its performance; Constraint (12) refers to the cross-line task execution constraint, which is used to prohibit UAVs from performing tasks across lines to avoid confusion in task execution; Constraint (13) stipulates that each UAV must be positioned in distinct hives at both the initial and final stages of the task. This ensures that every UAV is located in separate hives at the start and end of the mission, thereby efficiently avoiding various conflicts and ensuring the smooth operation of the multi-UAV system as well as the efficient completion of the task; Constraints (14-16) are constraints on the value range of variables to ensure that all decision variables are within a reasonable range, ensuring the solvability and practicability of the model.