MATERIALS AND METHODS 103
Chapter:-3
MATERIALS AND METHODS
In this chapter an overview of the simulation tool being used is given. General idea about
MATLAB and PROWLER is given. Then a new heuristic is proposed and described, for
increasing network lifetime considering Q-Coverage and P-Connectivity. It is then
compared with existing heuristic TPICSC. Again a new heuristic is proposed and
described, for increasing network lifetime considering Q-Coverage and P-Connectivity. It
is then compared with existing heuristic called HESL. This heuristic reduces the overall
energy consumption of the network and thus increases the lifetime of WSN.
3.1 Introduction of MATLAB
MATLAB stands for the matrix laboratory, which is the language of technical computing.
In the simulation of proposed heuristic MATLAB is used. Probabilistic Wireless Network
Simulator called PROWLER, a tool running under MATLAB, is used in the simulation.
MATLAB 14 is used for Windows 32-bit Operating system Environment. PROWLER
V1.25 is used in the simulation.
Initially the MATLAB was used to provide easy access to matrix software and this was
developed by the LINPACK and EISPACK projects. LINPACK and EISPACK both
represent the state-of-the-art in software for matrix operations and computations. As all
knows that MATLAB is a tool used for numerical computation and visualization [122]
purpose. The basic data element used in MATLAB is a matrix. So if a user wants to write
a program that manipulates array-based data, it is generally fast to write and run in
MATLAB (If the array used is large or it have lots of computations, then it is better off
using C or FORTRAN).
MATLAB is a high-level language. It provides an interactive environment for numerical
computation, visualization, and programming. The data can be analyzed, an algorithm
can be developed, models can be created and applications can be generated. The simple
language of MATLAB, its tools, and built-in math functions, allows the user to explore
different approaches and finds a solution faster than with spreadsheets or traditional
MATERIALS AND METHODS 104
programming languages, such as C / C++ or Java. MATLAB is used for a range of
applications
like
image
processing,
video
processing,
signal
processing,
in
communications and control systems, test and measurement, computational finance, and
computational biology. Most of the user’s engineers and scientists in research, industry
and academia use MATLAB, which is the language of technical computing.
MATLAB
(Matrix
Laboratory)
provides
multi-paradigm
numerical
computing
environment and it is a fourth-generation programming language. MATLAB was
developed by Math Works and it allows matrix manipulations, plotting of data, plotting
of functions, implementing algorithms, for creation of user interfaces, and interfacing
with programs written in other languages, like C, C++, Java and Python.
MATLAB is a high-performance language and basically used for technical computing.
MATLAB integrates all, computation, visualization, and programming in a friendly
manner. It provides an easy-to-use environment .Also the problems and solutions are
expressed in very simple and known mathematical notation. In university environments,
it is a tool for introductory and advanced courses of science and technical courses. In
industry, it is used for high-productivity research, development, and analysis.
The main uses of MATLAB includes:
In Mathematics and Computation.
In Modeling, Prototyping and Simulation.
In Data Analysis, Visualization and Exploration.
In Application Development, Including Graphical User Interface.
In Algorithm Development.
In Scientific and Engineering Graphics.
MATLAB is an interactive system. Its basic data element is an array and it does not
require dimensioning. Thus it allows a user to solve many problems on matrix and vector
formulations.
MATERIALS AND METHODS 105
3.2 History
Cleve Moler, the chairman of the computer science department at the University of New
Mexico, started developing MATLAB in the late 1970s. He developed and designed
MATLAB to give his students, the access to LINPACK and EISPACK without learning
Fortran. It spread rapidly to other universities and was found a sturdy audience within the
applied mathematics community. Jack little, was an engineer. He was exposed to it
during a visit which Moler made to Stanford University in 1983. Recognizing its
commercial potential, he joined with Moler and Steve Bangert. They rewrote MATLAB
in C and founded MathWorks in 1984 to continue its development. These rewritten
libraries were known as JACKPAC. In 2000, MATLAB was rewritten to use a newer set
of libraries for matrix manipulation, LAPACK.
MATLAB was first adopted by researchers and practitioners in control engineering,
Little's specialty, but quickly spread to many other domains. It is now also used in
education, in particular the teaching of linear algebra, numerical analysis, and is popular
amongst scientists involved in image processing.
Interfacing with other languages MATLAB can call functions and subroutines written in
the C programming language or FORTRAN. A wrapper function is created allowing
MATLAB data types to be passed and returned. The dynamically loadable object files
created by compiling such functions are termed "MEX-files" (For MATLAB executable).
Libraries written in Perl, Java, ActiveX or .NET can be directly called from MATLAB,
and many MATLAB libraries (For example XML or SQL support) are implemented as
wrappers around Java or ActiveX libraries. Calling MATLAB from Java is more
complicated, but can be done with a MATLAB toolbox which is sold separately by Math
Works, or using an undocumented mechanism called Java-to-MATLAB Interface (JMI),
which should not be confused with the unrelated Java Metadata Interface that is also
called JMI.
As alternatives to the MuPAD based Symbolic Math Toolbox available from
MathWorks, MATLAB can be connected to Maple or Mathematica.
MATERIALS AND METHODS 106
3.3 Toolboxes in MATLAB
MATLAB also have application-specific solutions called toolboxes. MATLAB,
toolboxes allow the user to adhere to a specialized technology. MATLAB Toolboxes are
comprehensive collections of MATLAB learn and apply functions, called M-files. These
MATLAB files extend the MATLAB environment and help in solving particular classes
of problems. Toolboxes are available in many areas including signal processing, control
systems, communications, neural networks, image processing, fuzzy logic, wavelets,
simulation, and many others.
MATLAB is primarily used for numerical computation. An optional toolbox uses the
MuPAD symbolic engine. MuPAD symbolic engine allows the access to symbolic
computing capabilities. Simulink is also added. Simulink provides graphical multidomain simulation environment and many Designs for dynamic and embedded systems.
In 2004, MATLAB had around one million users across industry and academia.
MATLAB users come from various backgrounds of engineering, science, and economics.
MATLAB is widely used in academic and research institutions as well as in industrial
enterprises.
The MATLAB applications are built around the MATLAB scripting language. MATLAB
applications use the Command Window as an interactive mathematical shell or execute
the text files containing MATLAB code.
3.4 MATLAB Components
The MATLAB system is made of five main parts:3.4.1 MATLAB Language
MATLAB language is a high-level language. It contains all control flow statements. It
also provides facility like inbuilt functions, user defined functions, different data
structures, input/output functions, and object-oriented programming language features. It
provides programming at the small level by rapidly creating quick and dirty throw-away
MATERIALS AND METHODS 107
programs. It provides programming at the large level by creating complete large and
complex application programs.
3.4.2 MATLAB Working Environment
MATLAB working environment is the collection set of different tools and facilities that
user work with as the MATLAB user or programmer. MATLAB working environment
manages the variables in workspace and import and export the data. It also includes
different tools for debugging, developing, managing and profiling M-files and
MATLAB’s applications.
3.4.3 Handle Graphics
Handle Graphics is the MATLAB graphics system. It contains high-level commands for
two-dimensional and three-dimensional data visualization, image processing, animation,
and graphics. It also includes low-level commands for user to fully customize the
appearance of graphics and to build complete Graphical User Interfaces on users
MATLAB applications.
3.4.4 The MATLAB Mathematical Function Library
The MATLAB mathematical function library contains a vast collection of computational
algorithms that ranges from elementary functions like sum, sine, cosine, and complex
arithmetic, to more complicated functions like matrix inverse, Eigen values, Bessel
functions, and Fast Fourier transforms.
3.4.5 The MATLAB Application Program Interface (API)
The MATLAB Application Program Interface (API) is a library that allows user to write
C and FORTRAN programs and that interact with MATLAB. It include facilities for
calling functions from MATLAB (Dynamic linking), calling MATLAB as a
computational engine, and for reading and writing M-files.
MATERIALS AND METHODS 108
3.5 Optimization Toolbox in MATLAB
Optimization Toolbox provides functions for finding parameters to maximize or
minimize the objective function while satisfying constraints. The optimization toolbox
solves linear programming, quadratic programming, mixed-integer linear programming,
nonlinear optimization, and nonlinear least squares. The optimization toolbox also used
to perform tradeoff analyses, to find optimal solutions to continuous and discrete
problems, and incorporate optimization methods into algorithms and applications.
3.6 Introduction of PROWLER Tool
PROWLER stands for Probabilistic Wireless Network Simulator. It runs under
MATLAB. It is capable of simulating wireless distributed systems, from the application
to the physical communication layer. The current version of PROWLER used is V1.25.
PROWLER is intended to optimize network parameters [123]. PROWLER runs under
MATLAB and it provides an easy way of application prototyping with nice visualization
capabilities. PROWLER provides a generic simulation environment. But its current target
platform is the Berkeley MICA mote running TinyOS.
PROWLER is an event-driven simulator. PROWLER can be set to operate in either
deterministic mode (To produce replicable results for testing the application) or in
probabilistic mode (To simulate the nondeterministic nature of the communication
channel and the low-level communication protocol of the motes). It can incorporate
arbitrary number of motes, on arbitrary (Possibly dynamic) topology. It can easily be
embedded into optimization algorithms.
The MATLAB-based simulator simulates the important aspects of the communication
scheme like local OS services including the network protocol stack, and also the radio
transmission phenomena (Signal power vs. distance, fading, collision, disturbances). In
the simulation environment it is easy to implement and test any services. Around the
simulator an optimization algorithm tunes the parameters of the service to provide an
optimum for a given QoS metric. The different solution can be provided to design and
MATERIALS AND METHODS 109
optimize distributed middleware services in a highly nondeterministic environment for a
large number of cooperating intelligent sensors.
The simulator runs under MATLAB and it provides a fast and easy way to prototype
applications. It has nice visualization capabilities. The graphical user interface of
PROWLER is shown below in Figure 3.1.The network simulator models the important
aspects of all levels of the communication channel and the application. The
nondeterministic nature of the radio propagation is characterized by a probabilistic radio
channel model. A simplified, but accurate model is used to describe the operation of the
Medium Access Control layer. The applications interact with the MAC layer through a
set of events and actions.
Figure 3.1: The Graphical User Interface of Probabilistic Wireless Network Simulator on a Grid
Layout.
MATERIALS AND METHODS 110
The network simulator can be used to test protocols and algorithms. It can also provide
metrics on the performance of the tested application. It is similar to the core of the
simulator. The applications can be parameterized and so different settings can easily be
tested. The proposed lifetime optimization heuristic is built around the simulator and it
calls the simulator with the required parameters.
3.6.1 Environment for PROWLER
PROWLER is targeted to the Berkeley MICA Mote hardware platform running
application built on TinyOS, though it could be modified to simulate more general
systems.
3.6.2 Simulation/Programming Language for PROWLER
PROWLER is written in MATLAB, while JPROWLER is written in Java.
3.6.3 Key Features of PROWLER
The simulator runs under MATLAB and so it provides a fast and easy way to prototype
applications. It has nice visualization capabilities. The network simulator models the
important aspects of all levels of the communication channel and the application. The
nondeterministic nature of the radio propagation is characterized by a probabilistic radio
channel model. A simplified, but accurate model is used to describe the operation of the
Medium Access Control layer.
3.6.4 Limitations of PROWLER
PROWLER provides an accurate radio model. However, it provides only one MAC
protocol, the default MAC protocol of TinyOS.
3.6.5 The Target System for PROWLER
A very successful, low-cost prototype field-node (Mote) family was developed at
Berkeley. The used variant (MICA) of the Berkeley motes (In Figure 3.2) includes an 8bit, 4 MHz Atmel ATMEGA103 microcontroller, 128kB program memory, 4KB RAM,
and an RFM TR1000 radio chip capable of providing 50 kbit/s transmission rate at 916.5
MATERIALS AND METHODS 111
MHz. The motes can also accommodate a set of interchangeable sensors (Temperature,
light, magneto, sound, etc.) [124].The one small operating system used by motes is called
TinyOS. It is designed to provide the necessary services in despite of the very limited
hardware resources. It contains a complete network stack with bit-level error correction,
medium access layer, network messaging layer, and timing [125].The Medium Access
Control layer uses a simple Carrier Sense Multiple Access protocol. It waits for a random
duration before trying to transmit a packet and then waits for a random back off interval
if the channel was found busy. It keeps trying until the complete transmissions can be
performed. This simple approach is not as effective as the more sophisticated protocols
(E.g. IEEE 802.11, [126]) in terms of collision avoidance. But it consumes less energy
and the communication overhead is also much smaller.
Figure 3.2 – A Berkeley Field-Node (Mote)
3.6.6 Radio Propagation Models
The radio propagation model is used to determine the strength of a transmitted signal at a
particular point of the space for all transmitters in the system. Based on the information
of the radio propagation models, signal reception conditions for the receivers can be
evaluated and collisions can be detected. Deterministic propagation function (Modeling
the decay of signal strength with distance), and random disturbances (Modeling the
fading effect, the time- varying nature of the signal strength, and other transmission
errors.), are used to determine the signal strength from the transmitter to a receiver.
MATERIALS AND METHODS 112
3.6.7 Features of PROWLER: PROWLER is an event-driven.
It may be deterministic or probabilistic in nature.
It may be command line / GUI.
PROWLER provides better Visualization, Statistics and Optimization.
It may have any number of Motes /for any application.
It is MATLAB-based.
PROWLER has fast and easy prototyping in MATLAB.
PROWLER captures the event-driven nature of TinyOS.
PROWLER has Easy debugging.
PROWLER does the algorithm testing in any of the three deterministic environment,
probabilistic environment and dynamically changing environment.
3.6.8 Application Areas of PROWLER
PROWLER is used in many applications. Some of them are given below: In communication protocols.
In routing protocols.
In arbitrary application prototyping.
In optimization, parameter tuning etc.
In providing visualization and easy to expand; plugins.
3.6.9 Applications Built Inside the PROWLER
Flood1D_application:-Flood application with probabilistic retransmission in one
direction
Flood2D_application:- Flood application with probabilistic retransmission in two
direction
Spantree_application:- Spanning tree building and visualization application. This
application illustrates the building of a spanning tree.
MATERIALS AND METHODS 113
Collision_demo_application:- Collision_demo_application is used to illustrate the
collision effect in radio transmission
Demo_application:-demo_application is used to illustrate the capabilities of
PROWLER. It runs the graphical user interface with an application. The first mote is
transmitting a message in every second. The other motes retransmit the message
(Flood).The received/sent message IDs are shown on the motes.
3.6.9.1 Mote Colors
Small red dots indicate motes with pending transmission.
Bigger red dots indicate transmitting motes.
3.6.9.2 Light Emitting Diodes (LEDs)
Small green dots indicate receiving motes.
Green LED is toggled when a message is received successfully.
Yellow LED is toggled when a collided message is received.
The white area can be clicked to move the first mote during simulation.
Mote's dot can be clicked to see memory dump (Even during simulation)
The first mote transmits the message, the receivers retransmit it with probability P=
[0.0:0.1:1]. Important factors are the Settling_Time and the Number _ of_ Receiving_
Motes.
3.6.9.3 Files in PROWLER Application
Each application of the PROWLER is consists of three files:(1) Name_topology:- It defines the topology of the motes. Means the topology
information of the motes (Coordinates of the motes).
(2) Name_animation:-It determines the graphical representation of events. Means the
animation information (How to display events during simulation)
(3) Name_application:-It contains the actual code for the application.
MATERIALS AND METHODS 114
Two additional files may be added to the PROWLER application:(4) Name_info:-Displays information about the application when the application Info
button is pressed.
(5) Name_params:-Defines application specific parameters. These parameters can be
viewed and modified by pressing the application parameters button.
Any of the supplied - application, animation, and topology files can be used as templates
for creating new program (_info and _params files are optional).
All the applications are event based which are given below.
(1). Init_Application.
(2). Packet_Sent.
(3). Packet_Received.
(4). Collided_Packet_Received.
(5). Clock_Tick.
(6). Application_Finished.
(7). Application_Stopped.
Actions can be activated when events occur. These actions cause further events to occur.
Actions are: Set-Clock and
Send-Packet. After the events like Application_Finished
and Application-Stopped, no further actions can be activated.
There are debug/visualization actions (No events caused):(1) Print Message :Example: PrintMessage ('PROWLER')
(2) LED:Examples: LED ('red on'), LED ('green off'), LED ('yellow toggle')
(3) Draw Line :Format of Draw line is:
Drawline (ModeStr, ID1, ID2 [optional formatting commands]);
ModeStr=Line|Arrow|Delete
Examples: DrawLine ('Arrow', ID1, ID2, 'color', [1 0 0]),
DrawLine ('Delete', ID1, ID2)
MATERIALS AND METHODS 115
The function call PROWLER ('GetDisplayHandle') can be used to get the actual displays
handle. It can be useful when creating extra graphics on the display.
3.7 Target Coverage and Connected Target Coverage Problem
In target Coverage problem the main aim is to cover the set of given targets. Each target
should be covered by at least one sensor because if it is not covered then it would not be
able to collect the required information about that target. Similarly sensors should be
connected directly or indirectly to the BS or fusion center. Then only they can send all
the required information collected to the fusion center. It is also well known that each
sensor is given energy in the form of battery. Means each sensor has their own battery,
but battery lifetime is limited, so full and proper utilization of battery life is required. In
order to increase the lifetime, the nodes must be divided into a number of subsets, called
cover sets. Sensors belonging to the currently scheduled cover set are in active mode,
while others are in sleep mode. Each cover set is capable of covering all monitored
targets.
3.7.1 Target Coverage Problem Definition
Given M targets with known location in energy constrained Wireless Sensor Network
with N randomly deployed sensors in the target’s vicinity, schedule the activities of
sensor nodes in such a way that all targets are continuously monitored and observed and
network lifetime is maximized. For sensor scheduling mechanism in target Coverage
problem, sensors send their location information to the BS. BS then executes the sensor
scheduling algorithm and broadcasts and sends the schedule when each node is active.
According to that every sensor schedules itself for active/sleep mode. In Target Coverage
problem the sensor nodes activities are scheduled such that
All targets are continuously observed,
Network life-time is maximized.
MATERIALS AND METHODS 116
3.7.2 Connected Target Coverage Definition
Given m targets with known location, a base station, and battery powered energy
constrained WSN having n sensors randomly deployed in the targets’ vicinity, schedule
the activities of sensor nodes in such a way that:
All targets are continuously monitored and observed.
Active sensor nodes are BS-connected, and from each source node to the sink, there
must exist a route traversing through only the active sensors.
Network life-time is maximized.
The network lifetime is measured as the time all targets are monitored and observed by a
subset of a sensor in the active state that are BS-connected and that satisfies the sensor
energy constraint.
It can also be as defined as the time period between the networks was set up and one or
more targets cannot be covered or a route cannot be found to send the sensed data to the
sink.
3.8 Problem Statement
The problem statement is “The Novel Energy Efficient Heuristic Based Approach with
Improved Network Lifetime in Wireless Sensor Network”.
Given m targets, with known location in energy constrained Wireless Sensor Network
and with n sensors, randomly deployed in the target’s vicinity, a problem is formulated to
schedule the activities of sensor nodes in such a way that all targets are continuously
monitored and observed, with Q-Coverage and P-Connectivity requirement and network
lifetime is maximized .
Given a set S ,consist of sensors S1, S2, . . . , Sn, a base station S0, and a set T of targets
T1, T2, . . . , Tm, proposed heuristic is used to find a set C of set-covers C1, C2, ..., Ck, with
time weights l1,..., lk in [0, 1]such that the following constraints are satisfied.
(1). Q-Coverage and P-Connectivity requirements are satisfied.
(2). l1 …... lk are maximizes.
MATERIALS AND METHODS 117
(3). Sensors in each set Ck are BS-connected.
(4). Each sensor set or cover set monitors all targets.
(5). Each sensor selected in the sets C1, C2…... Ck consumes at most E energy, where E is
the lifetime of each sensor.
A sensor can participate in multiple set covers and the time weight lk of each set cover Ck
may be different .So there is no need for the sensor sets to be disjointed.
A Q-Cover is a set of all sensor nodes that together covers all the targets satisfying their
Q-Coverage and P-Connectivity requirement. In Q-Coverage, Q = {q1, q2, q3 ... qm} is an
integer vector where each element of Q called qi denotes the number of sensors that
should covers the target i (Here the case when each qi of Q is same, is considered). In PConnectivity, P = {p1, p2, p3 ... pn} is an integer vector where each element of P called pi
denotes the number different paths required from the sensor i to the BS. (Here the case
when each pi of P is same is considered). The problem is to find out set of all such QCovers and assign a small lifetime constant to each Q-Cover such that aggregated
lifetime of all such Q-Covers is maximized subject to the constraint that each sensor node
is utilized maximally up to its residual battery lifetime.
The objective is to find to find out a set of Q-Covers that together covers all the targets
satisfying their Q-Coverage and P-Connectivity requirement and assign a small constant
of lifetime so that the aggregated lifetime of all Q-covers is maximum subject to the
constraint that no individual sensor can be used longer than initial battery life E.
3.9 Enhancement 1
In enhancement 1, a heuristic called Q-Coverage Maximum Connected Set Cover (QCMCSC) is designed for scheduling the sensor node activity and to increase the lifetime of
WSN while maintaining Q-Coverage and Connectivity in WSN. It is then compared with
existing algorithm called TPICSC and proved that the performance of QC-MCSC is
better than TPICSC.
MATERIALS AND METHODS 118
3.9.1 Constraints and Parameters in QC-MCSC
In the proposed heuristic the following parameters are being used.
Q-Coverage vector Q
Q is an integer vector where each element of Q called qi denotes the number of sensors
that should covers the target i (Here the case when each qi of Q is same, is considered).
Proposed algorithm is to maximize the network lifetime satisfying Q-Coverage
requirements.
Q-Covers C
Each Q-Cover denotes the set of sensor nodes that together covers all the targets. While
selecting sensors in a Q–Cover, priority is given to that sensor having maximum utility.
Then a small constant of this residual lifetime is given to activate that Q-Cover, so that
each sensor may participate in more than one Q-Cover. Thus smaller the constant of
lifetime assigned to a Q-Cover, more optimal is the solution achieved. Q-Cover C
denotes the set of all sensor nodes that together covers all the targets satisfying their QCoverage and Connectivity requirement. k is the number of set covers formed. Thus C=
{C1, C2, C3 ….Ck}.
Connectivity
Connectivity means there should be at least a path between any two sensors. To send the
information to the base station, Connectivity is necessary. Proposed algorithm is to
maximize the network lifetime satisfying both Q-Coverage and Connectivity
requirements.
Sensor Set
S= {S1, S2, S3,……. Sn} denotes the set of n sensors.
Target Set
T = {T1, T2, T3,……. Tm} denotes the set of m targets.
Sensor Battery Life time set
B = {B1, B2, B3, …. ... .. Bn} be the set of available battery lifetime of each sensor.
Sensor target Coverage matrix A
A sensor target Coverage matrix A is defined as –
MATERIALS AND METHODS 119
Aij
= {1 If sensor Si covers target Tj}
= {0 Otherwise}
For example:Table: 3.1: Sensor Target Coverage Matrix
T
T1
T2
T3
T4
S1
1
1
0
1
S2
1
0
1
0
S3
0
1
1
1
S4
1
0
0
1
S5
0
1
1
0
S6
0
0
1
1
S
In this matrix there are four targets and six sensors. Target T1 is covered by sensors S1,
S2, S4. Similarly target T2 is covered by S1, S3 and S5 and so on.
Using this metrics a Q-Cover C, can be find out which is a set of rows of A ( Means set
of sensor ) such that for every column j, there are at least qj rows i1 , i2 , i3 ,….. iqj in S
such that Aij =1.
Lifetime Constant Vector L
For each Q-Cover Ck, a small constant lifetime (lk) is given such that lk >= 0.This small
constant of lifetime tells for how much time that set cover is active.
Thus L= {l1, l2, l3, ……lk}.
MATERIALS AND METHODS 120
A Small Sensor Lifetime Granularity Constant l Є[0,1]
A small sensor lifetime granularity constant is decided for each set cover and its value is
l.
Sensor-Cover Matrix M
A matrix M defined as Mij
= {1 if sensor Si is in Q-Cover Cj}
= {O otherwise}
For example:Table: 3.2: Sensor-Cover Matrix
C
C1
C2
C3
C4
S1
0
1
1
0
S2
1
0
1
1
S3
1
1
0
0
S4
0
0
1
1
S5
0
1
1
1
S6
1
0
0
1
S7
1
0
1
1
S
This matrix can be drawn only if the number of set covers and its members are known.
Means rows of matrix M represent all sensors and columns represent set of Q-cover.
e1
e1 is the energy consumed in sensing per unit of time
e2
e2 is the energy consumed in communication per unit of time.
MATERIALS AND METHODS 121
There for during a round, consumed energy by an active sensor for sensing is equal to
El = lk el , and for communication is E2 = lke2.
3.9.2 Proposed Heuristic QC-MCSC
INPUT (A, Q, l, E, e1, e2)
Set lifetime of each sensor to E.
k=0
Repeat while for each target i Aij Biqj
(1) Coverage Phase
k=k+1
Ck = ϕ
For all targets
Uncover_level(T) = qj
Do while uncover_level (T)! = 0 for all targets
Select a critical target T with uncover_level (T) > 0 and a sensor S having greatest
contribution function.
Ck = Ck U{S}
For all targets covered by S
Uncover_level (T) = Uncover_level (T) -1
End do
(2) Connectivity and Redundancy Reduction Phase
Run the BFS algorithm and find out the shortest path from each sensor S Ck to BS in
G. Add extra nodes in this path to Ck, forming a new and updated connected set Ck for all
S Ck
Select a sensor S Ck with least priority.
MATERIALS AND METHODS 122
If Ck - S is still a connected set cover, then
Ck = Ck - S
End for
(3) Energy and Priority Updation Phase
lk = Lifetime (Ck) = Min (l,Max_lifetime ( Ck ) )
For all Si Ck
If Si Ck is performing as only relay node
Then Bi = Bi - E2
Else if Si is performing as sensing node then
Bi = Bi - (E1+E2)
Else if Bi < E2 then
S = S - Si
End for
Update priorities according to their remaining energy.
3.9.3 Description of Proposed Heuristic QC-MCSC
Input to the propose heuristic is A, Q, l, E, e1 and e2.Where A is the sensor target
Coverage matrix defined above. If a sensor Si covers the target Tj, then the value of Aij is
set to 1.Else it is 0.Q is the Coverage vector that has been already defined. Each value of
Q-Coverage vector is same here. Means the order of Coverage for all the targets are
same. l is the lifetime granularity constant which is already defined. E is the initial battery
of each sensor. Each active sensor consumes el energy for sensing and e2 energy for
communication per unit of time.
MATERIALS AND METHODS 123
Initially the lifetime of each sensor is set equal to E. Set covers are made only if the
condition of Q-Coverage is satisfied. Means the given condition i Aij Biqj should be
satisfied. So all the three phases will be executed till the condition of Q-Coverage is
satisfied. Initially k is set equal to 0, which means the numbers of set covers are 0.
The proposed heuristic is consisting of three phases.
(1) Coverage Phase
Coverage phase is used to check the order of Coverage while covering all the targets. If
the condition of Q-Coverage is satisfied then k is incremented by one. Means a new set
cover can be formulated.
Initially for all targets the numbers of sensors uncovering them are equal to the value qi
of Q-Coverage vector. At each step, a critical target to be covered is selected. This can
be for example the target most sparsely covered, both in terms of number of sensors as
well as with regards to the residual energy of those sensors.
Once the critical target has been selected, the heuristic selects the sensor with the greatest
contribution or we can say the sensor with the maximum utility and that covers the
critical target. There are various sensor contribution functions that can be defined. For
example a sensor has greater contribution if it covers a larger number of uncovered
targets and if it has more residual energy available. After the sensor has been selected, it
is added to the current set cover. Uncover_level of all additionally covered targets are
also reduced by one. A target is either covered by the sensors already selected in the set
cover, or it becomes a critical target, at which point the sensor with the greatest
contribution, that covers the critical target, is selected again.
Output of this phase is set Ck, which will be used in Connectivity and Redundancy
Reduction Phase.
(2) Connectivity and Redundancy Reduction Phase
Input to the Connectivity phase is Ck and G. Ck is the set cover returned in Coverage
phase. G is the network Connectivity graph. The goal in this phase is to compute the new
MATERIALS AND METHODS 124
and updated connected set Ck. For this apply the BFS algorithm. BFS algorithm is used, to
find out the shortest path for each sensor node Si in Ck to the BS in G. All the sensors in
this path are added to the set Ck, forming the new and updated connected set Ck.
If the set Ck is already a connected set, then the new and updated connected set Ck is
equal to the old set Ck formed in step 1. Otherwise, relay sensors are added to the set Ck
to form a new and updated connected set Ck.
Next goal is to remove the redundant sensors from the set Ck so that a minimal connected
set cover can be formulated. A sensor Si Ck with least priority in C is likely to be
removed. Remove the sensor Si Ck with least priority and then check if it is still a
connected set cover. If it is, then the set Ck is updated by Ck = Ck - S.
(3) Energy and Priority Updation Phase
Input to this phase is Ck. A small constant of lifetime to the set cover Ck is assigned,
which has been generated in Redundancy Reduction Phase. This is a non disjoint
algorithm which means a sensor may participate in more than one set cover. So one
sensor may participate in more than one cover set as a sensor doesn’t consume all of its
energy in a single cover set. The lifetime of a set cover is decided as minimum between
small lifetime granularity constant (l) and maximum lifetime available from sensors in a
set cover Ck, which is obtained by Min(l, Max_lifetime(Ck)). Bi is the residual energy of
each sensor Si .Each connected set cover corresponds to a round that will be active for l k
time. It is assumed that each active sensor consumes el energy for sensing and e2 energy
for communication per unit of time. There for during a round, consumed energy by an
active sensor for sensing is equal to El = lk el, and for communication is E2 = lk e2.
Thus an active sensing sensor consumes El + E2 energy, while a relay sensor consumes
only E2 energy per round (Since a sensing node sense data and communicates with
neighbors in the same time, but a relay node is only responsible for communication). In
this heuristic, If, after the update, the residual energy Bi of a sensor Si is less than E2,
means Bi < E2, then that sensor is removed from the set S. This is because of the sensor
cannot participates as a sensing or relay node in another set-cover in future.
MATERIALS AND METHODS 125
At last, the priorities of sensors are updated according to their remaining energy.
3.9.4 Assumptions in QC-MCSC
The following application scenario is considered in this thesis. In an area, a number of
targets with fixed locations are given. They are required to be continuously monitored
(Covered) by a large number of randomly deployed sensors. Each sensor is assumed to
cover a fixed area and any target located in that sensing area could be monitored by the
sensor. The data are sensed by the sensors and then collected, transmitted and processed
by a sink node. If a sensor is in active state, it generates data messages at a certain rate.
Sensed data by sensors are transmitted to the sink through radio communication. Single
hop or multiple-hop communication can be used from a source to the sink. A sensor node
which is used only to relay the data is called a relay node. A sensor is an active node if it
is working either as a source or as a relay or both. A sensor that is not in active state goes
into an energy saving sleep state. In sleep it does not consume any energy. In this thesis,
scheduling sensor activity means to determine the state of the deployed sensors to be
either active (As source or relay or both) or sleep as well as their state durations.
The monitored area of 1000*1000 m is assumed inside the sensing area .It is assumed
that sensors have the same energy equal to 1unit and sensing range equals 70m. The
network consists of a sink and randomly deployed nodes. The sink has more power and
more processing capability than the other nodes. Since the sink aggregates data in order
to send to a distant station, the events gathered by nodes will be sent to the sink which is
at the one corner of the deployment area. All the sensors send the data to the sink via
single or multi-hop communication. The multi-hop communication also results in a
reduction in energy dissipation. For simplicity in analysis, it is assumed that sensing and
communication radius is the same and has identical value for each node. Therefore, two
nodes are connected if and only if the distance between them is equal or smaller than the
sensing radius Rs and communication range Rc. Each sensor node considers the
connected sensor nodes as its neighbour nodes.
MATERIALS AND METHODS 126
3.10 Enhancement 2
A heuristic called Q-Coverage P-Connectivity Maximum Connected Set Cover (QC-PCMCSC) is designed for scheduling the sensor node activity to increase the lifetime of
WSN while maintaining Q-Coverage and P-Connectivity in WSN. It is then compared
with existing algorithm called HESL and proved that the performance of QC-PC-MCSC
is better than HESL.
3.10.1 Constraints and Parameters in QC-PC-MCSC
In the proposed heuristic the following parameters are used.
Q-Coverage vector Q
Q is an integer vector where each element of Q called qi denotes the number of sensors
that should covers the target i. (Here each qi of Q is same). Proposed heuristic is to
maximize the network lifetime satisfying Q-Coverage requirements.
P-Connectivity vector P
P is an integer value which denotes the number of different paths between any two
sensors. In P-Connectivity, P = {p1, p2, p3 ... pn} is an integer vector where each element
of P called pi denotes the number different paths required from the sensor i to the BS.
(Here the case when each pi of P is same is considered). Proposed algorithm is to
maximize the network lifetime satisfying P-Connectivity requirements.
Q-Covers C
Each Q-Cover denotes the set of sensor nodes that together covers all the targets. While
selecting sensors in a Q–Cover, priority is given to that sensor having maximum utility,
and then a small constant of their residual lifetime is given to activate that Q-Cover, so
that each sensor may participate in more than one Q-Cover. Thus smaller the constant of
lifetime assigned to a Q-Cover, more optimal is the solution obtained. Q-Cover C denotes
the set of all sensor nodes that together covers all the targets satisfying their Q-Coverage
and P-Connectivity requirement. k is the number of set covers formed. Thus
C= {C1, C2, C3, …….Ck}
Sensor Set
S= {S1, S2, S3,……. Sn} denotes the set of n sensors.
MATERIALS AND METHODS 127
Target Set
T = {T1, T2, T3, ……. Tm} denotes the set of m targets.
Sensor Battery Life Time Set
B = {B1, B2, B3, …. ... .. Bn} be the set of available battery lifetime of each sensor.
Sensor Target Coverage Matrix A
A sensor target Coverage matrix A is defined as –
Aij = {1 If sensor Si covers target Tj }
= {0 Otherwise}
For example
Table: 3.3:- Sensor Target Coverage Matrix
T
S
T1
T2
T3
T4
S1
1
1
0
1
S2
1
0
1
0
S3
0
1
1
1
S4
1
0
0
1
S5
0
1
1
0
S6
0
0
1
1
In this matrix there are four targets and six sensors. Target T1 is covered by sensors S1,
S2, S4. Similarly target T2 is covered by S1, S3 and S5 and so on.
MATERIALS AND METHODS 128
Using this metrics A, a Q-Cover C can be find out which is a set of rows of A (Means set
of sensor) such that for every column j, there are at least qj rows i1, i2 , i3 ,….. iqj in S such
that Aij = 1.
Lifetime Constant Vector L
For each Q-Cover Ck, a small constant lifetime (lk) is given such that lk >= 0.This small
constant of lifetime tells for how much time that set cover is active.
Thus L= {l1, l2, l3, ……lk}.
A Small Sensor Lifetime Granularity Constant l Є[0,1]
A small sensor lifetime granularity constant is decided for each set cover and its value is
l.
Sensor-Cover Matrix M
A matrix M defined as Mij = {1 if sensor Si is in Q-Cover Cj}
= {O otherwise}
For example
Table: 3.4:- Sensor-Cover Matrix
C
S
C1
C2
C3
C4
S1
0
1
1
1
S2
1
0
1
0
S3
1
1
0
1
S4
0
0
1
1
S5
0
1
1
0
S6
1
0
0
1
S7
1
0
1
1
MATERIALS AND METHODS 129
This matrix can be drawn only if the number of set covers and its members are known.
Means rows of matrix M represent all sensors and columns represent set of Q-cover.
e1
e1 is the energy consumed for sensing per unit of time
e2
e2 is the energy consumed for communication per unit of time.
There for during a round, consumed energy by an active sensor for sensing is equal to
El =lkel , and for communication is E2 = lke2.
3.10.2 Proposed Heuristic QC-PC-MCSC
INPUT (A, Q, P, l, E, e1, e2)
Set lifetime of each sensor to E.
k=0
Repeat while for each target I Aij Bi qj
(1) Coverage Phase
k=k+1
Ck = ϕ
For all targets
Uncover_level (T) = qj
Do while uncover_level (T)! = 0, for all targets
Select a critical target with Uncover_level (T) > 0 and a sensor S having greatest
contribution function.
Ck=Ck U{S}
For all targets covered by S
Uncover_level (T) = Uncover_level (T) - 1
MATERIALS AND METHODS 130
End do
(2) Connectivity Phase
Repeat for 1 to P
Run the BFS algorithm and find out the shortest path from each SCk to BS in G.
Add extra nodes in this path to Ck, forming a new and updated connected set Ck
End for
(3) Redundancy Reduction Phase
Unmark all SCk
Repeat while all SCk are marked.
Choose unmark S Ck with minimum utility.
If Ck - {S} is still a connected set then Ck = Ck - S
Else mark that S
End while
(4) Lifetime Assignment and Energy Updation Phase
lk = Lifetime (Ck) = Min (l, Max_lifetime ( Ck ) )
For all Sensors S Ck
If Si is performing as only relay node
Then Bi = Bi - E2
Else if Si is performing as sensing node then
Bi = Bi - (E1 + E2)
Else if Bi < E2 then
MATERIALS AND METHODS 131
S = S - Si
End for
3.10.3 Description of Proposed Heuristic QC-PC-MCSC
Input to the propose heuristic is A, Q, P, l, E, e1 and e2.Where A is the sensor target
Coverage matrix. If a sensor Si covers the target Tj, then the value of Aij is set to 1.Else it
is 0.Q is the Coverage vector that has been already defined. Each value of Q-Coverage
vector is same here. Means the order of Coverage for all the targets are same. P is the
order of Connectivity defined above. Each value of P-Connectivity vector is same here. l
is the lifetime granularity constant which is already defined. E is the initial battery of
each sensor. Each active sensor consumes el energy for sensing and e2 energy for
communication per unit of time.
Initially the lifetime of each sensor is set equal to E. Set covers are made only if the
condition of Q-Coverage is satisfied. Means the given condition I Aij Bi qj should be
satisfied. So all the four phases will be executed till the condition of Q-Coverage is
satisfied. Initially k is set equal to 0, which means the numbers of set covers are 0.
The proposed heuristic is consisting of four phases.
(1) Coverage Phase
Coverage phase is used to check the order of Coverage while covering all the targets. If
the condition of Q-Coverage is satisfied then k is incremented by one. Means a new set
cover can be formulated.
Initially for all targets the numbers of sensors uncovering them are equal to the value qi
of Q-Coverage vector. At each step, a critical target to be covered is selected. This can
be for example the target most sparsely covered in terms of number of sensors as well as
with regards to the residual energy of those sensors.
Once the critical target has been selected, the heuristic selects the sensor with the greatest
contribution or the sensor with the maximum utility and that covers the critical target.
MATERIALS AND METHODS 132
There may be various sensor contribution functions that can be considered. For example a
sensor has greatest contribution if it covers a larger number of uncover targets and if it
has more residual energy available. After the sensor has been selected, it is added to the
current set cover. Uncover_level of all additionally covered targets are also reduced by
one. A target is either covered by the sensors already selected in the set cover, or it
becomes a critical target, at which point the sensor with the greatest contribution, that
covers the critical target, is selected again. Output of this phase is set Ck, which will be
used in Connectivity phase.
(2) Connectivity Phase
Input to the Connectivity phase is Ck and G and P. Ck is the set cover returned in
Coverage phase. G is the network Connectivity graph. P is the order of Connectivity. The
goal in this phase is to compute the new and updated connected set Ck.
BFS algorithm is used here till constraint of P-Connectivity is satisfied, to find out the
shortest path for each sensor node Si in Ck to the BS in G. Add all these selected relay
sensors in this path to the set Ck, forming a new and updated connected set Ck.
If the set Ck is already a P-Connected set, then the set new and updated set Ck is equal to
the old set Ck in step 1. Otherwise, the selected relay sensors are added to the set Ck to
form a new and updated connected set Ck. So output of this phase is Ck and it is used in
Redundancy Reduction phase
(3) Redundancy Reduction Phase
The input in redundancy phase is a connected set cover Ck (Computed in the Connectivity
phase above), which ensures connected Coverage in the network. The goal of
Redundancy Reduction Phase is to remove the maximum number of redundant (Extra)
sensors from the connected set cover Ck so that minimal number of sensors remains in the
connected set cover. A sensor SCk with a higher order of Connectivity in Ck, is less
likely to be redundant. Even if a sensor with higher order of Connectivity is redundant
then a preferring sensors with a lower degree than this is to be selected for removal. This
MATERIALS AND METHODS 133
may possibly lead to more number of sensors being removed from the set Ck. Remove the
sensor with minimum utility and then check if it is still a connected set cover.
For this initially all sensors SCk are unmarked. Choose the unmarked sensor SCk with
the lowest degree in Ck or minimum utility. Then it is checked if the set Ck - {Si} is still a
connected set i.e. it ensures connected Coverage in the Wireless Sensor Network. If it is
true, then modify the set Ck as Ck = Ck - {Si}, Else mark the sensor Si. This process is
repeated till all SCk are marked. Thus output of this phase is updated set Ck , which will
be used in Life Time Assignment and Energy Updation Phase.
(4) Life Time Assignment and Energy Updation Phase
Input to this phase is Ck. A small constant of lifetime is assigned to the set cover Ck,
which has been generated in Redundancy Reduction Phase. This is a non disjoint
algorithm which means a sensor may participate in more than one set cover. So one
sensor may participate in more than one cover set as a sensor doesn’t consume all of its
energy in a single cover set. The lifetime of a set cover is decided as minimum between
small lifetime granularity constant (l) and maximum lifetime available from sensors in a
set cover Ck, which is obtained by Min(l, Max_lifetime (Ck) ).E is the residual energy of
each sensor .Each connected set cover corresponds to a round that will be active for l k
time. Each active sensor consumes el energy for sensing and e2 energy for communication
per unit of time. There for during a round, consumed energy by an active sensor for
sensing is equal to El =lk el , and for communication is E2 = lk e2.
Thus an active sensing sensor consumes El + E2 energy, while a relay sensor consumes
only E2 energy per round (Since a sensing node sense data and communicates with
neighbors in the same time, but a relay node is only responsible for communication). In
this heuristic, If, after the update, the residual energy of a sensor Bi is less than E2 means
Bi < E2, then that sensor removed from the set S. This is because of the sensor cannot
participates as a sensing or relay node in another set-cover.
MATERIALS AND METHODS 134
3.10.4 Assumptions in QC-PC-MCSC
The following application scenario is considered in this thesis. In an area, a number of
targets with fixed locations are given. They are required to be continuously monitored
(Covered) by a large number of randomly deployed sensors. Each sensor is assumed to
cover a fixed area and any target located in that sensing area could be monitored by the
sensor. The data are sensed by the sensors and then collected, transmitted and processed
by a sink node. If a sensor is in active state, it generates data messages at a certain rate.
Sensed data by sensors are transmitted to the sink through radio communication. Single
hop or multiple-hop communication can be used from a source to the sink. A sensor node
which is used only to relay the data is called a relay node. A sensor is an active node if it
is working either as a source or as a relay or both. A sensor that is not in active state goes
into an energy saving sleep state. In this thesis, scheduling sensor activity means to
determine the state of the deployed sensors to be either active (As source or relay or both)
or sleep as well as their state durations.
The monitored area of 1000*1000m is assumed inside the sensing area .It is assumed
that sensors have the same energy equal to 1unit and sensing range equals 70m. The
network consists of a sink and randomly deployed nodes. The sink has more power and
more processing capability than the other nodes. Since the sink aggregates data in order
to send to a distant station, the events gathered by nodes will be sent to the sink which is
at the one corner of the deployment area. All the sensors send the data to the sink via
single or multi-hop communication. The multihop communication also results in a
reduction in energy dissipation. For simplicity in analysis, it is assumed that sensing and
communication radius is the same and has identical value for each node. Therefore, two
nodes are connected if and only if the distance between them is equal or smaller than the
sensing radius Rs and communication range Rc. Each sensor node considers the
connected sensor nodes as its neighbour nodes.
3.11 Problem Formulation Using Linear Programming
An efficient Q-Coverage problem can be expressed into Linear Programming problem as
given below.
MATERIALS AND METHODS 135
To maximize ∑k lk
Subject to
∑k Mik * lk < = E
And
lk > = 0, for all Q-covers Ck
For all sensors Si
The above Linear Programming problem equations means that in order to maximize
network lifetime there is a need to maximize the summation of lifetime constant lk of all
set covers (Ck) of C, which is the time for which that particular set cover is used. k is the
total number of set covers available. Bi is the remaining battery lifetime of the available
sensors. The maximum constant lifetime for which a particular set cover is used is the
smallest available lifetime of its sensors.
So the problem is to maximize the summation of lifetime constant of each set cover
generated.
The matrix M defined as
Mij
= {1 if sensor Si is in Q-Cover Cj}.
= {O otherwise}.
For example
TABLE: 3.5:- Sensor Cover Matrix
C
S
C1
C2
C3
C4
S1
0
1
1
1
S2
1
0
1
0
S3
1
1
0
1
S4
0
0
1
1
S5
0
1
1
1
MATERIALS AND METHODS 136
S6
1
0
0
1
S7
1
1
0
0
So if a particular sensor is included in a set cover, then the constraint ∑k Mik * lk <= E is
checked and it must be satisfied .It means the time for which a sensor is used a set cover
should not be greater than the available battery lifetime Bi .Each set cover is to be
activated for time greater than zero.
The matrix M is explicitly known if the set of all Q-covers is known in advance. This is
not possible. So the other approach is to generate covers (columns of M) as and when
necessary (The typical column generation method of linear programming).
3.12 NP-Complete Problem
A decision problem is NP-complete when it is both in NP and NP-hard.NP-complete
problems called NP-C or NPC (NP standing for nondeterministic polynomial time).These
are the type of problems having two properties.
(1). The solution to the given problem can be verified rapidly (In polynomial time). The
set of problems with this property is called Nondeterministic Polynomial Time (NP)
problem.
(2). If any NP-Complete problem can be solved quickly (In polynomial time), then every
problem in NP can be solved.
The solution of such a problem can be verified quickly. But there is no known efficient
procedure to find out the solution in the first place. So there are no known fast solutions
exist for such problems. Indeed, the most notable characteristic of NP-complete problems
is that, there is no fast solution to them is known. The time required to solve the problem
using any currently known algorithm increases very rapidly as the size of the problem
grows. That’s why, the time required to solve even the moderately large versions of many
of these problems easily reaches into the billions or trillions of years, using any amount
MATERIALS AND METHODS 137
of computing power available today. As a result, determining whether or not it is possible
to solve these problems quickly is one of the principal unsolved problems of today.
NP may be equivalently defined as the set of decision problems that can be solved in
polynomial time on a non-deterministic Turing machine. A method for computing the
solutions to NP-Complete problems using a reasonable amount of time is not discovered
till now.
But computer scientists and programmers still frequently encounter NP-
complete problems. NP-C problems are often solved by using heuristic. NP-complete
problems are in NP; the set of all decision problems whose solutions can be verified in
polynomial time. A problem p in NP is NP-complete if every other problem in NP can be
transformed into p in polynomial time.
NP-complete problems are studied because the ability to quickly verify solutions to a NP
problem seems to correlate with the ability to quickly solve that problem (P). The
definition of a NP-Complete problem states that every problem in NP must be quickly
reducible to every NP-Complete problem (Means, it can be reduced in polynomial time).
Because of this, it is assumed that NP-complete problems are harder or more
difficult than NP problems in general.
3.13 Optimality Proof for NP-Complete Problem
The problem of selecting minimum number of sensors so that each target is covered by at
least one sensor is NP-Complete problem [127] and it is actually an instance of QCoverage problem. Thus it can be concluded that maximizing the network lifetime
satisfying Q-Coverage and P-Connectivity requirement is also a NP-complete problem.
The optimal solution of Q-Coverage problem is bounded above by u.
Where u = Minj [ ( ∑i Aij * Bi)/qj]
For each target ∑i (Aij * Bi)/qj is calculated and then minimum is find out. Means the
solution of Q-Coverage problem is bounded by the target having minimum values of
sensors covering it while satisfying Q-Coverage requirement. This is the upper bound for
the optimal solution.
MATERIALS AND METHODS 138
3.14 Summary
In this chapter an overview of the simulation tool being used is done. This chapter
includes about MATLAB and PROWLER. Study about history of MATLAB, toolboxes
in MATLAB, MATLAB components and optimization toolboxes are done. Then two
new heuristics are proposed and described, for increasing network lifetime of WSN. First
heuristic called QC-MCSC, considering Q-Coverage and Connectivity is proposed to
increase the lifetime of WSN. It is then compared with existing heuristic called TPICSC.
Again a new and improved heuristic called QC-PC-MCSC, considering Q-Coverage and
P-Connectivity is proposed for increasing network lifetime of WSN. It is then compared
with existing heuristic called HESL.
© Copyright 2026 Paperzz