A Species Conservation-Based Particle Swarm Optimization with Local Search for Dynamic Optimization Problems

In the optimization of problems in dynamic environments, algorithms need to not only find the global optimal solutions in a specific environment but also to continuously track the moving optimal solutions over dynamic environments. To address this requirement, a species conservation-based particle swarm optimization (PSO), combined with a spatial neighbourhood best searching technique, is proposed. This algorithm employs a species conservation technique to save the found optima distributed in the search space, and these saved optima either transferred into the new population or replaced by the better individual within a certain distance in the subsequent evolution. The particles in the population are attracted by its history best and the optimal solution nearby based on the Euclidean distance other than the index-based. An experimental study is conducted based on the moving peaks benchmark to verify the performance of the proposed algorithm in comparison with several state-of-the-art algorithms widely used in dynamic optimization problems. The experimental results show the effectiveness and efficiency of the proposed algorithm for tracking the moving optima in dynamic environments.


Introduction
As a very challenging optimization tool, evolutionary algorithms (EAs) have been successfully applied to the optimization problems in static environments. Nevertheless, EAs have not been effectively used to solve optimization problems in dynamic environments, which are very common in many real-world applications, for example, the changes of vehicle routing due to the temporary traffic control or sudden changes in weather, the newly added artefacts in production scheduling, and uncertain market factors lead to changes in financial trading models. In these complex real-world problems, its constraints and coefficients or even objectives may vary with time.
e problems with these characters can be modelled as dynamic optimization problems (DOPs). In DOPs, the worse candidate solutions in the past can be the optimal solutions in the new environment, and vice versa. e development of solution strategies in the area of EAs that may work in such uncertain environments raises new challenges.
In static environments, the goal is to find a single optimum or multioptima in the search space. However, in dynamic environments, the goal of the algorithms is no longer to locate the optimal solution, but to continuously track the moving optimum as closely as possible. Many researchers have introduced various strategies into canonical EAs to enhance their ability for tracking changing optima. In static optimization, convergence is a positive factor for the algorithms to locate the global optimum; however, it may weaken the ability of the algorithm to find the moving optimum in a later evolving process because of the diversity loss. In order to increase or maintain the population diversity, researchers have developed many schemes to enhance the canonical EAs' ability to locate moving optimum in dynamic environments. e simplest method of solving DOPs is to regard each change as the new optimization and reinitialize the population. However, in real-world applications, most of the environmental changes may not be too drastic, and the new optimum will be in some sense related to the historical optimal solutions [1]. In that case, saving the old optimum according to certain strategies is beneficial to the optimization in the new environment. us, the memory-based scheme is a widely used method adopted in DOPs [2][3][4]. In [2], the authors combined the multipopulation scheme and an improved memory strategy, which is saving the elite individual retrieved from each subpopulation, to enhance the exploration ability of the algorithm. In [4], a similar technique as [2] is used for the optimization of DOPs.
A similar scheme to memory named species is also a commonly used technique by EAs' community [5]. Speciesbased EAs are often regarded as a kind of multiswarm algorithm. It preserves the candidate solutions distributed in the search space according to a predefined radius, and after the evolution in each generation, the saved species seeds are either replacing the worse individual, if there has an unprocessed individual within the search radius, or replacing the worst unprocessed individual in the current population, if there is no solution within the search radius [6]. Many experimental results have shown that multiswarm strategy is helpful in locating multiple optima in multimodal optimization problems, and some researchers have extended this strategy to DOPs and achieved a good performance in locating and tracking the moving optimum [7,8].
In EAs' community, there are two well-known strategies, which are also commonly adopted in the optimization of DOPs to promoting diversity of the population, named hypermutation [9] and random immigrants. Hypermutation increases population diversity by drastically increasing the mutation rate as the environment changes, and random immigrants strategy replaces a fraction of EAs' population at each generation. e selection of individuals to be replaced often has two ways: one is randomly selected to be replaced and this way seems to be losing the good candidates in some cases, and another one is replacing the worst individuals in the current population.
Particle swarm optimization (PSO) [10] is a populationbased stochastic optimization algorithm; it can be considered as one of the most popular nature-inspired metaheuristics for continuous optimization, which was first developed by Eberhart and Kennedy in 1995. Due to its simple concept and easy implementation, PSO has been developed rapidly in the last two decades [11]. PSO has been widely used in the optimization in static environments, and many important research studies have been achieved [12][13][14]. In recent years, with more and more attention being paid to the research area of DOPs, PSO has been widely applied to the optimization of DOPs.
According to the characteristics of DOPs, and the commonly adopted strategies introduced mentioned above, we observed that the population diversity and historical information play an important role in the optimization of DOPs. Motivated by these observations, a species conservation combined with a spatial neighbourhood best searching strategy is integrated into canonical PSO (denoted as sslPSO) during the evolutionary process, to strengthen the exploration and exploitation ability of the PSO. In each iteration, in order to mitigate the loss of population diversity, the best individual in each subswarm is archived, and then, these species seeds are transferred into the next generation. Experiments on a commonly used benchmark of moving peaks benchmark (MPB) are carried out to investigate the effect of our proposed algorithm. e experimental results show that the proposed algorithm has a promising performance in solving the DOPs. e primary contribution of sslPSO is an enhanced species conservation, which uses species conserving during the environmental change period; at the same time, the spatial neighbourhood searching is introduced in the updating procedure. e comparison results indicate that the introduction of species conservation is beneficial for the tracking of moving optima in dynamic environments. Meanwhile, the spatially local best searching in the updating of position ensures the algorithm's high exploration ability while maintaining high exploitation ability. e rest of this paper is arranged as follows. In Section 2, the canonical PSO and its application in DOPs and some related works included in this study are briefly reviewed. e proposed sslPSO algorithm is described in detail in Section 3. Section 4 compares the sslPSO with other state-of-the-art algorithms widely used in DOPs which are presented to show the effectiveness and efficiency of the proposed algorithm. Finally, Section 5 concludes the study and outlines future work.

Background and Related Works
In this section, we first give a brief description of the definition of DOP. After that, the PSO framework and its application in DOPs and the need of species in dynamic environments are given briefly.

DOP.
Dynamic optimization problems are optimization problems in which one or more of its problem parameters, such as objective function, constraints, or environmental coefficients, may change over time. e dynamic character of the problem makes the optimization procedure much more complicated than the static optimization problem.
A DOP can be defined in general as follows: where f(x, t)is the objective function of the problem. x is the decision vector of Ddimensions in the search space, and g i (x, t) and h j (x, t) denote the ith inequality constraint and jth equality constraint of the problem, respectively. Both of them may vary during the evolutionary process for specific change type in real-world applications. In our study, we only consider the dynamic optimization without any dynamic constraints.

Particle Swarm Optimization (PSO).
In a PSO algorithm, each particle i is a potential solution in the D-dimensional search space. e position of ith particle in a population with N individuals (X 1 , X 2 , . . . X N ) can be represented by X i � (X i1 , X i2 , . . . , X i D ), and the velocity of this particle is represented by V i � (V i1 , V i2 , . . . , V iD ). In a commonly used update model, each particle is updated by two best solutions, P i � (P i1 , P i2 , . . . , P i D ), the best position of particle i it has experienced, and P g � (P g1 , P g2 , . . . , P gD ), the best position discovered so far by all particles. At the beginning, N particles are randomly generated over the search space. en, all particles search for the optimum by fly over the search space, until the global optimal position is found. At each iteration, the new velocity and position of each particle can be updated according to its current velocity and position as follows [10]: where ω is a parameter used to control the influence degree of the previous velocity to the current velocity, which is named inertia weight. c 1 and c 2 are two positive constants balancing the contribution of the particle's own previous best position and the best position the whole swarm had attained. R 1 and R 2 are two D-dimensional random vectors uniformly distributed in the interval U(0.0, 1.0). In the velocity updating procedure using equation (2), all particles are attracted to the best solution (P g (t)) found by all members of the population.
is updating model is typically called global best (denoted as gbest). In the gbest model, every individual learns from its own experience and imitates the very best member found in the population [15]. Another commonly used model is called local best (denoted as lbest). In the lbest network, each individual's movement is attracted by the best performance of its neighbours in a certain range. e determination of neighbours usually has two ways: one is determined according to the index which is randomly assigned at the initialization step and keeps constant in the whole evolution process; the other is determined on the basis of spatial distance between particles (the difference between these two structures will be described in detail in Section 3). e gbest model is generally considered to have a faster convergence rate; in the meantime, it would be more likely to get stuck in local optimal solution. e lbest model, however, is converged slower with less likely to be trapped into the local optimum than that of gbest model. e PSO algorithm repeatedly applies the update procedure until the maximum evaluations are reached. e pseudocode of the canonical PSO algorithm is described in Algorithm 1.

PSO in Dynamic Optimization Problems.
e application of PSO to dynamic optimization problems has been widely studied in recent years [5,[16][17][18][19][20]. Similar to other EAs, there are two key facts that must be faced in the application of PSO to dynamic environment: one is the outdated memory, and the other is the loss of diversity [18]. Most of the existing research studies introduce various strategies into canonical PSO to overcome these two problems. When a new environment comes, the previous best location visited by the particle becomes outdated. In this case, a simple and effective response is to recalculating the fitness value of the objective function of each particle. However, in real-world applications, most of the environmental changes are usually not dramatic. When the dynamic problem changes periodically or recurrently, it might be helpful to reuse previously found solutions to reduce the computation times [21]. Many researchers adopt various strategies to save redundant information to the memory particles for later use in case of environmental changes. In [22], a triggered memory scheme is proposed, in which the best individuals found by the "explore" population are stored in the memory, and two memory retrieval schemes, named memory-based resetting and memory-based immigrants, are adopted to retrieve memory when environmental change is detected. Zhu et al. [4] propose a new memory scheme with a large memory capacity to improve the performance of multipopulation algorithms for DOPs.
In dynamic optimization, convergence is unfavourable to the performance of the algorithms. erefore, many researchers have introduced various schemes into canonical PSO to maintain or increase the diversity of the population during evolution. Inspired by the movement of atom, Blackwell et al. [23,24] proposed charged PSOs to maintaining diversity in the solving of DOPs. Multiple swarm/ population methods are often considered as another effective strategy for increasing population diversity in the optimization of DOPs. In [25], the authors proposed two multiswarm paradigms of particle swarms and verified the effectiveness on a widely used moving peaks benchmark. Li et al. [8] proposed an adaptive multiswarm optimizer to enable adaptively to change the number of populations in dynamic environments.

e Need of Species Conservation.
In biology, species are a group of creatures with similar characteristics; similarly, in EAs' community, a species represents a collection of individuals with common characteristics. In all similarity measurements, the Euclidean distance is the most commonly used similarity measurement. e smaller the distance between two individuals, the more similar they are. e distance between two individuals X i � (X i1 , X i2 , . . . , X iD ) and X j � (X j1 , X j2 , . . . , X jD ) is defined as follows: Computational Intelligence and Neuroscience In this paper, the above definition of distance is used to measure the similarity between two individuals. Figure 1 illustrates the need for species conservation during evolution. As Figure 1 shows, after some iterations of the EA, most of the individuals have converged on peak S 1 , and at the same time, an individual X 3 with low fitness has emerged. Because of its low fitness, the individual X 3 will have a high probability of being eliminated in the next generation. However, this individual is very important in the multimodal optimization problems that need the algorithms to find all the optima, or in dynamic optimization problems that need the algorithms to track the moving optima. In order for the individual to survive in the next generation, this individual must be preserved. e species conservation procedure is described in Algorithm 2.

The Proposed Algorithm
Our proposed algorithm, denoted by sslPSO, takes advantage of the memory strategy to enhance the tracking ability of the PSO in dynamic environments. After initialization, the proposed enhanced species conservation-based PSO algorithm conducts the main loop with four main stages: species determination, particle update, seeds conservation, and particle attractor and swarm attractor update. ese stages are briefly described as follows.
e species-based scheme is introduced into the multimodal optimization or dynamic optimization [17], in which the whole population is divided into several species according to their similarity. In the later of the evolution process, most individuals are concentrated in a few optima, resulting in too large number of individuals in the corresponding species and a rapid decline in population diversity.
us, a mechanism for preventing too many individuals following a single peak is needed for the algorithm to track the moving optima. As in [17], a parameter PS max is also introduced in our study. If the number of particles in a species exceeds PS max , only the pre-PS max fittest particles are retained in the species, and the remainder will be randomly reinitialized, thus to maintain the population diversity during the evolution.
Following the species determination, the update procedure is applied. In this study, an improved lbest-based update strategy is introduced. In the usual lbest topology, each particle is affected by the best performance of its r immediate neighbours. However, the vector indices are assigned as their generating order at the initialization step and are kept constant throughout the evolution. e indicesbased neighbours may belong to a different group far apart spatially in the search space, resulting in a degradation of the exploitation ability of the algorithm.
As Figure 2(a) shows, the individuals X 1 , X 2 , X 3 , and X 4 are neighbours to each other, but it can be seen from the figure that some of them are spatially far apart. Take X 1 as an example, if an index-based neighbour is used, then X 2 or X 3 will be selected as the local best particle, and X 1 searches around X 2 or X 3 , resulting in severe decrease in the exploitation ability of the algorithm. Different from the indices-based neighbourhood, we use spatial-based neighbourhood in the update procedure, and the parameter r is renamed as neighbourhood radius and denoted by n r , which is used to search the fittest individual in what range. e determination of local best in n r neighbours is as shown in Algorithm 3. From Figure 2(b), we can see that the update of X 1 is only affected by the individuals around it in a certain range. If the radius is small, i.e., n r1 , then the update of X 1 is affected by 4 individuals (denoted by the solid blue circle); if the radius is further increased, i.e., (n r1 < n r2 ), then the update of the X 1 will be affected by 7 individuals around it. e difference in neighbourhood radius will affect the individual's exploitation ability and exploration ability. If the neighbourhood radius is small, the algorithm's exploitation ability will be higher; otherwise, the algorithm's exploration ability will increase. In dynamic environments, how to achieve a balance between exploitation ability and exploration ability is an important fact for the algorithm to (1) Randomly initialize N particles of population Pwithin the problem's search space; (2) Evaluate each individual in P; (3) for each P i ∈ Pdo (4) P best i � P i ; (5) end for (6) Find the global best particle P best g ; (7) while termination condition is not reached do (8) Apply equation (2) to update each particle's velocity; (9) Apply equation (3) to update each particle's location; (10) Calculate the fitness value of P i ; (11)   Input: species seed set P seeds saved at the species seed determination procedure and the newly generated population P t+1 , species radius δ s . Output: the population after the species conservation procedure.
(1) Mark all individuals in population P t+1 as unprocessed; (2) for all x ∈ P seeds do (3) Select the worst unprocessed individual p x ∈ P t+1 which satisfy d(p x , x) ≤ δ s ; (4) if p x exists then (5) if f(x) is fitter than f(p x ) then (6) replace p x with x; (7) end if (8) else (9) replace the worst unprocessed p x in P t+1 with x; (10) end if (11) Mark p x as processed; (12) end for ALGORITHM 2: e procedure of species conservation. Computational Intelligence and Neuroscience improve its performance. e performance of the algorithm under different neighbourhood radius will be analysed later in this paper.
In order to accelerate the convergence process over an environment period, the inertia weight ω in equation (2) is linearly decreasing from ω max to ω min as follows: where ω max and ω min are the maximum and minimum values of ω, respectively, and E itr is the iteration counter during an environment cycle (in this study, it is assumed that the environmental change cycle is known in advance). Once all the particles are updated, some species may not survive.
us, seeds conservation process is conducted immediately after the update procedure. e species seeds are either copied to the new population or substituted by better samples of the same species.
Algorithm 4 describes the framework of the sslPSO and Figure 3 presents the flowchart of the algorithm.

Experimental Evaluation
In this section, a series experiments are carried out based on the moving peaks benchmark problem to measure the effectiveness of the proposed algorithm (run on an Intel Core i5 4590@ 3.30 GHz processor with 8 Gb RAM on Windows 10 Home Premium 64-bit operation system), and then, the performance of sslPSO is compared with a set of EAs taken from the literature for DOPs. e involved algorithms include CPSO [19], mCPSO [24], mQSO [24], SPSO [26], and rSPSO [27] and canonical PSO. All the results of the peer algorithms presented in this paper are taken from the paper where they were proposed. In the following section, we will introduce the benchmark function adopted in our experiments, as well as the performance measure and parameter settings. Finally, we present the experimental results and analysis.

Benchmark Problem.
e moving peaks benchmark (MPB) was proposed by Branke [28] and has been widely used to test the performance of the dynamic optimization algorithms. Within an MPB problem with N p peaks in a D-dimensional search space, the location, height, and the width of the peaks can be varied at a certain frequency. e form of the canonical MPB is formulated as follows: where W i (t) and H i (t) denote the width and height of peak i at time t, respectively, and X id (t) denotes the dth element of peak i at time t, and X d (t) is the dth element of particle X at time t. e location of each peak is shifted by a vector v of a fixed distance s in a random direction. e parameter s is named as the shift length, which is used to define the change severity of the dynamic problems. e move of a single peak can be defined as follows: where r is a random vector and λ is used to determine the move direction correlated to the previous movement, λ � 0 for a random direction and λ > 0 for a direction related to the previous direction. More formally, a move of a single peak can be denoted as follows: σ ∈ N(0, 1).

Performance Measurement.
Properly measuring the performance of the algorithms is vital in the optimization of DOPs. ere are several most commonly used criteria to evaluate the algorithms in existing studies. Existing performance measures in DOPs can be classified into two main groups: optimality-based and behaviour-based. Interested readers can refer to [21] for a more detailed description. In this study, in order to quantify the performance of the proposed algorithm (sslPSO) within a dynamic environment, and for a fair comparison with the peer algorithms, we (1) Input: particle p i of population P with size N (2) Output: particle p lbest i in the n r neighbourhoods of p i (3) for j ⟵ 1 to N do (4) Calculate Euclidean distance d(p i , p j ), i ≠ j; (5) end for (6) Sort p i 's neighbours set P i rs in ascending order according to the d(p i , p j ); (7) P i rs � p rs 1 , p rs 2 , . . . , p rs N−1 ; (8) Select the formerly ranked n r particles in P i rs ; (9) P r � p rs 1 , p rs 2 , . . . , p rs n r ; (10) Search the local best p lbest i in P r . ALGORITHM 3: e algorithm of spatially neighbourhoods best searching. 6 Computational Intelligence and Neuroscience used the MPB as the test suite, and the offline error measurement is adopted, which is defined as follows: where f k is the best evaluation found by an algorithm right before the kth environmental change, f opt k is the theoretical optimum value of the kth environment, e off is the average of all differences between f opt k and f k over the environmental changes, and N e is the total number of environmental changes in a run.

Parameter Settings.
e default settings of the MPB used in the experiments in this paper are given in Table 1, which are the same as in all the peer algorithms (for SPSO in [26], the authors in [27] tuned the algorithms to optimising this benchmark, and the results are taken from [27]). In Table 1, the term "change of frequency, U" means that for every U fitness evaluation, an environment change will occur.
Initially, P peaks are randomly generated with the given boundaries of position, height, and width as shown in Table 1. e height and width are shifted randomly with the shift severity s in the range H � [30, 70] and W � [1,12], respectively.
In our sslPSO algorithm, the population size is set to 100, and the learning factors c 1 and c 2 are both set to 1.7. e inertia weight ω is initially set to ω max � 0.9 and then decreases linearly to ω min � 0.3 over the entire change cycle. e other parameters are set as follows: the species size is confined to PS max � 10, the species distance σ s is set to 30, the neighbourhood radius is set to n r � 3.0, and the performance with different sizes is also investigated in our study. For each test case, there were N e � 100 environmental changes, which result in N e × U � 100 × 5,000 fitness evaluations in each run. e result of each experiment is the average of 30 independent runs with different random seeds.

Experimental Results and Analysis.
In this section, the performance of sslPSO is investigated in several aspects, including the effect of neighbourhood radius, the effect of (1) Initialize the population P with size N; (2) While stop criterion is not satisfied do (3) Species determination; (4) for all i such that 0 ≤ i ≤ N (5) Search the local best P lbest i with Algorithm 3; (6) Apply equation (2) to update V i (replace P g (t) with P lbest i ); (7) Apply equation (3) to update X i ; (8) end for (9) Seeds conservation; (10) Update each particle's attractor and the population's attractor; (11) Figure 3: Flowchart of sslPSO.
Computational Intelligence and Neuroscience varying the shift severity, and the ability of locating and tracking the moving optima, respectively. Figure 4 presents the offline error achieved by sslPSO on the MPB problem with different neighbourhood radius. From Figure 4, we can see that when the particles learn from only its nearest neighbour (i.e., the neighbourhood radius is set to 1.0), the sslPSO achieved the largest offline error. With the increase of neighbourhood radius, the offline error begins to decrease. When the neighbourhood radius reaches 3.0, the optimal solution obtained is 0.75 and then increases slowly with the increase of the neighbourhood radius. When the neighbourhood radius is equal to the popsize, the lbest model is equivalent to gbest model, and the offline error obtained by the algorithm is 6.56 (not plotted in Figure 4). As can be seen from Figure 4, when the neighbourhood radius is small, the algorithm has a good balance of exploration ability and exploitation ability. As the neighbourhood radius increases, the individual moves closer to the global optima at a faster rate, which weakens the exploration ability of the algorithm. And this is the key issue that needs to be overcome in the optimization problem in the dynamic environments.

Comparison of sslPSO with Peer Algorithms.
In this section, a set of experiments is conducted to compare the performance of sslPSO with peer algorithms on the MPB problems with different settings of the shift severity parameters. Table 2 presents the experimental results regarding the offline error and standard deviation. e experimental results of the peer algorithms are taken from the corresponding research studies, and the parameters are set to the optimal values which enable them to achieve their best performance (e.g., using the optimal configuration of C(70, 3) for CPSO and using the optimal n r � 3.0 for sslPSO).
From Table 2, it can be seen that the results achieved by sslPSO are much better than the results of the other five algorithms on the MPB problems with different shift severities and are better than the results of the CPSO in most cases, or at least as good as CPSO. As we have speculated, the performance obtained by the canonical PSO is the worst among all algorithms, that is, the canonical PSO almost loses the ability to track moving optima in a dynamic   . e offline error of SPSO increases fastest in comparison with the other five algorithms, while the sslPSO and CPSO are two algorithms which are slightly affected by the increase of the shift severity. When the shift severity is set to 0.0, i.e., there is no movement of the peaks, the offline error of the sslPSO achieved the best with 0.65. When the shift severity is set to 1.0, a value setting as most researches adopted, the sslPSO achieved a value of 0.75, which is much better than the other peer algorithms. When the shift severity reaches 6.0, a value which is usually hard for an algorithm to track the moving optima, the offline error of sslPSO is 1.92, which is only slightly higher than that of CPSO, and is much better than the results of the other five algorithms. e results show that sslPSO is very robust to track the moving optima in severely change environments.

Conclusions
Particle swarm optimization algorithms have been widely used in the optimization in static environments, and some promising results have been achieved in recent years when it was applied to address DOPs. For DOPs, in order to effectively track the moving optima in dynamic environments, it is usually important to introduce additional strategies to increase or maintain the population diversity or to effectively use the history optima information in the following evolution.
In this work, a species conservation-based PSO combined with a spatial neighbourhood best searching is proposed for DOPs. In order to effectively track the moving optima in dynamic environments, the previously found optima distributed in the population are reserved according to their dissimilarity based on Euclidean distance and are either preserved or replaced by the better individuals within a predefined range in the following evolution. Experimental results on a commonly used benchmark function for DOPs show that the proposed algorithm can greatly improve the performance of PSO in terms of tracking the moving optima in a dynamic fitness landscape with multiple changing peaks. e performance of sslPSO has good expansibility regarding the change severity in the peaks movement in comparison with other peer algorithms. sslPSO performs much better than mCPSO, mQSO, rSPSO, SPSO, and PSO in tracking the moving optima in dynamic environments with different change severities and is better than CPSO or as good as it in each circumstance. When the change severity is small, sslPSO outperforms all the other peer algorithms. In future work, we will consider using fewer memory optima to reduce the computational complexity caused by the participation of the previous optima in the subsequent evolution; it would also be very interesting to investigate the performance of the proposed technique under different change periods and change peaks, and applying to the real-world application is also a promising direction.

Data Availability
No data were used to support this study.

Conflicts of Interest
e authors declare there are no conflicts of interest regarding the publication of this paper. Computational Intelligence and Neuroscience 9