## 2 Materials and Methods
### Particle Swarm Optimization (PSO)  
Metaheuristics are problem-independent (stochastic optimization) techniques [26]. They are strategies that guide the search process, for an efficient exploration of the search space, for finding near-optimal solutions. Metaheuristic algorithms are approximate and usually non-deterministic, and they usually find \"good\" solutions in a \"reasonable\" amount of time [27]. Their advantage is that they are noise tolerant; they do not need the source code of the evaluation simulation, which can be used as a black box.  
Swarm Intelligence (SI) comprises a class of novel population based intelligent metaheuristics, inspired from the emergent intelligent behavior of flocks of birds, fish, ants, immune system, bacteria, etc. In such collectivities, social interactions lead to complex social behavior, and that behavior is modified in dynamic environments. Particle Swarm Optimization (PSO) represents a branch of algorithms of SI, which implements a computational model for social learning [28]. The algorithm works with a population of particles (swarm) that, initially, are randomly generated throughout the search space of the problem. The particles are evaluated against a fitness function, each of them searching for locations in the fitness landscape with better fitness values. Each particle has neighbors, with which it exchanges information, and which are dictated by the representation of the particle and the neighborhood topology.  
The PSO algorithm consists in a swarm of particles that move in a (multidimensional) search space. Each particle has a position x, a speed \(v\), a memory of its most recent success (pbest--personal best--the position where the particle has obtained the best fitness) and a memory of the best neighbor (gbest--global best--the particle with the best neighbor in the neighborhood). The particles' speed and positions are updated after each iteration, according to the following equations:  
\[v[t+1]=w_{1}v[t]+w_{2}\text{rand}()+w_{3}\text{rand}(\text{gbest}-x) \tag{12}\]  
\[x[t+1]{=}\ x[t]+v[t+1] \tag{13}\]  
The parameters that appear in Equation (5) are:  
* \(w_{1}\) the inertia weight, which forces the particle to move in the same direction; it balances exploration and exploitation. When \(w_{1}\) is high, PSO is focused on the search space's exploration. When \(w_{1}\) is small, PSO focuses on exploitation rather than on exploration. Scenarios in which \(w_{1}\) decreases in time are usually used;
* \(w_{2}\) and \(w_{3}\) the learning factors--they are weights of the acceleration that attracts the particle towards its personal best position or the global best position. \(w_{2}\) is the cognitive learning factor, that suggests the tendency to repeat personal actions that proved more successful, while \(w_{3}\) is the social learning factor--a measure of the tendency to follow the success of the best individual from its neighborhood.  
After updating the speed, a speed limitation rule is usually applied, to prevent the particles from moving chaotically in the search space:  
\[v[t+1]=\text{max}(-v_{\text{max}},\ \text{min}(v_{\text{max}},v[t+1]) \tag{14}\]  
where \(v_{\text{max}}\) is a parameter of the algorithm.  
The basic structure of the PSO Algorithm 1 is the following:  
```
1:t = 0;
2:Create the initial swarm P(0)
3:repeat
4:Evaluate particles in P(t) using the fitness function
5: Update pbest for each particle
6: Update gbest
7:t = t + 1;
8:foreach particle in P(t)
9: Update its speed using Equation (12)
10: Update its speed using Equation (14)
11: Update its position using Equation (13)
12:endforeach
13:until stopping criterion is met
```  
**Algorithm 1**