Simplified particle swarm optimization algorithm

. Real ants and bees are considered social insects, which present some remarkable characteristics that can be used, as inspiration, to solve complex optimization problems. This field of study is known as swarm intelligence. Therefore, this paper presents a new algorithm that can be understood as a simplified version of the well known Particle Swarm Optimization (PSO). The proposed algorithm allows saving some computational effort and obtains a considerable performance in the optimization of nonlinear functions. We employed four nonlinear benchmark functions, Sphere, Schwefel, Schaffer and Ackley functions, to test and validate the new proposal. Some simulated results were used in order to clarify the efficiency of the proposed algorithm


Introduction
In natural systems, we commonly observe mechanisms where natural agents seem to be organized in a rational and ordered way. Social insects, such as ants and bees, are especially interesting examples, and exhibit some remarkable characteristics. Despite the extremely low intellectual capacity of the individuals, the colony can solve surprisingly complex problems while searching for food (DORIGO et al., 1996;KARABOGA;AKAY, 2009;KARABOGA;BASTURK, 2007).
Some of these natural agents are the main inspiration for interesting and powerful algorithms used in the search for optimal solutions of highly non-trivial problems (CHENG et al., 2009;KARABOGA, 2009;KARABOGA;BASTURK, 2007;TOKSARI, 2006;WANG et al., 2007) such as finding the global minimum of nonlinear functions, truss optimization, the classical traveling salesman problem, electric power systems, traffic flow, polymer design, the Schottky-Barrier estimation in diode models and several other applications (ALRASHIDI; EL-HAWARY, 2009;HUANG et al., 2003;MARTINS et al., 2008;TEODOROVIC 2003;). This field of study is known as "swarm intelligence" and has attracted an increasingly number of researchers since the proposal of Particle Swarm Optimization (PSO) algorithm and also of the Ant Colony Optimization (ACO) Algorithm (DORIGO et al., 1996).
In the specific case of PSO, the algorithm can be understood as the application of an updating process on a set of particles which are moving throughout the search space. In the traditional version, each particle is defined by three vectors: the position in the D-dimensional search space x i , the individual best position p i , and the velocity v i . Particles are initialized with random vectors for initial positions and initial velocities. At each step, velocities and positions of the entire swarm are updated accordingly with the rules described as follows. PSO Algorithm -the updating process for each time step t do for each particle I in the swarm do update position x i using calculate particle fitness f(x i ) update p i and p g end for end for where: c is a constant with the value of 2.0, e 1 and e 2 are random numbers and p g is the best position of the neighbors of the particle.
The main simplification was done by suppressing the velocity updating present in the original PSO. In this way, we may save some computational effort and obtain a reasonable performance (i.e. in comparison to that from the PSO) in the optimization of nonlinear functions. Furthermore, the implementation of the algorithm described in the next section is straightforward, making it easy to work with.

Simplified Particle Swarm Optimization algorithm
The proposed algorithm, which is presented in Figure 1, can be understood as a simplified version of the PSO algorithm and can be used to find the global minimum of nonlinear functions. Initially, a swarm of particles is defined, then they are randomly distributed over the search space, and an updating strategy is applied at each step in order to define the new positions of the particles. This updating process is made accordingly to the relation given by the Equation 1: where: x i represents the position vector of particle i, R is a Random number between -1 and +1, w i is a vector pointing the direction of the line joining the point "i" and x Global and with size |w| = (domain size)/(number of particles). S i is determined accordingly with the relative position of the particle and the best result obtained until that moment in the simulation, which is called x Global and calculated by equations (2a), (2b) and (2c), as follow: The calculation of S i has fundamental importance on the proposed algorithm, since it is the feature that makes the particles move in a non-symmetric way. The updated position tends to be located closer to the global solution than its predecessor. This behavior allows a fast concentration of particles around the "instantaneous" best solution until the maximum number of iterations is reached, or until a new best solution (x best ) is found. Thus, this "directed random walk" near x best can rapidly improve the obtained solution when it is not the global minimum yet.

Algorithm test and validation
The aim of the test and the validation step is to discuss the effect of the size of the swarm (or colony) proposed algorithm on the performance in the search for a global minimum of a nonlinear function. In this way, since the main interest is the optimization of functions, it is necessary to define some nonlinear benchmark functions to compare the obtained results with previous studies (KARABOGA; BASTURK, 2007;TOKSARI, 2006  The benchmark nonlinear functions constructed by analytical expressions (presented in Table 1) are shown in Figure 2. These functions, considered objective functions, were generated using the proposed ranges, also presented in Table 1.
Actually, the idea of some kind of asymmetric sorting for the direction of the next step is the central feature of the algorithm. In this way, the asymmetry can be described as an "attraction", or a scent comparing with ant's and bee's algorithms. The exclusive source of this scent will always be the best solution found until that moment in the simulation, and this source changes readily when the better solution is improved.

Results and discussion
Several tests were carried out in order to compare the performance of the proposed algorithm with the well known ACO (Ant Colony Optimization) and ABC (Artificial Bee Colony) algorithms. For this, a computational code was developed using the Fortran 90 Programming Language. This software makes it possible to test the proposed algorithm on the task of finding the global minimum from some benchmark functions, as presented in Table 1. In Figures 3 to 6, we present the results for the global minimum search, using the benchmark functions shown in Table 1. In these graphs we have the mappings of the evolution of the global minimum results (y axis) as a function of the number of iteration cycles (marked on the x axis). Besides that, we may observe that as colony size increases, the convergence of the global minimum result becomes faster. Actually, for colonies with a number of particles higher than a given number, which depends on the function considered, the global minimum found can be orders of magnitude smaller than before. On the other hand, when the colony size is larger than the critical size, increasing it will not improve significantly the performance. This last characteristic evidenced that the analysis of these "size-effects" can be an important task while evaluating the performance of a new algorithm, and that tests could be done using colony sizes that optimize the performance for the specific problem. In the Table 2, we may compare numerical results obtained through the simulations carried out with the benchmark functions. The simulations of figures 3 to 6 were chosen to represent typical results for specific parameters. Several tests were accomplished using different seeds for the random number generator in order to ensure that the results shown are typical, instead of pathological ones.

Conclusion
A simplified version of the PSO algorithm was presented. The version proposed here is very simple to implement and the performance is comparable to other "colony" algorithms.
Four nonlinear "benchmark" functions were selected to test the algorithm in the search for the global minimum. This kind of test is of great importance in the case of functions, such as Schwefel, Ackley and Schaffer functions, which Acta Scientiarum. Technology Maringá, v. 34, n. 1, p. 21-25, Jan.-Mar., 2012 present serious difficulties to have their global minimum "revealed" by traditional methods. Moreover, there is an optimal size (i.e. number of particles) for the colony that optimizes the convergence and provides great precision for the global minimum localization.
The results shown here, despite their simplicity, indicate that even simple algorithms can obtain good performance while solving non-trivial problems. Other aspect is the simple implementation, which makes it good as a "first trying" algorithm, at least when proving the power of swarm algorithms.