Z-Shaped Transfer Functions for Binary Particle Swarm Optimization Algorithm

Particle swarm optimization (PSO) algorithm is a swarm intelligent searching algorithm based on population that simulates the social behavior of birds, bees, or fish groups. The discrete binary particle swarm optimization (BPSO) algorithm maps the continuous search space to a binary space through a new transfer function, and the update process is designed to switch the position of the particles between 0 and 1 in the binary search space. Aiming at the existed BPSO algorithms which are easy to fall into the local optimum, a new Z-shaped probability transfer function is proposed to map the continuous search space to a binary space. By adopting nine typical benchmark functions, the proposed Z-probability transfer function and the V-shaped and S-shaped transfer functions are used to carry out the performance simulation experiments. The results show that the proposed Z-shaped probability transfer function improves the convergence speed and optimization accuracy of the BPSO algorithm.


Introduction
e particle swarm optimization (PSO) algorithm is one of the widely used evolutionary algorithms inspired by animal social behaviors [1,2]. It has the search speed, high efficiency, simple algorithm, and so on and has been widely used in crystal structure prediction [3], medical detection [4], grid scheduling [5], robot path planning [6], clustering problem [7], neural network, and many other areas [8][9][10]. However, many optimization problems have binary searching space, so it is necessary to develop binary optimization algorithm to solve them. e binary particle swarm optimization (BPSO) algorithm was proposed by Kennedy and Eberhart in 1997 [11]. Typical binary particle swarm optimization algorithm has two different components: a new transfer function and a different location update program. e transfer function is used to map the continuous search space to a binary space, and the update process is designed to switch the position of the particle between 0 and 1 in the binary searching space. e original version of BPSO algorithm is prone to fall into local extreme, so many scholars have made some improvements to BPSO algorithm. In 2008, Yin proposed a new improved BPSO algorithm, which uses the new updated position formula digital curve with the best polygon approximation [12]. In 2013, Wang et al. [13] used the average information of the individual population and the individual extremum of the particle swarm to determine the current probability value of the particle and removed the influence of the current value of the particle on the next generation. At the same time, the greedy thought is added so that the algorithm not only has the overall optimization characteristics of the particle swarm optimization algorithm but also accelerates the convergence speed of the algorithm. In 2014, Luo [14] revised the sigm function, taking the particle velocity as the correction term of the particle position, fully considering the guiding effect between the particles, and ensuring that the particle follows the optimization mode of the algorithm and applies it to solve the vehicle. On the path problem, the effectiveness of the algorithm is improved. Similarly, many other algorithms reference transfer functions, which are converted to binary versions by their successive versions. In 2013, Sharafi et al. [15] added a transfer function in the tracking mode of cat swarm algorithm, changed the meaning of velocity vector into the probability of mutation in each dimension of cats, and transformed continuous cat swarm algorithm into discrete binary cat swarm algorithm. In 2014, Mirjalili et al. [16] proposed a binary version of the bat algorithm, which is also a probability value that maps velocity values to updated locations using a transfer function. In the same year, Sabba and Chikhi [17] proposed a discrete binary bat algorithm (BINBA) for solving binary space optimization problems. e algorithm is based on the sigmoid function used by Kennedy and Eberhart in the binary particle swarm optimization algorithm proposed in 1997 [11]. BBA was tested on an example of a multidimensional knapsack problem. Compared with other bionic algorithms, the results have a good application prospect. In 2017, Fei [18] proposed a V-shaped transfer function to improve the binary bat algorithm to ensure that the probability of reducing the position of the vector of the position vector of the bat is an element equal to the current best position, and increasing the probability of changing the element of their position vector to the element of the bat is the element of the unequal current optimal position, which helps to enhance the optimization of the binary bat algorithm. In 2015, Emary et al. [19] proposed two new binary wolf optimization algorithms; one of which is to use the sigmoid function to compress the positions of consecutive updates, and then randomly these values are thresholded to obtain an updated double-valued gray wolf position. is method is used for binary gray wolf optimization (BGWO) to find feature subsets to maximize classification accuracy while minimizing the number of affected features. In 2017, Panwar et al. [20] proposed a heuristic binary method for solving the unit commitment problem (UC). is method estimates the continuous and valuable update of the wolves to the global optimal solution, followed by the sigmoid transformation. e simulation results show that BGWO has better performance in solving small-and medium-sized system UC problems compared with other existing heuristic and binary methods. In 2019, Hussien et al. [21] modified the original version of WOA to handle binary optimization problems. To this end, two transfer functions (s-shaped and v-shaped) are proposed to map a continuous search space to a search space. In order to illustrate the function and performance of the proposed binary whale optimization algorithm (BWOA) and apply it to 22 objective functions, 3 engineering optimization problems, and a worldwide sales problem, the results are obtained and the validity is verified. In the same year, Reddy et al. [22] mapped the binary natural PBUC problem to a continuous, real-valued whale position/location mapped to a binary search space through various transformation functions.
ey introduced three variants of BWOA, using a hyperbolic function, an inverse tangent function, and a sigmoid transfer function, respectively. e convergence characteristics, quality of the solution, and consistency of the results of different BWOA variables are discussed, and the superiority and statistical significance of the proposed method over the existing methods are given.
is shows that the transfer function is the most important part of the binary version of the algorithm. In this paper, a new Z-shaped transfer function is proposed and applied to the particle swarm optimization algorithm. e simulation results show that the new transfer function improves the convergence speed and optimization precision of the algorithm. e structure of this paper is organized as follows. Section 2 introduces the standard particle swarm algorithm. Section 3 introduces the binary particle swarm algorithm. Section 4 proposes a new Z-shaped transfer function. In Section 5, the effectiveness of the improved algorithm is verified by simulation experiments on typical test functions. Section 6 summarizes the full text and proposes future research directions.

Particle Swarm Optimization Algorithm
e particle swarm optimization (PSO) algorithm is an intelligent optimization algorithm proposed by Kennedy and Eberhart and Beheshti and Shamsuddin [1,2] in 1995. It simulates the bird's flight foraging behavior and optimizes the swarm through collective collaboration between birds. In the PSO algorithm, the potential solution to each optimization problem is a bird in the search space, named as a particle. Later, Shi and Eberhart added a new impact factor w, which improved the detection and exploratory, and formed the current standard particle swarm optimization algorithm [23]. All particles have an appropriate value determined by an optimized function, and each particle has a velocity that determines the direction and distance of their flight. en, the particle follows the current optimal particle to search in the solution space. e particle's velocity and position are updated by where v i d is the velocity of the ith particle in the dth dimension, p i d is the optimal position of the ith particle so far, x i d is the position of the current ith particle in the dth dimension, p g d is the optimal position that the particle swarm has searched so far, and w is the inertia weight. In this paper, the linear decreasing weight is used, namely, w max − ((t * (w max − w min ))/t max ), where w max represents the maximum value of inertia weight, w min represents the minimum value of inertia weight, t represents the current number of iterations, and t max represents the maximum number of iterations. is principle is still used in binary PSO algorithm. r 1 and r 2 are two randomly generated acceleration weight coefficients between [0, 1], c 1 and c 2 are acceleration factors, and the value 2 is taken in this paper [24]. ere are three parts in the velocity updating formula of particles. e first part is inertia or momentum, which reflects the movement habit of particles, and represents the tendency of particles to maintain their previous velocity. e second part is the cognitive part, which reflects the particle's memory or recall of its own historical experience, and represents that the particle tends to approach the optimal position of its own history. e third part is the social part, which reflects the collective historical experience of cooperation and knowledge sharing among particles, and represents the tendency of particles to approach the optimal historical position of the community.

Binary Particle Swarm
Optimization Algorithm In the binary particle swarm optimization (BPSO) algorithm, the velocity update equation has not changed, but a new velocity transfer function has been introduced to map the original continuous search space to the binary search space. e transfer function concept was originally proposed by Kennedy and Eberhart [11], which allows PSO algorithm to run in the binary searching space. In this version, particles can only be zero or 1 by taking their position vector. e effect of velocity is to indicate the probability that the bits take 0 or 1, so they propose a Sigmoid transfer function, as shown in equation (2), which can convert all real values of velocity into probability values [0, 1]: where v k i (t) represents the velocity of particle i at iteration t in k dimension.
After converting the velocity to a probability value, the position vector can be updated with the probability of its velocity by where v k i (t) represents the velocity of particle i at iteration t in k dimension. e flowchart of BPSO algorithm is shown in Figure 1. According to the experimental analysis, the original BPSO has some shortcomings, such as premature convergence and easy to fall into local optimal, so it has been continuously improved since BPSO was proposed. In 2008, Lee et al. proposed another modification of BPSO algorithm [25], which allows the continuous update velocity and position of PSO algorithm. In this improvement, they replace the velocity with the displacement in the transfer function. e probability formula is described as follows: where x k i (t) represents the position of particle i at iteration t in k dimension. e corresponding position updating formula is defined as follows: where x k i (t) represents the position of particle i at iteration t in k dimension.
is transfer function is named as S-shaped transfer function, and a set of S-shaped transfer functions are formed by changing parameters, whose expressions and graphs are shown in Table 1 and Figure 2, respectively [24]. It can be seen from Figure 3 that the velocity value of s 1 is larger than that of s 2 , and the saturation speed is also accelerated. Similarly, when the speed becomes smaller, as shown in s 3 and s 4 , the saturation speed will decrease. To sum up, the change probability of position vector increases with the increase of slope of these functions. erefore, when the velocity is the same, the probability value returned by s 1 is the largest. In the following Section 5, the influence of different slopes on solving the function optimization problem will be studied.

Swarm initialization
Update speed according to equation (1) The probability of a change in the position vector element is calculated according to equation (4) Update the elements of the position vector according to the rules in equation (5) Terminating conditions satisfied End Y Figure 1: Flow chart of BPSO algorithm.
Computational Intelligence and Neuroscience 3 In 2009, Rashedi et al. proposed a new transfer function named as V-shaped transfer function and a new position update strategy [26]. e formula is described as follows: where x k i (t) represents the velocity of particle i at iteration t in k dimension and (x k According to the characteristics of V-shaped transfer function, a series of V-shaped transfer functions are proposed by using different functional equations, whose expressions and graphs are shown in Table 2 and Figure 3, respectively. According to Figure 3, this function is a symmetric function. When the absolute value of velocity is larger, the probability of particle position change is higher. For different V-shaped functions, it is easy to find that when the slope of the function is higher, the probability of the particle position change is higher. In other words, when the velocity is constant, the function with higher slope has a higher probability of the returned particle change. Similarly, the influence of different slopes on the processing of function optimization problems will be analyzed in Section 5.

Improved Binary Particle Swarm Optimization Algorithm
Based on the characteristics of binary particle swarm optimization algorithm, the continuous search space is mapped to the discrete binary space. e purpose of the transfer function is to represent the probability that the element of the position vector goes from 0 to 1, so the transfer function must be a bounded function of [0, 1]. In addition, when the velocity value is 0, the probability of change should be relatively small because when the particle finds the optimal value, the velocity should be reduced to 0, and the probability of the position change of the particle should be 0. According to the characteristics of transfer function, a new Z-shaped transfer function is proposed, which is defined as follows: where x k i (t) represents the velocity of particle i at iteration t in k dimension and a is a positive integer. By changing the value of a, a set of Z-shaped function families is obtained, whose expressions and figures are shown in Table 3 and Figure 4, respectively.
As shown in Figure 4, the mapping function is an asymmetric mapping function. e asymmetric mapping function basically satisfies the absolute value of the velocity to determine the mapping probability of the particle position vector variation, so the convergence speed is fast. When the parameter Di m particle � Di m Function × 15 changes, the slope of the function also changes. e larger Di m particle � Di m Function × 15, the smaller the slope of the function. at is to say, when the speed is the same, the probability that the returned particle position of the parameter Di m particle � Di m Function × 15 is small changes is larger.

Selection of Test Functions.
e process of mapping continuous search space to discrete search space using the    [24].
proposed transfer function is shown in Figure 5. To represent each continuous variable in binary, 15 bits are adopted. It should be noted that each function variable retains a bit of its sign. erefore, the particle size is calculated by According to equation (8), when the test function has 5, 10, and 30 dimensions, the corresponding particle sizes are 75, 150, and 450, respectively. In order to evaluate the improved BPSO algorithm based on the Z-shaped transfer functions, the simulation experiments were carried out by using the nine benchmark functions proposed in the CEC special conference. e expressions of the benchmark functions and the three-dimensional graphics are shown in Table 4 and Figure 6, respectively.

Performance Comparison of Z-Shaped Transfer Functions.
In order to test the performance of the Z-shaped transfer function, the parameters of the Z-shaped transfer function are set as 2, 5, 8, and 20, respectively, and the influence of different parameter settings on the simulation experiments is analyzed. In order to further verify the optimization accuracy of Z-shaped transfer function, each test function was run 10 times, and the best, worst, average, and STD values of 9 functions in 5 and 30 dimensions were recorded, respectively. e maximum number of iterations is Max iter � 500. e simulation results of D � 5 and D � 30 are shown in Figures 7 and 8, respectively, and the statistical results are shown in Tables 5 and 6, respectively. It can be seen from Figure 7 and Table 5 that when the test functions have 5 dimensions, changing the parameters has no effect on the final convergence results, and the final convergence results are the same. However, the rate of convergence will be different. In the function convergence curves, it can be seen that increasing the value of parameters can improve the convergence speed of the algorithm, but it is not the case that the larger the parameters are, the faster the convergence speed will be. In the convergence curves of F 1 , F 2 , F 3 , F 7 , and F 9 , the transfer function whose parameter is set to 20 has the fastest convergence speed. In the convergence curves of F 4 , F 5 , and F 8 , the transfer function with parameter set to 8 has the fastest convergence speed.
It can be seen from Figure 8 and Table 6 that when the test functions have 30 dimensions, changing the size of parameters has no obvious influence on the convergence speed of the algorithm, but has an influence on the final convergence result. In the functions F 1 , F 2 , F 3 , F 4 , F 5 , F 7 , F 8 , and F 9 , the parameters are set to 5, 8, and 20, and the effect is better when the parameter is 2, that is to say that increasing the parameter can improve the accuracy of the algorithm. However, when the parameters are set to 5, 8, and 20, the results are the same. at is to say, it is not the case that the larger the parameters setting, the better the performance. When the parameters are set to a certain size, increasing the parameters will not improve the accuracy of the algorithm.

Test Function Results and Analysis.
To further investigate the validity of the Z-shaped transfer function, the Z-shaped transfer function is compared to the S-shaped and the V-shaped transfer function. rough the above analysis, it can be concluded that when the parameter of the Z-shaped transfer function is set to 5, the convergence precision and convergence speed are optimal. erefore, in this set of simulation experiments, the parameter of the new Z-shaped transfer function is set as 5, the selected 12 test functions have 10 dimensions, and the maximum number of iterations is 500. e simulation results and numerical analysis are shown in Figure 9 and Table 7, respectively.
It can be seen from the convergence curves that the proposed new transfer function improves the convergence speed of the algorithm. According to the data shown in Table 7, the new transfer function improves the accuracy of the BPSO algorithm. In particular, for functions F 1 , F 2 , F 3 , and F 7 , the optimal value of the function can be accurately derived. Similarly, for functions F 8 , the accuracy is 15 orders of magnitude higher than other transfer functions. For the composite functions F 10 ∼ F 12 , BPSO10 improves the convergence accuracy and convergence speed of the algorithm, but the optimal value of the function  Computational Intelligence and Neuroscience cannot be found, which will be the focus of future research and learning. In other functions, it also improves the convergence speed and convergence precision of the algorithm compared to other transfer functions.

Nonparametric Test Analysis.
In order to verify the stability of the algorithm, we perform a nonparametric test on the optimal value of the test function. In this work, Wilcoxon rank sum test [27] is used as a nonparametric statistical test to determine the importance of the results. Table 8 depicts the 5% p value obtained from this test. It can be seen from Table 8 that the p values for all test functions are much less than 0.05, highlighting the significant advantages of BPSO10 over other versions of the binary particle swarm algorithm based on the p value (less than 0.05) algorithm.

Comparison with Other Versions of Binary Particle Swarm
Algorithms. In order to further investigate the effectiveness of the transfer function, this paper compares the test results of BPSO10 with other recent binary particle swarm versions. Firstly, it was compared with the binary algorithm (BPSOGSA) proposed by Mirjalili et al. [28] based on particle swarm optimization algorithm and gravity search algorithm. e dimension of the test function was 5, and the comparison result was shown in Table 9. At the same time, it also proposed binary hybrid topology particle swarm optimization (BHTPSO) and binary hybrid topology particle swarm optimization quadratic interpolation (BHTPSO-QI), proposed by Beheshti et al. [29], and swarm optimization algorithm based on genetic algorithm is put forward by the quantum-behaved particle swarm optimization (SOGA) by Sun et al. [30] are compared. e dimension of the test    Table 10.
It can be seen from the data in Tables 9 and 10 that when the test function is 5 or 8 dimensions, the test results of the newly proposed z-type transfer function are significantly higher than those of BPSOGSA, BHTPSO, BHTPSO-QI, and SOGA proposed in recent studies. In particular, in the test functions F 1 , F 2 , and F 3 , BPSO10 can still accurately find the optimal value, and the STD data shows that the value is 0, indicating that the algorithm is very stable and has strong robustness. Among other test functions, BPSO10 also improves the optimization accuracy of the algorithm to varying degrees. erefore, the newly proposed z-type transfer function has good optimization ability.   All settings are the same as F 10 Where a is x's integral part and b is x's decimal part.  1.5 Parameter space  Parameter space x 1

Conclusions
In this paper, a new Z-shaped transfer function is proposed to improve BPSO algorithm. e simulation results on three sets' data show that the newly proposed Z-shaped transfer function improves the convergence speed and convergence precision of BPSO algorithm. In addition, by changing the slope of the Z-shaped transfer function, it is found that when the test function dimension is low, the slope has no effect on the final convergence result, but it will affect the convergence speed. When the test function dimension is high, the slope has no effect on the convergence speed. However, it will affect the convergence result. Combined with three sets of experiments, it is found that when the parameter is set as 5, the convergence speed is the fastest and the precision is highest. In the future research, BPSO algorithm can be improved by using the new transfer function as a direction of exploration. In addition, certain family functions with different slopes are used for comparative study to find the optimal algorithm.

Data Availability
ere are no data available for this paper.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this article.

Authors' Contributions
Sha-Sha Guo participated in the data collection, analysis, algorithm simulation, and draft writing. Jie-Sheng Wang participated in the concept, design, interpretation, and commented on the manuscript. Meng-Wei Guo participated in the critical revision of this paper.