# Solving the Fuzzy Transportation Problem by a Novel Particle Swarm Optimization Approach
## 6 Case Studies and Experimental Results
Set solution as a matrix to round each element of L to the nearest integer less than or equal to that element of L as Solution = floor [L]
11. Set Sumrow as the sum of the elements of all the rows. 12. Set Sumcol as the sum of the elements of the Columns. 13. Set s = Supply-Sumrow and d = Demand-Sumcol
14. for i = 1 to m do
15. for j = 1 to n do
16. if s(i) smaller or equal to d(j)
17. ww = min (d(i), d (j))
18. main (i,1) = main (i, j) + ww
19. d (j) = d(j) - S(i)
20. else if d (j) smaller than S(i)
21. ww = min (s(i), d(j))
22. main(i,j) = main (i,j) + ww
23. s(i) = s(i) - d(j)
24. end
25. end
26. end
27. Return L = Solution
```  
**Algorithm 1**Initialization algorithm  
The entire algorithmic approach is implemented utilizing MATLAB R2021b. TrigAC-PSO was tested on a set of different dimensional problems, both triangular and trapezoidal fuzzy sets as classical and generalized fuzzy numbers. Table 2 presents the 28 test instances that are examined in our research [15; 17; 25; 29; 30; 31; 32; 33; 34; 35; 36; 37; 38; 39]. In Table 3 and Figure 3, provided below, the performance of both exact methods and the Trig-PSO approach across 20 Monte Carlo runs is showcased. In every cell, the best value of each method is depicted using bold for the cases where the algorithms achieved the optimal solution. The last column provides the optimal solution for each numerical instance. The values highlighted in bold correspond to the optimal ones. As illustrated, the NW method attains optimal solutions in 3 out of 28 test instances (10.71%). LCM achieved the optimal solution in 5 out of 28 instances (17.86%). VAM surpasses the previous methods, securing optimal solution in 15 out of 28 instances (53.57%). Despite being introduced later than the preceding methods, MOMC fell short of exceeding [PERSON]'s method, as it succeeded in identifying the optimal solution in six instances (21.43%). Notably, the TrigAC-PSO method emerges as the most efficient, achieving optimal results in 24 out of 28 instances (81.71%). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**No** & **From Journal** & **Name** & **Problem Size** & **Type** & **Optimal Solution** \\ \hline
1 & [PERSON] (2014) & Pr. 01 & 3 \(\times\) 3 & Generalized Trapezoidal Fuzzy Number & 64.35 \\
2 & [PERSON] and [PERSON] (2018) & Pr. 02 & 4 \(\times\) 4 & Classic Triangular Fuzzy Number & 853.35 \\
3 & [PERSON] et al. (2020) & Pr. 03 & 3 \(\times\) 4 & Classic Triangular Fuzzy Number & 817.17 \\
4 & [PERSON] and [PERSON] (2020) & Pr. 04 & 3 \(\times\) 4 & Generalized Trapezoidal Fuzzy Number & 196.00 \\
5 & [PERSON] and [PERSON] (2018) & Pr. 05 & 3 \(\times\) 3 & Classic Triangular Fuzzy Number & 166.00 \\
6 & [PERSON] and [PERSON] (2018) & Pr. 06 & 3 \(\times\) 4 & Classic Triangular Fuzzy Number & 101.00 \\
7 & [PERSON] et al. (2018) & Pr. 07 & 3 \(\times\) 3 & Classic Trapezoidal Fuzzy Number & 1770.00 \\
8 & [PERSON] and [PERSON] (2011) & Pr. 08 & 3 \(\times\) 4 & Classic Trapezoidal Fuzzy Number & 199.00 \\
9 & [PERSON] et al. (2016) & Pr. 09 & 3 \(\times\) 3 & Classic Trapezoidal Fuzzy Number & 155.25 \\
10 & [PERSON] and [PERSON] (2017) & Pr. 10 & 3 \(\times\) 4 & Classic Trapezoidal Fuzzy Number & 126.00 \\  
[PERSON] and [PERSON] (2020) & Pr. 27 & 3 \(\times\) 3 & Generalized Trapezoidal Fuzzy Number & 91.45 \\
28 & [PERSON] and [PERSON] (2020) & Pr. 28 & 3 \(\times\) 4 & Generalized Trapezoidal Fuzzy Number & 75.60 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Details of the 28 test instances of the FTP. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Pr** & **NWC** & **LCM** & **VAM** & **MOMC** & \begin{tabular}{c} **TrgAC-** \\ **PSO** \\ \end{tabular}  & **Optimal** \\ \hline
01 & **64.35** & 67.60 & 67.60 & 67.60 & 65.10 & 64.35 \\
02 & 1046.67 & 870.05 & **853.35** & 855.00 & **853.35** & 853.35 \\
03 & 861.53 & 894.66 & **817.17** & 1000.67 & **817.17** & 817.17 \\
04 & 233.00 & 266.50  
The deviation measurement quantifies the extent of variation between observed values and expected or target values.