In order to find an optimal path with short distance and low node energy consumption in wireless sensor networks, an optimized ant colony algorithm DDEARA is proposed by using the “three-step progressive type” node finding method. Firstly, the dynamic radius search factor is used to find the next hop candidate nodes, which can ensure the convergence of ant colony algorithm and the uniform distribution of nodes location. Secondly, the node energy prediction factor is introduced to avoid the unreasonable phenomenon that the node is still overloaded when the energy is insufficient, that is, when all the energy of a node is consumed, all the data cannot be successfully transmitted. Finally, in the process of finding the next hop of candidate node, the direction factor is introduced, which has the directionality to find the node, avoiding the irrelevant node in the opposite direction to be selected as the next hop of candidate node, reducing the optimal path distance, saving node energy consumption, and improving the optimization efficiency of the algorithm. The simulation results show that DDEARA algorithm can realize the dynamic convergence of ant colony algorithm, the distance between adjacent nodes is moderate, the energy consumption of nodes is even, irrelevant nodes in the opposite direction are filtered, the optimal path distance is reduced, the optimization ability of algorithm is improved comprehensively, and the service performance and life of wireless sensor network are prolonged.