PCA-Guided Routing Algorithm for Wireless Sensor Networks

An important performance concern for wireless sensor networks (WSNs) is the total energy dissipated by all the nodes in the network over the course of network lifetime. In this paper, we propose a routing algorithm termed as PCA-guided routing algorithm (PCA-RA) by exploring the principal component analysis (PCA) approach. Our algorithm remarkably reduces energy consumption and prolongs network lifetime by realizing the objective of minimizing the sum of distances between the nodes and the cluster centers in a WSN network. It is demonstrated that the PCA-RA can be efficiently implemented in WSNs by forming a nearly optimal K-means-like clustering structure. In addition, it can decrease the network load while maintaining the accuracy of the sensor measurements during data aggregating process. We validate the efficacy and efficiency of the proposed algorithm by simulations. Both theoretical analyses and simulation results demonstrate that this algorithm can perform significantly with less energy consumption and thus prolong the system lifetime for the networks.


Introduction
Wireless sensor networks (WSNs) [1] consist of batterypowered nodes which inherit sensing, computation, and wireless communication capabilities.Although there have been significant improvements in processor design and computing issues, limitations in battery provision still exist, bringing energy resource considerations as the fundamental challenge in WSNs.Consequently, there have been active research efforts devoted to lifting the performance limitations of WSNs.These performance limitations include network throughput, energy consumption and, network lifetime.Network throughput typically refers to the maximum amount of packets that can be successfully collected by the cluster heads (CHs) in the network, energy consumption refers to the minimize energy dissipation that nodes in the network consume, and network lifetime refers to the maximum time limit that nodes in the network remain alive until one or more nodes drain up their energy.
The routing algorithms have been specifically designed for WSNs because the energy optimization is an essential design issue.A good routing scheme is helpful in improving these performance limits such as reducing the energy con-sumption, prolonging the network lifetime, and increasing the network throughput.Network researchers have studied a great variety of routing protocols in WSNs differing based on the application and network architecture.As demonstrated in [2,3], it can be classified into four categories: flit, hierarchical clustering, location-based routing, and QoSbased routing.The current routing protocols have their own design trade-offs between energy and communication overhead savings, as well as the advantages and disadvantages of each routing technique.
As per the representative hierarchical clustering protocol, low energy adaptive clustering hierarchy (LEACH) [4] has simplicity, flexibility, and scalability because its manipulations rely on randomized rotation of the cluster heads (CHs), but its features of unregulated distribution, unbalanced clustering structure, uniform initial energy, and so on, hinder its performance.Based on LEACH, there are many variants, such as [5][6][7][8].LEACH-E [5] more likely selects the nodes with higher energy as the CHs.LEACH-C [5] analytically determines the optimum number of CHs by taking into account the energy spent by all clusters.PEGASIS [6], TEEN [7], and ATEEN [8] improve the energy consumption by optimizing the data transmission pattern.HEED [9] is a complete distributed routing protocol which has different clustering formations and cluster-heads selecting measures.These protocols have many restrictive assumptions and applicable limitations, so it has great improvement space and extensibility.The rapid development of wireless communications technology, and the miniaturization and low cost of sensing devices, have accelerated the development of wireless sensor networks (WSNs) [10,11].As in [12], Zytoune et al. proposed a uniform balancing energy routing protocol (UBERP).The BP K-means [13] and BS K-means [14] can improve the structure of clusters and perform better load-balance and less energy consumptions.HMP-RA [15] proposes a solution to address this issue through a hybrid approach that combines two routing strategies, flat multihop routing and hierarchical multihop routing.ESCFR and DCFR can map small changes in nodal remaining energy to large changes in the function value and consider the end-to-end energy consumption and nodal remaining energy [16].Biologically inspired intelligent algorithms build a hierarchical structure on the network for different kinds of traffic, thus maximizing network utilization, while improving its performance [17].In the case where sensor nodes are mobile, as in [18,19], the nodes can adjust their position to help balance energy consumption in areas that have high transmission load and/or mitigate network partition.
In this paper, we consider an overarching algorithm that encompasses both performance metrics.It desires to minimize the sum of distances in the clusters.We show that the principal component analysis (PCA) [20], a useful statistical technique that has found application in fields such as face recognition and image compression, and a common technique for finding patterns in data of high dimension, can form a near-optimal K-means-like clustering structure, in which the distance between the non-CH nodes and CHs is near minimized.
Moreover, the data aggregating issue associated with the measurements accuracy calls for a careful consideration in scheme about data collecting and fusing.In this paper, we investigate the PCA technology in a high relative measurements context for WSNs.Our objective is to obtain a good approximation to sensor measurements by relying on a few principal components while decreasing the network load.
The remainder of this paper is organized as follows.In Section 2, we describe the network and energy model.Section 3 presents the PCA-guided routing algorithm (PCA-RA) model and gives numerical results to demonstrate the working mechanism of PCA-RA.Section 4 discusses the PCA-RA algorithm solution strategies.In Section 5, we simulate the PCA-RA and compare it with LEACH and LEACH-E.Finally, Section 6 concludes this paper.

Syestem Model
2.1.The Network Model.Let us consider a two-tier architecture for WSNs. Figure 1 shows the physical network topology for such a network.There are three types of nodes in the networks, namely, a base station (BS), the cluster-head nodes (CHNs), and the ordinary sensor nodes (OSNs).
For each cluster of sensor nodes, there is one a CHN, which is different from an OSN in terms of functions.The primary functions of a CHN are (1) data aggregation for data measurements from the local clusters of OSNs and (2) relaying the aggregated information to the BS.For data fusion, a CHN analyzes the content of each measurement it receives and exploits the correlation among the data measurements.An CHN has a limited lifetime, so we need consider rotating the CHNs to balance to the energy consumption.
The third component is the BS.We assume that there is sufficient energy resource available at the BS and thus there is no energy constraint at the BS.

The Energy Consumption Model.
We compute the energy consumption using the first-order radio model [5].The equations, which are used to calculate transmission costs and receiving costs for an L-bit message to cross a distance d, are shown below, In (1), the electronics energy, E elec , depends on factors such as the digital coding, modulation, filtering, and spreading of the signal, whereas the amplifier energy, ε fs d 2 or ε mp d 4 , depends on the distance to the receiver and the acceptable bit-error rate.d 0 is the distance threshold.

PCA-Guided Routing Algorithm Model
PCA is a classic technique in statistical data analysis, data compression, and image processing.PCA transforms a number of correlated variables into a number of uncorrelated variables called principal components.The objective of PCA is to reduce the dimensionality of the dataset, but not only retain most of the original variability in the data.The first principal component accounts for as much of the variability in the data as possible.Mathematically, how to pick up the dimensions with the largest variances is equivalent to finding the best low-rank approximation of the data via the singular value decomposition (SVD) [21].
The design of routing algorithm is important in wireless sensor networks.Although plenty of interests are drawn on it, there is still a challenge to face on the aspect of efficiency and energy consumption.In this section, we will describe the notations about PCA-guided routing algorithm model firstly and then propose the PCA-guided clustering model, and finally, we will present the PCA-guided data aggregating model.y i = x i −x, which defines the centered distance vector column wise, and x = i x i /n is the mean vector column wise of X matrix.

Notations. Let X = {x
Let M = {m 1 , m 2 • • • m p } be a group of measurements collecting from the sampling period.Each sensor generates a stream of data.Let D N×P be a matrix with elements D i j , 1 i n, 1 j p, being the measurement taken by sensor i at point j.Let Q N×P be a centered matrix with elements q i j = d i j − d i. /n, d i. = j d i j .

PCA-Guided Clustering Model.
We define the equation for the SVD of matrix Y [22] as follows: ( The covariance matrix (ignoring the factor 1/n) is i The principal components v k are eigenvectors satisfying

K-Means Clustering Model.
According to [23,24], we find the PCA dimension reduction automatically by performing data clustering according to the K-means objective function [25,26].Using K-means algorithm, it can form a better cluster structure by minimizing the sum of squared errors.We define the squared distance between sensor nodes and cluster centers as where m k = xi∈Ck x i /n k is the center of cluster C k and n k is the number of sensor nodes in C k .Given the fact that by minimizing the distance between sensor nodes and cluster centers, the energy consumption can be effectively reduced.Our clustering algorithm is thus designed to be capable of minimizing the above metric J K .
For the sake of convenience, let us start with the case of K = 2.To obtain the explicit expression for J k , letting be the sum of squared distances between two clusters C p and C l , after some algebra one obtains the following: where n 1 and n 2 are the numbers of sensor nodes in C 1 and C 2 , n is the total number of sensor nodes; therefore, we get If denoting we thus have That is where y 2 is a constant and it denotes the distance between the sensor nodes and the center for all nodes; thus min (J K ) is equivalent to max (J D ), and because the two resulting clusters are as separated and compact as possible.Because the averaged intracluster distance is greater than the sum of the averaged intercluster distances, that is From ( 9), it is seen that J D is always positive.This is to say, evidenced from (11), for K = 2 minimization of cluster objective function J K is equivalent to maximization of the distance objective J D , which is always positive.When K > 2, we can do a hierarchical divisive clustering, where each step using the K = 2 is a clustering procedure.This procedure can get an approximated K-means clustering structure.

PCA-Guided Relaxation Model.
In [24], it proves that the relaxation solution of J D can get via the principal component.It sets the cluster indicator vector to be The indicator vector satisfies the sum-to-zero and normalization conditions.Consider the squared distance matrix H = (h i j ), where h i j = x i − x j 2 .q T Hq = −J D is easily observed.
(1) The First Relaxation Solution.Let q take any value in [−1, 1]; the solution of minimization of J(q) = q T Hq/q T q is given by the eigenvector corresponding to the lowest eigenvalue of the equation Hz = λz.
(2) The Second Relaxation Solution.Let H = ( h i j ), where the element is given by in which, h i. = j h i j , h .j = i h i j , h .. = i j h i j .
After computing, we have q T Hq = q T Hq = −J D , then relaxing the restriction q, the desired cluster indicator vector is the eigenvector corresponding to the lowest eigenvalue of Hz = λz.
(3) The Third Relaxation Solution.With some algebra, we can obtain H = −2Y T Y .Therefore, the continuous solution for cluster indicator vector is the eigenvector corresponding to the largest eigenvalue of the covariance matrix Y T Y which by definition, is precisely the principal component v 1 .

PCA-Guided Clustering Model.
According to the mentioned above, for K-means clustering where K = 2, the continuous solution of the cluster indicator vector is the principal component v 1 , that is, clusters C 1 and C 2 are given by We can consider using PCA technology to clustering sensor nodes for WSNs.It near minimizes the sum of the distances between the sensor nodes and cluster centers.
Compute the eigenvector of the matrix, Y T Y , that is, the principal component v 1 : If v 1 (i) 0, sensor i belongs to C 1 , otherwise it belongs to C 2 .We depicted the above clustering results into Figure 2.
When K > 2, we do a hierarchical divisive clustering, where each step uses the K = 2 clustering procedure.
In summary, a PCA-guided clustering model can be used to form a nearly optimal K-means-like clustering structure.

PCA-Guided Data Aggregating Model.
As mentioned above, D N×P represents the data measurement matrix collected from the sampling period by the cluster heads.Q is a centered matrix about D.
The vector {w k } 1≤k≤N is the principal components satisfying Because in most cases there exist high correlations between sensor measurements, good approximations to sensor measurements can be obtained by relying on few principal components.The first principal component accounts for as much of the variability in the data as possible, so we can find the first principal component vector w 1 , such that their projection data can effectively express the original measurements.Approximations Q to Q are obtained by where The CHs only send three packets about Z, w k , and the mean vector column-wise G of D matrix to the base station: Because the mean vector column-wise G is subtracted by the CHs prior to the aggregation of its value, the base station can add back after the computation of the approximation.
Example 2. If the CH collects the matrix D as follow: Then the CH can compute the matrix Q and the principal components w 1 , then the packet about Z, w 1 , and G are delivered to the base station.The base station will compute the approximation Q.
After adding back the subtracted mean value G, we can obtain:

PCA-Guided Routing Algorithm Solution Strategies
In Section 3, we have actually proposed a PCA-guided clustering and data aggregating model for routing optimization problem in WSNs by theoretical analyses and numerical examples.The following steps provide an overview of the solution strategy.

Initialization Stage.
In the first stage, we assume that a set of N location coordinates are gathered at the base station.
The base station computes the first principal component v 1 .
The two clusters C 1 and C 2 are determined via v 1 according to (15) by the BS.

Clusters Splitting Stage.
When the number of sensor nodes is huge, two clusters are not enough and can induce the energy consume rapidly, considering splitting these clusters whose memberships are more than the CH can support.
If there are K clusters, there are on average N/K nodes per cluster (one CH node and non-CH nodes).We define that We can estimate the average energy dissipated per round to get the most energy efficient number of the clusters as follows: The notation and definition of the parameters in ( 26) are described as Table 1.
We can get According to the average energy dissipated per round, the scope of the clusters' number can be estimated when it is the most energy efficient.In [4,13,14], the authors use the average energy dissipated per round to obtain the optimal cluster number.Based on this methodology, here in this paper, we study the appropriate upper limit of the cluster nodes to perform the clusters splitting and thus extend this methodology.
Example 3. If we assume the number of sensor nodes is 100, the average energy dissipated per round as the number of clusters is varied between 1 and 20. Figure 3 shows that it is most energy efficient when there are between 3 and 5 clusters in the 100-node network.We define that the most appropriate number of clusters is varied from 3 to 5 because We obtain that the appropriate upper limit of the cluster nodes is 100/3 = 34.
If the number of cluster nodes is more than 34, the PCAguided clustering algorithm will implement to split it.

Cluster Balancing Stage.
We use the BS running the PCAguided clustering algorithm to divide sensor nodes based on the geographical information.We get K clusters from N nodes in the field rapidly and form better clusters by dispersing the CHs throughout the network.Now let us introduce the basic idea of the cluster balancing stage.Above, we get the number of clusters K if there are N nodes.We define the average node number per cluster as Ave.The cluster-balanced step is added in each iteration process.If |C j | > Ave, 1 ≤ j ≤ K, the BS computes dist(s i , u q ), where s i ∈ C j , j / = q and |C q | < Ave.This means to compute the distances between the nodes and each cluster center whose cluster's node number is less than Ave.The BS gets s i if its value is minimum and adjusts the node into the corresponding cluster computed.After implementing the cluster-balanced step, the BS limit the node number in each  cluster and change the clusters unequal distribution in the space of nodes originally.
Example 4. Figure 4 gives an example to illustrate how the cluster-balanced step works.In this example, if we only consider the geographical information of sensor nodes while using PCA-guided splitting algorithm, the sensor nodes s 1 to s 1 should belong to the C 1 .However, the nodes in C 1 are more than Ave(=5).Thus, this scenario motivates the clusterbalanced step.To have a balance among all the clusters, in our method, we suggest that the sensor s 6 should be grouped into C 2 because its distance is nearest to C 2 .We obtain the final balanced cluster structure by a serial standard PCA-guided splitting stage and the cluster balancing stage.

Cluster Heads Selecting Stage.
After the base station divides the appropriate clusters using PCA technique, it needs to select the optimal cluster heads in these clusters.Assume that the initial energy is same, the base station can rank the matrix Y for each cluster and section the sensor nodes which is the nearest to the cluster centers.

Data Aggregating Stage.
The sensor nodes begin to transfer the data to the cluster heads after finishing the cluster formation.The cluster heads collect the measurements from the sensor nodes and then compute the first principal component w 1 (as ( 18)), the mean vector G (as ( 21)), and Z (as ( 20)).They can be delivered to the base station with a constant packet size for each cluster head.At last, the base station will compute the approximate measurements by these packets.
4.6.The Description for PCA-Guided Routing Algorithm.The procedure taken by the base station is as follows.
Step 1: compute the first principal component v 1 , Step 2: according to (15), the two clusters C 1 and C 2 are determined via v 1 .
Step 3: compute E round and get the appropriate upper limit of the cluster nodes.
Step 4: while the cluster node number are more than the appropriate upper limit.Step 5: compute a new v 1 for the cluster.
Step 7: end Step 8: if needed, implement the cluster balancing stage.
Step 9: select the cluster heads.

Simulation Results
To evaluate the performance of PCA-RA, we simulate it, LEACH and LEACH-E, using a random 100-node network.
The BS is located at (50, 150) in a 100 × 100 m 2 field.Figures 5 and 6 show the clustering structure for using LEACH and PCA-RA.Comparing Figures 5 and 6, one finds that each cluster is as compact as possible, and the cluster heads locate more closely to the cluster centers by using PCA-RA.This gives us an intuition that it is more efficient to balance the load of network and to even distribute the nodes among clusters by using PCA-RA.
The benefits of using PCA-RA are further demonstrated in Figures 7 and 8, where we compare the network performance of network lifetime and throughput under the PCA-RA with that under LEACH and LEACH-E.Figure 7 shows the total number of nodes that remain alive over the simulation time, while the first dead node remains alive for a more long time in PCA-RA, this is because PCA-RA takes into account the structure of clusters and the location of the cluster heads.Figure 8 shows that PCA-RA sends much more data in the simulation time than LEACH and LEACH-E.Note that the survey nodes in each round are NS i ; each node can send D i data.Then, the maximum throughput can be expressed as follows; From Figure 7, the T max for PCA-RA are more than the T max for LEACH and LEACH-E.Then, Throughput PCA-RA > Throughput LEACH and Throughput PCA-RA > Throughput LEACH-E .
For example, under the given test data, there are 60.456 * 10 3 bits data sent in whole network lifetime with PCA-RA.And there are 33.394* 10 3 bits and 28.235 * 10 3 bits by using LEACH-E and LEACH, respectively.The mathematics demonstrates that PCA-RA has 80.01% increase about throughput compared with LEACH-E and 114.12% increase about throughput compared with LEACH.
PCA-RA is a centralized algorithm, and the complexity and communication cost of PCA-RA mostly happen in BS.About the balance structure stage, we think the effect on time complexity is small and consider that the time complexity is comparable to LEACH-C.
Table 2 displays the network lifetime (in terms of the time that the first node becoming dead) and the resulted square error function of the senor node structure under K-means algorithms and PCA-RA.
From Table 2, we can find that K-means algorithm can get a minimum square error.Because of the cluster-balanced step, PCA-RA can get a bigger square error, but the sensor nodes can survive a longer time.This implies that one can reach a certain tradeoff between the spatial distance of sensor structure and the network lifetime.The suboptimal solution in PCA-RA can achieve such tradeoff.In Figure 9, we simulate the sensor nodes collecting the measurements about temperature in some regions.Assume that the base station receive the packets from the cluster head in two minutes interval.Figure 9 demonstrates the approximations obtained by the base station about a certain sensor node in some intervals.

Conclusions
In this paper, we propose the PCA-guided routing algorithm for WSNs.By disclosing the connection between PCA and K-means, we design a clustering algorithm by utilizing PCA technique which efficiently develops a clustering structure in WSNs.Moreover, as a compression method, we demonstrate that the PCA technique can be used in data aggregation for WSNs as well.We establish the explicit procedure of PCAguided routing algorithm for WSNs by incorporating PCA technique into both the data aggregating and routing process.The advantages of the proposed algorithm are demonstrated through both theoretical analyses and simulation results.The simulation results show that the PCA-guided routing algorithm significantly reduces the energy consumption, prolongs the lifetime of network, and improves network throughput when compared with LEACH and LEACH-E.Further, it keeps the accuracy about the measurements while reducing the network load.
Future research will focus on the distributed strategies of PCA-guided data aggregation and will investigate the performance of PCA-RA with different values of parameter K.

Figure 1 :
Figure 1: Physical topology for two-tier wireless sensor networks.

Table 1 :
Parameter description.Parameters Head description k The number of the clusters N The total number of the sensor nodes E elec The energy consumption per bit when sending and receiving l The sending data bit ε mp /ε fs The energy consumption about the amplifier a The data aggregating rate.It is application specific, where we assume a = 3 as mentioned in Section 2. d toBS The average distance between the CHs and the BS.We assume it = 75 m d toCH The average distance between the CHs and the non-CH nodes.From [5], we obtain d toCH = (1/2π)(M 2 /k), in which, M denotes the area of this field.

Figure 2 :
Figure 2: The clustering structure for 20 sensor nodes.

4 K = 3 Figure 3 :
Figure 3: Average energy dissipation per round with varying the number of clusters.

Figure 4 :
Figure 4: An example of the cluster balancing stage.

Figure 5 :
Figure 5: The clustering structure for using LEACH.

Figure 9 :
Figure 9: Approximation obtained for the sensor nodes.
Example 1.Let us assume in a WSN there are 20 sensors distributed in the network.X represents the 2D coordinate matrix.

Table 2 :
A numerical example.