Paper— An Improved Ant Colony Algorithm in Wireless Sensor Network Routing An Improved Ant Colony Algorithm in Wireless Sensor Network Routing

— In order to make the energy consumption of network nodes relatively balanced, we apply ant colony optimization algorithm to wireless sensor network routing and improve it. In this paper, we propose a multi-path wireless sensor network routing algorithm based on energy equalization. The algorithm uses forward ants to find the path from the source node to the destination node, and uses backward ants to update the pheromone on the path. In the route selection, we use the energy of the neighboring nodes as the parameter of the heuristic function. At the same time, we construct the fitness function, and take the path length and the node residual energy as its parameters. The simulation re-sults show that the algorithm can not only avoid the problem of local optimal solution, but also prolong the life cycle of the network effectively.


Introduction
In recent years, with the rapid development of wireless communication technology, the sensor becomes miniaturized, networked, integrated and intelligent [4]. Compared with traditional sensors, the cost of micro sensors is very low. However, its coverage is small. Therefore, in practical applications, tens of thousands of micro-sensors are often required to work together. Based on this demand, the concept of wireless sensor networks has emerged [2].
As an important information acquisition technology, wireless sensor networks greatly expand the functionality of existing networks [1]. It enhances the human understanding of the objective world. Through the wireless sensor network, humans can directly perceive the outside world. In 2003, Business Week evaluates that the wireless sensor network is one of the four major high-tech in the century [3]. In addition, it points out that wireless sensor network is one of the most influential technologies in the world.
Wireless sensor network has a very broad application prospects. It can be widely used in national defense and military, environmental testing, intelligent home, medical care, remote control of dangerous areas, urban transport and interstellar exploration and other fields [5]. As a result, it has received wide attention from governments, military, multinational corporations and research institutions. The academia has done a lot of research on the wireless sensor network, which involves many aspects of the wireless sensor network. However, it is still in the initial stage of research. In view of this, combined with the characteristics of wireless sensor networks, we propose a wireless sensor network routing algorithm based on energy balance. In order to find the optimal path from the source node to the target node, the algorithm considers the energy factor into the path selection and the enhancement of the information degree, so as to prolong the life cycle of the whole network. These are important components of the key technology in the field of wireless sensor networks, and the research contents have high application value. It is of great theoretical and practical significance to track the latest research results at home and abroad, and to carry out further research on this basis.

State of the art
The earliest research in the wireless sensor network is the US military [6]. In 1978, the Distributed Sensor Network Working Group was established at Carnegie Mellon University [7]. According to the military's demand for military detection systems, it focuses on the problems of communication and computation in sensor networks. Since then, DARPA and NSF have set up a number of research projects on sensor networks [8]. These studies have promoted the new military revolution with network technology as the core, established the network centric warfare system, and thus opened the prelude to the research of wireless sensor networks. Since the mid-1990s, wireless sensor networks have attracted great attention from academia, military and industry [9]. Through the Ministry of Defense and the National Natural Resources Commission and other channels, the United States invested heavily in support of wireless sensor network technology research. Other developed countries have also launched a number of research programs on wireless sensor networks. In 2003, the US Natural Science Foundation Committee developed a sensor network research program, investment million dollars to support the basic theory of the study. Under the auspices of the Natural Science Foundation of the United States, the University of California at Berkeley, Massachusetts Institute of Technology, Cornell University and the University of California began to study the basic theory and key technologies of sensor networks [10].
Compared with foreign countries, China's wireless sensor network research started late. However, in the research, application and standardization, China and the international advanced level is basically synchronized. The sensor network has become one of the important directions in the field of information in China. In 1999, In the Chinese Academy of Sciences "information and automation research report", it has made the sensor network as one of the five key projects in the field. In 2001, the Chinese Academy of Sciences established the Microsystem Research and Development Center based on Shanghai Microsystems, which aims to lead the relevant work of the Chinese Academy of Sciences wireless sensor networks. In 2006, in the published National Medium and Long-term Science and Technology Development Plan (year), it included wireless sensor networks in research planning. Among them, the major special "new generation of broadband mobile wireless communication network" is listed as one of its important directions. On August 7, 2009, premier Wen Jiabao inspected Wuxi, and he proposed in Wuxi to establish a "perception of China" center. In the same year on November 13, the State Council approved the "on the support of Wuxi to build national sensor network innovation demonstration area (National Sensing Information Center situation) report", this marks the "perception of China" has officially risen to the national level, and entered into the strategic implementation stage. China's wireless sensor network industry is facing great opportunities.

3
Ant colony algorithm and its application in wireless sensor network routing The ant colony algorithm (ACO) was first proposed by Italian scholar M.Dorigo et al. in the 1990s. It is a distributed intelligent optimization algorithm that truly simulates the foraging behavior of the natural community. M.Dorigo et al. used it to solve the traveler, and achieved good experimental results. In recent years, under the continuous efforts of experts and scholars, the basic ant colony algorithm has been continuously developed and improved. In communications, transportation, chemical and other areas need to be optimized, it has been further verified. At present, the ant colony algorithm has been successfully applied to travel agents, production scheduling, assignment, communication network routing and so on.
The traditional wireless network routing protocol design mainly refers to avoid network congestion, and improve the quality of service. However, due to the limitation of node energy, the design of routing protocol in wireless sensor networks needs to improve energy efficiency. On the one hand, it needs to ensure that network energy consumption is minimized; on the other hand, it requires global energy consumption to be balanced to extend the lifecycle of the entire network. Ant colony optimization algorithm is a kind of distributed intelligent simulation algorithm, which is inspired by the biological behavior of ant colony in nature. Some of the features of network routing problems, such as internal information, distributed computing, random dynamics, and asynchronous network state updates, match the characteristics of ant colony algorithms. Therefore, the ant colony algorithm provides a new direction for solving the problem of network routing. In view of this, combined with the characteristics of wireless sensor networks, we apply ant colony algorithm to wireless sensor networks, and propose a wireless sensor network routing algorithm based on energy balance. In order to find the optimal path from the source node to the target node with smaller cost and more energy. The algorithm takes the energy factor into the probability selection of the path and the enhancement of the information degree, thus prolonging the life cycle of the whole network.
Biologists have found that the nature of the ants looking for food is the group behavior, and it is not a single ant behavior. The most important feature of ant colony is that ant individuals use pheromone as the medium to communicate with each other. In the process of searching for food, ants will leave a chemical called "pheromone" where they pass. Its concentration characterizes the path of the distance. The higher the pheromone concentration, the shorter the corresponding path distance, and vice versa. In the process of being advanced, after the subsequent slave feels the substance, the probability that they choose the path is much greater than the probability of selecting a path without the substance. At the same time, they release a certain pheromone to enhance the pheromone concentration on the path. After this constant cycle, the more ants pass through the path, the more pheromone left, and the more ants follow the path. This process will continue until the entire ant colony selects an optimal path.
In order to better explain the principle of the slave group algorithm, we will specify the following diagram. In Figure 1, assuming that the ants from the nest A point of departure, food source at D, the ant walking speed is the same, and ACD path length is 20 units' distance. The ABD path length is 10 unit distances, and the slaves leave a unit of pheromone concentration after each path. In Figure 1, when the ant starts from the point of departure, since the ants do not know which path is the optimal path (no pheromone), they have the same probability of selecting the ABD and ACD paths. When the ants finished 10 units away, the ABD path of the ants had successfully found the food, while the ACD path of the ants had just arrived at the C point. When the ants had finished 20 unit distances, the ants on the ADB path had successfully returned to the nest A, and the ants on the ACD path had found the food at point D. At this time, the pheromone concentration of ABD path is 2 units, while the pheromone concentration of ACD path is 1 unit. When the ants finished 40 units of distance, ACD ants from the food source D point back to the nest A point, and the pheromone concentration is 2 units. However, the pheromone concentration of the ADB pathway becomes four units, that is, the ABD path pheromone concentration: ACD path pheromone concentration = 2: 1. Followed by the subsequent ant colony in the choice of ABD and ACD path, they will send two ants to go ABD path, and send another follow ACD path, and then after 40 unit distance, ABD path pheromone concentration: ACD path pheromone concentration = 3: 1. So the cycle continues, the ratio will gradually increase, that is, it forms a positive feedback. Finally, all the ants in the mosquito will choose the ABD route. The basic ant colony optimization algorithm is characterized by: 1. Path choice: the greater the pheromone concentration, the greater the chance of being chosen. 2. Pheromone update: the pheromone concentration above the path increases with the passing of the ant. At the same time, the concentration of pheromone gradually evaporated over time. 3. Positive feedback mechanism: ants through the pheromone to communicate and work together. On the optimal path, the ants will leave more pheromone, and the stronger pheromone concentration will attract more ants in the ant colony, resulting in more information on the better path. However, the pheromone on the nonoptimal path is gradually reduced because of the evaporation, that is, in the search process, it converges to the optimal solution. The end result is that all the ants in the ant colony are absorbed into the same optimal path, which is beneficial to the convergence of the algorithm. 4. Parallel distributed computing: by using the distributed computing method, multiple ants search for many points in the solution space according to the pheromone concentration and the heuristic factor, which is very suitable for parallel implementation. Therefore, it is essentially an efficient parallel search algorithm. The distribution of the slave group algorithm is characterized by two aspects: first, the pheromones are distributed on each edge of the structure graph, and each ant constructs the solution according to the pheromone situation of the current point, and it does not need a control center. Second, the whole slave system is still able to maintain normal function when one or several mare individuals cease to work. Therefore, the algorithm has strong robustness. 5. Easy stagnation: after the algorithm searches for a certain degree, the pheromone on a local optimal path will be higher than the other path. All the ants are absorbed into this path, so that the solution space cannot be further search. The irrational distribution of pheromone easily leads to the occurrence of stagnation. In this case, by dynamically adjusting the pheromone value, we can limit the pheromone to an appropriate range, so as to solve such local optimal problems.

Routing discovery and establishment process
In this algorithm, the wireless sensor network makes the following assumptions: 1. All nodes have equal initial energy values, and each node has enough energy and node communication. 2. The communication between nodes is bidirectional, that is to say, the adjacent two nodes can not only transmit data, but also receive data. 3. The sink node is unique, and is located at the boundary of the area. 4. The node power is limited, and the data need to be multi-hop forwarding to reach the target node.
At the initial stage of the network, the sink nodes send broadcasts to cover the transmission power of the entire network, start the sensor operation, and initialize the message parameters. After receiving the message, the sensor node broadcasts the message to the neighboring node with the preset transmission power, and the neighbor node generates the neighbor table accordingly.
This agreement uses two types of artificial ants, that is, forward ant and posterior ants. Among them, the forward ants are used to find the path from the source node to the destination node. The backward ant travels back to the source node from the destination node along the path of the former slave mother, and updates the global pheromone. At the same time, the backward ant is also used to confirm the message carried by the forward ant.
The route implementation flow of this algorithm is shown in Figure 1. The process of forward ant to find the routing is as shown in Figure 3(a). The process of backward ant to find the routing is as shown in Figure 3 The routing process is as follows: Step 1: when the path search begins, the forward slave is concentrated at the source node.
Step 2: there are m forward ants starting from the source node. When arriving at the intermediate node, first check whether it has been to the node from the reverse routing table. If the ants have been here, the action is terminated. According to the formula, calculate the respective transfer probability ij P , select a node from the adjacent next hop node ) i ( N k set. And then update the packet header hops, taboo table and reverse routing table.
Step 3: when the ant arrives at the destination node, the sink node calculates the pheromone increment according to the pheromone update rule according to the information carried by the forward ant message, including the energy value and the hop count of each node, and then sends the backward ant, they go along the path of the forward ant from the destination node to return to the source node.
Step 4: the backward ant update the global pheromone of the return path.
Step 5: after reaching the number of iterations of the cycle specified by the slave, then obtain the optimal path.

Routing maintenance
In a wireless sensor network, the failure of the node and the depletion of the energy will cause the sensor node to fail, resulting in a change in the network topology. Therefore, the maintenance of the route is very important. Node failure and node energy consumption are two key issues that must be addressed in route maintenance.
(1) Node failure In a wireless sensor network, the node periodically sends messages to its neighboring nodes to report their own status and other related information. The node updates its neighbor table based on this. If the broadcast message has not been received for a long time, and the lifetime has reached the value of 0, the node can be considered invalid and has failed. It is deleted from the neighbor entry, and the node will not be used as the next hop.
(2) Node energy consumption In routing, the algorithm will select the next hop based on the energy level of the neighboring nodes. The node broadcasts its current energy value to the neighboring node when its energy changes, and the neighboring node updates the routing table according to its remaining energy. As shown in Figure 3.

Simulation experiment
In the MATLAB7.0 simulation environment, we simulated the routing algorithm and analyzed the convergence of the algorithm. At the same time, we also calculated the total energy consumption of the whole wireless sensor network, and the average energy of sending and receiving messages, and compared with other algorithms. The relevant experimental parameters are shown in Table 1. The simulation scene of the node is shown in Figure 4. The transmission power of all nodes is adjustable. The sensor node adjusts the transmission power according to the actual needs to communicate with other nodes.

The feasibility of the algorithm
In the simulation scenario, we find the energy consumption balanced routing from the source node A to the destination node B, in which the energy of node C and node D is low. The algorithm shows that the optimized path from node A to node B succeeds in avoiding node C and node D, as shown in Figure 5.

Routing overhead
Wireless sensor network routing control information overhead refers to the amount of data discovered and maintained in the route and the size of all the packet size in the sensor network. The simulation results are shown in Figure 6. In the flooding protocol, the node broadcasts to all neighboring nodes after receiving the packet. The process will continue until the packet arrives at the destination node or pre-set life cycle, so its network overhead is greatest. Based on forward ants and backward ants, the improved ACO algorithm packets are small. Therefore, the network load of the routing control information is small. At the same time, as the transmission rate increases, the routing control information remains basically unchanged, although the routing control data is increased. Therefore, the cost of routing control information for improved ACO algorithms is reduced.

Total energy analysis
The total energy consumption of the sensor network is defined as the sum of the energy consumed by the sensor nodes of the entire network. The smaller the total energy consumption of the network, the smaller the cost of the network routing, so the longer the life cycle of the network. Taking the total energy consumption of the sensor as a measure, we compare this algorithm with the flooding model and the basic ACO algorithm. The results are shown in Figure 7.
It can be seen from Figure 7 that the energy consumption of this algorithm is less than that of flooding model and algorithm. Because at the beginning stage, the algorithm has to spread the message. However, since all the nodes in the flooding model are involved in the flooding of the data and the detection data, the energy consumption is intensively increasing over time. The ACO algorithm uses the network delay information to update the path, and in order to optimize the path requires more decontamination work, which will consume too much sensor node energy. The improved ACO algorithm takes into account the dynamic optimization of the ants while considering the energy balance characteristics, so it avoids the periodic ant diffusion, and saves the energy consumption of the network, thus achieving the purpose of extending the path life cycle.

Average energy analysis
From the above experiment, we can draw the following conclusions: 1. With the increase of the number of nodes in the coverage area of the sensor network, the average energy of all nodes will be decreased when the nodes receive the same size of packets. 2. Under the condition of a certain number of nodes, with the increase of the number of nodes, the average energy of all nodes will be reduced with the increase of the received packets.
In the case of probabilistic selection, although these two algorithms take into account the energy value of the next hop node, the "polyline effect" is prone to occur during the data transmission process. This can cause the routing path to be too long, which has a negative impact on the energy consumption of the routing nodes and the whole network. In the next hop selection, the MEACO algorithm not only considers the energy balance of the node as the important parameter of the heuristic value, but also constructs the fitness function. In addition, it also takes the path and node residual energy as its parameters, and forms a number of energy efficient paths to the destination node. Through the simulation, we can see that the experimental results of the algorithm will be better than the two algorithms, which can extend the network life cycle.

Conclusion
In this paper, we applied the ant colony optimization algorithm to the routing of wireless sensor networks and improved it. At the same time, we proposed a multi-path ant colony algorithm based on energy balance. In the MATLAB7.0 environment, we conducted a routing simulation experiment, and compared it with the flooding model and the basic ant colony algorithm. The simulation results show that the proposed algorithm not only avoids the problem of local optimal solution, but also effectively controls the total energy consumption of the whole network and the average energy consumption of the network nodes, so as to extend the life cycle of the network.