Unmanned aerial vehicles (UAVs) formation has been widely accepted for improving productivity and entertainment, in which the formation maintenance and transformation are significantly important. Due to the constraint of limited battery capacity, finding the shortest path to conduct a formation transformation is of great significance to extending the use time, which is complex and tough to figure out in a short time. This work proposes an artificial potential field (APF) method to compute the optimal path for multiple UAVs. In addition, based on genetic algorithm and discrete particle swarm optimization, a novel evolutionary algorithm, termed GA-DPSO, is proposed to further improve the quality of the obtained solution, which can be easily extended to solve other problems. Experimental result shows that the proposed method is effective and efficient in dealing with the UAVs formation transformation problem.