This paper proposes a new localization algorithm and route planning method for wireless sensor networks (WSNs) to reduce localization errors and enhance network performance. It discusses the limitations of traditional algorithms and presents a genetic algorithm for optimized route planning to prolong network lifetime. Simulation results indicate that the proposed methods outperform existing techniques in terms of accuracy and efficiency.