# Formation Control Algorithm of Multi-UAV-Based Network Infrastructure
## 4 Formation Control Algorithm
### Congestion Equalization Force  
\(F_{adhoc}\) and \(F_{dist}\) form the UAV fleet regularly; at the same altitude, and the same distance between the nodes. Although these two forces let UAVs be spread while maintaining the connection with the gateway, there is no concern about the traffic management of the end devices, which could make some UAVs redundant or cause the traffic concentration. In particular, variability of the altitude of the AP is one of the most essential advantages of the UAV-based network infrastructure, since the altitude determines the communication area projected at the ground (Equation (1)). As shown in Equation (5), excessive increment on the number of the connections in a single UAV degrades the network performance of the infrastructure. Under the influence of the aforementioned background forces, congestion equalization force is designed to let UAVs subdivide the traffic concentrated spots to equalize the congestion of the UAVs. We apply the force with direction to the \(+z\) axis for the relatively more congested UAVs to explicitly narrow the coverage space and reduce the connections. Meanwhile, the relatively less congested UAVs are applied the force with the direction to the \(-z\) axis and the direction toward the highly congested UAVs. Through this equalization force, the less congested UAVs take over a part of the devices which are excessively connected to another UAV. Also, to progressively seek the network resource requirement on the ground, relatively low congestion UAVs push the relatively high congestion UAVs until the expected congestion comes to the equilibrium. The equation of the congestion equalization force \(F_{coneq}\) can be expressed to  
\[F_{coneq}=\frac{1}{\beta}\sum_{E}\frac{n-n_{i}}{|n-n_{i}|}\exp(|n-n_{i}|)(\mathbf{ p}-\mathbf{p}_{i})+\mathbf{h}_{i} \tag{12}\]  
where  
\[\mathbf{h}_{i}=\begin{bmatrix}0\\ 0\\ \frac{1}{\beta}\exp(|n-n_{i}|)\end{bmatrix}. \tag{13}\]  
Congestion relaxation degree \(\beta\) determines the weight of the \(F_{coneq}\), since the congestion could be relaxed by the protocol and then the support of other UAVs is less needed. Figure 4a,b show an example of our \(F_{coneq}\) design graphically. For better readability, we use the terms attractive and repulsive forces for every \(F_{coneq}\) applied. Since UAV 2 located in the center of the traffic concentrated area, the altitude gets higher and the position is changed by the repulsive force by the nearby UAVs. On the case of UAV 3, the repulsive force is applied by UAV 4 and 5, and the attractive force is applied by UAV 2. By the sum of the forces, UAV 3 is dominantly powered by the repulsive force toward the center of the traffic concentrated area. UAV 0, 1, 4, and 5 receive the same direction of the power, but also receive the downward power by Equation (13). UAV 3 has more congestion than UAV 4 and UAV 5, and less congestion than UAV 2. As a result, the altitude change of UAV 3 is less than the other UAVs. One of the examples of the result formation effected by \(F_{coneq}\) is shown in Figure 4b. Note that the excessive clustering among the UAVs by \(F_{coneq}\) is prevented by \(F_{distr}\), addressed in Section 4.2. On the basis of the formation maintenance forces \(F_{distr}\) and \(F_{adhoc}\), \(F_{coneq}\) reforms the formation to be more traffic-aware.  
Figure 4: \(Cont\).