Sparrow Search Algorithm (SSA) (including MATLAB code)

Let me make a statement first: The article is directly copied and pasted from the push in my personal official account, so friends who are interested in intelligent optimization algorithms can follow my personal official account: < a i=1>Heuristic algorithm discussion. I will share different intelligent optimization algorithms in the public account from time to time, classic ones, or new intelligent optimization algorithms proposed in recent years, with MATLAB codes attached.

picture

Sparrow Search Algorithm (SSA) is a new swarm intelligence optimization algorithm inspired by the foraging behavior and anti-predation behavior of sparrow populations.

Sparrows are animals that like to live in groups. There are many species in nature and they often appear in environments where humans live. Through research, it was found that there is a clear division of labor within the sparrow group in the process of foraging. There are two different types of internal sparrows, one is the discoverer and the other is the follower. The discoverer sparrow provides direction guidance for the population to forage, and the remaining individuals are follower sparrows, which obtain food by following the discoverer sparrow in the population. In the population, the identities of the discoverer sparrow and the follower sparrow are not fixed and can be flexibly changed. At the same time, there will also be competition within the sparrow population for food. In addition, because the sparrows on the outside of the population are more vulnerable to predators, individuals in the sparrow population will constantly adjust their positions to move closer to neighboring peers or gather inward to reduce the risk of being predated.

Its original reference is as follows:

Xue J, Shen B. A novel swarm intelligence optimization approach: sparrow search algorithm[J]. Systems science & control engineering, 2020, 8(1): 22-34.

01
设计原则

Similar to other swarm intelligence optimization algorithms, the Sparrow search algorithm agrees on some rules during the optimization process, which makes the algorithm implementation efficient, simple and interpretable. In algorithm design, the foraging behavior of sparrow populations is generally idealized and divided into the following six steps:

(1) The discoverer individual in the sparrow population generally has a better fitness value than other individuals. It is responsible for searching for the location of food during the process of searching for food in the population, and transmits the location and direction information of the food to the entire population, so that Follower individuals follow it for food;

(2) During the foraging process, if a random individual sparrow in the population predicts danger, it will automatically send out a warning signal to attract the attention of the population. Warning signals vary in size. When designing the algorithm, the safety warning value threshold is manually set. If the warning signal value is greater than the safety warning value threshold, the sparrow population will not look for food there, and the discoverer sparrow will lead the followers to other safe places. The area continues to feed;

(3) During the foraging process, the identities of two different sparrows are interchangeable. If the follower sparrow discovers a better food location during the search process, the identity of the follower individual will be transformed into a discoverer. During the transformation process, every time a follower sparrow transforms into a discoverer sparrow, then it will A clone of a discoverer sparrow becomes a follower, and the number ratio of discoverer sparrows and follower sparrows in the entire sparrow population is fixed;

(4) Because the amount of food is fixed, the discoverer who arrives at the food location first will eat the food first to replenish his own energy, while the followers who follow later will get less food, and some may even not eat any food. Therefore, due to hunger, subsequent follower sparrows will fly away from the population and look for new food locations to replenish energy. This mathematical model can give the algorithm a probability to jump out of the local area, allowing the population to explore more regional space;

(5) Followers in the population will always follow the discoverer who finds the most food and follow them to forage. Because they believe that the discoverer with the highest fitness value will have more and more high-quality food around him, but at the same time, some followers will also monitor the discoverer and compete with them for food resources;

(6) When a sparrow population discovers an alien predator, the individual sparrow at the edge of the population will change its position and move closer to the middle or inside of the population to avoid being caught by the predator; while in the sparrow population, it will The individual sparrows in the middle will move closer to the surroundings and reduce the probability of being preyed on by gathering with their companions.

02
Arithmetic design

picture

picture

picture

03
Calculation process

picture

04
Experimental Simulation

SSA is used for function optimization. The MATLAB program of the algorithm is coded strictly according to its original reference. Use the CEC2005 test set to verify the performance of SSA. Here we choose the Dung Beetle Optimization (DBO) algorithm which is very popular this year for comparison (for the sake of fair comparison, two The population size of the algorithm is set to 30, and the maximum number of iterations is 500). The simulation results are only briefly displayed without further analysis.

The comparison results are as follows:

SSA Vs DBO

The convergence curve suddenly disappears on some functions because it has converged to the theoretical optimal value of 0. I use semilogy to draw the convergence curve, and semilogy draws the logarithm of the y-axis. Therefore, if the curve converges to 0, semilogy cannot draw it.

05
MATLAB Daigo

The MATLAB code link corresponding to SSA is as follows:

SSA runs CEC2005 test set There is a link in the public account
SSA runs CEC2013 test set There is a link in the public account
SSA runs CEC2014 test set There is a link in the public account
SSA runs CEC2017 test set There is a link in the public account
SSA runs CEC2020 optimization function test set There is a link in the public account
SSA runs CEC2022 optimization function test set There is a link in the public account
Analysis of the proportion of exploration and development in SSA There is a link in the public account
Engineering applications of SSA (Issue 1): Pressure vessel design, rolling bearing design, tension/compression spring design, cantilever beam design, gear train design, three-bar truss design There is a link in the public account
Engineering applications of SSA (Issue 2): welding beam design, multi-disc clutch brake design problem, stepping cone pulley problem, reducer design problem, planetary gear train design optimization problem, robot gripper problem There is a link in the public account

You can download the code list through the link below, find the required algorithm code in it, and then go to the corresponding link to obtain it. The list will be updated simultaneously, and once new code is available, it can be found in the list. Some of the codes in the list are obtained from open source. Available for free download at any time.

Link: https://pan.baidu.com/s/1SFDMplrL7tiqGZlrpOSGYg
Extraction code: 8023

Guess you like

Origin blog.csdn.net/jieyanping/article/details/133620903