According to the characteristics of pneumatic marking system, and the typing path was seen as a TSP problem. After comparing the Dijkstra optimization algorithm of marking path results, and applying the genetic algorithm (GA) to analysis, research, and solve the optimization problem, reasonable to get print needle typing path. In this case, printing mark time was shorten as much as possible. It was proved by MATLAB simulation that the study can solve the problem of path optimization and improve the efficiency of marking greatly.