Aiming at the problems of premature convergence and slow convergence speed in the optimization process of single population particle swarm optimization algorithm, in order to improve the global convergence performance of particle swarm optimization algorithm, a hierarchical three-population integer coded particle swarm optimization algorithm based on grade evaluation with parallel structure is proposed and used to solve the traveling salesman problem (TSP). The algorithm imitates the form of biological aggregation in nature. In the initialization stage, three independent populations are generated according to different particle fitness, including an elite population composed of small-scale individuals with high fitness and two large-scale civilian populations composed of remaining individuals. The three populations apply the immigration strategy based on grade evaluation to exchange particles after a certain number of evolutionary generations. By applying the grade evaluation strategy, the natural law of the biological cluster is integrated into the particle swarm optimization algorithm, which effectively improves the optimization efficiency of the particle swarm optimization algorithm. The above algorithm is applied to the inspection route optimization of one of the traveling salesman problems. The results show that the improved algorithm is superior to the single population particle swarm optimization algorithm in terms of convergence speed, global optimization ability and stability.