# Energy-Balanced Routing Algorithm Based on Ant Colony Optimization for Mobile Ad Hoc Networks
## 3 IEMACO Routing Algorithm
### Protocol Design  
The routing protocol designed in this paper is based on the AntHocMMP routing protocol. It improves the broadcast phase and the returning process for the _backward ant_. The route discovery process is as follows. **Step 1**. After the network is initialized, when the source node needs to transmit data to the destination node, query whether there is a path to the destination node in the local routing table. If so, enter the route maintenance (data transmission phase). If the source node does not have any routing information of the destination node, the source node generates a _forward ant_ Fant and broadcasts. **Step 2**. When the node receives the Fant packet, check whether it has been forwarded by itself or generated by itself. If yes, discard it directly. Otherwise, check whether the lifetime has expired. If yes, discard it directly. Otherwise, check whether the destination node ID is its own ID, if not, write its own ID to the path, modify the hop count and broadcast. If the node is the destination node, go to step 3. **Step 3**. When the broadcast packet arrives at the destination node, first check the node information in the path, generate a _backward ant_ Bant, then return it according to the node information of the path domain. In addition, when the destination node receives the first forward ant, it starts a timer, and the Fant that arrives at the destination node within the specified time will be received. Otherwise, the route discovery time is too long and the link quality is poor. **Step 4**. Establish a node state table and a pheromone-transfer probability table according to the node information in the Bant path state table and previous formulas. **Step 5**. After the Bant reaches the source node, the pheromone table and the state transition table are established, and the route discovery phase ends. The detailed route discovery process is shown in Figure 1. The pseudocode of the IEMACO routing algorithm is provided in Algorithm 1. For simplicity, the corresponding expressions are shortened as follows: phr-tab for pheromone table, st-rt-tab for stack routing table, \(N_{dest}\) for destination node, \(N_{src}\) for source node ; \(P_{optimal}\) for optimal path, \(P_{robust}\) for robust path, \(N_{current}\) for current node, \(N_{neigh}\) for neighbor node and link-disconn for link disconnection, ep for energy path costs, used to update the phr-tab when initializing the network. \begin{table}
\begin{tabular}{c l l l} \hline \hline
**Notation** & **Description** & **Notation** & **Description** \\ \hline \(p(i,j)\) & The transition probability from node \(i\) to node \(j\) & RLT\(I\) & The remaining lifetime of links \\ \hline \(\alpha\) & The pheromone heuristic factor & \(c(i,j)\) & The energy consumed in one hop when one \\  & & & packet is transferred \\ \hline \(\beta\) & The expected heuristic factor & \(E_{elec}\) & The energy consumption for processing one \\  & & & bit data \\ \hline \(\rho\) & The pheromone evaporation rate & \(E_{0}\) & The energy consumed by the amplifier to \\  & & & send a one-bit data \\ \hline \(\theta\) & The offset coefficient & \(E_{i}\) & The energy of a node at any time \\ \hline \(q\) & A random number in (0,1) & \(r_{i}\) & The energy consumed by the node per \\  & & & unit time \\ \hline \(q_{0}\) & The balance coefficient & \(E_{min}\) & The minimum residual energy of all nodes \\  & & & to be accessed on the path \\ \hline \(t_{0}\) & The evaporation period & \(E_{erg}\) & The total energy remaining in the path to \\  & & & be accessed divided by the path length \\ \hline RLT\(n\) & The remaining lifetime of nodes & \(l_{path}\) & The sum of the length of each hop to \\  & & & be accessed \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Notation table.