Optimizing routing paths improves the network's topological properties and performance, and helps balance the network's energy. Traditional network routing algorithms use the energy balanced ring routing algorithm, which causes an uneven consumption of energy throughout the network. This paper thus proposes a method of optimizing network routing paths based on an improved ant colony algorithm with constraint feedback. First, a network model is designed, and its topology is established. The robust coefficients are determined, and route choices are used to update the GRAEB routing algorithm. Using the region segmentation method, the confidence interval of cluster routing task's random distribution is obtained. Through the ant feedback constraint, the probability of information being correctly transmitted is increased. According to Bayes' theorem, route node localization and saving of route location reliability recursive algorithm, network routing is optimized. Simulation experiments show that the algorithm can effectively increase the probability of information being transmitted correctly on the network, with transmission being almost distortion-free. As the number of routing hops increases, the advantages of this routing algorithm become more apparent, improving the quality of the information transmission.