Skip to main content
. 2018 Feb 28;18(3):724. doi: 10.3390/s18030724
Algorithm 2. Modified ant colony algorithm.
Input: the number of sensor nodes N, the power expended to run the transmitter or receiver circuitry of sensor node Eelec, energy consumption of multi-path fading amplifier Eamp, energy consumption of free-space amplifier Efs, distance threshold d0, impact factors of pheromone information ς, impact factors of heuristic information ξ, μ is a small positive constant ∈(0,1], pheromone information on edge (i,j)τ, heuristic information on edge (i,j) ρ, β and σ are ∈[0,1] constants.
Output: optimal routing Routing.
1 Initialization routing R(Path,iter,ϑ), energy for each node and tabu
2 calculate distance dij of different nodes, ρij=1/dij
3 while maximum iterations has not be reached
4  for ϑ=1: Θ′
5   compute allowedϑ according to the node communication radius.
6   generate transition probability pijϑ based on Equations (15) and (16)
7   choose the next hop node, relying on pijϑ, modify routing and tabu
8   the destination node or not? If not, go back to step 2, or proceed to step 9
9   update the node residual energy based on Equations (5) and (6), routing depending on Equation (17)
10  end for
11 end while
12 return the optimal routing Routing.