## 4 Design of a Capacity-Constrained Weighted Clustering Algorithm
### CH and BCH Node Selection
The communication energy consumption of the node \(i\) can be expressed as follows:  
\[E_{icomm}=t\times\sum_{j=1}^{D_{i}}w_{ij} \tag{5}\]  
where \(t\  
where \(b_{1}\) and \(b_{2}\) are two parameters related to the aircraft's weight (including all its payloads), wing area, air density, \(a(t)\) is the acceleration, \(v_{i}\) is the flight speed, \(g\) is the gravitational acceleration, and \(t_{flight}\) is the flight duration. The sensing and data processing energy consumption of the node \(i\) can be expressed as follows:  
\[E_{isensor}=P_{sensor}\times t_{sensor}+P_{process\sin g}\times t_{process\sin g} \tag{7}\]  
where \(P_{sensor}\) is the average power consumed by the node \(i\) for perceiving target information, \(t_{sensor}\) is the duration of perception work, \(P_{process\sin g}\) is the average power consumed by the node \(i\) for preprocessing the perceived information, and \(t_{process\sin g}\) is the duration of the data preprocessing. 3. Mobility similarity factor  
In the UAV cluster network, the cluster head needs to maintain stable communication links with all cluster members. If the motion patterns of the cluster head and cluster members are similar, the distance fluctuations between the nodes can be reduced, thereby minimizing communication interruptions caused by rapid distance changes or signal attenuation. UAVs are equipped with Inertial Measurement Units (IMU) and Global Positioning Systems (GPS), which can provide information such as position, velocity, and acceleration [41]. In the overall design of the clustering topology construction algorithm, in order to maximize the network topology maintenance time, both the current instantaneous motion state and future movement trend of the nodes need to be considered. Therefore, this paper proposes a method to calculate the relative mobility of nodes in a three-dimensional coordinate system using velocity and acceleration information. The motion state of the node \(i\) within the cluster is shown in Figure 6, where includes velocity and acceleration. The velocity components in the X, Y, and Z directions can be expressed as follows:  
\[v_{i-z}=v_{i}\cos\alpha_{i} \tag{8}\]  
\[v_{i-x}=v_{i}\sin\alpha_{i}\cos\theta_{i} \tag{9}\]  
\[v_{i-y}=v_{i}\sin\alpha_{i}\sin\theta_{i} \tag{10}\]  
where \(v_{i}\) is the scalar value of the velocity of the node \(i\) at the moment, \(\alpha_{i}\) is the angle between the velocity of the node \(i\) and the Z-axis at the moment, and \(\theta_{i}\) is the angle between the XY-plane component of the velocity of the node \(i\) and the X-axis at the moment. The average velocity difference between the node \(i\) and all other nodes within its cluster can be expressed as follows:  
Figure 6: Motion state of the node. \[f_{C_{i}}=\frac{n_{i}}{N_{k}-1} \tag{2}\]0  
\[f_{C_{i}}=\frac{n_{i}}{N_{k}-1} \tag{2}\]1  
\[f_{C_{i}}=\frac{n_{i}}{N_{k}-1} \tag{2}\]2  
\[f_{C_{i}}=\frac{n_{i}}{N_{k}-1} \tag{2}\]3  
where \(N_{k}\) is the number of nodes in this cluster, \(v_{j}\) represents the scalar value of the velocity of node \(j\) at the moment, \(\alpha_{j}\) represents the angle between the velocity of node \(j\) and the Z-axis at this moment, and \(\theta_{j}\) represents the angle between the velocity XY-plane component of node \(j\) and the X-axis at this moment. After normalization, the velocity similarity factor can be expressed as follows:  
\[f_{C_{i}}=\frac{n_{i}}{N_{k}-1} \tag{2}\]4  
where represents the value of the node's maximum movement speed. At the same time, considering the acceleration of each node, the nodes with smaller differences in acceleration will have more similar motion trajectories.