# Applying Particle Swarm Optimization Variations to Solve the Transportation Problem Effectively
## 4 The Basic PSO for Solving the TP
Their study is based on the distribution of supply and demand quantities, taking into account the two minimum-cost cells and their redistribution through penalties [25]. Finally, the last method presented is known as the Bilqis Chastine Erma Method (BCE), which constitutes an enhanced version of the JHM [26]. The whole algorithmic approach was implemented using MATLAB R2021b. The algorithm was tested on a set of different dimensional problems. All parameters of the proposed algorithm were selected after exhaustive experimental testing. Each of the four variations was tested using different parameter values, and those values whose computational results were superior to other values were selected. The number of iterations is set to 100. The parameter \(r_{1}\) is set as a random number derived from the uniform distribution in range \([0,1]\), and \(r_{2}\) is set as the complement of \(r_{1}\); that is, \(r_{2}=1-r_{1}\). This modification plays a significant part as it is different from the customary application where both \(r_{1}\) and \(r_{2}\) are randomly derived uniformly from range \([0,1]\). Using the former relationship between \(r_{1}\) and \(r_{2}\), we manage to achieve stronger control over these parameters' values. In the following table (Table 2) and Figure 1, the performance of both the exact methods and the PSO-based ones are presented for 30 Monte Carlo runs; more precisely, the best value achieved by each method is depicted. The last column presents the optimal solution of each numerical problem. As shown, the Vogel method manages to find 9 out of the 32 test instances (28.13%); the Total Differences Method 1 (TDM1) succeeds in finding more optimal solutions than the Vogel method by finding 13 out of 32 optimal solutions (40.63%); using the TOCM-MT method, the results show that the method's performance is better still, finding the optimum in 23 out of 32 test instances (71.9%); the JHM method, which \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**No** & **From Journal** & **Name** & **Problem Size** & **Optimal Solution** \\ \hline
1 & [PERSON] and [PERSON] (1977) & Pr.1 & 3-4 & 880 \\
2 & [PERSON] (2012) & Pr.2 & 3-4 & 743 \\
3 & [PERSON] and [PERSON] (2012) & Pr.3 & 3-3 & 5600 \\
4 & [PERSON] et al. (2011) & Pr.4 & 3-4 & 59 \\
5 & [PERSON] (2012) & Pr.5 & 3-4 & 28 \\
6 & [PERSON] et al. (2009) & Pr.6 & 3-4 & 435 \\
7 & [PERSON] and [PERSON] (2009) & Pr.7 & 4-5 & 390 \\
8 & [PERSON] et al. (2018) & Pr.8 & 3-5 & 1580 \\
9 & [PERSON] et al. (2017) & Pr.9 & 4-4 & 49 \\
10 & [PERSON] et al. (2016b) & Pr.10 & 4-4 & 410 \\
11 & [PERSON] et al. (2016b) & Pr.11 & 3-4 & 2850 \\
12 & [PERSON] et al. (2016a) & Pr.12 & 3-5 & 183 \\
13 & [PERSON] and [PERSON] (2016) & Pr.13 & 3-4 & 799 \\
14 & [PERSON] and [PERSON] (2016) & Pr.14 & 3-5 & 273 \\
15 & [PERSON] et al. (2014a) & Pr.15 & 3-4 & 1160 \\
16 & [PERSON] et al. (2015a) & Pr.16 & 3-4 & 200 \\
17 & [PERSON] and [PERSON] (2017) & Pr.17 & 3-4 & 240 \\
18 & [PERSON] (2017) & Pr.18 & 3-3 & 820 \\
19 & [PERSON] (2016) & Pr.19 & 3-4 & 190 \\
20 & [PERSON] (2016) & Pr.20 & 4-4 & 83 \\
21 & [PERSON] (2017) & Pr.21 & 3-4 & 3460 \\
22 & [PERSON] et al. (2019) & Pr.22 & 3-4 & 910 \\
23 & [PERSON] et al. (2019) & Pr.23 & 4-4 & 1670 \\
24 & [PERSON] et al. (2019) & Pr.24 & 4-4 & 2280 \\
25 & [PERSON] et al. (2019) & Pr.25 & 3-4 & 2460 \\
26 & [PERSON] et al. (2019) & Pr.26 & 3-3 & 291 \\
27 & [PERSON] and [PERSON] (2015) & Pr.27 & 3-3 & 4525 \\
28 & [PERSON] and [PERSON] (2015) & Pr.28 & 3-4 & 920 \\
29 & [PERSON] and [PERSON] (2015) & Pr.29 & 3-4 & 809 \\
30 & [PERSON] and [PERSON] (2015) & Pr.30 & 3-4 & 417 \\
31 & [PERSON] and [PERSON] (2015) & Pr.31 & 4-5 & 3458 \\
32 & [PERSON] and [PERSON] (2015) & Pr.32 & 4-6 & 109 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Detail of 32 numerical examples of the TP.