## 5 Grey Wolf Algorithm
### Improved Design of the Grey Wolf Algorithm for Large-Scale Neighborhood Search
#### 5.2.5 Local Search Operations  
Letting the population of the grey wolf update their location globally, take grey wolf \(\alpha\), \(\beta\), \(\delta\) as the object of the local search operation, apply the idea of damage repair in a large-scale neighborhood search algorithm for local search, and assume that the number of customer points is m, divided into n regions; then, the damage operator removes k (\(1\leq k\leq k_{\text{max}}\)) customer nodes from each of s (\(2\leq s\leq m\)) adjacent paths of the current solution to obtain the set R of removed customer nodes, forming the destructive solution \(S_{d}\), where \(k_{\text{max}}\) is formulated as  
\[k_{\text{max}}=\min(|\overline{p_{n}}|,|p_{c}|) \tag{30}\]  
where \(|\overline{p_{n}}|\) is the average value of the regional distribution customer nodes of the current solution, and \(|p_{c}|\) is the number of the regional distribution customer nodes of the current solution. Inserting a client node in R back to a location in \(S_{d}\), the insertion cost of inserting the client node back to \(C_{I}\) is obtained by subtracting the maximum of the path distance of the client node from all the path distances of \(S_{d}\). The resulting insertion cost is sorted from smallest to largest \((C_{II},C_{IZ},C_{I3},\cdots,C_{In})\), and the regret value \(V_{S}\) is \(C_{I2}-C_{I1}\). The specific steps to repair the operator are  
1. Initialize the repaired solution \(S_{d}\). 2. If R is non-empty, advance to step (3); otherwise, advance to step (6). 3. Calculate the number of client nodes in R, and calculate the regret value of each interpolated client node \(V_{S}\). Figure 7: Grey wolf individual crossover operation chart. 4. Identify the maximum \(V_{S}\) and insert the unsettled client point back into the \(S_{d}\) insertion cost minimum position. 5. Update the set R and return to step (2). 6. End the repair process and output. The pseudo-code for local search operation [35] and the pseudo-code for IGWO are shown in Algorithms 1 and 2 respectively. ```
0: Current solution \(S\), Number of customer nodes \(n\), Number of regions \(m\) Output: The removed customer node set R and the broken solution S*
1 \(R\leftarrow\varnothing\) The set of customer nodes that are removed, initially empty
2 \(T\leftarrow\varnothing\) The set of broken paths, initially empty
3 Determine the number of routes to remove \(k\gets Random[2,i]\)
4 Select a customer node \(i_{seed}\) at random from the current solution \(S\)
5 for \(i\in adj(i_{seed})\) and \(|T|<k\)do
6 if \(tour(i)\
otin T\)then
7 \(I\gets Random\big{[}1,\min\big{(}|T|_{1}|,|t_{2}|\big{)}\big{]}\)
8 \(I\gets I\cup\text{removeSelected}(i,I)\)
9 \(T\gets T\cup tour(i)\)
10 end if
11 end for
12 Remove the form in set R from the solution S to form the failure solution S*
13 Return R and S*
```  
**Algorithm 1**Local Search Operation  
Where \(adj(i_{seed})\) represents the city sequence with the distance from customer node \(i_{seed}\) sorted from large to small; \(i_{seed}\) is the first element in the sequence; \(tour(i)\) indicates the path where customer node \(i\) resides; And removeSelected\((i,l)\) means to randomly remove I consecutive customer nodes from \(tour(i)\), including customer node \(i\). ```
0: Population size I, Dimension D, The maximum number of iterations \(T_{\max}\), The objective function \(f(x)\) Output: Optimal solution
1 The greedy algorithm principle is used to initialize the population, The population individual is \(X_{i}=(X_{i}^{l},X_{i}^{2},\ldots,X_{i}^{l})\)
2 Calculate all individual fitness values
3 In order of fitness value from largest to smallest
4 Individuals \(\alpha\), \(\beta\) and \(\delta\) corresponding to the first three fitness values were selected.