Aiming at planning the welding path of complex ship components, a welding path planning optimization model was constructed with the shortest welding path and using the target and the welding process and welding starting and ending points as constraints. Based on the model, an improved ant colony algorithm with dynamic adaptive parameters was proposed to complete the path planning work. Simulation results showed that, compared with other classical optimization algorithms, the proposed algorithm improved optimization speed while ensuring optimization effect and achieving better results in path planning of complex ship components.