# Task Assignment of UAV Swarm Based on Wolf Pack Algorithm
## 3 The Wolf Pack Algorithm
### The Basics of the Wolf Pack Algorithm
\(P_{g}^{k}\) is the position of the leader wolf, representing the global extremum in iteration \(k\). \(\lambda_{i}^{k}\) is a temporary variable. \[\lambda_{i}^{k}=c_{2}\otimes F_{1}(\varphi_{i}^{k},P_{g}^{k})= \begin{cases}F_{ 1}(\varphi_{i}^{k},P_{g}^{k}),&\varepsilon=\mathit{rand}()<c_{2}\\ \varphi_{i}^{k},&\text{otherwise}\end{cases} . \tag{14}\]

Figure 2: Tracking individual extremum. During the operation in Figure 3, a random number \(\varepsilon\in[0,1]\) is generated firstly. If \(\varepsilon<c_{2}\), where \(c_{2}\) is the threshold to determine crossover, two random integers \(a,b\in[1,N_{T}]\) are generated. The columns between the index range \([a,b]\) of \(\varphi_{i}^{k}\) will be exchanged with the counterpart in the global extremum \(P_{g}^{k}\). The result of this operation is \(\lambda_{i}^{k}\). On the other hand, if \(\varepsilon\geq c_{2}\), \(\lambda_{i}^{k}=\varphi_{i}^{k}\). #### 3. Individual variation

This part of the formula is described in the discrete domain as Equation (15), where \(\mathit{step}_{a}\) is the walking step, which determines how many columns of \(\lambda_{i}^{k}\) will mutate. \(W_{i}^{k}\) is a temporary variable representing the result of the walking behavior. \[W_{i}^{k}=F_{2}(\lambda_{i}^{k},\Gamma(\mathit{step}_{a})). \tag{15}\]

During the operation in Figure 4, function \(\Gamma(\mathit{step}_{a})\) randomly selects \(\mathit{step}_{a}\) columns in the \(\lambda_{i}^{k}\). The values of the \(1^{\mathit{st}}\) row in these columns are randomly selected from \([1,N_{V}]\), while the values of the second row are randomly exchanged. #### 3.2.3 Improvement on Calling Behavior

The calling behavior is an essential process for fierce wolves to converge to the current optimal solution which is the position of the leader wolf. This behavior determines the convergence rate of the algorithm. Inspired by gene segment duplication in the GA, each fierce wolf duplicates a piece of the leader's position to replace its own to realize the fast approach of the leader wolf. This part of the formula is expressed in the discrete domain as Equation (16). \(P_{g}^{k}\) is the position of the leader wolf, representing the global extremum in iteration \(k\), \(\mathit{step}_{b}\) is the raid step, and \(C_{i}^{k}\) (\(i\in M\)) is a temporary variable representing the result of the calling behavior. \[C_{i}^{k}=F_{1}(X_{i}^{k},P_{g}^{k},\mathit{step}_{b}). \tag{16}\]

During the operation in Figure 5, a continuous segment of length \(\mathit{step}_{b}\) is randomly intercepted from the wolf \(i\in M\), then, is replaced by the corresponding segment of the leader wolf. Figure 4: Individual variation. Figure 3: Tracking global extremum. #### 3.2.4 Improvement on Sieging Behavior

This part of the formula is expressed in the discrete domain as Equation (17), where \(\mathit{step}_{c}\) is siege step, and \(X_{i}^{k+1}\) is the result of the siege behavior. \[X_{i}^{k+1}=F_{2}(X,\Gamma(\mathit{step}_{c}))= \begin{cases}F_{2}(W_{i}^{k}, \Gamma(\mathit{step}_{c})),&i\in S\\ F_{2}(C_{i}^{k},\Gamma(\mathit{step}_{c})),&i\in M\end{cases} . \tag{17}\]

During the operation in Figure 6, Function \(\Gamma(\mathit{step}_{c})\) randomly selects \(\mathit{step}_{c}\) columns in \(X\). The values of the first row in these columns are randomly selected from \([1,N_{V}]\), while the values of the second row are randomly exchanged. #### 3.2.5 Improvement in Wolf Population Update

In WPA, \(R\) weakest wolves are eliminated and replaced by new wolves generated randomly just as the initialization. Experiments show that new wolves generated by this method do not have competitiveness, and they are finally eliminated and meaningless in the algorithm. In the PSO-GA-DWPA, a new wolf is generated by using the method of small variation of the leader wolf. The process is similar to individual variation in walking behavior. This is expressed in the discrete domain as Equation (18), where \(\mathit{step}_{d}\) is variation step, and \(X_{i}^{k+1}\) is the position of new wolf.