# Task Assignment of UAV Swarm Based on Wolf Pack Algorithm
## 3 The Wolf Pack Algorithm  
### The Basics of the Wolf Pack Algorithm  
The WPA adopts the bottom-up design principle and simulates wolves hunting cooperatively according to their division system of responsibilities as shown in Figure 1. Wolves are divided into a leader wolf, exploring wolves and fierce wolves, and they share information with each other. The leader wolf is closest to the prey because it is most sensitive to smell, so it is the guidance of the wolf pack. Exploring wolves are responsible for detecting the environment to find the position of the prey, due to their sensitivity to smell. Fierce wolves are responsible for getting close to catch the prey quickly. The problem space is defined as an \(N\times D\) Euclidean space, where \(N\) is the number of wolves in the wolf pack, and \(D\) is the number of each wolf's information dimension. The position of the wolf \(i\in N\) is expressed as \(X_{i}=\{x_{i1},\cdots x_{id},\cdots,x_{iD}\}\), where \(x_{id}\) is the value in \(d^{th}(d\in D)\) dimension of wolf \(i\in N\), the smell concentration of prey perceived by wolf is described as the cost function value. The distance between the wolf \(p\) and \(q\) is defined as the Manhattan distance. \[L(p,q)=\sum\limits_{d=1}^{D}\bigl{|}x_{pd}-x_{pd}\bigr{|}. \tag{7}\]  
WPA is shown in Algorithm 1. The whole process of wolf pack hunting can be abstracted into 3 features:  
* the selection of the leader wolf based on the winner-take-all rule;
* three cooperative behaviors including walking, calling and sieging;
* an update mechanism based on the strongest-survives law. ```
Data: initial position of UAVs:\(pos_{V}\), position of targets:\(pos_{T}\),iterations, population size:\(N\), \(step_{a}\), \(step_{b}\),\(step_{c}\), \(T_{max}\), \(d_{near}\), \(\alpha\), \(\beta\) Result: solution \(X_{lander}\), min cost \(J\)  Generate initial solution \(X\); foriterationsdo  Select the leader wolf; /* walking behaviour: */  Select \(S\) exploring wolves; whilewalking times \(<T_{max}\)do for exploring wolvesdo  walk to \(h\) directions as \(Eq. (8)\); if\(J(X_{new})<J(X)\)then  update position:\(X\gets X_{new}\)  end if if\(J(X)<J(X_{leader})\)then  replace leader wolf:\(X_{lander}\gets X\);  break;  end if  end for  end for /* calling behaviour: */  Select \(M\) fierce wolves; whiledistance between fierce wolf and leader \(<d_{near}\)do forfierce wolvesdo  get close to the leader wolf as \(Eq. (9)\) if\(J(X_{new})<J(X)\)then  update position:\(X\gets X_{new}\);  update distance between fierce wolf and leader as \(Eq. (7)\)  end if if\(J(X)<J(X_{leader})\)then  replace leader wolf:\(X_{leader}\gets X\);  break;  end if  end for  end for /* sieging behaviour: */  forall wolves except the leader wolfdo  get close to the leader wolf as \(Eq. (11)\); if\(J(X_{new})<J(X)\)then  update position:\(X\gets X_{new}\)  end if  end for /* eliminate and generate: */  Select \(R\) weakest wolves;  delete the \(R\) wolves;  generate randomly \(R\) new wolves;  end for
```  
**Algorithm 1**WPA  
```
Data: initial position of UAVs:\(pos_{V}\), position of targets:\(pos_{T}\),iterations, population size:\(N\), \(step_{a}\), \(step_{b}\),\(step_{c}\), \(T_{max}\), \(d_{near}\), \(\alpha\), \(\beta\) Result: solution \(X_{



#### 3.1.1 The Selection of Leader Wolf Based on Winner-Take-All Rule

The wolf with the minimum cost can be the leader wolf at any time. Initially, the wolf with the minimum cost is chosen as the leader wolf. In the subsequent stages, if the cost of some wolf is less than that of the current leader wolf, that wolf will be the new leader. If multiple wolves are the best at the same time, pick one at random to be the leader wolf. The leader wolf goes directly to the next iteration without executing the following cooperative behaviors, until it is replaced by a new leader wolf. #### 3.1.2 Three Cooperative Behaviors

1. Walking behavior. \(S\) suboptimal wolves are selected as exploring wolves to perform the walking behavior.