Taking network′s annual reduced value as optimization object, pipe layout and pipe diameter as parameter, a tree-type pipe network optimization model was established. Particle swarm algorithm based on integer coding was adopted for solving the math model, which take a pipe network connection status with the pipe diameter as the particle swarm individuals and updates the particle''s location to search the optimal network structure. Through the integer coding design, the optimizations of pipe layout and pipe diameter were achieved simultaneously. During the optimization process, the infeasible solutions during evolutionary process were disposed to improve the optimization efficiency. A instance showed that applying the particle swarm optimization algorithm to optimal design of tree-type pipe network could get a better results and efficiency.