An Artificial Bee Colony-Based Green Routing Mechanism in WBANs for Sensor-Based E-Healthcare Systems

At present, sensor-based E-Healthcare systems are attracting more and more attention from academia and industry. E-Healthcare systems are usually a Wireless Body Area Network (WBANs), which can monitor or diagnose human health by placing miniaturized, low-power sensor nodes in or on patient’s bodies to measure various physiological parameters. However, in this process, WBAN nodes usually use batteries, and especially for implantable flexible nodes, it is difficult to accomplish the battery replacement, so the energy that the node can carry is very limited, making the efficient use of energy the most important problem to consider when designing WBAN routing algorithms. By considering factors such as residual energy of node, the importance level of nodes, path cost and path energy difference ratios, this paper gives a definition of Optimal Path of Energy Consumption (OPEC) in WBANs, and designs the Optimal Energy Consumption routing based on Artificial Bee Colony (ABC) for WBANs (OEABC). A performance simulation is carried out to verify the effectiveness of the OEABC. Simulation results demonstrate that compared with the genetic algorithm and ant colony algorithm, the proposed OEABC has a better energy efficiency and faster convergence rate.


Introduction
Sensor-based E-Healthcare systems are a new technology developed in the field of health care in recent years. Wireless Body Area Networks (WBANs) [1] are mainly used in emergency rescue, telemedicine, home care and other occasions. Medical sensor nodes are worn on the body surface or implanted in the human body to monitor the patient's medical data, these physiological data are transferred to a sink through the WBAN, and the sink processes the data or sends the data to a medical monitoring center [2]. The nodes are mostly powered by microbatteries, the energy is very limited, so if some nodes are frequently used for data forwarding, it is likely to lead to the early depletion of these nodes, affecting the network connectivity, and eventually leading to a reduced global network lifetime [3][4][5]. Compared with the traditional data-centric WSN, WBANs' human-centered features make their energy requirements more demanding [6] is several aspects: (1) Faster signal transmission attenuation: the specificity of the human tissue structure and the shadow effects make the signal in the transmission process have a great path loss [7], resulting in WBANs' communication energy consumption being much higher than that of other normal networks of the same size. (2) Varying network communication link time: the network topology of WBANs is closely related to the changes in

The Important Level Factor α
There are many types of medical sensor collection activities. Some are essential, and must always be guaranteed, such as ECGs or blood pressure; some can be experienced interruption or delay, such as body temperature; and some nodes even only have forwarding functions, without the acquisition function. According to these characteristics, the importance level factor α of the node is defined, so the higher the importance level of the node, the greater the factor α. The maximum α is 9, and the lowest is 1.
In Figure 1 [29], the WBANs has 15 various types of nodes, the node set V is {v 0 , v 1 , v 2 , v 3 , v 4 , v 5 , v 6 , v 7 , v 8 , v 9 , v 10 , v 11 , v 12 , v 13 , v 14 }, where v 0 is EEG, v 1 is hearing aid cochlear implant, v 2 is positioning, v 3 is motion sensor, v 4 is blood pressure, v 5 is Blood pump ECG, v 6 is insulin injection, v 7 is glucose, v 8 is blood oxygen, v 9 is lactic acid, v 10 is artificial knee1, v 11 is artificial knee2, v 12 is pressure sensor1, v 13 is pressure sensor2, v 14 is sink [30]. The initial value of the residual energy of all nodes is 50, the node's important level factor α varies with the sensor node, and the corresponding network topology as shown in Figure 2, where each node includes the node name, the residual energy and the importance level factor α. The number on the link between nodes is the transmission energy consumption.

Mathematical Description of Path Energy Consumption
Definition 2. Path Set, denoted as P. The source node is v 0 , the destination node is v n , the alternate sequence v 0 . . . v i v j . . . v n is a path from v 0 to v n , let P= {r 1 , r 2 , r 3 , . . . , r k }, so P is the collection of all paths from v 0 to v n .
Definition 3. Path Transmission Energy Consumption, denoted as E. The power consumption required to transfer a packet through r i is formulated as: The larger the E(r i ), the greater the energy required to transfer the data using the path, and vice versa. Definition 4. Path Cost, denoted as C. The cost of the node v i is formulated as: The cost of the path r i is the sum of the cost of all nodes in the path and is formulated as: With the decrease of the residual energy of the node, the cost of transmitting the data of the node will be increased, the C(r i ) when the path r i containing the node v i also increases, and vice versa.
Definition 5. Path Energy Difference Ratio, denoted as η. In the nodes of path r i , the node with the largest remaining energy is max and the node with the smallest energy is min, the path r i energy difference ratio η is formulated as: η(r i ) indicates the degree of energy difference between the maximum energy node v max and the minimum node v min in the path r i , and the larger the η, the smaller the difference is, the better the energy consumption of the path r i , otherwise the worse. α min is the importance level factor of v min , used to adjust η, when v min is very important or the energy will be exhausted, you can increase α min , making η smaller. At the same time, in order to protect the node which residual energy has reached its may easily cause some nodes to run out of energy, the path will not be utilized.

Definition of the OPEC
The OPEC is denoted by r opt , choosing r opt can use the energy of nodes reasonably and efficiently, so that the energy of the whole network can be steadily reduced and the survival time of the whole network can be prolonged. Therefore, when calculating r opt we need to consider the energy difference ratio η, path cost C and transmission energy E, but the weight of each parameter is different. First we consider η, select the maximum path of η from all paths that conform to η r > η Th , and try not to use less energy or very important nodes to transmit data. If there are multiple paths with the same η, the path with the lowest C is selected, to reduce the usage of nodes with less residual energy. If there are still multiple paths with the same η and C, select the path with the lowest E.

Introduction to the Artificial Bee Colony (ABC) Algorithm
The ABC algorithm is inspired by the behavior of bee colonies, which is an optimization method mimicking the behavior of bees, proposed by the Karaboga team in 2005 to optimize the algebra problem [14]. It is an application of cluster intelligence concepts. Through the local optimization of artificial bees, the global optimal value emerges. In the ABC algorithm, the colony of artificial bees contains three groups of bees: worker bees, onlookers and scouts. A bee waiting on the dance area for making decision to choose a food source, is called an onlooker and a bee going to the food source visited by itself previously is named a worker bee, a bee carrying out random search is called a scout. The position of a food source represents a possible solution of the optimization problem and the amount of nectar of a food source corresponds to the quality (fitness) of the associated solution.
In the first step, the ABC generates a randomly distributed initial population of SN solutions, where SN denotes the size of the population. Each solution X i (i = 1, 2, . . . , SN) is a D-dimensional vector.
Here, D is the number of optimization parameters. In order to produce an initial food position, the ABC uses the following expression: where x max and x min are the upper and lower bounds of search space. After initialization, the worker bee will start the neighborhood search. It generates a new candidate position based on the local information in its memory and checks the amount of nectar in the new location. If the new location is better than the original position, the bee remembers the new location and forgets the original location. The new candidate position equation is: The above is called the ABC algorithm search equation, where k ∈ {1, 2, . . . , BN}, j ∈ {1, 2, . . . , D} are randomly chosen indexes. Although k is determined randomly, it has to be different from i. φ i,j is a random number between [−1, 1].
After the worker bees complete the search process, they will share the memory of the nectar with onlookers through the dance. An onlooker bee chooses a food source depending on the probability p i associated with that food source, p i is calculated by the following expression: where f it i is the fitness value of the solution i evaluated by its employed bee. When a nectar source is selected, the onlooker bee will use Equation (8) to produce a new position. By checking the amount of nectar in the new position, if the position is better than the one in memory, it will be replaced, otherwise the original position is left. In order to prevent the algorithm from falling into a local optimum, if the amount of nectar does not improve after the limit cycle, the colony will abandon the position, whereby the worker bee becomes a scout and randomly generates a new nectar according to Equation (7).

The Fitness Function of the Path
The general algebra problem can construct the fitness function directly according to the requirement of the problem. It can be found that the optimal path of energy needs to consider the Path Energy Difference Ratio η, Path Cost C, Path Transmission Energy Consumption E, so the higher the fitness of the path, the better the energy consumption. We define the fitness of the path r k according to Equation (9): where α, β, γ are the adjustment parameters to ensure that the η is the maximum weight, followed by C. E is minimum, and its value depends on the specific network environment.

Initial Path Generation Formula
In the initial stage, the ABC algorithm generates SN initial solutions for the worker bees randomly by using Equation (6). In the algebraic optimization problem, the solution space is continuous, so the randomly generated solutions are feasible solutions, but each solution of the path planning problem is a path in a particular network topology, its path is discrete, so not any combination of nodes is a path, therefore, we cannot directly apply Equation (6) to generate the initial path.
In order to find a random path, our method is to randomly select a node from neighbors of node v 0 as the next node of the path, and then continue to generate the next node of the path in the same way. If one cannot find the neighbor node, then one goes back to the previous step to select another neighbor node as the next node until the next node is the path end point v n , to obtain a random path.
Let the function Adj(i) return the set of all adjacencies of node i. Then Equation (10) for generating the node t in path r i is: where t∈{0, 1, . . . , m − 1}, m is the number of nodes of path i, t is a randomly selected node in path i, and t − 1 is the predecessor node of node t.

The Generation Formula of the New Path
Definition 7. In two paths, if there are sections which have the same starting and ending points, it is said that same segments are Same Area (SA) for the two paths.
. v n >, r i and r j have multiple SA, randomly select an SA, denoted as SA α . SA α in r i is <r . . . s>, denoted as SA αi ; in r j is <p . . . q>, denoted as SA αj . If SA αi in path r i is replaced by SA αj , so the new path is Proof. r i is a connected path, and its sub-paths < v 0 . . . v r−1 > and < v s+1 . . . v n > are also connected in accordance with the characteristics of the connected path.
Using the SA αj of the r j path to replace the SA αi of the r i path, the r i becomes Since r j is connected, so the SA < v p . . . v q > of its must be connected. In summary, the sub-paths When path i and j exist k SA, then SA t in the path i and j are denoted as SA ti and SA tj respectively, The function GetSA(i, j, t) returns SA tj , then the equation for generating the new path r i * is: Equation (11) is the search equation for the OEABC algorithm, i, j ∈ {1, 2, . . . , SN}, t ∈ {0, 1, . . . , m − 1}, m is the number of SA of path i and path j.

Experiments and Results Analysis
We set the body area network node set V = {v 0 , v 2 , v 3 , . . . , v 150 } for the simulation environment, the data sending node is v 0 , and the sink node is v 150 ; the node remaining energy c i ∈ {1, 2, . . . , 50}; the node service factor α i ∈ {1, 2, 3}; E = {e 1 , e 2 , e 3 , . . . , e 1525 } is an edge set. When <i, j> ∈ E, node i transmits a packet to node j, energy consumption a ij ∈ {1, 2, 3}. In order to facilitate the verification result, it is assumed that the node topology is a hierarchical network, and each layer node is only connected to the upper layer and the next layer. The adjustment parameters for setting the fitness function are: α = 50, β = 5, γ = 0.1.
We implemented the OEABC algorithm in C++ programming and tested it in the above simulation environment. In our simulation configuration, we adopt the following simulation settings: the data collection node is v 0 and the sink node is v 150 . The communication link is established between neighbor nodes, and each node has 10-15 predecessors and successors. The data packet is sent out from v 0 , the data packet is exchanged by the successor node, the transmission path from the data collection node to the network sink node is established, and the data packet is sent to the sink node v 150 . The main simulation parameter values are listed in Table 2 below. The OEABC parameters are set as: SN = 5, Limit = 10, Cycle = 50, and the running process of the algorithm is as follows: The first step is to initialize the population. Randomly generate five paths and calculate the fitness of each path. The results are shown in Table 3. Path 4 has the best fitness and is the optimal path. The second stage is the worker bee stage. The results are shown in Table 4. It can be seen that paths 1 and 4 are optimized, the path fitness is improved, and the optimal path is path 4. The third stage is the onlooker stage. As shown in Table 5, path 3 is optimized and the optimal path is still path 4. Since it is the first operation of the algorithm, it does not meet the requirements of Limit, so the scout phase is not performed. The results of the operations after 50 iterations, are shown in Table 6. It can be seen that the five paths have been optimized, the optimal path has changed from path 4 to path 3, and the fitness has also increased from the initial 58.42 to 71.46.

Parameter Analysis
Before running the OEABC, one needs to set the SN, Limit, and Cycle parameters. SN is the population size. Limit is when to give up with the current solution required for the maximum number of searches. Cycle refers to the number of iterations of the algorithm. By setting different SN, Limit and Cycle parameters, run the OEABC 30 times, record and analyze the fitness of the generated path.

The Analysis of SN
Set Limit = 30, Cycle = 50. When the SN is 20, 30, 40, respectively, the fitness of the path generated by the OEABC is shown in Figure 5. As can be seen from Figure 5, When SN = 20, in the 30 paths generated by the algorithm, a total of four paths have a fitness change greater than 10% of the average fitness, compared with the generated paths, the ratio of paths greater than 10% of the average fitness is 13%. This is because the initial paths generated by OEABC are stochastic, and when the number of iteration Cycle is greater than the limit, the new path generated by the scout bee is also stochastic.  SN is 20, 30, 40, respectively, the fitness of the path generated by the OEABC is shown in Figure 5. As can be seen from Figure 5, When SN = 20, in the 30 paths generated by the algorithm, a total of four paths have a fitness change greater than 10% of the average fitness, compared with the generated paths, the ratio of paths greater than 10% of the average fitness is 13%. This is because the initial paths generated by OEABC are stochastic, and when the number of iteration Cycle is greater than the limit, the new path generated by the scout bee is also stochastic. When SN = 30, there are three points with an amplitude of change greater than 10% of the average fitness, and compared with the generated paths, only 6% of the paths are more than 10% of the average fitness, and the variation amplitude of the generated solution tends to converge with the increase of SN.
When SN = 40, there is only one point with a variation amplitude greater than 10% of the average fitness, and compared with the generated paths, only 3% of the paths are more than 10% of the average fitness, the fluctuation range of the fitness curve becomes smaller and tends to be stable. Therefore, the bigger the SN is, the higher the fitness of the path generated by the algorithm, the closer we are to the optimal solution. At the same time, it can also be seen that the path ratio of the fitness change amplitude greater than 10% of the average fitness decreases from 13% to 3%. Therefore, with the increase of SN, the variation amplitude of the generated solution tends to converge, and the stability of the algorithm is gradually improved. This is because SN becomes larger, which means that the larger the solution space is, the higher the probability of obtaining the optimal solution is. However, the increase of SN will lead to the synchronous increase of the overhead of the algorithm, When SN = 30, there are three points with an amplitude of change greater than 10% of the average fitness, and compared with the generated paths, only 6% of the paths are more than 10% of the average fitness, and the variation amplitude of the generated solution tends to converge with the increase of SN.
When SN = 40, there is only one point with a variation amplitude greater than 10% of the average fitness, and compared with the generated paths, only 3% of the paths are more than 10% of the average fitness, the fluctuation range of the fitness curve becomes smaller and tends to be stable. Therefore, the bigger the SN is, the higher the fitness of the path generated by the algorithm, the closer we are to the optimal solution. At the same time, it can also be seen that the path ratio of the fitness change amplitude greater than 10% of the average fitness decreases from 13% to 3%. Therefore, with the increase of SN, the variation amplitude of the generated solution tends to converge, and the stability of the algorithm is gradually improved. This is because SN becomes larger, which means that the larger the solution space is, the higher the probability of obtaining the optimal solution is. However, the increase of SN will lead to the synchronous increase of the overhead of the algorithm, which cannot increase the SN indefinitely. It is necessary to select the SN which is suitable for the scale of the problem.

The Analysis of Limit
Set SN = 30, Cycle = 50. When the Limit is 5, 30, 50, respectively, the fitness of the path generated by the OEABC is shown in Figure 6. As can be seen from Figure 6, when Limit = 5, the overall level of the generated solution is low, and the average fitness of the path is only 46. This is because the Limit value is small, meaning that it will be possible to release the scout bee multiple times to generate random paths. Randomness enhancement of the algorithm generation solution and the probability of finding the optimal solution decreases obviously because the experience obtained before cannot be fully utilized to search for a new solution.
When Limit = 30, although the Limit is not the largest, the overall level of the fitness curve is the highest, and because of the reasonable value of the Limit, the algorithm does not fall into a local optimum, nor is it completely dependent on stochastic generation, giving full play to the advantages of both local and global optimization of the ABC algorithm.
When Limit = 50, the Limit becomes larger, but the fitness of the generation path decreases. When the value of Limit is larger, the generated path can easily to fall into a local optimum, and one cannot achieve global optimization, which leads to a low level of fitness of the path, so a bigger Limit is not the best one, and there is a suitable Limit size to get a better path fitness. The size of the Limit needs to be proportional to the SN, the Cycle and other parameters of OEABC to avoid both complete stochasticity and local optimization.

The Analysis of Cycle
Set SN = 30, Limit = 30, when the Cycle number is 30, 60, 90, respectively, the fitness of the path generated by the OEABC is shown in Figure 7. As can be seen from Figure 6, when Limit = 5, the overall level of the generated solution is low, and the average fitness of the path is only 46. This is because the Limit value is small, meaning that it will be possible to release the scout bee multiple times to generate random paths. Randomness enhancement of the algorithm generation solution and the probability of finding the optimal solution decreases obviously because the experience obtained before cannot be fully utilized to search for a new solution.
When Limit = 30, although the Limit is not the largest, the overall level of the fitness curve is the highest, and because of the reasonable value of the Limit, the algorithm does not fall into a local optimum, nor is it completely dependent on stochastic generation, giving full play to the advantages of both local and global optimization of the ABC algorithm.
When Limit = 50, the Limit becomes larger, but the fitness of the generation path decreases. When the value of Limit is larger, the generated path can easily to fall into a local optimum, and one cannot achieve global optimization, which leads to a low level of fitness of the path, so a bigger Limit is not the best one, and there is a suitable Limit size to get a better path fitness. The size of the Limit needs to be proportional to the SN, the Cycle and other parameters of OEABC to avoid both complete stochasticity and local optimization.

The Analysis of Cycle
Set SN = 30, Limit = 30, when the Cycle number is 30, 60, 90, respectively, the fitness of the path generated by the OEABC is shown in Figure 7.
to be proportional to the SN, the Cycle and other parameters of OEABC to avoid both complete stochasticity and local optimization.

The Analysis of Cycle
Set SN = 30, Limit = 30, when the Cycle number is 30, 60, 90, respectively, the fitness of the path generated by the OEABC is shown in Figure 7.  As can be seen from Figure 7, When Cycle = 30, in the 30 paths generated by the algorithm, the change amplitude of fitness is greater than 10% of the average (that is, the fitness is more than 57 or less than 47), which is only the 16th path with a value of 60, merely 3% of the paths are more than 10% of the average fitness. The reason is that Cycle is too small and there are not enough iterations of the solution, so it is difficult to generate the path with higher fitness.
When Cycle = 60, compared with the previous round, the average fitness of the current round increased by nearly 10% from 52 to 58, because the Cycle value is large enough to enable the solution to be fully iterated.
When Cycle = 90, compared with Cycle = 60, the average fitness rose from 58 to 61, an increase of about 5%. Although the further increase of the Cycle enables the solution to be further optimized and the best solution 70 appears, the improvement decreases gradually. This is because the initial solution of the ABC algorithm and the solution generated by the scout bee are both stochastic, if the random solution is not good, it is difficult to generate the solution with high fitness by simply increasing the number of iterations.
Therefore, the bigger the Cycle is, the higher the fitness of the algorithm generating path is. It can also be seen that when the Cycle rises from 30 to 60, the average fitness increase is significantly greater than when the Cycle rises from 60 to 90. That is to say, when the Cycle reaches a certain value, the effect of improving path fitness will be worse and worse simply by adding to the Cycle number. The Cycle number not only maintains a proportional relationship with the SN, Limit and other parameters, but also considers the computational ability of nodes to ensure that the solutilon can be quickly iterated.
In summary, through the analysis of the SN, Limit and Cycle parameters, it can be seen that the fitness of the path generated by OEABC with different parameters changes greatly, which has a great impact on the performance of the OEABC. The SN represents the size of the bee colony, and a larger colony will be able to cover a wider range of solution space, effectively improving the probability of finding an optimal solution. Through the roulette mechanism, OEABC implements positive feedback on the path of higher fitness, by conducting the Cycle number of rounds of search in the neighborhood, iterate to find the path with higher fitness, but the problem is that it is easy to fall into a local optimum. The scout bee mechanism is used to solve this problem, and when a path cannot be optimized after the Limit iterations, it will be discarded and a random path will be generated, ensuring an opportunity to continue searching for the optimal solution globally. In the specific application scenario, selecting parameters not only considers the performance of the OEABC algorithm itself, but also should take into account the size of the body area network, the computational ability of nodes and specific requirements that need to be addressed.

Comparative Analysis
In order to further verify the performance of the algorithm, OEABC, the genetic algorithm [37] and ant colony [38] algorithms are used to generate the optimal energy consumption path in the above network environment. Two experiments are designed to compare and analyze the three heuristic algorithms. In Experiment 1, we compared the percentage for the appearance of optimal solution, while in Experiment 2 is the convergence rate of the algorithm. Experiment 1. The population size and the number of iterations of the three algorithms are the same, 20 and 100, respectively, other parameter settings also choose the most commonly used settings, details as follows: OEABC: The Limit parameter is 30. Genetic Algorithm: crossover probability Pc is 0.8, mutation probability Pm is 0.2. Ant Colony Algorithm: the proving factor ALPHA is 1.0, the expected factor BETA is 2.0, the pheromone volatility coefficient ROU is 0.5.
We run the above three algorithms 50, 100 and 150 times, respectively, then calculate the percentage for the appearance of the optimal solution. The calculation method is the number of optimal solutions divided by the total number of runs, and the results are shown in Table 7.

Experiment 2.
In order to verify the convergence speed of the algorithm, in the above network environment, set the parameters SN = 30, Limit = 20, Cycle = 50, by recording the fitness of five paths generated by OEABC that form a convergence curve. The algorithm runs five times, and the corresponding convergence curve shown in Figure 8.   Figure 8.
The convergence rate Cv is calculated as: where rinit is the initial path, ropt is the optimal energy consumption path. As can be seen from Figure 8, after 50 iterations, the 1st convergence is from 50 to 75, Cv is 0.5; the 2th from 47 converge to 79, Cv is 0.64; the 3th from 53 converge to 77, Cv is 0.48; the 4th from 49 converge to 79, Cv is 0.6; the 5th from 55 converges to 75, Cv is 0.4, so the arithmetic average of 50 times Cv is 0.52.
Comparing the convergence rates of the above three algorithms in the case of population size 20, 30, 40, the convergence rate Cv is calculated using Equation (12). The number of iterations are 50, the other parameters are the same as in Experiment 1. The experimental results are shown in Table 8.   The convergence rate Cv is calculated as: where r init is the initial path, r opt is the optimal energy consumption path. As can be seen from Figure 8, after 50 iterations, the 1st convergence is from 50 to 75, Cv is 0.5; the 2th from 47 converge to 79, Cv is 0.64; the 3th from 53 converge to 77, Cv is 0.48; the 4th from 49 converge to 79, Cv is 0.6; the 5th from 55 converges to 75, Cv is 0.4, so the arithmetic average of 50 times Cv is 0.52.
Comparing the convergence rates of the above three algorithms in the case of population size 20, 30, 40, the convergence rate Cv is calculated using Equation (12). The number of iterations are 50, the other parameters are the same as in Experiment 1. The experimental results are shown in Table 8. Through the comparison results, we can see the OEABC has an obvious advantage in solving the problem of optimal energy consumption path of WBANs, whether the percentage for the appearance of optimal solution or the convergence rate of the algorithm are considered.

Conclusions
By considering the factors that affect the energy consumption of the WBANs, the definition of the optimal energy consumption path is given. Combined with the idea of ABC, using the method of exchanging path SA, the OEABC algorithm is designed and implemented, and the ABC is successfully applied to solve the problem of discrete solution space. The experimental results show that the OEABC can effectively solve the NP problem of the optimal energy consumption path in WBANs. Compared with the ant colony algorithm and genetic algorithm, it is further shown that the OEABC has a good performance in obtaining the optimal path of energy consumption and convergence rate.