Abstract

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.

1. Introduction

The 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 [810]. However, many optimization problems have binary searching space, so it is necessary to develop binary optimization algorithm to solve them.

The 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. The 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. The 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. The 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. This 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). This method estimates the continuous and valuable update of the wolves to the global optimal solution, followed by the sigmoid transformation. The 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. They introduced three variants of BWOA, using a hyperbolic function, an inverse tangent function, and a sigmoid transfer function, respectively. The 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.

This 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. The simulation results show that the new transfer function improves the convergence speed and optimization precision of the algorithm. The 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.

2. Particle Swarm Optimization Algorithm

The 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 , 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. Then, the particle follows the current optimal particle to search in the solution space.

The particle’s velocity and position are updated bywhere is the velocity of the th particle in the th dimension, is the optimal position of the th particle so far, is the position of the current th particle in the th dimension, is the optimal position that the particle swarm has searched so far, and is the inertia weight. In this paper, the linear decreasing weight is used, namely, , where represents the maximum value of inertia weight, represents the minimum value of inertia weight, represents the current number of iterations, and represents the maximum number of iterations. This principle is still used in binary PSO algorithm. and are two randomly generated acceleration weight coefficients between [0, 1], and are acceleration factors, and the value 2 is taken in this paper [24].

There are three parts in the velocity updating formula of particles. The first part is inertia or momentum, which reflects the movement habit of particles, and represents the tendency of particles to maintain their previous velocity. The 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. The 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.

3. 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. The 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. The 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 represents the velocity of particle at iteration in dimension.

After converting the velocity to a probability value, the position vector can be updated with the probability of its velocity bywhere represents the velocity of particle at iteration in dimension.

The 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. The probability formula is described as follows:where represents the position of particle at iteration in dimension.

The corresponding position updating formula is defined as follows:where represents the position of particle at iteration in dimension.

This 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 is larger than that of , and the saturation speed is also accelerated. Similarly, when the speed becomes smaller, as shown in and , the saturation speed will decrease. To sum up, the change probability of position vector increases with the increase of slope of these functions. Therefore, when the velocity is the same, the probability value returned by is the largest. In the following Section 5, the influence of different slopes on solving the function optimization problem will be studied.

In 2009, Rashedi et al. proposed a new transfer function named as V-shaped transfer function and a new position update strategy [26]. The formula is described as follows:where represents the velocity of particle at iteration in dimension and is the complement of .

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.

4. 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. The 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 represents the velocity of particle at iteration in dimension and is a positive integer. By changing the value of , 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. The 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 changes, the slope of the function also changes. The larger , the smaller the slope of the function. That is to say, when the speed is the same, the probability that the returned particle position of the parameter is small changes is larger.

5. Simulation Experiments and Result Analysis

5.1. Selection of Test Functions

The process of mapping continuous search space to discrete search space using the 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. Therefore, 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. The expressions of the benchmark functions and the three-dimensional graphics are shown in Table 4 and Figure 6, respectively.

5.2. 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. The maximum number of iterations is . The simulation results of and 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 , , , , and , the transfer function whose parameter is set to 20 has the fastest convergence speed. In the convergence curves of , , and , 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 , , , , , , , and , 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. That 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.

5.3. Performance Comparison of Z-Shaped, S-Shaped, and V-Shaped Transfer Functions
5.3.1. 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. Through 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. Therefore, 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. The 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 , , , and , the optimal value of the function can be accurately derived. Similarly, for functions , the accuracy is 15 orders of magnitude higher than other transfer functions. For the composite functions , BPSO10 improves the convergence accuracy and convergence speed of the algorithm, but the optimal value of the function 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.

5.3.2. 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% value obtained from this test. It can be seen from Table 8 that the 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 value (less than 0.05) algorithm.

5.4. 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. The 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. The dimension of the test function was 8 dimensions, and the comparison result is shown in 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 , , and , 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. Therefore, the newly proposed z-type transfer function has good optimization ability.

6. Conclusions

In this paper, a new Z-shaped transfer function is proposed to improve BPSO algorithm. The 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

There are no data available for this paper.

Conflicts of Interest

The 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.

Acknowledgments

This work was supported by the Basic Scientific Research Project of Institution of Higher Learning of Liaoning Province (Grant no. 2017FWDF10) and Project by Liaoning Provincial Natural Science Foundation of China (Grant no. 20180550700).