It is important for printed circuit boards (PCB) programming system to find out theoptimal moving path. However, determining the optimal moving path is a NP-hard travelingsalesman problem (TSP). Up to now, the drilling path automatic generated by programming systemmay not be the optimal. Based on Particle Swarm Optimization (PSO) and Complex Method (MC),a novel algorithm, Particle Swarm Optimization with Complex local searching (PSOC), is proposedin the paper. Numerical computations and algorithm performance analysis show that the approachhas global searching capability and can give satisfactory solutions. The algorithm is applied infinding the optimal moving path for PCB. The results have demonstrated the effectiveness andefficiency of the approach.