To research the optimal path problem in wireless sensor network (WSN), Genetic Algorithms, Differential Evolution, Particle Swarm Optimization and Dijkstra algorithm are used in this study. Experimental comparisons show that the different algorithms may represent obvious difference under different network size. During small-scale network, the Dijkstra algorithm needs the least run time and obtains the highest success rate to find optimal solutions. However, the Differential Evolution and Particle Swarm Optimization provide the better performance than Dijkstra algorithm under big-scale network. In a word, Dijkstra algorithm and Differential Evolution show up better performance and greater adaptability among the above algorithms, respectively.