CHAPTER 3 The Improved Weighted Clustering Algorithm
3.3 An Example
A simple example in a two-dimensional space is given to explain how the IWCA can be used to find the application nodes in dynamic wireless sensor networks.
Assume in this example there are totally twelve mobile sensor nodes activated with their initial factors shown in Table 3-1, where “SN” represents the serial number of a sensor node, “Location” represents the coordinate position of an SN, “Radius”
represents the transmission radius, “Mobility” represents the mobility speed, “Time”
represents the cumulative time, “Rate” represents the transmission rate, and “Energy”
represents the initial power energy.
Table 3-1: The initial factors of SNs in this example
SN Location Radius Mobility Time Rate Energy
1 (3,3) 5 2 1 5 7500
2 (4,7) 5 2 2 6 7200
3 (4,12) 5 1 4 6 6600
4 (7,15) 5 1 6 4 8400
5 (11,15) 5 2 0 5 10000
6 (15,20) 5 3 2 4 7600
7 (7,4) 5 4 1 4 9600
8 (11,6) 5 1 1 5 9000
9 (15,4) 5 1 7 5 8500
10 (17,8) 5 0 5 6 9600
11 (18,17) 5 2 2 4 9600
12 (15,15) 5 1 0 5 8000
Besides, some required parameters have to be set for the improved weighted clustering algorithm (IWCA) to work. In this example, the threshold number M is set at 3, which means an application node can ideally handle 3 sensor nodes. The five coefficient values are set as follows: w1=0.5, w2=0.1, w3=0.05, w4=0.05 and w5=0.3 where the summation of the weights is equal to 1. For this example, the proposed algorithm proceeds as follows. Only the first SN is demonstrated to show the execution process.
Step 1: The neighbors of every sensor node v are searched and its degree dv is obtained. The results are shown in Figure 3-1, where the neighbors of SN1 are SN2 and SN7. The degree d1 is thus 2.
19 20
Figure 3-1: The neighbors of each SN in this example
Step 2: The degree difference of every node v is computed by the formula M
dv
v = −
Δ . Assume in this example, M=3. The degree difference of SN1 is
derived as follows: Δ1 = d1−M = 2−3 =1.
Step 3: The sum of the distances Dv between an SN and all its neighbors is calculated.
For SN1, D1=
(
3−4) (
2 + 3−7)
2 +(
3−7) (
2 + 3−4)
2 ≅8.25.Step 4: The mobility speed Mv of every sensor node v is calculated. For example, assume in the past 2 time blocks, SN 1 has moved from the position (1, 1) to
(1, 3) and then to (3, 3). Its mobility speed is calculated as follows:
( ) ( )
1 1 3 1( ) (
3 1 3 3)
22
1 2 2 2 2
1= ⎜⎝⎛ − + − + − + − ⎟⎠⎞=
M .
Step 5: The cumulative time Tv for a node v to act as an application node is obtained.
Assume the cumulative time obtained so far is shown in the column Tv of Table 3-1.
Step 6: The characteristic Cv of every node v is derived. Assume in this example, the constant of amplification c is set at 1000. The characteristic factor for SN1 is calculated as follows:
67
Step 7: The combined weight of each sensor node v is calculated by the formula:
v
After Step 7, all the factor values for the sensor nodes are listed in Table 3-2.
Step 8: The node with a minimum is chosen as the cluster head. It can be observed from Table 3-2 that W
Wv
12 has a minimum combined weight (1.5).
SN12 is thus chosen as an application node. The results are shown as Figure 3-2.
Table 3-2: The factor values of the sensor nodes in this example
Figure 3-2: The first chosen application node with its neighbors
Step 9: The chosen cluster head and its neighbors are thus eliminated from the set of original sensor nodes. The results after SN12 and its neighbors are deleted are shown in Figure 3-3.
19 20
Figure 3-3: The remaining sensor nodes after the first iteration
Step 10: Steps 1 to 9 are repeated for processing the remaining nodes until each node is assigned to a cluster. The final clusters are shown in Figure 3-4. There are totally 4 clusters formed in this example
19 20
Figure 3-4: The final clusters by IWCA
For a comparison, the WCA algorithm is also run for the same example. The clustering results are shown in Figure 3-5. More clusters are derived by WCA than by IWCA.
Figure 3-5: The final clusters of the given SNs by WCA
CHAPTER 4
The Algorithm Based on Lifetime Fitness for Base Stations Known in Advance
4.1 The Idea
The lifetime is a very crucial issue in wireless sensor networks. Assume the locations of the base stations have been known in the network. According to the locations of base stations and sensor nodes, an algorithm based on lifetime consideration is proposed to determine the application nodes. In the algorithm, the sensor nodes will be grouped into several clusters and one of the nodes in each cluster will be chosen as a cluster head. Each cluster head must satisfy the constraint that the number of its neighbors is larger than a pre-defined degree threshold. It can this avoid the appearance of numerous clusters. The cluster heads chosen will then act as the application nodes and may change in different time intervals due to the dynamic mobile environment. Each node may thus play two roles, one for sensor node and the other for application node. When a node plays as a sensor node, it uses its predefined
application node. When a node plays as an application node, its transmission radius can be lengthened for data transmitted to its corresponding base station due to strengthened power consumption. In this paper, the transmission radii in the nodes are assumed to be the same for simplifying the problem. The algorithm considers the lifetime as the fitness evaluation of each sensor node. When a sensor node is chosen as an application node, it will receive the data from the other sensor nodes in the same cluster and will transmit the data to its corresponding base station. The fitness function is then a combination of the two components. The sensor node with the highest fitness value in a cluster will be chosen as the head of that cluster. Since the sensor environment is dynamic, the proposed algorithm is re-run again to find new applications nodes after a fixed interval of time, such that the system lifetime can be expected to last longer.
4.2 The Algorithm
The details of the proposed algorithm are stated below.
The proposed algorithm based on lifetime fitness:
Input: A set of N sensor nodes, each with the same transmission radius R, its own
location (xj, yj), transmission rate rj, and power energy Ej, j = 1 to N; A minimum degree threshold M; A set of K base stations, each with its own location (xk, yk), k =1 to K, the values of the two coefficients w1 and w2 for the two factors in lifetime fitness, w1 + w2 = 1.
Output: A set of application nodes with its neighbors.
Step 1: Find the neighbors N(j) of each sensor node j, where a neighbor is a node with its distance with node j within the transmission radius R. That is:
}.
' , ) ' , ( distance
|' { )
(j j j j R j j
N = ≤ ≠
Define the degree dj as the number of the elements in N(j).
Step 2: Calculate the lifetime lij from node i to node j for every node j and i∈N(j).
That is:
), ( i1 i2 ijn
i i
ij E r d
l = α +α
where Ei is the power energy, ri is the transmission rate, αi1 and αi2 are the distance-independent and distance-independent parameters of node i, and
is the n-order Euclidean distance between node i to node j.
n
dij
Step 3: Calculate the lifetime Lik from each node i (which may act as an application node that the number of neighbors are larger than or equal to M) to each base station k. Assume that the transmission radius between an application node
and a base station is unrestricted. That is:
where is the n-order Euclidean distance between node i to base station k, and are the data-rate summation of the neighbors of an application
node.
Step 6: Eliminate the chosen cluster head and its neighbors from the set of original sensor nodes.
Step 7: Repeat Steps 1 to 6 for the remaining nodes until each node is assigned to a cluster.
Note that in Step 3, when a sensor node acts as an application node, its parameters αi1 and αi2 may have different values from those when it acts as a sensor node. Here they are assumed the same for simplification. But the algorithm can easily be modified for different parameter values. Besides, in Step 4, the first factor in the lifetime fitness is the minimum value of the lifetimes of its neighbors since in this
case at least a sensor node runs out of its energy and cannot work. As an alternative, it can also be chosen as the average values of the lifetimes of its neighbors.
4.3 An Example
A simple example in a two-dimensional space is given to explain how the lifetime consideration can be used to find the application nodes in dynamic wireless sensor networks. Assume in this example there are totally eight mobile sensor nodes activated with their initial factors shown in Table 4-1, where “SN” represents the serial number, “Location” represents the coordinate position, “Radius” represents the transmission radius, “Rate” represents the transmission rate, and “Energy” represents the initial power energy of a sensor node.
Table 4-1: The initial factors of sensor networks in this example SN Location Radius Rate Energy
1 (12,2) 5 5 10000
2 (12,7) 5 6 8400
3 (13,5) 5 5 8000
4 (16,7) 5 5 8500
5 (6,15) 5 5 10000
6 (6,20) 5 4 8800
7 (4,17) 5 6 12000
8 (4,13) 5 6 8500
Also assume there are two base stations located at (10, 15) and (10, 5). The serial number of BS(10,15) is 1 and the number of BS(10,5) is 2. In this example, the minimum degree threshold M is set at 3, and both the coefficient weights w1 and w2
are set at 0.5 for balance consideration. The proposed algorithm proceeds as follows.
Only the first SN is demonstrated to show the execution process.
Step 1: The neighbors of every sensor node v are searched and its degree dv is obtained. The results are shown in Figure 4-1, where the neighbors of SN1 are SN2 and SN3. The degree d1 for SN1 is thus 2. All the degrees of SNs are listed in Table 4-2.
19 20
Figure 4-1: The neighbors of each SN and the locations of BSs in this example
Table 4-2: The degrees of the SNs in this example SN Location Degree
1 (12,2) 2
2 (12,7) 3
3 (13,5) 3
4 (16,7) 2
5 (6,15) 3
6 (6,20) 2
7 (4,17) 3
8 (4,13) 2
Step 2: The lifetime lij from node i to node j is calculated for every node j and i∈N(j).
Take the pair of nodes, SN1and SN3, as an example. The lifetime from SN3to SN1 is calculated as follows:
) 160 16 . 3 (
* 5
8000 )
* 1 0
( 312 2
3 3
31 = =
= +
d r
l E
where αi1 is set at 0, αi2 is set at 1, and n is set at 2. All the other lifetimes can be similarly calculated. The results are shown in Table 4-3.
Table 4-3: All the lifetimes from a sensor node to another in this example to
from 1 2 3 4 5 6 7 8
1 80.00 200.00 48.78 9.76 5.56 6.92 10.81
2 56.00 280.00 87.50 14.00 6.83 8.54 14.00
3 160.00 320.00 123.08 10.74 5.84 7.11 11.03
4 41.46 106.25 130.77 10.37 6.32 6.97 9.44
5 9.76 20.00 13.42 12.20 80.00 250.00 250.00
6 6.11 10.73 8.03 8.18 88.00 169.23 41.51
7 6.92 12.20 8.89 8.20 250.00 153.85 125.00
8 7.66 14.17 9.77 7.87 177.08 26.73 88.54
Step 3: The lifetime Lik from each node i to each base station k is calculated. For SN1, d1>M (2>3) is not satisfied. Therefore, the SN2 is chosen for demonstration.
Its lifetime to each base station is calculated as follows:
72
where L21 means the lifetime from node 2 to BS1 and L22 means the lifetime from node 2 to BS2. All the other lifetimes to base stations can be similarly calculated. The results are shown in Table 4-4.
Table 4-4: All the lifetimes from a sensor node to base stations in this example BS equal to the degree threshold M is calculated. In this example, M = 3 and the degree of SN1 is smaller than M, such that SN1 cannot act as an application
node. For SN2, its fitness value is calculated as follows:
After Step 4, the fitness values of all the nodes are listed in Table 4-5.
Table 4-5: The fitness values of all the nodes in this example SN Location Fitness
1 (12,2) 59.23
Step 5: The node with the maximum fitness value is chosen as the cluster head. It can be observed from Table 4-5 that SN1has the maximum fitness value (59.23).
SN1 cannot, however, be chosen as an application node since its degree is not enough to act as an application node. SN3 with the second maximum fitness value (28.85) is thus chosen as a cluster head, which also serves as an application node. The results are shown in Figure 4-2.
19 20
Sensor node Base station Application node
5
3
Figure 4-2: The first chosen cluster head with its neighbors
Step 6: The chosen cluster head and its neighbors are thus eliminated from the set of original sensor nodes. The results after SN3 and its neighbors are deleted are shown in Figure 4-3.
19 20
Sensor node Base station Application node
5
Figure 4-3: The remaining sensor nodes after the first iteration
Step 7: Steps 1 to 6 are repeated for processing the remaining nodes until each node is
assigned to a cluster. The final clusters are shown in Figure 4-4. There are totally 2 clusters formed and the two cluster heads are respectively connected to their nearest base stations.
19 20
Sensor node Base station Application node
3 5
Figure 4-4: The final clusters and their cluster heads
CHAPTER 5
The Three-Phased Algorithm for Determination of Application Nodes and Base Stations at the Same Time
5.1 The Idea
In this chapter, we propose a three-phased algorithm to determine the application nodes and to find the locations of base stations from sensor nodes in a two-tiered mobile wireless sensor architecture. In the first phase, our previous improved weighted clustering algorithm is modified to determine the cluster heads from the sensor nodes in a given mobile wireless sensor network. The cluster heads chosen will act as application nodes. Each node may thus play two roles, one for sensor node and the other for application node. The transmission radii of a node are different when it plays different roles. The transmission radius for a node as a sensor is usually set smaller than that as an application node due to the actual need for transmission.
In the second phase, the improved weighted clustering algorithm is modified again to cluster the application nodes found in Phase 1 and to determine the cluster
of base stations. In the third phase, the PSO approach for base-station allocation [13]
is then used to refine the locations of base stations. The output from Phase 2 is a set of base-station locations, which is then used as the initial solution in Phase 3. Since each initial base station is a cluster head, it has its cover of sensor nodes. The algorithm then forms a minimum rectangle including all the covered sensors for each base station and improves the solution in each rectangle by using the previous PSO approach for allocating a single base station [13]. Each initial base station can be refined in this way. The solution obtained is thus expected to be better than the initial one. Phase 3 thus proceeds in a divide-and-conquer way, such that each appropriate base-station location can quickly converge. It can find the final locations of base stations and compute the lifetime of each cluster. Finally, the minimum lifetime of all clusters is the lifetime of the whole network.
5.2 The Algorithm
The details of the proposed three-phased algorithm for heterogeneous sensor networks are stated below.
The Proposed Three-Phased Approach for Determination of Both Base Stations and
Application Nodes:
Input: A set of sensor nodes, each node v with its initial individual location (xv, yv), cumulative time Tv, mobility speed Mv, transmission rate rv, energy Ev, two transmission radii Rv and Rv’ respectively for acting as a sensor node and as an application node, distance-independent parameter αj1, and distance-dependent parameter αj2, the constant of amplification c, two predefined ideal degree numbers M and M’ in a cluster respectively for clustering sensor nodes and clustering application nodes, and the five coefficients w1 to w5.
Output: Appropriate sensor nodes as application nodes and locations of base stations.
Phase 1: Using IWCA to find application nodes from sensor nodes
Step 1: Find the neighbors N(v) of each node v, where a neighbor is a node with its distance with v within the transmission radius Rv. That is:
} ) ' , ( distance
|' { )
(v v v v Rv
N = ≤ .
Calculate the degree dv the number of the elements in N(v).
Step 2: Compute the degree-difference △v as |dv – M|for every node v.
Step 3: Compute the sum Dv of the distances between node v and all its neighbors.
That is:
∈
∑
Step 4: Compute the mobility speed of every node v by the following formula:
( ) ( )
where and are the expected coordinate positions of node v at time t and t-1, and T is the time for re-allocating the application nodes.
) ,
(Xt Yt (Xt−1,Yt−1)
Step 5: Find the cumulative time Tv in which node v has acted as a cluster head. A larger Tv value with node v implies that it has spent more resources (such as energy). Initially, Tv is set at 0.
Step 6: Compute the characteristic Cv of every node v as follows:
v
Step 8: Choose the node with a minimum Wv as the cluster head (application node).
Step 9: Eliminate the chosen cluster head and its neighbors from the set of original nodes.
Phase 2: Using IWCA again to find initial base-station locations from application
nodes found in Phase 1:
The steps in this phase are the same as those in Phase 1 except the following three points.
1. The applications nodes found in Phase 1, instead of the original sensor nodes, are to be clustered.
2. The transmission radius adopted is Rv’ instead of Rv and the ideal node number in a cluster is M’ instead of M.
3. In Step 6 for each applications node i, since it must transmit the data of its
neighbors as well, its new transmission rate is thus set as follows:
,
) (
i i N m
m
i r r
r
∑
∈
+
=
where
∑
∈N(i)
m r are the summation of the transmission rates of the neighbors m
of the application node i.
Phase 3: Using PSO to refine the initial base stations found in Phase 2:
Step 1: Find the cluster cover Ui of each initial i-th base station which is found from Phase 2 as follows:
Ui={k | k∈N(j) j, j∪ ∈N’(i) i }, ∪
where N’(i) is the set of neighbors of node i in Phase 2 and N(j) is the set of neighbors of node j in Phase 1. Ui is thus the set of original sensor nodes covered by the i-th base station.
Step 2: Find the minimum rectangle of each cluster cover Ui. Its left-lower corner is (min(xk), min(yk)), k∈Ui, where the pair (xk, yk) is the location of the k-th sensor node. Its right-upper corner is (max(xk), max(yk)), k∈Ui.
Step 3: For each base station, refine its location by the PSO algorithm for a single base station. The initial base station is one of the particles in PSO. The other particles are variants of the initial base station and are randomly generated.
The new transmission rate of an application node (See Point 3 in Phase 2) is used to calculate the lifetime.
Step 4: Output the final locations as the base-station locations.
The termination conditions of the PSO approach in Phase 3 may be predefined execution time, a fixed number of generations, or the particles have been converged.
Note that if the base stations are also mobile, their locations as well as the application nodes can be re-calculated after each time interval. If they are not mobile, then they are just decided from the initial data of the sensor networks.
5.3 An Example
A simple example in a two-dimensional space is given to explain how the IWCA can be used to find the cluster heads in a mobile wireless sensor network. Assume in this example, there are 12 sensor nodes activated with their initial factors shown in Table 5-1, where “SN” represents the series number of a sensor node, “Location”
represents the coordinate position of an SN, “Radius” represents the transmission radius, “Mobility” represents the mobility speed, “Time” represents the cumulative time, “Rate” represents the transmission rate, and “Energy” represents the current power energy.
Table 5-1: The initial factors of the twelve sensor nodes in this example SN Location Radius Mobility Time Rate Energy
1 (3,3) 5 2 0 5 7500
2 (4,7) 5 2 0 6 7200
3 (4,12) 5 1 0 6 6600
4 (7,15) 5 1 0 4 8400
5 (11,15) 5 2 0 5 10000
6 (15,20) 5 3 0 4 7600
7 (7,4) 5 4 0 4 9600
8 (11,6) 5 1 0 5 9000
9 (15,4) 5 1 0 5 8500
10 (17,8) 5 0 0 6 9600
11 (18,17) 5 2 0 4 9600
12 (15,15) 5 1 0 5 8000
Besides, some required parameters have to be set for the improved weighted
at 3, which means an application node is expected to ideally handle 3 sensor nodes.
The five coefficient values are set as follows: w1=0.5, w2=0.1, w3=0.05, w4=0.05 and w5=0.3, where the summation of the weights is equal to 1. For this example, the proposed algorithm proceeds as follows. Only the first SN is demonstrated to show the execution process.
Phase 1:
Step 1: The neighbors of every sensor node v are searched and its degree dv is obtained. The results are shown in Figure 5-1, where the neighbors of SN1 are SN2 and SN7. The degree d1 for SN1 is thus 2.
Figure 5-1: The neighbors of each SN in this example
Step 2: The degree difference of every node v is calculated by the formula M
dv
v = −
Δ . Assume in this example, M = 3. The degree difference of SN1
is derived as follows: Δ1 = d1 −M = 2−3 =1.
Step 3: The sum of the distances Dv between an SN and all its neighbors is calculated.
For SN1, its sum of distance is calculated as follows:
For SN1, its sum of distance is calculated as follows: