## 2 Materials and Methods
### MADDPG Solves UAV Path Planning and Task Offloading Problem
When \(g_{j,q}=1\), there is only the first term in Formula (34); at this time, the closer the sub-network inference \(g^{*}_{i,j,q}\) is to 1, i.e., the closer it is to the true value, the smaller the loss value. To better represent the gap between the real sample labels and the predicted probabilities, the parameters of the target inference subnetwork are updated by the binary cross-entropy loss function. The loss function of the estimation and inference part is the sum of the loss functions of the two subnetworks, as shown in Formula (35). \[L^{GI}=-\frac{1}{N}{\sum_{i}{\sum_{j\
eq i}{\sum_{q}{\left[{g_{j,q}\cdot log( g^{*}_{i,j,q})+(1-g_{j,q})\cdot log(1-g^{*}_{i,j,q})}\right]}}}} \tag{34}\]  
\[L(\theta^{ToM})=L^{\text{OE}}+L^{GI} \tag{35}\]  
As graph neural networks (GNNs) have strong learning capabilities, they can capture spatial information hidden in the network topology, and a GNN has the generalization ability to handle unseen topology when the network is dynamic. Message sending is  
Figure 2: Structure diagram of unmanned aerial vehicle communication mechanism. essentially a communication network, and the basic structure of communication network is a graph. Graph data, a kind of non-Euclidean spatial data, has complex correlations and inter-object dependencies, and a GNN can quickly mine topological information and complex features in graph structure to solve the communication problem between agents. Therefore, the message sending part uses a GNN to implement the communication function between UAVs. This part is modeled end-to-end, with UAVs modeled as graph nodes and the communication relationship between UAVs modeled as edges. First, generate node features \(u_{i,j}=(E^{\prime}_{i,j},\zeta_{i,j})\), which represent the node features of UAV \(j\) from the perspective of UAV \(i\), where \(E^{\prime}_{i,j}=\sum_{q=1}^{m}{(g^{*}_{i,j,q}>\delta)\cdot E_{i,q}}\), and \(\delta\) represents the probability threshold. Then, the edge features between UAV \(j\) and UAV \(k\) are generated according to \(\sigma(u_{i,j},u_{i,k})\), where \(\sigma\) is the edge feature encoder. Finally, the feature set \(G=(V_{i},\zeta_{i})\) of all nodes and edges in UAV \(i\)'s GNN is obtained. In order to reduce communication redundancy, it is necessary to reduce unnecessary edges, and the algorithm determines the validity of each edge through ablation analysis. The specific steps of ablation analysis are: remove a certain edge from \(\sum_{s}{g^{*}_{j,i}}\) to obtain the non-connected subgoal \(g^{-}_{i}\), where \(\sum_{s}{g^{*}_{j,i}}\) represents the message set sent by all other UAVs to UAV \(i\); then, calculate the divergence value \(\chi=D_{KL}(g^{-}_{i}||g_{i})\) through the KL divergence calculation formula. If \(\chi\leq\tau\) (\(\tau\) is a preset threshold), it means that \(\sum_{s}{g^{*}_{j,i}}\) has a small impact on the final decision made by UAV \(i\) and belongs to redundant communication, so this edge should be removed; otherwise, keep the edge. The update formula of the message sending part parameters is (36). The reason we chose KL divergence to assess redundant communication is that KL divergence is a measure of the difference between two probability distributions. In reinforcement learning algorithms, communication between agents is achieved by transmitting probability distributions or policies. By comparing the differences in the probability distributions transmitted by different agents, we can determine the existence of redundant communication. The basic principle is that if the probability distributions transmitted by two agents are similar enough, then the communication between them may be redundant because the information from one agent does not provide additional value or help. KL divergence can be used to quantify the difference between two probability distributions, and a smaller KL divergence indicates a higher similarity between the two probability distributions, suggesting the presence of redundant communication.