## 5 Experiments  
The experimental hardware platform is four Linux servers with a total of 64 CPU cores and 128 G memory. Use five standard TSP instances in TSPLIB [13]. Compared with common serial programs, resource scheduling and task allocation of Spark platform consume extra time, so we first compare common program (single core) with the 2-core Spark platform on run time. The experimental parameters and the results are shown in Table 1. Column \"opt\" represents the length of the known optimal solution of every instance. Columns \"MMAS\" and \"MMAS+2-Opt\" represent the best results for every instance achieved by the two algorithms, respectively.  
From Table 1 we can see that MMAS combined 2-Opt based on MapReduce can obtain optimal solutions. The running time of the 2-core Spark platform is longer than common program when city scales are small. As the city scale increases, the acceleration effect becomes greater. So the Spark platform is suitable for large calculations, such as rat195, pr299.  
Because the number of ants has a great influence on the solution accuracy, we choose the eil101 instance and change the number of ants to compare common program with 2-core Spark platform. The experimental results are shown in Figure 3.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Instance** & **Opt** & **MMAS** & \begin{tabular}{c} **MMAS +** \\ **2-Opt** \\ \end{tabular} & \begin{tabular}{c} **Number** \\ **of ants** \\ \end{tabular} & \begin{tabular}{c} **Iterations** \\ \end{tabular} & \
\begin{tabular}{c} **Spark** \\ **2-core/min** \\ \end{tabular} &
\begin{tabular}{c} **Single** \\ **core/min** \\ \end{tabular} \\ \hline att48 & 10,628 & 10,628 & 10,628 & 48 & 1000 & 1.1 & 0.5 \\ st70 & 675 & 677 & 675 & 96 & 1000 & 2.7 & 2.6 \\ eil101 & 629 & 635 & 629 & 128 & 1000 & 6.5 & 8.5 \\ rat195 & 2323 & 2369 & 2323 & 192 & 1000 & 45.8 & 70.2 \\ pr299 & 48,191 & 48,287 & 48,191 & 320 & 1000 & 221.3 & 396 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison between single core program and Spark platform.  
When the number of ants increases by 64, the time consumptions of common programs increase by 4 min and these of the Spark platform are 2 min. Spark platform starts tasks so fast that adding Map tasks will not bring extra time consumption.  
Then we use pr299 and increase the number of CPU cores to test the speedup of the Spark platform. If the number of CPU cores is less than 64, cores are evenly divided among four servers. For example, when we test four cores, the program is executed on four servers (every server uses one core) and cores are LAN-connected. The time consumptions of different CPU cores are shown in Table 2.  
For the parallel computing system, the main performance index is speedup. The comparison between Spark and Hadoop is shown in Figure 4.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Cores** & **1** & **2** & **4** & **8** & **16** & **32** & **64** \\ \hline Time/min & 396 & 221 & 112.6 & 57.4 & 28.7 & 17 & 12.3 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Time consumption of different number of Cores.  
Figure 4: Comparison between the speedups of Spark and Hadoop. In order to make the linear speedup to be a straight line, we let \(y=log_{2}(T_{l}/T_{n})\). \(T_{l}\) is the running time of common program (single core).  
Figure 3: Time consumption of different number of ants.  
The experimental results show that Spark platform has a very noticeable accelerating effect on ant colony algorithm and performs better than Hadoop. When the CPU core number is 1-16, the speedup is close to the linear speedup and then decreases. By observing the CPU load we find that CPU runs in full load when the CPU core number is 1-16, and CPU load decreases while the CPU core number increases to 32 or 64, which means that the amount of calculation is trivial for the Spark platform. So the parallel ant colony algorithm based on the Spark platform is more suitable for handling large-scale problems.