## 3 Routing algorithms based on sensor position
### Ant algorithm-based intelligent routing  
Compared with the previous position-based routing algorithms, ant algorithm-based intelligent routing algorithms are complicated. It is found that the ants have the ability of finding the best route between ant's cave and food via detecting the pheromone [55], which is the original idea to design ant algorithm. In travel, the shorter the path is, the higher the pheromone concentration is, so ants can find right field in searching space using positive feedback mechanism. As social insects, ants can show a colony intelligent behavior via cooperation while carrying out some tasks that can't be finished by the individual. Ant algorithms are used to solve not only the TSP problem, but also the anycast routing and query processing problems and so on [56; 57]. Combined with the idea of ant algorithm and position information, ant algorithm-based intelligent routing algorithms have been proposed successively for WSN [58; 59]. In order to set up the routing, each source node sends several detection packets (ants) to the sink node. Each ant packet has the following information: the visited list, the edge list and the position of the sink. The visited list is used to record the nodes, which have been passed by ants, and the initial value of it is empty. The edge list is used to record the edges ant selected when detecting. Each node maintains a table including the position information of their neighbor nodes, which can be updated by hello messages between neighbor nodes periodically. Each of the source nodes can obtain the position information of the sink by receiving the interests the sink flooded and generate the ants. Before the ant-based intelligent algorithm is described, some parameters are explained firstly. In Figure.25, node \(u\) is one of the neighbors of node \(v\). \(\theta_{<v,u^{>}}\) is denoted as the deflexion angle of the edge \(e_{<v,u^{>}}\) at node \(u\) relative to the sink. The number of the source nodes is \(m\). The detailed steps are described as follows: \begin{table}
\begin{tabular}{|l|l|l|l|} \hline  & GLS & TTDD & GBRA \\ \hline Energy consumption & High & Middle & Low \\ \hline Negotiation-based & No & Yes & Yes \\ \hline Complexity & High & Middle & Low \\ \hline Reliability & High & Middle & Middle \\ \hline Scalability & Low & Good & Middle \\ \hline Mobility & All moving & Sink moving & No \\ \hline \end{tabular}
\end{table} 
Table 2: Comparison among GLS, TTDD and GBRA. Figure 25: The illustration of the deflexion angle. Step.1: The pheromone value of each edge of the network is initialized to 1. There are \(m\) ants in the \(m\) source nodes respectively (The source node \(k\) sends the ant \(k\) and \(k\in[1,m]\)). And the source node \(k\) is inserted into the visited list of ant \(k\). Step.2: Assume that the node at which ant \(k\) currently arrived is \(v\), and the set \(\Omega\), contains all the neighbor nodes of the node \(v\), the local rules for each ant are as follows:  
1) If node \(v\) is the sink node, the destination is found and the ant stops detecting. 2) Else, judge each of the neighbor nodes \(u\in\Omega_{v}\) of node \(v\) to find out whether they are in the visited list of ant \(k\) or not. Set the number of the neighbors of node \(v\) that is not in the visited list of ant \(k\) is \(R\). then,  
a) If \(R\)>0, continue to detect each of the \(R\) available neighbor nodes. If the current detected node \(u\), is the sink node, then set it as the next step node. Otherwise, follow the rules below:  
* Based on the coordinates of node \(v\), node \(u_{t}\) and the sink node, calculate the cosine value of angle \(\theta_{{}_{\text{\tiny{$v$,$,$,$,$,$}}}}\) by the formula of cosines. Then calculate the diverted weight of the node \(u_{t}:\rho_{{}_{\text{\tiny{$v$,$,$,$,$,$,$,$,Figure 25:0v$,  
Though position-based routing algorithms have some obvious advantages, there are several problems.