## 3 Protocol Specification
### Hybrid Route Discovery  
In our proposed hybrid routing algorithm based on AFSA and ACO, we use the heuristic information from AFSA as an initial pheromone value in the early stage in the ACO route discovery process, which is expected to avoid chaos and falling into a local optimum. We introduce a novel probabilistic route discovery scheme, which takes its inspiration from a state transition rule in the Ant Colony System (ACS) [6]. A sensor node \(i\) releases a forward ant toward the sink node at some interval and will select the next node \(j\) to move to by applying the rule given by Equation (4):  
\[j=\left\{ \begin{array}{ccc}\arg\max_{r\in N_{i}^{k}}\left\{\tau_{ir}^{\alpha }\cdot\eta_{ir}^{\beta}\right\}&,q\leq q_{0}(exploitation)\\ p_{ij}&,q>q_{0}(exploration)\end{array} \right. \tag{4}\]  
where \(q\) is a random number uniformly distributed in \([0,1]\), \(q_{0}\) is a control parameter (\(0\leq q_{0}\leq 1\)) of route exploitation and exploration and \(p_{ij}\) is a random variable selected according to the probability distribution given in Equation (5):  
\[p_{ij}=\left\{ \begin{array}{ccc}\frac{\tau_{ij}^{\alpha}\cdot\eta_{ir}^{ \beta}}{\sum_{r\in N_{i}^{k}}\tau_{ir}^{\alpha}\cdot\eta_{ir}^{\beta}}&,&\forall j \in N_{i}\text{ {and} }j\
otin M\\ 0&,otherwise\end{array} \right. \tag{5}\]  
where \(\tau_{ij}\) and \(\eta_{ij}\) refer to the global pheromone trail and the local heuristic desirability of link \((i,j)\), respectively. \(\alpha\) and \(\beta\) are two parameters that control the relative importance of pheromone trail and heuristic value. \(N_{i}\) is the set of neighbours of node \(i\). \(M\) is the tabu list, which stores the visited node and carried by the forward ant. According to this method, a sensor node will select the optimal neighbour node (exploitation) or a stochastic one (exploration). Here, in Equation (4), exploitation implies that the forward ant has the ability to exploit prior and accumulated knowledge, while exploration means that the artificial ant pays more attention to exploring new paths toward the sink node. This method will reinforcethe positive effect of an artificial ant learning process and then increase the convergence speed for the route discovery in order to achieve a better path in the early route discovery phase. However, at the later stage of the algorithm, the concentration of pheromone in a certain path continuously increases. The ACO routing protocol has a higher probability of being trapped in the optimal layout according to Equations (4) and (5) [39]. Here, we introduce the crowd factor \(\delta_{ij}\) in AFSA to limit the scale of pheromone increment. \[\delta_{ij}=2\tau_{ij}/\sum_{i\
eq j}\tau_{ij} \tag{6}\]  
where \(\delta_{ij}\) and \(\tau_{ij}\) refer to the pheromone value and crowd value of link \((i,j)\), respectively. At the same time, we use \(\delta(t)\) to indicate the crowd threshold at time \(t\). If \(\delta_{ij}<\delta(t)\), which means the current link is less crowded, the artificial ant will follow that link toward the next sensor node, otherwise, the artificial ant has to re-select the next hop according to Equation (5). The crowd threshold value is a function of time \(t\). \[\delta(t)=1-e^{-\lambda t},\quad t\geq 0\;\;and\;\;0<\lambda\leq 1 \tag{7}\]  
where \(\lambda\) is constant and \(t\) is the route discovery iteration times. In this way, the crowd threshold value will change with the route discovery times. The larger \(t\) is, the larger \(\delta(t)\) will be. In the initial phase of the algorithm, the crowd factor \(\delta_{ij}\) and the crowd threshold \(\delta(t)\) are both small; thus, the crowd factor does not restrict the route selection process. As the iterative process continues, the concentration of pheromone in some links increases significantly, and the crowd threshold also gradually increases. In this case, the crowd factor will limit the artificial ant influx into the high pheromone link. The introduction of a crowd factor controls the number of artificial ants in the overcrowded path.