Pipe routing is one of the most time-consuming and complicated jobs in shipbuilding design. This article presents the automatic ship pipe routing method. To improve the efficiency of single pipe routing, the fixed-length encoding genetic algorithm (GA) is first used by connecting adjacent intermediate points with generated pipe segments according to the specific routing patterns. The crossover and mutation operations are designed on the basis of this encoding as well. In case of the routing for multipipes or pipe with branches, cooperative coevolutionary GA is adopted to route pipes harmoniously and to reduce the risk of combinatorial explosion caused by the number of pipes. During algorithm implementation and the building of cell decomposition model, the practical constraints in ship piping have been taken into account. In the end, the efficiency and feasibility of the proposed approach are illustrated by solving problems in designed test case and real ship applications.