Professional Documents
Culture Documents
120pJ/bit/m
2
Fig 2.1 First order radio model
E
elec
*k
amp
*k*d
2
E
elec*K
Transmit
electronics
Tx Amplifier
k bit packet
Receiver electronics
K bit packet
25
For these parameter values, receiving a message is not a low cost operation; the protocol
thus should try to minimize not only the transmit distances but also the number of transmit and
receive operations for each message.
This thesis makes the assumption that the radio channel is symmetric such that the energy
required to transmit a message from node A to node B is the same as the energy required to
transmit a message from node B to node A for a given SNR. It also assumes that all sensors are
sensing the environment at a fixed rate and thus always have data to send to the end user. For
future versions of these protocols, it will implement an event-driven simulation, where sensors
only transmit data for some event occurs in the environment.
Micro sensor networks can contain hundreds or thousands of sensing nodes. It is desirable
to make these nodes as cheap and energy-efficient as possible and rely on their large numbers to
obtain high quality results. Network protocols must be designed to achieve fault tolerance in the
presence of individual nodes failure while minimizing energy consumption. In addition, since the
limited wireless channel bandwidth must be shared among all the sensors in the network, routing
protocols for these networks should be able to perform local collaboration to reduce bandwidth
requirements.
Eventually, the data being sensed by the nodes in the network must be transmitted to a
control center or base station, where the end-user can access the data. There are many possible
models for these micro sensors networks. In this work we consider micro sensor networks where:
- The base station is fixed and located far from the sensors.
- All nodes in the network are homogenous and energy constrained.
Thus, communication between the sensor nodes and the base station is expansive, and there
are no high-energy nodes through which communication can proceed.
2.5 DIRECT TRANSMISSION
Using a direct communication protocol, each sensor sends its data directly to the base
station. If the base station is far away from the nodes, direct communication will require a large
amount of transmit power from each node (since d in equation 2.1 is large). This will quickly
drain the battery of nodes and reduce the system lifetime. However the only reception in this
protocol occur at the base station, so if either the base station is close to the nodes, or the energy
26
required receiving data is large, this may be an acceptable (and possibly optimal) method of
communication.
2.6 LEACH (low energy adaptive clustering hierarchy)
LEACH is a self-organizing, adaptive clustering protocol that uses randomization to
distribute the energy load evenly among the sensors in the network. In LEACH, the nodes
organize themselves into local clusters, with one node acting as the local base station or cluster-
head. If the cluster-heads were chosen a priori and fixed throughout the system lifetime, as in
conventional clustering algorithms, it is easy to see that the unlucky sensors chosen to be cluster-
heads would die quickly, ending the useful lifetime of all nodes belonging to those clusters. Thus
LEACH includes randomized rotation of the high-energy cluster-head position such that it
rotates among the various sensors in order to not drain the battery of a single sensor.
Sensors elect themselves to be local cluster-heads at any given time with a certain
probability. These cluster-head nodes broadcast their status to the other sensors in the network.
Each sensor node determines to which cluster it wants to belong by choosing the cluster-head
that requires the minimum communication energy. Once all the nodes are organized into clusters,
each cluster-head creates a schedule for the nodes in its cluster. This allows the radio
components of each non-cluster-head node to be turned off at all times except during its transmit
time, thus minimizing the energy dissipated in the individual sensors. Once the cluster-head has
all the data from the nodes in its cluster, the cluster-head node aggregates the data and then
transmits the compressed data to the base station. Since the base station is far away in the
scenario we are examining, this is a high energy transmission. However, since there are only a
few cluster-heads, this only affects a small number of nodes. Being a cluster-head drain the
battery of that node. In order to spread this energy usage over multiple nodes, the cluster-head
nodes are not fixed; rather, this position is self-elected at different rounds.
Initially, when clusters are being created, each node decideswhetheror not to become a
cluster-head for the current round. This decision is based on the suggested percentage of cluster
heads for the network (determined a priori) and the number of times the node has been a cluster-
head so far. This decision is made by the node n choosing a random number between 0 and 1. If
the number is less than a threshold T(n), the node becomes a cluster-head for the current round.
The threshold is set as.
27
( {
. (2.3)
Where p is the desired percentage of cluster heads (e.g., P = 0.05), r = the current round,
and G is the set of nodes that have not been cluster-heads in the last
1 rounds, T = 1 for any nodes that have not yet been cluster-heads, and
after
rounds, all nodes are once again eligible to become cluster-heads. Future versions of this
work will include an energy-based threshold to account for non-uniform energy nodes. In this
case, we are assuming that all nodes begin with the same amount of energy and being a cluster-
head removes approximately the same amount of energy for each node.
2.7 SUMMARY
Clustering is a revolutionary idea in wireless sensor networks before clustering direct
transmission is used in wireless sensor networks. In direct transmission all the nodes in the
network participate in transmission of data to the Base station due to this energy consumption of
the network is high and another disadvantage of direct transmission is data redundancy will be
there because all the nodes sent their information directly to the base station. All these problems
are solved using the clustering technique in clustering cluster head will have communication
with the BS and nodes will send their data to their cluster head instead of to base station and
cluster head will aggregate the data received and send the non-redundant data to the base station.
All the transmission and reception is implemented using the First order radio model .First order
radio covers the transmission, amplifier and reception losses according to the transmission
distance.
28
CHAPTER 3
ENERGY EFFICIENT PROTOCOLS IN WSN
3.1 INTRODUCTION
Sensor nodes will sense the data from the environment surrounding the node. But this data
has to be sent to the destination (called Base-station or BS) for the further processing. Therefore
these nodes will require some amount of energy to sense the data and to transmit it. So each node
in the system is given a fixed amount of initial energy. Recharging of nodes are not possible
during the processing. But it is observed that, most of the node energy is wasted during the
transmission phase than in sensing state. So to reduce these transmission energy different types
of transmission techniques were introduced.
29
Initially when the sensor systems were introduced direct transmission from node to the
destination was used (As shown in the Fig 3.1). But in this transmission mode the energy
consumption of the nodes which are far from the base station will be high. This is because the
first order radio model [5] shows that transmitting energy required E
Tx
is directly proportional to
the square of the distance (d) and this type of nodes will die quickly.
d
1
Base-station (BS)
d
2
d
3
d
4
Fig 3.1 Direct Transmission
E
Tx
d
2
. (3.1)
Where E
Tx
is the transmission energy, d is the distance between nodes and Base station.
So to reduce the transmission energy, transmission distance is to be reduced, so for this purpose
we will go for the clustering approach.
3.2 CLUSTER BASED PROTOCOLS
In this type of protocol entire network is divided into small areas (as shown in fig 3.2) called
clusters. The Base-station informs each node to which cluster they belong, after assigning all
nodes into clusters BS will elect a node from each cluster as head (known as cluster-head CH)
and informs other nodes in the cluster or we go for different algorithm techniques, which select
CH first and then all other node find their distances to all the cluster-head and which cluster-head
is nearer to the node that node will join that cluster in this way various cluster-head and cluster
forms.
30
Base station
Cluster-head (CH) clusters
Fig3.2: Clustering approach
So during the transmission phase, nodes will transmit the data to the respective cluster head
only. Due to this type of transmission the distance to which the data is to be transmitted is to be
reduced. The function of the cluster-head is to gather the data from its cluster node and
aggregates the data and sends it to the base-station. Thus base station only receives data from the
cluster-heads. So the number of reception at the base station also reduced. All these
modifications in the network show that the energy consumption by the nodes is reduced.
3.3 FIREFLY ALGORITHM
A Firefly Algorithm (FA) is a recent nature inspired optimization algorithm that simulates
the flash pattern and characteristics of fireflies [4].Fireflies produce short and rhythmic flashes.
The flashing light is produced by a process of bioluminescence. Fundamental functions of such
flashes are to attract mating partners (communication). The rhythmic flash, the rate of flashing
and the amount of time form part of the signal system that brings both sexes together.
It is well known that the light intensity at a particular distance r from the light source
obeys the inverse square law. That is to say, the light intensity (I) decreases as the distance r
increases in terms of I
end
While Post process results and visualization
3.3.2 Flow Chart of Firefly Algorithm
Start
Generate initial population of n=100
Round start
33
No Yes
Fig 3.4 Flow chart of firefly algorithm
3.3.3 FA-idealized rules
Some of the flashing characteristics of fireflies can be idealized so as to develop firefly-
inspired algorithms. For simplicity in describing this new Firefly Algorithm (FA) which was
developed by Xin-She Yang at Cam- bridge University in 2007, we now use the following three
idealized rules
- All fireflies are unisex so that one firefly will be attracted to other fireflies regardless of
their sex;
- Attractiveness is proportional to their brightness, thus for any two flashing fireflies, the
less bright one will move towards the brighter one. The attractiveness is proportional to
Cluster formation with random
cluster head with the near nodes
Energy based switching
Select the nodes having best
fitness value that nodes will be
cluster heads of that round
Max
Cycle=1800 Stop
Data transmission takes place
R=R+1
Calculate fitness value
CH(i).fit=CH(i).E / M(k)
34
the brightness and they both decrease as their distance increases. If there is no brighter
onethan a particular firefly, it will move randomly;
- The brightness of a firefly is affected or determined by the landscapeof the objective
function.
For a maximization problem, the brightness can simply be proportional to the value of the
objective function. Other forms of brightness can be defined in a similar way to the fitness
function in genetic algorithms.
3.3.4FA- light intensity and brightness concept
In the firefly algorithm, there are two important issues: the variation of light intensity and
formulation of the attractiveness [1,4]. For simplicity, one can always assume that the
attractiveness of a firefly is determined by its brightness which in turn is associated with the
encoded objective function.
In the simplest case for maximum optimization problems, the brightness(I) of a firefly at a
particular location x can be chosen as I(x) f(x). However, the attractiveness is relative; it
should be seen in the eyes of the beholder or judged by the other fireflies. Thus, it will vary with
Distance r
ij
between firefly i and firefly j. In addition, light intensity decreases with the distance
from its source, and light is also absorbed in the media, so we should allow the attractiveness to
vary with the degree of absorption.
In the simplest form, the light intensity I(r) varies according to the inverse square law:
I(r) =
. (3.2)
Where I
s
is the intensity at the source and r is the distance.
As a fireflys attractiveness is proportional to the light intensity seen by adjacent fireflies,
we can now define the attractiveness of a firefly by:
=
0
.. (3.3)
Where
0
is the attractiveness at r = 0 and is the light absorption coefficient. As it is
often faster to calculate
. (3.4)
35
The distance (R
ij
) between any two fireflies i and j at x
i
and x
j
, respectively, is the
Cartesian distance:
R
ij
= || x
i
x
j
|| = (
. (3.5)
Where x
i,k
is the
.. (3.6)
The movement of a firefly i is attracted to another more attractive(brighter) firefly j is
determined by
X
i
= X
i
+
0
(X
j
X
i
) +
. (3.7)
Where the second term is due to attraction and third term is randomization with being
the randomization parameter, and
(3.9)
Where values of x
c
are one for our binary-GA when it is a CCH, otherwise, it is zero.
=fs and =2 when dd0
=mp and =4 when dd0.
q represents number of member nodes in cluster.
The optimal probability popt is determined by the GA by searching the solution space
through an evolutionary optimization process incorporating probabilistic transitions. Energy
consumption of cluster Head
( {
}
(3.10)
Where n=no.of nodes
k=no.of clusters
EDA =represents the energy dissipation for aggregating data
E
elec
=Transmitter/ Receiver electronics
E
fs
=Transmit amplifier (if d to BS<do)
E
mp
= Transmit amplifier (if d to BSdo)
Energy consumption of non-cluster Head
2
non-CH toCH elec fs
E (l,d)=l*E +l*E *d
. (3.11)
d
to CH
=distance from node to cluster head
Assuming the shape of clusters is a circle
2 2 2
toCH
2
E[d ]= (x +y )dxdy
A
}}
..... (3.12)
38
= (1/)*M
2
/k
M*M= Network area
Energy dissipation in a cluster
* *
Total CH non CH
E k E n E
= +
.. (3.13)
Total energy dissipation for a round is
2
2
0
2
4
0
*[2nE nE kE E[d ] E ]if
*[2nE nE kE E[d ] E ]if
elec DA fs toBS fs toBS
Total
elec DA fs toBS fs toBS
nM
l d d
k
E
nM
l d d
k
+ + + <
H
=
`
+ + + >
H )
(3.14)
l =l-bit message over a distance d
d
to BS
=distance from cluster head to base station
From solving the above equation optimal solutions for
and P
opt
... (3.15)
Optimal probability:
0
2
0
4
1
; d
[ ]
1
; d
[ ]
toBS
toBS
opt
opt
fs
toBS
mp
toBS
M
d
n
E d
k
p
n
E
M
d
n E
E d
t
t
<
=
`
>
)
.. (3.16)
Assuming the co-ordinates of Base station as (0.5M,0.5M+B) values calculated are
2
2 2
[ ]
6
toBS
M
E d B = +
... (3.17)
4
4 2 2 4
7 2
[ ]
180 3
toBS
M
E d B M B = + +
.. (3.18)
0
Total
E
k
c
=
c
0
2
0
4
; d
[ ]
; d
[ ]
toBS
toBS
opt
fs
toBS
mp
toBS
n M
d
E d
k
E
n M
d
E
E d
t
t
<
=
`
>
)
39
Therefore the values of k
opt
and p
opt
are related to the total number of sensor nodes,
domain size of sensor field, and the location of BS.
3.4.2 WSN routing protocols using genetic algorithm
The scenarios of WSNs routing protocols using genetic algorithm are developed for the
networks having no global positioning system. The main purpose of the operations of these
protocols is to increase the network life-time by maximizing the number of transferred data
packages with clustering [19]. The clustering mechanism of the proposed protocols is based on
the clustering technique of LEACH protocol where cluster heads perform data aggregation
processes of their clusters. Cluster heads use TDMA MAC in intra-cluster communication and
CDMA MAC communication with the base station. The main operational difference between the
proposed protocols and LEACH is the selection process of cluster heads (CH); clustering head
selection is performed by genetic algorithm in proposed protocols while LEACH uses a random
selection method. The proposed network clustering protocol is based on a centralized control
algorithm that is implemented at the base station. The base station is a node with unlimited
energy supply.
3.4.3 Cluster based routing strategy
In a typical WSN application, sensor nodes collect data nearby and send it to the
destination which is a neighbor node or the base station. In a clustered approach, cluster heads
gather data about the common phenomena from sensor nodes and then aggregate this raw data to
form the final abstract data. The main idea in the aggregation of data is to combine the data
obtained from different sensor nodes in a neighborhood and minimize the total amount of data
transmission before transferring data to the base.
We consider a wireless sensor network model that consists of a base station and a number
of stationary sensor nodes that are grouped into clusters dynamically in each tour as used in
LEACH.
Initialization
40
Setup
Data gathering
Fig. 3.5 Main steps of the proposed protocol
In the first step (setup), cluster organization is made by selecting of the cluster-heads for
the current tour. Then, sensor nodes are joined to the nearest cluster-heads. After this selection
process, periodical data from the network is gathered via the cluster-heads as the second step.
In the proposed approach based on genetic algorithm, selection process of cluster heads is
achieved using calculated optimal probability in the genetic based protocol which the
communication energy is considered as the significant factor. The distance between the
communicating elements is the main concern of energy consumption.
3.4.4 Flow Chart of genetic Algorithm
Start
Generate initial population n=100
Calculate the optimal probability p_opt.
41
No Yes
Fig 3.6 Flow chart of genetic algorithm
3.4.5 pseudo code of genetic algorithm based energy efficient adaptive clustering protocol
INITIALIZATION
Specify the probability (p), number of nodes (n);
Einit(s)=E
0
, s=1,2, , n;
Calculation of optimal probability
Set-up phase
if (Einit(s)>0 & rmod(1/ p
opt
)0) then //p
opt
calculated
Select the nodes randomly for
each iteration of each round
Select the nodes that satisfy the
threshold function
Round Begins
R<=R
max
(1800)
Stop
Data transmission takes place
R=R+1
42
rrandom(0,1) and compute T(n); //given by threshold eq where p
opt
is used instead of p.
if (r < T(n)) then
CCH{s}=TRUE; //node s be a candidate CH
Else
CCH{s}=FALSE; //node s not be a candidate CH
end if
end if
STEADY-STATE PHASE
If (CH(s)=TRUE) then
Receive(IDi, DataPCK) //receive data from members;
Aggregate(IDi, DataPCK) //aggregate received data;
Tans To BS(IDi, DataPCK); //transmit received data;
// one round is completed.
CHAPTER 4
IMPLEMETATION OF THE PROTOCOLS USING MATLAB
Mathematical formulation of firefly and Genetic based algorithm as well as cluster
formation is discussed in the previous chapter. This chapter tells about the parameter used for
43
implementing firefly, Genetic and Hybrid algorithm along with the algorithm steps which are
used in implementing those protocols and flow charts of the protocols. It is also going to discuss
the advantages and disadvantages if any of these protocols and purpose the modifications done in
overcome those disadvantages. First we implemented Genetic based algorithm which has higher
first node death value and it also uses optimal probability value which is obtained from different
network parameters rather than random value. The advantages of firefly algorithm are
exploration and exploitation but mostly exploitation in this implemented firefly and high
convergence rate but the problem is it uses energy based switching for cluster head selection and
to overcome this we implemented Hybrid algorithm which is a combination of Genetic based
and firefly which uses fitness value switching i.e (CH will have higher fitness value than other
nodes) due to this last node death value increases drastically, this implementation overcome the
problems like fast first node death and also have high network life time it has advantages of
having both exploration and exploitation characteristics.
4.1 NETWORK DESIGN
In designing the wireless sensor network in all the protocols, the following assumptions are
made
- Base station is located far away from the sensing field.
- Sensors and the base station are all stationary after deployment.
- Every node in the field has the initial energy of 0.5Joules.
- All nodes are homogeneous and each node is assigned a unique identifier.
- All links are symmetric.
- A node can compute approximate distance to other node based on the received signal
strength.
Table 4.1 shows the required parameters whose initial values are assumed as follows
Table 4.1 Parameters and their initial values
Parameter Value
Sensor field region (100*100)m
44
Base station location (50,150) (in meters)
Number of nodes 100
CH probability 0.1
Rmax 1800
Data packet length 4096 bits
E
elec
70nJ/bit
E
amp
120pJ/bit/m
2
EDA 5nJ
Initial energy 0.5J
4.2 FIREFLY ALGORITHM IMPLEMENTATION
Step 1: I nitialization
Initially provide all the constant value which are used in the MATLAB code. For
example network area, base station location, number of nodes in the network, initial energy
provided to each node, data aggregation energy required in each round, transmitter and receiver
electronics (E
elec
) and transmitter amplifier (
), number of rounds ( R
max
) , clustering
probability and number of bits transferred (Kb).
Step 2: Generation of sensor network
Now network will be generated with the given number of nodes. Each node gets their
position based on the random location generated by rand function. Ex. the x-coordinate and y-
coordinate of a node is given as
S(i).Xd=rand(1, 1)*Xm;
S (i).Yd=rand (1, 1)*Xm; where Xm, Ym gives the network x-axis and y-axis range.
And X
d
, Y
d
gives the co-ordinate position of the nodes.
Whereas rand(1,1) will generate single random number between 0 and 1.
Step 3: Firefly round begins
45
In this step first initialize the value of dead is equal to zero and then check the energy of
each node, if energy of node is equal to zero then we increment dead value by one. Then
randomly generate the total number of clusters and Cluster head based on the given probability
value and save the result in a structure. After formation of cluster find the distance of each node
with each CH and join the cluster in which cluster head is nearest.
Step 4: Energy based switching
Now in this step first initialize the value of optimization round. Now compare the every
node with the other nodes in the network, if the energy of the node is more than the CH energy
then that node will be eligible for the CH means location of cluster head changed because
previous CH is no more eligible for CH. This is the same thing as firefly change their location if
attracted towards more brighter firefly. After becoming new CH again clustering done, and
comparison process runs till the given optimization round value in that current round.
While comparing if the energy of the CH is more than the node then the CH will not be changed
in that optimization round.
Step 5: Fitness value calculation
After energy based switching step we find the fitness value in that optimization round for
that the clusters.
CH (k).fit=
(
(
. (4.1)
Where CH (k).fit gives the fitness value and CH(k).E gives the energy of the current CH
whereas M(k) is given as the sum of square of distances of all the nodes with their corresponding
CH in addition with distance of CH with the base-station.
Step 6: Getting best CHs
Now in this step first store the fitness value for the clusters of previous optimization
round along with the fitness value for the clusters of the current optimization round. After storing
the values get the fitness values in descending order and choose top k cluster-head for the further
process and this step goes on and finally will get the best possible set of CHs.
46
FIT=0; DER=0;
for k=1:c
FIT=[FIT CH(k).fit];
DER=[DER CH (k).der];
end
FIT=FIT (2: end);
DER=DER(2: end);
Best = [Best FIT];
[Best ID] = sort(Best, descend);
Best = Best (1: c);
ID=ID (1: c);
Step 7: Energy consumption
After getting best possible CHs, all the nodes starts sending data to their respective CHs.
Cluster-head collects these data and aggregate these data and sends it to the Base-station. All
nodes update their energy and then algorithm goes back for the next round. Where energy
consumption is calculated as:
For transmitting data
E
T-x
=E
elec
*Kb +
*d
2
*Kb . (4.2)
Where Kb is the number of bits sent and d is the distance between CH and node
For receiving data
E
R-x
=E
elec
*Kb (4.3)
4.3 Genetic algorithm IMPLEMENTATION
47
For a sensor network with N nodes and k number of clusters, the sensor network can be
clustered as follows
Step 1
Initially network is created using rand command using the above parameters and the
base station is located at the given position.
Step 2
Calculate the optimal probability of selecting the Cluster heads using the proposed
formula which is obtained from solving the objective function.
Step 3
For every node a random number is given and check it satisfies the threshold function
and if it satisfies the function it is chosen as cluster head.
Step 4
Clusters are formed considering the distances between the nodes and cluster heads
Step 5
In this step communication takes place between nodes and loss incurred are calculated
and residual energy of the network is calculated.
Step 6
Repeat steps 2 to 5 until the maximum number of round is reached. Each cluster head
receives data from its member node, process the data and send it to the base station for each
round. Check for dead nodes, alive nodes and residual energy for each round. If the energy of
node is less than or equal to zero then it is consider as dead node. Now plot is made for alive
node, residual energy and throughput of network for each round.
4.4 PROPOSED HYBRID ALGORITHM
Start
Initialization of value and
generation of sensor
network
Round starts
48
Yes
NO
No
Yes No
Fig 4.1 Flow chart of hybrid algorithm
In the case of Genetic algorithm First node death round is much more than any other
algorithm so network life will be more than any other algorithm without losing any node. Where
as in the case of proposed algorithm last node dies late compare to any other algorithms which
gives smooth energy consumption throughout the network.
Step 1: Initialization
Provide all the initial value required as like in Genetic and Firefly algorithm
Step 2: Sensor network generation
Dead==0
Clustering using Fitness value based switching
for CH selection from all the nodes in the
network and get set of best CHs
Communication takes place,
energy update of nodes
R <= R
max
(1800)
STOP
Implements Genetic
algorithm based
protocol
R= R+1
Implements Firefly algorithm with Fitness
function is S(i).fit=S(i).E/M(i)
Clustering of nodes is done with the
selected cluster heads
49
Nodes are deployed in random manner using rand command in the given network area.
Step 3: Round begins
In this step we first initialize the value of dead is equal to zero and then check the energy
of each node, if energy of node is equal to zero then we increment dead value by one. Then
randomly generate the total number of clusters and CH based on the given probability value and
save the result in a structure. After formation of cluster find the distance of each node with each
CH and join the cluster in which cluster head is nearest than other CH.
Step 4: Check below given condition
if (dead= = 0)
go to step 5
else
go to step 6
Step 5: Genetic algorithm begins
All the process of Genetic algorithm is carried out as described earlier until the first node
dies and after the first node death firefly algorithm starts.
Step 6: Random CH Selection and Clustering
Now in this step CH are choosen randomly based on the optimal probability and
clustering is done based on the distances between the nodes and the selected Cluster Heads.
Step 6.1: Fitness value calculation (Fitness value based switching)
After energy based switching step we find the fitness value in that optimization round for
every node in the network.
50
S(i).fit=
(
(
. (4.4)
Where S(i).fit gives the fitness value and S(i).E gives the energy of the every node whereas M(j)
is given as the sum of square of distances of all the nodes with the node in addition with distance of node
with the base-station.
Step 6.2: Getting best CHs
Now in this step first store the fitness value for the clusters of previous optimization
round along with the fitness value for the clusters of the current optimization round. After storing
the values get the fitness values in descending order and choose top k cluster-head for the further
process and this step goes on and finally will get the best possible set of CHs.
FIT=0;
for k=1:c
FIT=[FIT CH(k).fit];
end
FIT=FIT (2: end);
Best = [Best FIT];
[Best ID] = sort(Best, descend);
Best = Best (1: c);
ID=ID (1: c);
Good=0;
Good=[Good ID];
Good=Good(2:c);
Form the clusters using the nodes from obtained from matrix Good as choosing them as the CH.
Step 6.3:Energy consumption
After getting best possible CHs, all the nodes starts sending data to their respective CHs.
Cluster-head collects these data and aggregate these data and sends it to the Base-station. All
nodes update their energy and then algorithm goesback for the next round. Where energy
consumption is calculated as:
For transmitting data
51
E
T-x
=E
elec
*Kb +
*d
2
*Kb ... (4.5)
Where Kb is the number of bits sent and d is the distance between CH and node
For receiving data
E
R-x
=E
elec
*Kb . (4.6)
Clusters are formed as considering the distance between the nodes and the selected
Cluster heads.
As soon as the first node dies, Firefly algorithm starts and follows all the steps of firefly
algorithm and then plots all the results.
All the above algorithms are implemented using MATLAB and simulation results will be
discussed in the next chapter.
CHAPTER 5
SIMULATION RESULTS
5.1 SIMULATION METRICS
The main objective of the simulation is to evaluate the performance of each protocol.
52
Evaluation is made based on the following three metrics
- Alive nodes
- First node and last node dead
- Residual energy of the network
- Throughput of the network
Alive nodes
Here the number of nodes alive after finishing every round will be obtained
First node and last node dead
The performance of a network depends on the lifetime of its node. If the lifetime of the
node is high means less number of node dead for longer duration then the network performs well
and also transmits more data to the base station.
Residual energy of the network
Here the residual energy of the network for different algorithm with respect to the
number of nodes is analyzed. Any algorithm is better if their residual energy is greater and
energy graph is more smooth and flatter then only that algorithm is known as energy optimized
algorithm.
Throughput of the network
Throughput of the network shows data sent during the process. If the number of alive
nodes is more, then throughput of the network will be more. Throughput of the network is given
as:
Throughput= Alive nodes * Kb .. (5.1)
5.2 RESULTS AND ANALYSIS
Here sensing area is taken as (100*100)m whereas working area is (100*200)m and base
station is located at (50,150). Number of rounds (R
max
) is taken as 1800.
53
5.2.1 Plotting of nodes
Fig. 5.1Sensor network
Figure 5.1 shows the distribution of the 100 nodes in the given sensing area. Nodes are
randomly distributed in the given 100*100m network whereas base station is placed at (50,150)
location.
5.2.2 Hybrid along with all other algorithms
54
Fig 5.2 Alive nodes after every round in all the algorithms
Fig 5.2 shows dead node comparison of proposed hybrid algorithm along with Firefly,
Genetic, Leach and DT. Above fig shows the FND and LND is better for Hybrid algorithm so
hybrid algorithm is better than all other algorithms .Number of alive nodes is less in case of DT
is less because all the nodes in the network has to send information and leach has higher value
than DT because it uses the concept of clustering but it has early first node death because it
chooses the cluster head in a random probabilistic manner .GA based algorithm uses calculated
optimal probability rather random value therefore it gives better results than LEACH. Firefly has
better first node death than leach and lower than GA based because its clustering is done based
energy switching concept and it also take much time to find an optimal solution. Hybrid has
almost same first node death value as GA based because it implements GA based algorithm until
the first node dies and later it uses fitness value based switching. Conclusion of the above result
more alive nodes better network life time.
5.2.3 Number of dead nodes per round for implemented protocols
55
Fig 5.3 Comparison of dead nodes among all the algorithms
Fig 5.3 shows dead node comparison of proposed hybrid algorithm along with Firefly,
Genetic, Leach and DT. Above fig shows the FND and LND is better for Hybrid algorithm so
hybrid algorithm is better than all other algorithms. As mentioned DT involves all the nodes in
the network in transmission so its network lifetime is less than other algorithms its last node
death occurs at 280 rounds. LEACH has its last node death 780 rounds and firefly and GA based
algorithms has their last node death at 750 rounds. The Hybrid algorithm has its LND at 1450
rounds which is a high improvements than the other algorithms.
5.2.4 Residual Energy per round for implemented protocols
56
Fig. 5.4 Residual Energy comparison of all the algorithms
Fig 5.4 shows the Residual energy comparison of Hybrid, Firefly, Genetic, Leach and DT
algorithm. From the above graph one can conclude that the energy is optimized more in the case
of hybrid algorithm than any other algorithms. The residual energy of DT becomes zero at 280
rounds because all nodes are involved in transmission in every round. In LEACH it becomes
zero at 780 rounds. In firefly and Genetic based it becomes zero at 750 rounds because these
algorithms doesnt consider the location of node while electing the CH. Hybrid has higher value
than other because it selects the nodes which have higher fitness value as CH, fitness function
involves the energy of the node and its distance from other nodes and base station thats why its
residual energy becomes zero much later than other algorithms i.e at 1450 rounds.
5.2.5 Throughput per round for implemented protocols
57
Fig 5.5 Throughput comparison of all the algorithms
Fig 5.5 shows the Throughput comparison of Hybrid algorithm along with Firefly,
Genetic, Leach and DT. Above fig tells in Overall, Hybrid algorithm will send more bits of data
than any other algorithm throughout the process. So Hybrid algorithm is better than all other
algorithms because it sends more bits of data, their energy is optimized and overall lifetime of
network also increases in the case of hybrid algorithm. Same conclusion is drawn from alive
nodes it is directly proportional to alive nodes.
58
5.3 Comparison Table
Table 5.1 First node dead (FND), Last node dead (LND), Residual Energy & Throughput
comparisons:
Algorithms First node dead
(in rounds)
Last node dead
(in rounds)
Residual Energy
At 700 rounds
(in joules)
Throughput
At 700 rounds
(in bits*10
5
)
Direct Transmission 44 280 0 0
LEACH 114 780
8 3
Genetic 266 750 7 3.5
Firefly 228 750 7 3.4
Proposed Hybrid 260 1450 24 3.9
Table 5.1 compares the FND, LND, Residual Energy and Throughput result of all
the above discussed algorithms. From the above bar graph one can see that FND is more in the
case of Genetic algorithm, LND is almost same for genetic algorithm and firefly algorithm.so
genetic algorithm is used for hybridization with firefly algorithm works for longer duration with
full efficiency than any other algorithms.Hybrid algorithm more network lifetime than any other
algorithms with FND almost equal for hybrid algorithm and genetic algorithm and LND at
1450
th
round. Residual energy for direct transmission is zero at 700 round, for genetic algorithm
and firefly algorithm residual energy is almost same but the proposed hybrid algorithm has
higher residual energy compared to other algorithms because of that its LND is at 1450 rounds.
Throughput for direct transmission is zero at 700 round, for genetic algorithm has better
throughput compared to firefly algorithm but the proposed hybrid algorithm has higher
throughput compared to other algorithms because of that its LND is at 1450 rounds
59
Fig 5.6 Comparison of all the Algorithms for FND, LND, Residual energy and Throughput
Fig 5.6 compares the FND, LND, Residual Energy and Throughput result of all the above
discussed algorithms. From the above bar graph one can see that FND is more in the case of
Genetic algorithm, LND is almost same for genetic algorithm and firefly algorithm. so genetic
algorithm is used for hybridization with firefly algorithm works for longer duration with full
efficiency than any other algorithms. So hybrid algorithm more network lifetime than any other
algorithms with FND almost equal for hybrid algorithm and genetic algorithm and LND at
1450
th
round
Below table shows that the Residual energy of the network is more in the case of hybrid
algorithm than any other algorithms. The improvement in residual energy is more in the case of
hybrid algorithm with other algorithms are given below
% improvement in residual energy =
*100. (5.1)
Where R
H
= residual energy (In Joule) of the network using hybrid algorithm after 350 rounds.
R
O
= residual energy (in joule) of the network using other algorithm taken one at a time like DT,
leach, Genetic and Firefly algorithm
260
1450 1450 1450
228
750 750 750
266
750 750 750
114
780 780 780
44
280 280 280
FIRST NODE DEATH LAST NODE DEATH RESIDUAL ENERGY THROUGHPUT
N
o
.
o
f
r
o
u
n
d
s
Output Parameters
Comparison
Proposed Hybrid Firefly Algorithm Genetic based Algorithm Leach Direct transmission
60
Table 5.2 Residual energy improvement using hybrid after 700 round
Algorithm Improvement using
hybrid (in %)
Hybrid Vs DT 100
Hybrid Vs Leach 200
Hybrid Vs Genetic 242.8
Hybrid Vs Firefly 242.8
Table 5.2 tells about Residual energy improvement of the network using hybrid
algorithm than other algorithms discussed above. In above table column 2 tells about the
percentage improvement of the Residual energy of the network using hybrid algorithm in
comparison to the other algorithms like DT, leach, Genetic and Firefly algorithm. Table 5.1
clearly tells that the hybrid algorithm is better than all the algorithms because network lifetime of
the network is more in the case of hybrid algorithm than any other algorithms.
Table 5.3 CPU time taken per round for all the algorithms
LEACH Genetic
Algorithm
Firefly Hybrid
e=Total time 61.18 73.87 498.32 510.34
z=Time taken
per round
0.062 0.049 0.711 0.283
Initial CPU time t= cputime
Running For r rounds
Total CPU Time taken for that algorithm e= cputime-t (5.3)
Time taken per round z=e/(number of rounds) . (5.4)
61
CHAPTER 6
CONCLUSION
6.1 CONCLUSION
This thesis discussed the various energy efficient algorithms. In LEACH protocol
probability based cluster head (CH) selection process occurred whereas in genetic based
algorithm selection of cluster-head is done based on the calculated optimal probability through
given objective function which will take more number of rounds for the first node to die than
other algorithms. In Firefly Energy based switching of CH takes place which gives the best
possible cluster-head which has more energy than any other nodes, firefly algorithm is
implemented and its drawback is rectified in Hybrid algorithm. The drawback of firefly is
considering the node with high energy as CH but in hybrid fitness value every node is calculated
and nodes with high values are considered as CH which gives more number of rounds for the last
node to die. The network will work with full efficiency in the case of genetic based for longer
duration. The residual energy curve is more smooth and better for hybrid compare to any other
algorithms. Now with taking the advantages of Genetic based and Firefly, Hybrid Algorithm is
proposed. This Hybrid approach increases the life-time of the network. More number of nodes
alive for longer duration in the case of hybrid algorithm. From the residual energy graph one can
conclude that energy is optimized in hybrid than any other algorithms. Hybrid algorithm also
sends more bits of data than any other algorithms.
FUTURE WORK
In all the above algorithms, only randomly distributed network is taken where nodes are
distributed randomly but in future one can think about other possible distribution model and
compare the results and finds out that whether the results are better or not in case of other
distributions.
All the above algorithms assumed that all the sensors sensing the environment at fixed
rate and always have data to send to the end user. But in future version one can think about the
situation when nodes does not have data to send but still taking part in the process which causes
loss of battery power. So if nodes do not have data, then nodes should switched-off so that
battery life increases.
62
References
[1] Afnizanfaizal Abdullah, Safaai Deris, Mohd Saberi Mohamad & Siti Zaiton Mohd
Hashim 2011, A New Hybrid Firefly Algorithm for Complex and Nonlinear Problem,
S. Omatu et al. (Eds.): Distributed Computing and Artificial Intelligence, AISC 151, pp.
673680.
[2] Ahmed, G, Khan, NM & Ramer, R 2008, Cluster Head Selection Using Evolutionary
Computing in Wireless Sensor Networks Progress In Electromagnetics Research
Symposium, Hangzhou, China, University of New South Wales, Australia, pp. 883-885.
[3] Amir Hossein Gandomi, Xin-She Yang & Amir Hossein Alavi, 2011, Mixed variable
structural optimization using Firefly Algorithm, Elsevier, Computers and Structures 89
23252336.
[4] Bai Chen , Yaxiao Zhang , Yuxian Li , Xiaochen Hao & Yan Fang 2011, A Clustering
Algorithm of Cluster-head Optimization for Wireless Sensor Networks Based on Energy
Journal of Information & Computational Science, Institute of Electrical Engineering,
Yanshan University, Qinhuangdao, China vol. 8, no. 11 pp. 21292136
[5] Baker, DJ & Ephreminds, A 1981, The architecture organization of a mobile radio
network via a distributed algorithm, Transactions on communications, IEEE, vol. 29,
no.11, pp.1694-1701.
[6] Dezhen Song 2005, Probabilistic Modeling of Leach Protocol and Computing Sensor
Energy Consumption Rate in Sensor Networks,academics_tr_tamu-cs-tr-2005-2-2.
[7] Erfan. Arbab, Vahe, Aghazarian, Alireza, Hedayati , Nima & Ghazanfari Motlagh 2012,
A LEACH-Based Clustering Algorithm for Optimizing Energy Consumption in
Wireless Sensor Networks, 2nd International Conference on Computer Science and
Information Technology (ICCSIT) Singapore, pp. 147-150.
[8] Farahanish, M, Abshouri, AA, Nasiri, B, & Meybodi, MR 2011, A Gaussian Firefly
Algorithm, International Journal of Machine Learning and Computing, Vol. 1, No. 5.
[9] Gandomia, AH, Yang b, XS, Talatahari, S & AH, Alavi d, 2013, Firefly algorithm with
chaos, Commun Nonlinear Sci Numer Simulat 18 8998.
[10] Handy, MJ, Haase, M, & Timmermann, D 2002, Low Energy Adaptive Clustering
Hierarchy with Deterministic Cluster-Head Selection, IEEE_MWCN.
63
[11] Hill, JL 2003, System architecture for wireless sensor networks, University of
California, Berkerley Ph.D. dissertation.
[12] Jenn-Long Liu , Chinya & Ravishankar, v 2011, LEACH-GA: Genetic Algorithm-
Based Energy-Efficient Adaptive Clustering Protocol for Wireless Sensor Networks,
International Journal of Machine Learning and Computing, Vol.1, pp. 1
[13] Jennifer Yick, Biswanath Mukherjee & DipakGhosal, 2008, Wireless sensor network
survey, University of California, J. Yick et al. / Computer Networks 52 , 2292233.
[14] Mihaleacardei, T, thai & Weiliwu 2005, Energy efficient target coverage in wireless
sensor networks, university of texas, IEEE, O-7803-8968-9-05.
[15] Navdeep Kaur & Deepiika Sharma 2013, Genetic Algorithm for Optimizing the Routing
in the Wireless Sensor Network International Journal of Computer Applications Vol. 70,
No.28, pp. 0975 8887
[16] Senthilnath, J, Omkar, SN & Mani, V 2011, Clustering using firefly algorithm:
Performance study, Swarm and Evolutionary Computation 1 164171.
[17] Shankar, T, Shanmugavel, S, Karthikeyan, A & Dhanbal, R 2012, Selection of cluster of
head using neural network in wireless sensor network, European Journal of Scientific
research, Department of SENSE, VIT university, vol.3, no.3, pp. 320-337.
[18] Shankar, T & Shanmugavel, S 2013, Hybrid approach for WSN using ABC and firefly
Algorithm, International review on computer science and software, vol.8, no.10,
pp.2335-2341.
[19] Shankar, T, Shanmugavel, S & Karthikeyan, A 2013, Hybrid approach energy
optimization in WSN using PSO, International review on computer science and
software, vol.8, no.6, pp. 1454-1459.
[20] Shankar, T & Shanmugavel, S 2014, Energy optimization in cluster based WSN,
Journal of Engineering science and technology, vol.9, no.2, pp.246-260.
[21] Shankar, T, Shanmugavel, S & Karthikeyan, A 2013, Modified harmony search
algorithm for energy optimization in WSN, International review on computer science
and software, vol.8, no.6, pp. 1469-1475.
[22] Surafel Luleseged Tilahun & Hong Choon Ong 2012, Research Article Modified Firefly
Algorithm, Hindawi Publishing Corporation Journal of Applied Mathematics Volume ,
Article ID 467631, 12 pages doi:10.1155/2012/467631.
64
[23] Tolle, G, Culler, D & Hong, W 2005, A microscope in the redwoods, in proceedings of
the 3
rd
international conference on embedded sensor systems, San Diego, CA.
[24] Vasilescu, I, Kotay, K, Rus, D, Dunbabin, M & Corke, P 2005, Data Collection,
Storage, Retrieval with an underwater sensor network, in proceedings of the third
international conference on Embedded Networked Sensor Systems (Sensys), San Diego,
CA.
[25] Wendi Rabiner Heinzelman, Anantha Chandrakasan & Hari Balakrishnan 2000, Energy-
Efficient Communication Protocol for Wireless Microsensor Networks, Proceedings of
the 33rd Hawaii International Conference on System Sciences.
[26] Xin-She Yang, 2010, Nature-Inspired Metaheuristic Algorithms Second Edition,
Published by Luniver Press, ISBN-10: 1-905986-28-9.
[27] Xu, K, & Gerla, M 2002, A heterogeneous routing protocol based on a new stable
clustering scheme, in proceedings of IEEE Military communication conference, vol.2 ,
Anachim, CA.
65
BIODATA
Name : G. Praveen Kumar Reddy
Reg. No : 10BEC0077
Fathers name : G. Bhaskar Reddy
Address : 10-155, Nehru bazaar,
Piler, Andhra pradesh
Pin code- 517214
Mobile No : 9042303069
Email-Id : praveenreddygm@gmail.com
Name : B.S.S.S.C Surya Teja
Reg.No : 10BEC0186
Fathers Name : B.V.V.S Narayana
Address : Plot no.402,Gayathri plaza
:Tadepalligudem
: Andhra Pradesh
: Pin No 534101
Mobile No : 08124273347
Email-id : suryabsssc@yahoo.com