# Applying Particle Swarm Optimization Variations to Solve the Transportation Problem Effectively
## 4 The Basic PSO for Solving the TP
On the one hand, with a large value for the cognitive parameter and small value for the social parameter at the beginning, particles are moving by their own experience according to their own best positions, being able to move freely without following the mass. On the other hand, a small value for the cognitive parameter and a large value for the social parameter help the particles to escape from the area around their personal best positions and allow them to enhance the global search in the latter stages of the optimization procedure, converging toward the global optima. This concept can be mathematically represented as

\[c_{1}=c_{1i}-\left(c_{1i}-c_{1f}\right)\cdot\frac{t}{t_{max}}; \tag{8}\]

\[c_{2}=c_{2i}-\left(c_{2i}-c_{2f}\right)\cdot\frac{t}{t_{max}}, \tag{9}\]where \(c_{1i}\) defines the value of \(c_{1}\) in the first iteration equal to 2.5 and \(c_{1f}\) defines the value of \(c_{1}\) in the last iteration equal to 0.5. Respectively, the value of \(c_{2}\) in the first iteration is \(c_{2i}\) and is set to 0.5, while the value of \(c_{2}\) in the first iteration is \(c_{2f}\) and is set to 2.5 [21]. ### Trigonometric Acceleration Coefficients-PSO (TrigAC-PSO)

In this subsection, a new variation is introduced. According to this variation, the impact of parameters \(c_{1}\) and \(c_{2}\) is extensively studied. First, each particle is guided by the knowledge and experience gained by the swarm (the value of \(c_{2}\) is considerably bigger than the value of \(c_{1}\)). Next, relying on the learning mechanism, each particle builds its own strategy and acquires its own experience (the value of \(c_{2}\) is becoming smaller while the value of \(c_{1}\) is becoming bigger (see Equations (10) and (11)). This decrement of \(c_{2}\) and increment of \(c_{1}\) take place until both parameters are equalized to 2 in the last generation of the algorithm. The following equations are used to calculate the cognitive and social acceleration parameters:

\[c_{1}=\frac{c_{1f}}{2}+\sin\frac{2\cdot c_{1i}\cdot t}{t_{max}}\cdot\frac{\pi }{2}; \tag{10}\]

\[c_{2}=c_{2i}+\cos\frac{c_{2f}\cdot\pi\cdot t}{2\cdot t_{max}}-\frac{1}{2}. \tag{11}\]

Here, in the first iteration, \(c_{1i}\), which is the personal acceleration value, is equal to 0.5, while \(c_{2i}\), which is the social acceleration value, is equal to 3.5. In the last iteration of the algorithm, both personal \(c_{1f}\) and social \(c_{2f}\) are equal to 2. The value of inertia weight \(w\) varies according to the number of the current iteration \(t\) and the number of maximum iterations \(t_{max}\). It is described as follows in Equation (12):

\[w=\frac{t_{max}-t}{t_{max}}. \tag{12}\]

### Four Sectors Varying Acceleration Coefficients PSO (FSVAC-PSO)

In the following section, a new variation is developed. This variation is novel and comprises the major technical merit of this contribution. The major role in this variation is the multiple changes of the coefficient parameters \(c_{1}\) and \(c_{2}\). In this case, the solution is approached both from the knowledge of the particle and from the experience of the whole swarm. The number of iterations is divided into four sectors. Starting from the first iteration, the social and cognitive acceleration coefficient is initialized to 2. In the first sector of iterations, the value of \(c_{1}\) is increasing while the value of \(c_{2}\) is decreasing.