In modern society,the path planning problem widely exists in all walks of life,aiming at independently exploring an accessible and feasible path from the starting point to the goal point,and this process usually involves the consideration of the cost of work,time,distance,etc.for different path costs.Aiming at the two-dimensional planar pair path planning problem,based on the particle swarm optimisation algorithm,the inertia weight coefficients and acceleration constants with linear transformation are used,and cubic spline interpolation is introduced to constrain the path,dynamically adjusting the inertia factors,balancing the algorithm's global search and local optimisation ability,and increasing the smoothness.The experimental results show that the particle swarm optimisation algorithm has good performance in solving 2D path planning.