# A Hybrid Brain Storm Optimization Algorithm to Solve the Emergency Relief Routing Model
## 4 The Proposed Hybrid BSO Algorithm
### Hybrid BSO Algorithm  
As a novel type of intelligent optimization algorithm, the BSO has been applied in many fields. However, it has also been found that the BSO algorithm has two notable drawbacks.  
Only the optimal solution is adjusted when updating the solutions, which means the algorithm may tend to become stuck in the local optimum trap. The method of generating random steps is used to find new solutions when calculating child solutions, and the search efficiency is relatively slow. It is worth mentioning that the ideas of the SA and LNS can make up for the shortcomings of the BSO algorithm. The LNS algorithm can help speed up the convergence and compute the optimal solution faster, while the SA algorithm can expand the range of the optimal search and help stay away from the local optimum. These two algorithms can enhance the comprehensive performance of the BSO algorithm. Based on observation, we propose the HBSO algorithm, combining the SA algorithm and LNS algorithm with the BSO algorithm.  
In the HBSO, the initial solution is first generated using \(K\)-means clustering. A cluster center is randomly selected, and this cluster center is updated with a newly developed random solution. After updating all individuals, a new generation of solutions is obtained. Then, the new solutions are further searched using the LNS algorithm. The individuals are split and regrouped using the \"destroy\" and \"repair\" operators to compute better individuals. Then, the SA selection and retention operation are performed on all newly generated individuals. The solutions that are better than the previous generation are retained, and the non-best solutions are recorded according to probability. A random number is compared with the dynamically changing probability. If the current probability is larger than the random number, this generation of individuals will be retained. The current probability is calculated according to the iteration number and the improvementrate of the repaired individual over the pre-repair individual. The exploration can be increased by using the SA algorithm, and the likelihood of discovering the global optimal solution can be improved. The pseudocode of the HBSO is shown in Algorithm 3.  
```
Input:\(NP\) (population size), \(ND\) (the number of clusters), \(max\_gen\) (the maximum number of iterations), \(p\) (the dynamically changing probability of remaining the non-optimal individual)
1 Initialization: create n probable solutions (individuals) at random, and evaluate them;
2 while the stop criterion is not met then
3 Clustering: using the k-means clustering algorithm, cluster n individuals into m clusters;
4 Update populations: choose one or two cluster(s) at random to generate a new individual;
5 LNS: further search for updated individuals using the \"damage\" and \"repair\" operators;
6 SA selection: the newly generated individual is compared with the optimal individual of the previous generation;
7 if\(rand<p\)then
8 Accept the new individual as the optimal individual of the previous generation;
9 elseif
10 Accept the optimal individual of the previous generation as the new individual;
11 endif
12 endwhile
13 Output: the optimal individual and its fitness
```  
**Algorithm 3**HBSO