# Ant Colony Optimization Task Scheduling Algorithm for SWIM Based on Load Balancing
## 5 Experiment and Results Analysis
### Experimental Results and Analysis
(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, the task execution time of the ACTS-LB algorithm, min-min algorithm, ACO algorithm and PSO algorithm were tested in the context of task scheduling. The experimental results were sorted according to the data in NS-3. The four algorithms were executed 1000 times and averaged. The results of the task execution time span are shown in Figures 7 and 8. It can be seen from the experimental results in Figure 7 that, in the initial stage of task scheduling, the task execution time of the ACTS-LB algorithm, min-min algorithm, ACO algorithm and PSO algorithm are basically the same. However, the task execution time of the ACTS-LB algorithm becomes smaller than that of the other three algorithms as the number of tasks increases. From the experimental results in Figure 8, it can also be seen that when the number service nodes increased, the ACTS-LB algorithm execution task scheduling time was less than that of the min-min algorithm, ACO algorithm and PSO algorithm. This shows that the method of calculating heuristic function by using expected execution time in the ACTS-LB algorithm plays an effective role in shortening the task execution time, and ants tend to choose the path with high pheromone concentration and minimum completion time. It can be concluded that the ACTS-LB algorithm can improve task execution efficiency and enable ants to have a stronger task scheduling ability. Experiment 3: The system load deviation 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 this paper, the load deviation value (\(LDV\)) of SWIM resource nodes is proposed as a reference standard for evaluating load balancing in task scheduling. The \(LDV\) definition can be expressed by Equation (10). \[LDV=\frac{LB_{\max}-LB_{\min}}{LA} \tag{10}\]  
The definition of the SWIM resource nodes load value \(LB\) is the same as in Equation (3); \(LB_{\max}\) and \(LB_{\min}\) are the maximum and minimum values of \(LB\), respectively; \(LA\) is the average of all resource node loads. According to the experimental results, the load deviation values of the resource nodes during the task scheduling of the four algorithms were obtained. The results are shown in Figures 9 and 10. Figure 8: The comparison of task execution time span under different service nodes. It can be seen from Figures 9 and 10, the \(LDV\) value of the ACTS-LB algorithm is smaller than that of the min-min algorithm, ACO algorithm and PSO algorithm, and the transformation becomes slower as the number of tasks increases. This is because in the ACTS-LB algorithm, pheromones are updated according to the hardware quality and the load balancing of node resources, so ants tend to aim for resource nodes with high pheromone concentrations (high performance and low load of  
Figure 10: The comparison of system load deviation values under different service nodes. Figure 9: The comparison of system load deviation values under different scheduling tasks. resource nodes) when selecting the next task processing target node. It can be concluded that the ACTS-LB algorithm with \(LDV\) as the reference standard can achieve the goal of load balancing and improve the overall performance of task scheduling.