I. INTRODUCTION
Wireless Sensor Network (WSN) has become one less expensive and efficient alternative to monitor events that may happen in specific geographic space. This technology consists a bunch of electronic devices called nodes deployed in a given area. A node is a device with limited computing capabilities and wireless transmission. These nodes have sensors that communicate changes in some variables that may occur in the proximity of them. This information is transmitted to a central node called collector or sink. This node has communication with a personal computer or notebook. This computer is used to centralize the data of the WSN [1].
The problem is focused on defining a route that allows connecting from a source node to a collector node through a WSN. It supposes that there are a large number of sensors in a geographic area and there is a need for communication between a source and collector node. The construction of this route is a difficult task because you have to take into account several variables. One of the most important variables is the energy of the sensors. This energy is exhaustible, and the routing should seek to extend the lifetime of the network for lasting monitoring.
Our proposal is based on swarm intelligence. The swarm intelligence is a way to emulate the behavior of groups or communities of living beings like ants, bacteria, bees, and others. These organisms in their natural environments must solve complex problems such as foraging and protection from a predator. Studying the behavior of these organisms allow developing algorithms that can be used to solve optimization problems. We present two algorithms of swarm intelligence to solve the routing problem in a WSN. The first one is based on the cooperative behavior of ants and the second one is based on the way that bee collects nectar.
This paper is organized as follows: in Section 2 we present the theoretical framework; in Section 3 the background; in Section 4 the problem; in Section 5 we propose the solution; in Section 6 we show the results and discussion. Finally, in Section 7 the conclusions and future work are presented.
II. RELATED WORK
A. Theoretical concepts
Wireless Sensor Network
A Wireless Sensor Network (WSN) consists of a large number of small devices called nodes with limited computing power, wireless communication, and sensors to measures some variables from the environment. A sink (central node) node is responsible for collecting the information measured for each node of the network [1-3].
WSN are capable of self-restore. It means that if a node fails, the network finds new ways to route data packets. In this way, the whole network survives, even if individual nodes lose power or are destroyed [4].
Wireless Sensor Networks are a set of electronic devices called nodes with the ability to sense the physical environment variables such as temperature, humidity, sound, light, atmospheric pressure, pollution among and others. These devices communicate with each other wirelessly and can be deployed in a wide geographical area. In this way, it is possible to monitor events that occur within it. One of the most important aspects of a WSN is to save as much energy as possible [5]. An example of a WSN can be seen in Fig. 1
The devices are distributed over a geographic area, and they send the information to a central or sink node. The sink node has serial and Ethernet ports. The central node transmits the information to a PC. The PC will be responsible for those processes that require high computational load, such as the implementation of the routing algorithm.
Bio-inspired algorithms
Bio-inspired algorithms simulate the behavior of natural systems. These algorithms can be applied in of non-deterministic search. Bio-inspired algorithms are one of the most promising areas of research in algorithms design [6,7].
Bio-inspired systems model is an existing phenomenon in nature. This phenomenon is general is not deterministic. Also, often it also has a parallel structure by using several organisms. The organisms are adaptive because they have a feedback with the environment that they use to update their behavior.
There are some models of bio-inspired systems used to solve engineering problems. These include neural networks, swarm-based optimization as Particle Swarm Optimization (PSO), evolutionary algorithms, and immune algorithms [8].
Bonabeau et. al. [8] define the swarm intelligence as: "Any attempt to design algorithms or problem solving-devices inspired by the collective behavior of social insect colonies and other animal societies" [8].
There are several swarm intelligence optimization techniques like ant colony optimization and bee colony optimization. The ant colony optimization (ACO) tries to solve some real problems by imitating the way that ants look for food. ACO involves solving problems that can be transformed into graphs as shown in [9].
Ant algorithms create artificial ants that mimic the behavior of real ants. The real ants move by depositing pheromones. These pheromones are perceived by other ants, and it influences their behavior. The interaction of ants, pheromones and a source of food produce the shortest path between nest and food. This model is very useful for troubleshooting routing in telecommunications networks [10].
Other important techniques of swarm intelligence are bee algorithms. These algorithms model the way that bees search for nectar. The particularity of this behavior is how bees communicate via dance to inform potential sources of food for the entire colony. The colony must continually adapt to each new situation, trying to have the amount of nectar needed for maintenance of the hive, through the appropriate division of labor between field exploration for new sources of food and the exploitation of known sources [11].
B. Background
One of the proposed routing protocol for WSN using swarm intelligence is presented in [12]. The great qualities of the proposed protocol are self-organization, fault tolerance, and environmental adaptation. Another important aspect of this protocol is that it tries to behave like colonies which are organized into groups (clusters) by mechanisms of generation and evaporation of pheromones.
Chen et al. [13] show the importance of self-organization in WSN. They propose a protocol in which first verify the quality of the link before sending information. This protocol called LQER (link quality estimation based routing protocol) selects the route based on a historical state of link quality. The proposed link quality is based on the concept of dynamic window (m, k) where k is the size of the window and m is the number of data packets traveling through it.
WSN are characterized by limited and non-renewable energy supply and therefore an efficient way to extend the life of the network infrastructure is required. One possible way to solve this problem is presented in [14].
The routing in a WSN is a complex job due to restrictions by the energy consumption. Conventional distribution protocols of routing data are not efficient in these networks (WSN). In [15] they have developed more specific protocols that solve this problem in part.
III. PROBLEM
A possible application of the WSN is to monitor environment variables. A WSN is composed of electronic devices called nodes. The nodes have sensors to measure variables such as relative humidity, temperature, sounds, and others. The nodes of the WSN are distributed in a geographical area to detect what is happening around it [15].
These wireless nodes have a limited source of energy, which must be managed very well. Usually, this source is two 1.5 Volt batteries. These batteries allow to sensors of the node to monitor what happens but allows them to communicate to the central node. When a node communicates with others within the same network consumes much energy due to the use of wireless communication [16].
Typically, these networks are composed of many nodes that cover a wide geographical area. For this reason, it is possible to define different paths that could route the information from any node to the central node [12,13,16-19].
Aguilar et. al. [20] define the swarm intelligence as: "The problem with the current protocols for sensor networks is that they use the same path for each communication. However, that is not good to extend the life of the network. Often, when using the same path leads to energy depletion of the nodes along of it that produces a partition of the network.".
An alternative algorithm to define the routing in a WSN is required. This algorithm should choose the best routes of communication between nodes that are within the same network. To this must be taken into account that the power consumption should be low, since this comes from an exhaustible source, the range of the nodes is limited and, then, there are many possible routes within of the network.
IV. SOLUTION
We used the swarm intelligence to solve the routing problem in WSN. The swarm intelligence has shown its efficiency to solve routing problems as traveling salesman, quadratic assignment, and others. Two algorithms were designed: (i) Ant colony optimization (ACO); (ii) Bee colony optimization. A description of both algorithms ants and bees is presented. Also, a simulator was developed to test the designed algorithms.
A. Algorithm Ant Colony Optimization to routing a WSN into Colony Optimization
To describe the routing process, we use the node distribution shown in Fig. 2. A network of wireless sensors with 5 devices is proposed, all with most of their energy. The distances among the different nodes are shown in Fig. 2. The coverage radius of each sensor is 70 meters.
Given this information and assuming that you want to perform routing between sensor 5 and 1. The pheromone matrix is shown in Table I.
The Pheromone matrix (τ) is a square matrix with a dimension equals to the number of nodes in the network. This matrix is initialized with a value τ_ini. τ_ini is calculated dividing the distance between the node both transmitter and the receiver (in this case 76.79 meters) by the number of nodes (5 in this case). The value for τ_ini would be 0.002604. The diagonal of the matrix is initialized to zero because these positions represent the connection of a node to itself.
The next step is the construction of the tours of each of the ants from the transmitting node (5) to the receptor node (1). It assumes that an ant is at node 5. The ant must decide the next node that it goes to visit. The general way to choose the next node is shown in Equation 1, which shows the probability that has a node to be selected to belong to the tour of an ant but considering only the distance.
Where,
Probability of ant k to move from node x toward node y.
Amount of pheromone between node x and node y.
Heuristic measure that indicates the cost to move from node x toward node y. In this case where d xy is the distance between node x and y.
Parameter to control the importance of.
Parameter to control the importance of .
In this work, the aim is to find a tour but considering the amount of energy in the nodes. Equation 2 shows the probability that has a node to be selected to belong to the tour of an ant but considering both the distance and the energy.
Where,
Probability of ant k to move from node x toward node y.
Amount of pheromone deposited between node x and node y.
Heuristic measure that indicates the cost to move from node x toward node y. In this case where d xy is the distance between node x and y.
available energy or power in node y.
Parameter to control the importance of
Parameter to control the importance of .
In the example, the ant is located at the node 5. To select the next node in the tour of the ant the transition probabilities to go to node 2, 3 and 4 must be calculated. The transition probabilities are shown Table II. The highest probability is that of sensor 3 because it is the closest node to the receiver and it has good energy available. If for some reason it has no energy, the algorithm would give it a low probability and the high probability would be in another node.
The ant is located at node 5, so it has two strategies to select the next node: exploitation and exploration. To choose the strategy, a random number between 0 and 1 is generated. There is a parameter in the algorithm called probability of exploitation. If the random number is lesser than this probability, the next node to be selected should be the node with the highest probability. We call this strategy exploitation. If the random number is higher than this probability the next node will be selected taking a random between possible nodes. The last process defines the next node to be visited by the ant. This process is repeated until the receiver node is reached. The nodes that the ant visited form the route of this ant.
Now the pheromone trail is updated. This update is applied to routes found by each ant, and this is called local pheromone update. The process is done in sequential order. For the example of performing routing between the sensors 5 and 1 (Fig. 2), the route found by the ant is {5-4-1}, this formula is applied in the position τ5, 4 and τ4,1 of the τ matrix. The local pheromone update is done using equation 3.
Where,
Amount of pheromone between node x and node y.
Coefficient of pheromone evaporation.
Amount of pheromone change between node x and node y produce by ant k.
When all ants find their routes, it is necessary for calculating the performance of each path. Comparing the fitness of all tours the best path is detected. In our example (Fig. 2.) the best tour is {5-3-1}, and its fitness is 0.090. The pheromone among the nodes that form the best tour is updated, and this is called global pheromone update using equation 4.
Where,
Amount of pheromone between node x and node y belonging to the best tour.
Coefficient of pheromone evaporation.
Amount of pheromone change between state x and state y belonging to the best tour. In this case where d tr is the distance between transmitter and receiver node and N is the total number of sensor.
The result is meaning that in the positions τ5,3 and τ3,1 of the pheromone matrix τ the pheromone is changed based on Equation 4. This cycle should be performed until the number of iterations is reached. At the finish, the algorithm returns the best-found solution.
B. Bee algorithm adapted to WSN
To describe the routing process, we will take into account the node distribution shown in Fig. 3. A WSN with six devices is proposed, all of them with most of their energy. The distances among the different nodes are shown in the plane. The coverage radius of each node is 70 meters. The goal is to establish a connection between nodes 1 and 6.
To solve this problem, five bees are used. Each bee makes a random tour from transmitter to receiver node. There is a parameter (SS= Selected Sites) that define the quantity of tour to be selected from the total number of tours. Assuming that each bee generated a successful tour, the tours would be the shown in Table III.
For this example, SS is equal to five, therefore, all the five random routes found by bees are stored. The tours are organized from high to low fitness. From five tours, the three with higher fitness are called elite sites (highlighted in the table). The others two tours are called normal sites. The first elite site is modified using a heuristic. In our example, the elite site that corresponds to the best tour of first elite bee would be from origin 6 to destination 1, i.e., the route {6-5-4-3-1}.
A random number between 1 and 5 is generated. For example, if the generated number is 2, then taken as cutoff point and from there a new route to the destination is created. The new origin is the sensor 5. The Partial tour of the first elite bee will be origin 6 to destination 5, i.e., the route {6-5}.
Now, a Tour is newly created, but considering that the origin is sensor 5 and the destination is the sensor 1. The selection of the next sensor from the new origin it should consider some aspects: (i) the possible sensor should be on; (ii) must be within the coverage of the sensor origin; (iii) the distance sensor possible to the receiving node must be smaller than the source sensor to the receiver.
A possible sensor should have met the rules mentioned. In our example is located in the sensor 5, it is possible to jump to nodes 2, 3 or 4. The aim is to select the next node trying to get the best tradeoff between distance and energy, so we need to apply Equation 5. So, we obtain the maximum value to choose the selected sensor. For the example of Fig. 3, the selected sensor is number 3.
Where,
Value cost to move from node x toward node y.
Distance between node x and y.
Available energy or power in state or node y.
Equation 5 should be done with all possible nodes to reach the receiver node. This new tour will be stored. Continuing the example, the new tour for first elite bee might be {6-5-3-1}. This cycle should be performed until all bees complete its tours.
After, should calculate the profits of each of the solutions found by the bees. Then, the solutions are sorting in descending order according to its profits. The Selected Sites (SS) are selected (five according to the example) which were the basis of the generation next. This process must be done by the number of iterations. Finally, the algorithm returns the best solution found.
V. RESULTS AND DISCUSSION
We use the BIOROUTE simulator [21] for testing the algorithms. Manually one thousand nodes were distributed (See Fig. 4), in a plane of 100m x 100m. Bio-inspired algorithms base on swarm intelligence were run 5 times. A non bio-inspired algorithm was implemented, and it was run 50 times. The average length belongs path found, energy consumed, number of hops (number of sensors that should light from the source node to destination node) and, the CPU time consumed is taken into account. In our work, the number of hops is counted from the transmitter node to the receiver node. For example, in the route {9-10-1}, the number of hops would be three and not two due the three sensors perform power consumption.
A. Non Bio-Inspired Algorithm
The algorithm was designed using the multi-hop model; i.e., a node transmits to the receiver node by forwarding its data to one of its neighbors, which is near to the receiver node. The last procedure is repeated until the receiver node is reached [22]. Fifty running of the algorithm were performed. This approach only took into account the distance and not the energy available therein. The results are shown in Fig. 5, which shows that the values found are very next to the actual distances.
The disadvantage of the multi-hop algorithm refers solutions found will be repeated, and this will cause problems. The algorithm does not take into account the available energy of the sensors, and the calculated route is always the same. It can cause problems for the network, because the nodes that are used continuously may finish its energy. Therefore, the network can be split with good energy in some nodes but without communication among them.
B. Bio-inspired Algorithms
In the simulations, we considered the next situations: (i) Optimize distance. It means that the calculations only take into account the distance between the different nodes; (ii) Optimize energy. It means that the calculations only take into account the energy; (iii) Optimize distance and energy: It means that the two variables are considered to calculate the best route. Fig. 6shows the behavior of the bio-inspired algorithms. The simulations were done using both an ant algorithm and a bee algorithm.
The three algorithms solved each simulation. When we use the distance to optimize, the algorithms have a similar behavior. If we use the energy to optimize, the bee algorithm is the best. When we use the distance and the energy to optimize, the shortest route is found by the algorithm. Fig. 7 shows the CPU time of the implemented algorithms.
According to Fig. 7 the algorithm computationally most weight is the ant colony optimization (ACO). The faster algorithm is the non-bio-inspired algorithm, but it has problems with the life of the network.
C. Analysis of results with the discharge of the wireless sensor network
This test was performed in order to observe the behavior of the two algorithms through time elapsed and until was finish the energy total in the Wireless Sensor Network (WSN). We used a WSN with twenty-five sensors, and we assigned energy of 0.1 Ah for each node in the network, i.e., it was assigned only 2% of the total energy which a node can have (4.8 Ah).
Random events were simulated to probe the behavior of the WSN. A node is chosen of random way to send information to another node which also was chosen randomly. After, routing is performed. The energy of the nodes of the route is decreased. The quantity of energy consumption depends if the node is transmitting o receiving information. When a node transmits information consumes a total of 0.00974 A. When a node receives information uses a total of 0.00997 A. [23].
This process is performed cyclically until all sensors went out, So, the life of the network finished.
The last process was performed 20 times with every algorithm and only taken into account the optimization of distance and energy simultaneously. Each time the number of events generated is stored until the network is fully downloaded. Fig. 8 shows the average of events that were generated in the WSN.
The network is discharged of balanced form, although the events were completely random. The tests showed that the maximum number of nodes with energy at end of the discharge did not exceed 2. It important mentioning that there were not isolated sensors. This behavior is different to the non-bio-inspired algorithm.
VI. CONCLUSIONS AND FUTURE WORK
In this paper, we proposed the design and implementation of bio-inspired algorithms to solve the routing problem in Wireless Sensor Networks (WSN). We create two bio-inspired algorithms based on ants and bee behavior.
The non-bio-inspired algorithm can find a route in a fast way, but, routes found are repeated because the algorithm not taken into account the nodes energy. Therefore, it can cause nodes discharge in an unbalanced way, which results in the network partition. We observed that the routes found by bio-inspired algorithms are not always the same, this contributes to the network is discharged a balanced way. The explaining can be the random nature of bio-inspired algorithms and, that they consider the energy of sensors.
The bio-inspired algorithms developed can find possible solutions to communicate two sensors. However, the found routes depend on the randomness of such algorithms. The computational runtimes show the bee algorithm was faster than the ant algorithm in most tests, and this is due that the ant algorithm must perform a more complex computation. In this work only was considered an event at time.
As future work, we can be considering more events at the same time in different nodes. We propose design and implement others bio-inspired algorithms such as particle swarm optimization (PSO), genetic algorithms, bacteria foraging optimization (BFO), and others to solve the problem of routing a WSN. Finally, we propose to design and to implement bio-inspired algorithms to achieve the routing in an actual WSN.