  Routing represents a pivotal concern in the context of Wireless Sensor
Networks (WSN) owing to its divergence from traditional network routing
paradigms. The inherent dynamism of the WSN environment, coupled with the
scarcity of available resources, engenders considerable challenges for industry
and academia alike in devising efficient routing strategies. Addressing these
challenges, a viable recourse lies in applying heuristic search methodologies
to ascertain the most optimal path in WSNs. Ant Colony Optimization (ACO) is a
well-established heuristic algorithm that has demonstrated notable advancements
in routing contexts. This paper introduces a modify routing protocols based on
Ant colony optimization. In these protocols, we incorporate the inverse of the
distance between nodes and their neighbours in the probability equations of ACO
along with considering pheromone levels and residual energy. These formulation
modifications facilitate the selection of the most suitable candidate for the
subsequent hop, effectively minimizing the average energy consumption across
all nodes in each iteration. Furthermore, in this protocol, we iteratively
fine-tune ACO's parameter values based on the outcomes of several experimental
trials. The experimental analysis is conducted through a diverse set of network
topologies, and the results are subjected to comparison against
well-established ACO algorithm and routing protocols. The efficacy of the
proposed protocol is assessed based on various performance metrics,
encompassing throughput, energy consumption, network lifetime, energy
consumption, the extent of data transferred over the network, and the length of
paths traversed by packets. These metrics collectively provide a comprehensive
evaluation of the performance attainments of the routing protocols.
