The development of science and technology requires UAV to improve the accuracy of path planning to better apply in the military field and serve the people. The research proposes to use the social spider algorithm to optimize the ant colony algorithm, and jointly build an IACA to deal with the optimal selection problem of UAV path planning. Firstly, the swarm spider algorithm is used to make a reasonable division and planning of the UAV’s flight field. Secondly, the AC is used to adjust and control the UAV’s state and path. Then, the IACA is formed to carry out performance simulation and comparison experiments on the optimal path planning of the UAV to verify the superiority of the research algorithm. The results show that the maximum number of iterations of the original AC and the IACA is 100, but the IACA under the route planning optimization reaches the convergence state in 32 generations; Moreover, when the number of iterations is about 20 generations, there will be a stable fitness value, which saves time for the experiment to find the optimal path. In the simulation experiment, it is assumed that three UAVs will form a formation to conduct the experiment, and the multiple UAVs will be subject to global track planning and repeated rolling time domain track planning. The autonomous operation time of multiple UAVs through the assembly point is (5.30 s, 5.79 s, 9.29 s). The distance between UAVs during flight is predicted. It is found that the nearest distance is 2.3309 m near t= 6.65 s, which is in line with the safety distance standard. Under the improved algorithm, the speed in all directions is also relatively gentle. All the above results show that the improved algorithm can effectively improve the iteration speed and save time.