## 2 PSs Siting and Timing: Technical Background and Problem Formulation
### Particle Swarm Optimization (PSO)  
PSO, part of the swarm intelligence family, was developed by [PERSON] and [PERSON] in 1995 [23]. Initially, it was structured to determine mass behavior; however, programmers noted its potential for solving many optimization problems. PSO allows solving a problem through the concept of particles represented by insects, birds, and other organisms. Particles usually travel in big groups to search for food. Similarly, PSO emulates this behavior as it initializes a population with several particles that move in the space of solutions. Movement velocity, or the capability to jump from one solution to another to get the optimal (or close to it) value, depends on how the PSO has been programmed. There are two determining factors to the orientation of each particle. The first is own experience, denominated as the local best \(p_{i}^{best}\), which is the best-encountered solution by the particle \(i\). The second is the global experience, denominated as global best \(g_{best}\), which is the best solution obtained so far by any particle in the population. PSO was first designed for continuous problems, but the authors also developed a binary to solve noncontinuous optimization problems, such as PSs location or distribution feeder reconfiguration. PSO works as follows; see Figure 2:  
1. Initialize a population of \(n\) particles with random positions \((x_{i}(t);y_{i}(t))\) and velocities \(\big{(}v_{xi}(t);v_{yi}(t)\big{)}\), where \(t\) denotes the considered iteration. It is worth noticing that the positions and velocities can be defined based on the dimensions of the problem space;
2. For each particle \(i\), evaluate the value of the fitness function;
3. Compare particle's fitness with particle's \(i\) personal best \(p_{i}^{best}(x_{p_{i}^{best}};y_{p_{i}^{best}})\). If the particle's \(i\) fitness value is better than \(p_{i}^{best}\) fitness, then set the \(p_{i}^{best}\) fitness value equal to the particle's \(i\) fitness, and the \(p_{i}^{best}\) location equals the particle's \(i\) location;
4. Compare the fitness of \(p_{i}^{best}\) with the population's overall previous fitness \(g_{best}(x_{best};y_{best})\). If the \(p_{i}^{best}\) value is better than \(g_{best}\) ones, reset \(g_{best}\) to the particle's \(i\) fitness and location;
5. Change the velocity and location of the particle according to Equations (1) and (2), respectively: \[ \begin{split} v_{xi}(t+1)&=w\!\cdot\!v_{xi}(t)+c_{1 }\!\cdot\!r_{1}\!\cdot\!\Big{(}x_{p_{i}^{best}}-x_{i}(t)\Big{)}+c_{2}\cdot r_{2 }\!\cdot\!(x_{best}-x_{i}(t))\\ v_{yi}(t+1)&=w\!\cdot\!v_{yi}(t)+c_{1}\!\cdot\!r_{ 1}\!\cdot\!\Big{(}y_{p_{i}^{best}}-y_{i}(t)\Big{)}+c_{2}\cdot r_{2}\!\cdot\!(y _{best}-y_{i}(t))\end{split} \] (1) \[ \begin{split} x_{i}(t+1)&=x_{i}(t)+v_{xi}(t+1)\\ y_{i}(t+1)&=y_{i}(t)+v_{yi}(t+1)\end{split} \] (2)  
where \(r_{1}\) and \(r_{2}\) are random numbers between 0 and 1, which weight the velocity for the acceleration toward \(p_{i}^{best}\) and \(g_{best}\) locations; constants \(w\), \(c_{1}\), and \(c_{2}\) are parameters of the PSO algorithm; \(p_{i}^{best}\) is the position that gives the best fitness value ever explored by particle \(i\) and \(g_{best}\) is the one explored by all the particles in the swarm. The parameter \(w\) is the inertia weight, a constant value between 0 and 1, and determines how much the particle should keep on with its previous velocity, i.e., the speed and direction of the search. The parameters \(c_{1}\) and \(c_{2}\) are called the cognitive and the social coefficients, respectively. They control how much weight should be given between refining the particle's search result and recognizing the swarm's search result. These parameters can be considered as the trade-off between exploration and exploitation. It is worth noticing that, \(p_{i}^{best}\) and \((x_{i}(t);y_{i}(t))\) are two-position vectors, and their difference is a vector subtraction. Adding this subtraction to the original velocity  
Figure 2: Flow-chart of the PSO algorithm and the principle of the PSO particle movement.