## 4 Congestion Control Based on the RED Algorithm
### The Cred Algorithm
From the experimental data, we can select a specific group and set the source node as 3 and the destination node as 13. By running the ACA, we can obtain an optimized path from node 3 to node 13 and calculate the corresponding total delay. After this, the node parameters on the cross path, specifically the service rate \(u\), are adjusted to simulate a sharp decrease in data processing capacity, resulting in congestion. This allows us to determine the second optimized path total delay after congestion. Finally, by introducing the CRED algorithm, we can alleviate the congestion and obtain the third optimized path total delay after congestion relief. The results of these simulations are illustrated in \[P=a_{1}\text{avg}^{2}+b_{1}\text{avg}+c_{1} \tag{9}\]6

\[P=a_{1}\text{avg}^{2}+b_{1}\text{avg}+c_{1} \tag{9}\]7 Random network topology model. delay without congestion relief, the total delay is significantly reduced by approximately 500 ms. These findings demonstrate the effectiveness of the CRED algorithm in controlling congestion, further confirming that the ACA can still achieve a path with lower delay even after congestion occurs. The proposed ACA and CRED algorithms are designed to be applicable in real-time applications. The time required to find a solution depends on several factors, including the problem's size and complexity, the efficiency of the algorithm implementation, and the availability of computational resources. To demonstrate the computational efficiency of the proposed method, the execution time of our algorithm on different node sizes is given in \[P=a_{1}\text{avg}^{2}+b_{1}\text{avg}+c_{1} \tag{9}\]8 From the table, it can be seen that the computation time of the proposed method increases linearly as the number of nodes increases, verifying that the algorithm has a better time complexity and computational efficiency. Furthermore, the existing resource allocation algorithm fails to fully solve the problem of the non-linear increase in computation time caused by the increase in the number of nodes. The main reason for the improvement in computational efficiency of the proposed algorithm is the optimization of the RED algorithm, thus solving the problem of inconsistency in describing the actual traffic. Therefore, the proposed algorithm has good scalability in real-time application scenarios. ## 6 Conclusions

This paper focuses on the application of swarm intelligent computing in the context of CAEVs IoT. It begins by discussing the current development status of CAEVs and highlights the issue of resource allocation in their applications. To address this problem, the paper introduces a detailed resource allocation method based on the ACA. Furthermore, the paper provides a comprehensive explanation of the principles behind the RED algorithm, highlighting its advantages and disadvantages. Recognizing the inconsistency in the RED algorithm for describing actual traffic, an improved variant called the CRED algorithm is proposed and its principles are elaborated upon. Through simulation and comparison using the NS2 platform, the performance of the CRED algorithm is demonstrated to be superior. Consequently, the paper concludes by advocating for the combination of the CRED algorithm and ACA to effectively alleviate short-term congestion. Subsequent simulations further validate that this combination successfully mitigates congestion and enables the discovery of optimized paths with lower delay. In summary, this paper presents a feasible and practical solution based on the ACA for the resource allocation challenge in CAEVs IoT applications. Compared with existing resource allocation methods based on ACAs, our proposed method has the following three improvements. First, in resource allocation, the proposed method integrates security, reliability and latency issues specific to CAEVs IoT scenarios. Second, we improve the inconsistency problem of the RED algorithm in describing actual traffic and integrate it with the ACA to improve the path optimization.