# Ant Colony Optimization Task Scheduling Algorithm for SWIM Based on Load Balancing
## 5 Experiment and Results Analysis
### Experimental Results and Analysis  
In order to verify the effectiveness of the ACTS-LB algorithm designed in this paper, we tested the method using the same parameter configuration conditions but in two different situations: (1) The service nodes number is fixed, but scheduling tasks number is changed; (2) The scheduling tasks number is fixed, but the resource nodes number is changed. This was compared with the classic min-min algorithm [20], the ACO algorithm [21] and the PSO algorithm [10] in terms of transmission delay, task execution time and system load deviation value. Experiment 1: The transmission delay comparison. (1) Set the number of service nodes at \(m=20\) and the number of scheduling tasks at \(10<n<200\). (2) Set the number of scheduling tasks at \(n=100\) and the number of service nodes at \(5<m<50\). In the above two cases, by running the simulation software NS-3, the time delay data of the path was obtained by measuring different iterations of the ACTS-LB algorithm, min-min algorithm, ACO algorithm and PSO algorithm in the path finding process. The trace file obtained was counted and analyzed by the statistical analysis tool Wireshark. We obtained the total time delay value of the path after each iteration for each of the four algorithms, and the average value of each algorithm was obtained after each iteration was run 1000 times. The result was processed by MATLAB. The results are shown in Figures 5 and 6. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \
\begin{tabular}{c} **Parameter** \\ **Name** \\ \end{tabular} & \(\alpha\) & \(\beta\) & \(\mu\) & **Bandwidth** & **Delay** & \(\delta_{1}\) & \(\delta_{2}\) & \(\delta_{3}\) &
\begin{tabular}{c} **Population** \\ **Size** \\ \end{tabular} & \(NC_{\text{max}}\) \\ \hline Parameter value & 1.0 & 2.7 & 0.6 & 150 Mbps & 10 ms & 0.4 & 0.3 & 0.3 & 50 & 150 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Simulation experiment test parameters. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
\begin{tabular}{c} **Serial Number** \\ \end{tabular} & \(\mu\) & \(\alpha\) & \(\beta\) & **Optimal Path** & **Running Time (S)** \\ \hline
14 & 0.6 & 1.0236 & 2.7472 & 568.10969 & 40.25 \\
15 & 0.6 & 1.0187 & 2.7356 & 568.10969 & 40.27 \\
16 & 0.6 & 4.3789 & 1.5387 & 568.19446 & 41.58 \\
17 & 0.6 & 5.2468 & 2.4998 & 568.10969 & 41.31 \\
18 & 0.6 & 5.3846 & 2.5368 & 568.10969 & 41.02 \\
19 & 0.6 & 6.3985 & 4.2673 & 568.19446 & 42.29 \\
20 & 0.6 & 6.3653 & 4.2672 & 568.19446 & 42.37 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: \(Cont.\)It can be seen from the experimental results in Figures 5 and 6 that, at the beginning of ant colony routing, the four algorithms have large fluctuations in the total transmission delay of the path and have the same performance. After 100 iterations, the ACO algorithm basically leveled off and no longer changed, indicating that the ACO algorithm falls into premature convergence after the 100 th iteration. Figure 5: The comparison of transmission delay under different scheduling tasks. Figure 6: The comparison of transmission delay under different service nodes. iteration and could no longer search for a better path. When the number of tasks increased in the later period, the transmission delay variation of the min-min algorithm and PSO algorithm were not obvious. The ACTS-LB algorithm expanded the path space due to the optimized updating of pheromones, and the ants disturbed other paths so that the obtained paths were evenly distributed in the path space, ensuring that the ants had a stronger search ability and could find better quality transmission paths. Thus, it can be seen that the ACTS-LB algorithm can effectively solve the premature convergence problem of the ACO algorithm, providing ants with a stronger search ability and obtaining a better-quality path set. Experiment 2: The task execution time span comparison. (1) Set the number of service nodes at \(m=20\) and the number of scheduling tasks at \(10<n<200\).