Sunteți pe pagina 1din 55

Comparative Study for Improving Routing

Protocol in Sensor Networks

Submitted in partial fulfillment of requirements


For the award of Degree of

MASTER OF TECHNOLOGY
In
COMPUTER SCIENCE
Supervised By:

Submitted By:

Dr R. L. UJJWAL
(Assistant Professor)

Name - SIDHARTH DHADRA


Enroll No - 01616404814

University School of Information and Communication Technology

GGS INDRAPRASTHA UNIVERSITY - Delhi - 78


Batch 2014 - 2016

DECLARATION

The work titled Comparative Study for Improving Routing Protocol in Sensor Networks
in this report as part of my thesis (JanuaryMay, 2016) under the guidance of Dr R. L.
Ujjwal has not been submitted anywhere else.
Any work that is not our original has been duly and appropriately referred by us by
mentioning it in the 'References' section.
Any academic misconduct and dishonesty found in regard to above or otherwise shall be
solely and entirely my responsibility. In such a situation, I understand that a strict disciplinary
action can be undertaken by the concerned authorities of the University and I shall abide by
it.

SIDHARTH DHADRA
M T ECH (CSE)

01616404814

ii

ACKNOWLEDGEMENT

This work required a lot of guidance and assistance and I am extremely fortunate to get to have
got this all along my thesis. I would like to express my thanks to our esteemed faculty, Dr R. L.
Ujjwal whose proper guidance and supervision has steered me to complete this work. I am
thankful to him whose help and cooperation is invaluable in progress of my work for its solid
foundation. It was their valuable guidance and kind support due to which I am able to complete
this work. I have benefited tremendously from their efficiency, expertise and professionalism.
I would like to place a word of appreciation on records for all those who have directly or
indirectly helped me with full support and encouragement that lead to the culmination of this
project.

SIDHARTH DHADRA
M TECH (CSE)
01616404814

iii

CERTIFICATE

This is to certify that the work titled Comparative Study for Improving Routing Protocol in
Sensor Networks in this report as part of thesis (January May, 2016) was conducted under my
guidance and is an original work of this student to the best of my knowledge and it has not been
submitted anywhere else.

Dr R. L. UJJWAL
USICT

iv

ABSTRACT

Wireless sensor network is a collection of ad-hoc networks and many mobility sensor nodes.
Wireless sensor network has many sensing nodes which provide facility like, communication,
computation.
Wireless sensor network provide facility of finding shortest path. It will help in finding shortest
path with dynamically assigned nodes and it avoids malicious nodes and intrusion. (Akkaya &
Younis, 2003)
Routing in an ad hoc sensor networks is a problem of concern for a wide range of applications.
This study talks about finding the shortest path between source to destination with the help
different algorithm for improving performance.
We introduce the concept of backtracking and controlled suboptimal aspect to sensor routing,
with the intent of improving the flexibility and efficiency by accounting restricted capabilities of
the sensor nodes and the need for a prompt delivery of data. Koenig (1998; 2006, 2006; 2010;
1999; 2014)

TABLE OF CONTENTS
DECLARATION..ii
CERTIFICATEiii
ACKNOWLEDGEMENTiv
ABSTRACT..v
TABLE OF CONTENTS..vi
LIST OF FIGURES...vii
LIST OF TABLES.viii
1. Chapter 1 INTRODUCTION.10
1.1.Brief outline of thesis..10
1.1.1.About Network Model.10
1.1.2.About Routing Protocols..11
1.1.3.About Sensor Network.12
1.2.Problems and Challenges.13
Problems related to Sensor Network..13
1.3.Problem statement15
1.4.Motivation of thesis..16
1.5.Outline of thesis16
2. Chapter 2 LITERATURE SURVEY...17
2.1.Definition17
2.2.Declaration of variable used in th algorithm.18
2.3.Novel method ....20
3. Chapter 3 Proposed Work..22
3.1.Generate-and-Test...22
3.2.Hill climbing22

3.2.1.Simple Hill Climbing23


3.2.2.Steepest-Ascent Hill Climbing (Gradient Search)....................................................23
3.2.3.Hill climbing: Disadvantages..24
3.2.3.1.Localmaximum...24
3.2.3.2.Plateau....24
3.2.3.3.Ridges.25
3.2.3.4.Hillclimbing:Conclusion....25
3.3.Best First Search....26
3.3.1.Algorithm.....27
3.3.2.Greedy Search...........................................................................................................27
3.3.3.Uniform-cost search...................................................................................................27
3.3.4.Algorithm A*..............................................................................................................28
3.4.Proposed Algorithm of Thesis29
4. Chapter 4 MICROSOFT VISUAL STUDIO.....30
4.1.About Microsoft Visual Studio .NET30
4.2.Features of the Common Language Runtime32
4.3. .NET Framework Class Library33
5. Chapter 5 Experimental Setup and Implementation.....37
6. Chapter 6 RESULT AND ANALYSIS........................46
7. Chapter 7 CONCLUSION.48
8. Chapter 8 FUTURE SCOPE..49
REFERENCE.50

vi

LISTS OF FIGURES
1. Ad hoc routing protocol10
2. Basic Component of Wireless Sensor Network Node12
3. LRTA* algorithm with a lookahead of one.19
4. The novel nLRTS algorithm.21
5. The local maximum..24
6. Plateau24
7. Ridge..25
8. Example of Best First Search26
9. Visual Studio Environment...34
10. Welcome Window...38
11. Node Selection39
12. Freezing of node..40
13. Starting node...41
14. Destination node..42
15. Route Selection...43
16. Routing pathing with distance calculation..44
17. Shortest Path choosen from algorithm...45

Vii

LIST OF TABLES

1. Table1 depicting the line Graph for various using different algorithm in various
network45
2. Table2 depicting the Bar Graph for various using different algorithm in various
network46

Viii

Chapter 1 INTRODUCTION
1.1 Brief outine of thesis
1.1.1

About Network Model

There are currently two main mobile wireless network namely,


I.
Infrastructure Network
II.

Ad hoc Networks
Infrastructure Network These networks are network with fixed and wired gateways and
bridges for these networks are called base station. A mobile unit within these networks
connects to, communicates with, the nearest base station that is within its communication
radius. As the mobile travels out of range of one base station into another handoff occurs.
Ad hoc Network- These mobile networks have no fixed infrastructure, and support
applications for military users, post-disaster rescuers.

Figure 1 as proposed by (Bulitko, Sturtevant, & Kazakevich, 2005; Bulitko et al., 2005; Jain &
Shrivastava, 2011, 2011; Karp & Kung, 2000, 2000, 2000; Koenig, 1998, 1998; Lee et al., 2006,
2006, 2006; Pellier et al., 2010, 2010; Royer & Toh, 1999, 1999, 1999, 1999; Sturtevant &
Bulitko, 2014, 2014)

Networks that push on mobility, number of nodes, or both include:

Ad-hoc networks: These mobile networks have no fixed infrastructure, and support
applications for military users, post-disaster rescuers.
Sensor networks: Comprised of small sensors, these mobile networks can be deployed with very
large numbers of nodes, and have very impoverished per-node resources. Minimization of state
per node in a network of tens of thousands of memory-poor sensors is crucial.
Rooftop networks: Proposed by Shepard, these wireless networks are not mobile, but are
deployed very densely in metropolitan areas (the name refers to an antenna on each buildings
roof, for line-of-sight with neighbors) as an alternative
to wired networking offered by traditional telecommunications providers. Such a network also
provides an alternate infrastructure in the event of failure of the conventional one, as after a
disaster.
A routing system that self-configures (without a trusted authority to configure a routing
hierarchy) for hundreds of thousands of such nodes in a metropolitan area represents a significant
scaling challenge. (Karp & Kung, 2000)
1.1.2

About routing protocol

A. Routing
Routing is the process of selecting the best route for data transmission between sender and
receiver. Many routing protocols were established for routing purpose and are divided into two
categories like topology and position based.
Topology is further divided into three categories Proactive, Reactive and Hybrid. The main aim
of each routing protocol is to find the appropriate path for forwarding of data packets. Some
algorithms like Ad Hoc On demand Distance Vector Routing protocol (AODV), Destination
Sequenced Distance Vector (DSDV), Distance Vector Routing (DVR) protocol were established.
These were generally based on the concept of finding the shortest path on the basis of distance
only. For successful transmission of data we dont consider distance as a main factor for finding
the best path.
B. Distance Vector Routing (DVR)
Distance Vector Routing protocol generally maintains a vector in which the distance of
source node to all other neighbor nodes must be manipulated. The node with shortest
distance must be selected as the next node.
This process further repeats itself for selecting all other nodes in a path. Any router which
uses the DVR protocol must knows
a) Distance to destination node
b) Direction in which traffic should be directed.
Here each node knows how to reach the next node and the cost to reach there. This
protocol generally requires periodically updates of routing tables. Example of DVR- a)
Interior Gateway Routing Protocol (IGRP) b) Routing Information Protocol (RIP)

C. Problems with DVR


a) Updating of routing tables.
b) Generally considers the shortest paths which are based on the neighboring nodes. Hence, all
nodes in a network must not be included.
c) Paths can be found on the basis of distance only. No other parameters like security,
throughput, trust value of nodes must be included.
1.1.3 About Sensor network
.

Figure 2 Basic Component of Wireless Sensor Network Node


Sensor networks are an important part of the ad hoc network research field. Sensor nodes in
general have limited computational power and energy reserves, thus simple, energy efficient
routing algorithms are being used.
As we know that, in sensor networks it is expensive to maintain routing information (i.e., before
it is needed) within an individual sensors memory, as these sensors generally have a limited
storage and computational capabilities. Moreover, these sensor devices generally requires tens or
a few hundreds of kilobytes of R/W memory in which they can accommodate, not only routing
information but also all relevant data related to the specific application.(Lee et al., 2006)

Sensor Networks can be classified on the basis of their mode of functioning and the type of target
application into two major types. They are
a) Proactive Networks
The nodes in this network switch on their sensors and transmitters periodically, sense the data
and transmit the sensed data. They provide a snapshot of the environment and its sensed data at
regular intervals. They are suitable for applications that require periodic data monitoring like
moisture content of a land in agriculture.
b) Reactive Networks
The nodes in this network react immediately to sudden and drastic changes in the value of the
sensed attribute. They are therefore suited for time critical applications like military surveillance
or temperature sensing.
Some Applications of Sensor Network

Habitat and Ecosystem Monitoring

Seismic Monitoring

Civil Structural Health Monitoring

Monitoring Groundwater Contamination

Rapid Emergency Response

Industrial Process Monitoring

Perimeter Security and Surveillance

Automated Building Climate Control

1.2 Problems and Challenges


Problems related to Sensor Networks
Most sensor networks are application specific and have different application
requirements. Thus, all or part of the following main design objectives is considered in
the design of sensor networks.
(i)

Small node size: Since sensor nodes are usually deployed in a harsh or hostile
environment in large numbers, reducing node size can facilitate node deployment. It will
also reduce the power consumption and cost of sensor nodes.

(ii)

Low node cost: Since sensor nodes are usually deployed in a harsh or hostile
environment in large numbers and cannot be reused, reducing cost of sensor nodes is
important and will result into the cost reduction of whole network.

(iii)

Low power consumption: Since sensor nodes are powered by battery and it is often very
difficult or even impossible to charge or recharge their batteries, it is crucial to reduce the
power consumption of sensor nodes so that the lifetime of the sensor nodes, as well as the
whole network is prolonged.

(iv)

Reliability: Network protocols designed for sensor networks must provide Error control
and correction mechanisms to ensure reliable data delivery over noisy, error-prone, and
time-varying wireless channels.

(v)

Scalability: Since the number sensor nodes in sensor networks are in the order of tens,
hundreds, or thousands, network protocols designed for sensor networks should be
scalable to different network sizes.

(vi)

Self-configurability: In sensor networks, once deployed, sensor nodes should be able to


autonomously organize themselves into a communication network and reconfigure them
in the event of topology changes and node failures.

(vii)

Channel utilization: Since sensor networks have limited bandwidth resources,


communication protocols designed for sensor networks should efficiently make use of the
bandwidth to improve channel utilization.

(viii)

Fault tolerance: Sensor nodes are prone to failures due to harsh deployment
environments and unattended operations. Thus, sensor nodes should be fault tolerant and
have the abilities of self testing, self-calibrating, self-repairing, and self recovering.

(ix)

Adaptability: In sensor networks, a node may fail, join, or move, which would result in
changes in node density and network topology. Thus, network protocols designed for
sensor networks should be adaptive to such density and topology changes.

(x)

Security: A sensor network should introduce effective security mechanisms to prevent


the data information in the network or a sensor node from unauthorized access or
malicious attacks.(Nikolidakis, Kandris, Vergados, & Douligeris, 2013).

(xi)

Connectivity: High node density in sensor networks precludes them from being
completely isolated from each other. Therefore, sensor nodes are expected to be highly
connected. This, however, may not prevent the network topology from being variable and
the network size from being shrinking due to sensor node failures. In addition,
connectivity depends on the, possibly random, distribution of nodes.

(xii)

Data Aggregation: Since sensor nodes may generate significant redundant data, similar
packets from multiple nodes can be aggregated so that the number of transmissions is
reduced. Data aggregation is the combination of data from different sources according to
a certain aggregation function, e.g., duplicate suppression, minima, maxima and average.
This technique has been used to achieve energy efficiency and data transfer optimization
in a number of routing protocols.

(xiii)

Quality of Service: In some applications, data should be delivered within a certain


period of time from the moment it is sensed, otherwise the data will be useless. Therefore
bounded latency for data delivery is another condition for time-constrained applications.
However, in many applications, conservation of energy, which is directly related to
network lifetime, is considered relatively more important than the quality of data sent. As
the energy gets depleted, the network may be required to reduce the quality of the results
in order to reduce the energy dissipation in the nodes and hence lengthen the total
network lifetime. Hence, energy-aware routing protocols are required to capture this
requirement.
(Al-Karaki & Kamal, 2004)

1.3 Problems statement


Research in this paper is based upon previous work conducted with real-time heuristic
search methods in sensor networks. In (Y.Shang et al. 2003), the authors adapt a classic
real-time heuristic search algorithm (LRTA*, (Korf 1990)) for routing in ad hoc sensor
networks. The resulting algorithm called Constraint-Based Learning Real-Time A*(CBLRTA*), takes routing and destination constraints into account, and the user controls the
main objectives of the network, such as minimizing energy consumption, maintaining
confidentiality, and minimizing hops taken to reach the goal.
For Example, a motion detector sensor could send commands to another sensor to turn on
the lights in a building. We consider the case of a fixed destination for each transmission,
simulating each source node providing information to a central information hub.
With different network topologies in an attempt to learn which algorithms are best for
which situations.
Also, different numbers of messages and message repetitions are used in an attempt to
determine which algorithms are better when more messages are sent, and which are best
when the same message is continually repeated.
(Ahmed & Sajjadur, 2011; Braginsky & Estrin, 2002; Bulitko et al., 2005; Jain &
Shrivastava, 2011; Karp & Kung, 2000; Koenig, 1998; Lee et al., 2006; Pellier et al., 2010;
Robnik-\vSikonja, 1996; Royer & Toh, 1999; Sturtevant & Bulitko, 2014)

1.4 Motivation of the Thesis


In the world, with the demand of Wireless Technology there comes the need adhoc network.
Similar to adhoc network, Wireless Sensor Network provide a bridge between the real physical
and virtual worlds.
Allow the ability to observe the previously unobservable at a fine resolution over large spatiotemporal scales. Have a wide range of potential applications to industry, science, transportation,
civil infrastructure, and security.
Our goal here is to improve the routing protocol using a proposed method known as Novel
Algorithm and applying our Greedy approach using Hill Climbing Algorithm to reach an
Accuracy with minimum time bound using our improvised greedy Novel Algorithm as proposed
in this this study.
1.5 Outline of Thesis
This thesis is divided into 8 chapters, the chapter 1 is the Introduction to the thesis covering Brief
Study, Problem and Challenges, Problem Statement, Motivation and lastly the Outline. The
chapter 2 defines Literature Survey comprises of Problem definition, Declaration of terminology
used in this Survey, Description of Novel method proposed,Proposed Algorithm of Thesis. The
chapter 3 Hill climbing algorithm covering Generate-and-Test, Hill climbing, Simple Hill
Climbing,Steepest-Ascent Hill Climbing (Gradient Search),Hill climbing: Disadvantages,
Hillclimbing:Conclusion and Best First Search.The Chapter 4 Microsoft Visual Studio covering
About Microsoft Visual Studio .NET, Features of the Common Language Runtime, .NET
Framework Class Library. Chapter 5 Experimental Setup and Snapshots includes snapshots of
implemented part. Chapter 6 Result and Analysis shows the comparison between novel method
and proposed method for various network with distance coverage in minimal time. Chapter 7
Conclusion tells about the accuracy achieved by the proposed method.Lastly, Chapter 8 Future
Scope talks about the scope of proposed method using Evoutionary Algorithm using such as
Genetic Algorithm.

Chapter 2 LITERATURE SURVEY


II.1 Definition
Search proceeds in cycles, each consisting of planning, learning, and execution (Figure 3). On
each cycle a particular node is called current and serves as a centre of the local search. Such a
current node s examines its (immediate) neighboring nodes and for each neighbor
) = g(s,

)+h(s,

),

where g is the distance from state s to


distance from

computes f(

(known precisely), and h is a heuristic estimate of the

to the closest goal state. The node then plans to move the neighbor

with

the smallest f value. Planning can be divided into off-line and on-line planning.
In off-line planning, the planners build solution plans, and then execute the all the actions of the
plan. They use very good heuristic functions that drive the search efficiently toward the goal.
However, although they find solution plans very quickly on sufficiently easy problems, these
may fall if they have not enough time to find a solution plan.
Conversely, in on-line planning, the agent repeatedly executes a task, called an episode or a trial.
At each step, the agent is situated in a current state, and performs a search within the space
around the current state in order to select his best action. Then the agent executes the action, and
reaches a new state.
When the agent reaches the goal state, another trial or episode is launched, and so on. When the
planners make their decision in constant time, this corresponds to Real-Time Search (RTS).
Since the pioneering Korfs work on puzzles, RTS has been strongly linked to the development
of video games in which the agents need good path-finding algorithms running in real time.
(Ahmed & Sajjadur, 2011; Braginsky & Estrin, 2002; Bulitko et al., 2005, 2005; Jain &
Shrivastava, 2011; Karp & Kung, 2000; Koenig, 1998, 1998; Lee et al., 2006, 2006, 2006; Pellier
et al., 2010, 2010, 2010; Robnik-\vSikonja, 1996; Royer & Toh, 1999; Sturtevant & Bulitko,
2014, 2014)
The node

s current h is smaller than f(

), the node updates its to f(

), since the distance

to the goal must be at least as large as the distance of going through the neighbor with the
minimum f value. This step is called learning. Finally, the planned neighbor
next current state (this is called execution).

becomes the

One small difference in classic DVR is that the initial cost to any destination is set to infinity,
whereas in classic LRTA* these values are set to zero. In our work, we set the initial distance to
any destination to be the minimum distance to the nearest neighbor.
II.2 Declaration of the variable used in the algorithm
Current_node = current node in the wireless sensor network
Neighbour_node = neighbor node in the wireless sensor network
Initial_node = initial node in the wireless sensor network
Goal_node = goal node in the wireless sensor network
Final_node =final node in the wireless sensor network
g= distance from the state Current_node to Neighbour_node
h= heuristics estimate Neighbour_node to the closest goal state
= initial heuristics estimate
= nodes previously estimated shortest distance to the goal
= distance from the current state to the state on the frontier is weighted by

=distance through most promising neighbour

=distance from current node to most promising neighbour

=heuristics estimated distance from most promising neighbour


Data_message=data message
u=cumulative learning amount
f(

) = g(s,

)+h(s,

(0,1]

(Bulitko et al., 2005; Lee et al., 2006; Pellier et al., 2010; Sturtevant & Bulitko, 2014)

LRTA*
1 initialize the heuristic: h
2 reset the current state: Current_node Initial_node
3 while Current_node Goal_node do
4 generate children one move away from state s
5 find the state Neighbour_node with the lowest f(Neighbour_node) = g + h
6 update h(Current_node) to f(Neighbour_node) if f(Neighbour_node) is greater
7 execute the action to get to Neighbour_node
8 end while
Figure 3: LRTA* algorithm with a lookahead of one. As proposed by Bulitko et al. (2005; 2006;
2014)
A more recent algorithm, called Learning Real-Time Search (LRTS), extended the LRTA* in
Figure 4 with three enhancements: deeper lookahead, optimality weighting and
backtracking control (Bulitko & Lee 2006).
First, the distance from the
current state to the state on the frontier (i.e., the furthest
visible state) is weighted by (0, 1].
(Bulitko et al., 2005; Lee et al., 2006; Sturtevant & Bulitko, 2014)

2.3 Novel method


DVR with two extensions adopted from LRTS is presented in Figure 4 and henceforth referred to
as nLRTS (network Learning Real-Time Search). A sensor node Current_Node running nLRTS
operates as follows.
When we sent a data message m through another sensor node till it reaches Final_node (i.e final
Node), the node Current_node first checks whether is it the destination (d) node for this message
(line 1, Figure 3). If Current_node is not the destination node then, it finds the most promising
neighbor (line 4). If the nodes previously estimated shortest distance to the goal (
the distance through its most promising neighbor(
update

to

) is less than

), lines 5 and 6 then it will do the operation

, assuming the heuristic is admissible (non overestimating).

Node s then broadcasts its updated

to all its neighbors so they can updates their own heuristic

estimates for destination (d) node (line 7).


This constitutes the sending of a control message. Node Current_node then checks if the
cumulative learning amount u will exceed the learning threshold Learning_threshold (i.e the
maximum amount of learning allowed before backtracking occurs) if the learning amount at this
juncture is added to it. If so, the learning threshold will have been exceeded, and Current_Node
bounces the message back to the sender Final_node in line 10.
Otherwise it updates u and sends the message Data_message to the most promising neighbor
(i.e.,Final_node) in lines 12, 13. Whenever a message is transmitted in lines 10 and 13, the
cumulative learning amount u is sent along.

For all nodes n, the estimated distance

to all other nodes

this is the distance from n to its closest neighbor

is initialized to one hop, since

. This ensures the

admissible.
(Bulitko et al., 2005; Lee et al., 2006; Sturtevant & Bulitko, 2014)

nLRTS(, Learning_threshold, u,Data_message,

1 if Current_node =Neighbour_node then


2 stop
3 else
4 find the neighbor Neighbour_node with the lowest
5 if

<

6 update

then

7 send updated

to all neighbors

8 end if
9 if Data_message + |

| Learning_threshold then

10 return Data_message and u to Final_node


11 else
12 increase amount of learning u by |

13 send Data_message and u to Neighbour_node


14 end if

heuristic values are

Figure 4: The novel nLRTS algorithm proposed(Lee et al., 2006) .


(Braginsky & Estrin, 2002; Bulitko et al., 2005; Jain & Shrivastava, 2011; Karp & Kung,
2000; Koenig, 1998; Lee et al., 2006; Pellier et al., 2010; Royer & Toh, 1999; Sturtevant
& Bulitko, 2014)

Chapter 3 Proposed Work


3.1 Generate-and-TestAlgorithm
Generate-and-Test Algorithm
1. Generate a possible solution.
2. Test to see if this is actually a solution.
3. Quit if a solution has been found. Otherwise, return to step 1.
Acceptable for simple problems.
Inefficient for problems with large space.

Generate-and-Test is of three type


Exhaustive generate-and-test.
Heuristic generate-and-test: not consider paths that seem unlikely to lead to a solution.
Plan generate-test:
- Create a list of candidates.

- Apply generate-and-test to that list.


Example: coloured blocks
Arrange four 6-sided cubes in a row, with each side of each cube painted one of four colours,
such that on all four sides of the row one block face of each colour is showing.
Example: coloured blocks
Heuristic: if there are more red faces than other colours then, when placing a block with several
red faces, use few of them as possible as outside faces.

3.2 Hill Climbing


Hill climbing involves following Steps

Searching for a goal state = Climbing to the top of a hill


Generate-and-test + direction to move.
Heuristic function to estimate how close a given state is to a goal state.

Hill Climbing Algorithm has two subtypes namely


1. Simple Hill Climbing
2. Steepest-Ascent Hill Climbing (Gradient Search)

3.2.1 Simple Hill Climbing


Algorithm
1. Evaluate the initial state.
2. Loop until a solution is found or there are no new operators left to be applied:
- Select and apply a new operator
- Evaluate the new state:
goal quit
better than current state new current state

Evaluation function as a way to inject task-specific knowledge into the control process.
Example: coloured blocks
Heuristic function: the sum of the number of different
colours on each of the four sides (solution = 16).

3.2.2 Steepest-Ascent Hill Climbing (Gradient Search)


Considers all the moves from the current state.
Selects the best one as the next state
Algorithm
1. Evaluate the initial state.
2. Loop until a solution is found or a complete iteration produces no change to current state:
- SUCC = a state such that any possible successor of the
current state will be better than SUCC (the worst state).
- For each operator that applies to the current state, evaluate
the new state:
goal quit
better than SUCC set SUCC to this state
- SUCC is better than the current state set the current
state to SUCC.

3.2.3

Hill Climbing: Disadvantages

3.2.3.1 Local maximum


A state that is better than all of its neighbours, but not better than some other states far
away

Figure 5 showing the local maximum

3.2.3.2 Plateau
A flat area of the search space in which all neighbouring states have the same value.

Figure 6 showing the plateau

3.2.3.3 Ridge
The orientation of the high region, compared to the set of available moves, makes it
impossible to climb up. However, two moves executed serially may increase the height.

Figure 7 showing the ridge


Ways Out

Backtrack to some earlier node and try going in a different direction.

Make a big jump to try to get in a new section.

Moving in several directions at once.

Hill climbing is a local method:

Decides what to do next by looking only at the immediate consequences of its


choices.

Global information might be encoded in heuristic functions.

3.2.4 Hill Climbing: Conclusion

Can be very inefficient in a large, rough problem space.

Global heuristic may have to pay for computational complexity.

Often useful when combined with other methods, getting it started right in the right
general neighbourhood.

3.3 Best-First Search

Depth-first search: not all competing branches having to be expanded.

Breadth-first search: not getting trapped on dead-end paths.

Combining the two is to follow a single path at a time, but switch paths whenever some
competing path look more promising than the current one

Figure 8 showing an example of Best-First Search


There are two types of Nodes used in Best-First Search

OPEN: nodes that have been generated, but have not examined.
This is organized as a priority queue.

CLOSED: nodes that have already been examined.


Whenever a new node is generated, check whether it has been generated before.

3.3.1 Algorithm
OPEN = {initial state}.

Loop until a goal is found or there are no nodes left in OPEN:


- Pick the best node in OPEN
- Generate its successors
- For each successor:
new evaluate it, add it to OPEN, record its parent
generated before change parent, update successors
Best First Search is of two types namely

Greedy search:
o h(n) = estimated cost of the cheapest path from node n to a goal state.

Uniform-cost search:
o g(n) = cost of the cheapest path from the initial state to node n.

3.3.2 Greedy search:


h(n) = estimated cost of the cheapest path from node n to a goal state.
Neither optimal nor complete
3.3.3 Uniform-cost search:
g(n) = cost of the cheapest path from the initial state to node n.
Optimal and complete, but very inefficient

3.3.4 Algorithm A* (Hart et al., 1968):


f(n) = g(n) + h(n)

h(n) = cost of the cheapest path from node n to a goal state.


g(n) = cost of the cheapest path from the initial state to node n.

Algorithm A*:
f*(n) = g*(n) + h*(n)
h*(n) (heuristic factor) = estimate of h(n).
g*(n) (depth factor) = approximation of g(n) found by A* so far.

3.4 Proposed Algorithm of thesis


The Proposed algorithm is an Amalgem of the of the classic Novel Algorithm also known
as network Learning Real Time Search (nLRTS) and Greedy search approach as
mentioned in the Hill Climbing Algorithm.

This approach along with the added functionality which are defined in the Proposed
algorithm and applied in the Implementation part. The main focus here is on finding the
legitimate result with repetitive distance learning by looking at the neighbor node from
the current node with a goal of reaching to the final node by covering minimal distance
without exceeding the Learning Threshold
This algorithm is reflection of the work being done during this study and adaptive
learning done on the basis of literature survey and other sources which is as follws:Greedy_nLRTS(Learning_threshold, u,Data_message,
1. finding direct distance

2. if Current_node =Neighbour_node then stop


3. else
4. find the neighbor Neighbour_node with the lowest
5. if

<

6. update

then

7. send updated

to all neighbors

8. end if
9 if u + |

| Learning_threshold then

10. if
11. direct path choosen

then
and return Data_message and u to Final_node

12. elseif routed path choosen

and return Data_message and u to Final_node

13. else
14. increase amount of learning u by |

15 send Data_message and u to Neighbour_node


16 end if

Chapter 4 MICROSOFT VISUAL STUDIO

4.1 About Microsoft Visual Studio .NET


Visual Studio is a complete suite of tools for building both desktop and team-based Enterprise
Web applications. In addition to building high-performing desktop applications, you can use
Visual Studio's powerful component-based development tools and other technologies to simplify
team-based design, development, and deployment of Enterprise solutions.
Visual Studio .NET is a complete set of development tools for building ASP Web applications,
XML Web services, desktop applications, and mobile applications. Visual Basic .NET, Visual C+
+ .NET, and Visual C# .NET all use the same integrated development environment (IDE), which
allows them to share tools and facilitates in the creation of mixed-language solutions. In
addition, these languages leverage the functionality of the .NET Framework, which provides
access to key technologies that simplify the development of ASP Web applications and XML
Web services.
Language Enhancements
Microsoft Visual Basic, Microsoft C++, and Microsoft JScript have all been updated to meet
your development needs. Additionally, a new language, Microsoft C#, has been introduced.
These languages leverage the functionality of the .NET Framework, which provides access to
key technologies that simplify the development of ASP Web applications and XML Web
services.
The .NET Framework
The .NET Framework is a new computing platform that simplifies application development in
the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the
following objectives:
To provide a consistent object-oriented programming environment whether object code is stored
and executed locally, executed locally but Internet-distributed, or executed remotely.
To provide a code-execution environment that minimizes software deployment and versioning
conflicts.
To provide a code-execution environment that guarantees safe execution of code, including code
created by an unknown or semi-trusted third party.

To provide a code-execution environment that eliminates the performance problems of scripted


or interpreted environments.
To make the developer experience consistent across widely varying types of applications, such as
Windows-based applications and Web-based applications.
To build all communication on industry standards to ensure that code based on the .NET
Framework can integrate with any other code.
The .NET Framework has two main components: the common language runtime and the .NET
Framework class library. The common language runtime is the foundation of the .NET
Framework. You can think of the runtime as an agent that manages code at execution time,
providing core services such as memory management, thread management, and remoting, while
also enforcing strict type safety and other forms of code accuracy that ensure security and
robustness. In fact, the concept of code management is a fundamental principle of the runtime.
Code that targets the runtime is known as managed code, while code that does not target the
runtime is known as unmanaged code. The class library, the other main component of the .NET
Framework, is a comprehensive, object-oriented collection of reusable types that you can use to
develop applications ranging from traditional command-line or graphical user interface (GUI)
applications to applications based on the latest innovations provided by ASP.NET, such as Web
Forms and XML Web services.
The .NET Framework can be hosted by unmanaged components that load the common language
runtime into their processes and initiate the execution of managed code, thereby creating a
software environment that can exploit both managed and unmanaged features. The .NET
Framework not only provides several runtime hosts, but also supports the development of thirdparty runtime hosts.

4.2 Features of the Common Language Runtime


The common language runtime manages memory, thread execution, code execution, code safety
verification, compilation, and other system services. These features are intrinsic to the managed
code that runs on the common language runtime.
With regards to security, managed components are awarded varying degrees of trust, depending
on a number of factors that include their origin (such as the Internet, enterprise network, or local
computer). This means that a managed component might or might not be able to perform fileaccess operations, registry-access operations, or other sensitive functions, even if it is being used
in the same active application.
The runtime also enforces code robustness by implementing a strict type- and code-verification
infrastructure called the common type system (CTS). The CTS ensures that all managed code is
self-describing. The various Microsoft and third-party language compilers generate managed
code that conforms to the CTS. This means that managed code can consume other managed
types and instances, while strictly enforcing type fidelity and type safety.
The runtime also accelerates developer productivity. For example, programmers can write
applications in their development language of choice, yet take full advantage of the runtime, the
class library, and components written in other languages by other developers. Any compiler
vendor who chooses to target the runtime can do so. Language compilers that target the .NET
Framework make the features of the .NET Framework available to existing code written in that
language, greatly easing the migration process for existing applications.

4.3 .NET Framework Class Library


The .NET Framework class library is a collection of reusable types that tightly integrate with the
common language runtime. The class library is object oriented, providing types from which your
own managed code can derive functionality. This not only makes the .NET Framework types
easy to use, but also reduces the time associated with learning new features of the .NET
Framework. In addition, third-party components can integrate seamlessly with classes in the
.NET Framework.
As you would expect from an object-oriented class library, the .NET Framework types enable
you to accomplish a range of common programming tasks, including tasks such as string
management, data collection, database connectivity, and file access. In addition to these common
tasks, the class library includes types that support a variety of specialized development scenarios.
For example, you can use the .NET Framework to develop the following types of applications
and services:
Console applications.
Scripted or hosted applications.
Windows GUI applications (Windows Forms).
ASP.NET applications.
XML Web services.
Windows services.

Figure 9: Visual Studio Environment


C#.NET
C# is a multi-paradigm programming language, encompassing imperative, declarative
functional, generic, object-oriented (class-based), and component-oriented programming
disciplines. It was developed by Microsoft within the .NET initiative and later approved as a
standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the programming
languages designed for the Common Language Infrastructure.
C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
Design Goal
C# language is intended to be a simple, modern, general-purpose, object-oriented programming
language.
The language, and implementations thereof, should provide support for software engineering
principles such as strong type checking, array bounds checking, detection of attempts to use
uninitialized variables, and automatic garbage collection. Software robustness, durability, and
programmer productivity are important.
The language is intended for use in developing software components suitable for deployment in
distributed environments.
Source code portability is very important, as is programmer portability, especially for those
programmers already familiar with C and C++.

C# is intended to be suitable for writing applications for both hosted and embedded systems,
ranging from the very large that use sophisticated operating systems, down to the very small
having dedicated functions.
Although C# applications are intended to be economical with regard to memory and processing
power requirements, the language was not intended to compete directly on performance and size
with C or assembly language.
Features
C# is the programming language that most directly reflects the underlying Common Language
Infrastructure (CLI). Most of its intrinsic types correspond to value-types implemented by the
CLI framework. However, the language specification does not state the code generation
requirements of the compiler: that is, it does not state that a C# compiler must target a Common
Language Runtime, or generate Common Intermediate Language (CIL), or generate any other
specific format. Theoretically, a C# compiler could generate machine code like traditional
compilers of C++ or Fortran.
Some notable distinguishing features of C# are:
There are no global variables or functions. All methods and members must be declared within
classes. Static members of public classes can substitute for global variables and functions.
Local variables cannot shadow variables of the enclosing block, unlike C and C++. Variable
shadowing is often considered confusing by C++ texts.
C# supports a strict Boolean datatype, bool. Statements that take conditions, such as while and if,
require an expression of a type that implements the true operator, such as the boolean type. While
C++ also has a boolean type, it can be freely converted to and from integers, and expressions
such as if(a) require only that a is convertible to bool, allowing a to be an int, or a pointer. C#
disallows this "integer meaning true or false" approach on the grounds that forcing programmers
to use expressions that return exactly bool can prevent certain types of common programming
mistakes in C or C++ such as if (a = b) (use of assignment = instead of equality ==).
In C#, memory address pointers can only be used within blocks specifically marked as unsafe,
and programs with unsafe code need appropriate permissions to run. Most object access is done
through safe object references, which always either point to a "live" object or have the welldefined null value; it is impossible to obtain a reference to a "dead" object (one which has been
garbage collected), or to a random block of memory. An unsafe pointer can point to an instance
of a value-type, array, string, or a block of memory allocated on a stack. Code that is not marked
as unsafe can still store and manipulate pointers through the System.IntPtr type, but it cannot
dereference them.

Managed memory cannot be explicitly freed; instead, it is automatically garbage collected.


Garbage collection addresses the problem of memory leaks by freeing the programmer of
responsibility for releasing memory which is no longer needed.
In addition to the try...catch construct to handle exceptions, C# has a try...finally construct to
guarantee execution of the code in the finally block.
Multiple inheritance is not supported, although a class can implement any number of interfaces.
This was a design decision by the language's lead architect to avoid complication and simplify
architectural requirements throughout CLI.
C# is more type safe than C++. The only implicit conversions by default are those which are
considered safe, such as widening of integers. This is enforced at compile-time, during JIT, and,
in some cases, at runtime. There are no implicit conversions between booleans and integers, nor
between enumeration members and integers (except for literal 0, which can be implicitly
converted to any enumerated type). Any user-defined conversion must be explicitly marked as
explicit or implicit, unlike C++ copy constructors and conversion operators, which are both
implicit by default.
Enumeration members are placed in their own scope.
C# provides properties as syntactic sugar for a common pattern in which a pair of methods,
accessor (getter) and mutator (setter) encapsulate operations on a single attribute of a class.
Full type reflection and discovery is available.
C# currently (as of version 4.0) has 77 reserved words.
Checked exceptions are not present in C# (in contrast to Java). This has been a conscious
decision based on the issues of scalability and version.

Chapter 5 Experimental Setup and Implementation

This chapter covers the implementation part of the algorithm which is done
on Microsoft Visual Studio 2010. There are snapshot shown in this chapter
covers the implementation procedure.
Starting from the welcome window which is like the introduction to the
application. Here welcome window consist of Node panel, Freeze button and
Exit button.
Second snapshot shows Node selection in the Node panel. This panel allows
us to select as many node as possible for creating a network.
Third snapshot shows Freezing of the Node in the node panel. By freezing
node its persist further addition of node for the network and as soon we click
on freeze button , two list of path selection arises naming starting node and
destination node and a calculate button.
Fourth snapshot shows the Starting node which consist of collection of all the
nodes.
Fifth snapshot shows the Destination node which consist of collection of all
the nodes.
Sixth snapshot shows route selection which covers the initial and final node
of the network.
Seventh snapshot show Routing Path with Distance Calculation in the
algorithm
Eight snapshot show Shortest Path choosen from algorithm through adaptive
Learning Greedy_nLrts approach.

5.1WelcomeWindow

5.2NodeSelection

5.3

Freezing the node in the network

5.4

Starting Node

5.5

Destination Node

5.6

Route Selection

5.7 Routing Path with Distance Calculation

5.8 Shortest Path Choosen from algorithm

Chapter 6 RESULT AND ANALYSIS


There is a line graph which depicts the study of three approach direct
distance coverage method, nLRTS and Greedy_nLRTS on various network
such as Linear network, Star network, Ring Network and Hybrid Network.
Direct distance shows the 100% accuracy as it always gives the shortest
result in calculating the distance but suffers from various disturbance.
nLRTS used the Real time heuristic approach in the networking which
provides much unsatisfactory results in comparison to the direct approach.
Lastly, Greedy_nLRTS i.e our approach this gives us most promising result in
comparison to nLRTS and it gives best result in linear network.

Table1 depicting the line Graph for various using different algorithm in various
network

There is a bar graph which depicts the study of three approach direct
distance coverage method, nLRTS and Greedy_nLRTS on various network
such as Linear network, Star network, Ring Network and Hybrid Network.
Direct distance shows the ideal approach as it always gives the shortest
result in calculating the distance but suffers from various disturbance but
achieving ideal condition is difficult.
nLRTS used the Real time heuristic approach in the networking which
provides much unsatisfactory results in comparison to the direct approach.
Lastly, Greedy_nLRTS i.e our approach this gives us most promising result in
comparison to nLRTS and it gives best result in linear network and better
result in for hybrid network in comparison to hybrid.

Table2 depicting the Bar Graph for various using different algorithm in various
network.

Chapter 7 CONCLUSION
We have put forward to provide a Comparative Study, through implementation of Improving
Routing Protocol in Sensor Networks by a heuristic search algorithm known as Novel Algorithm
and comparing the result with other algorithm with a similar network simulation environment.
The heuristic Search algorithm are part of the artificial intelligence and is based on a general
problem-solving rule or set of rules that do not guarantee the best solution or even any solution,
but serves as a useful guide for problem-solving. Novel algorithm used the same approach to
achieve this goal.
Similar to Novel Algorithm, Hill climbing Algorithm performs Searching for a goal state then
performs Generate-and-test procedure along with direction to move. Finally, Heuristic function is
used to estimate how close a given state is to a goal state.
By using the Greedy approach of hill climbing algorithm, we enhance the accuracy of Novel
algorithm and provide an alternate method to its shortcoming by using Direct routing if time
exceeds the maximum time-stamping then system makes choice of whether to choose a routing
or the direct path.

Chapter 8 FUTURE SCOPE


In this study, we can conclude by extending a well-known routing algorithm, i.e. Distance Vector
Routing and by adding further functionality to this method, such as backtracking and
convergence to suboptimal solutions. This leads to resulting an algorithm known as Novel
algorithm or nLRTS.
The extensions introduced in this study have been previously unified along with learning realtime search algorithm called LRTS. By evaluating nLRTS for synchronous sensor networks with
an unlimited energy reserves demonstrated its advantages.(Bulitko et al., 2005; Lee et al., 2006)
In this study, we follow up with an application of nLRTS to the more realistic cases of
asynchronous networks and nodes with limited battery life. Allowing for more suboptimality and
backtracking gives the nodes using the nLRTS algorithm the ability to find better paths from
source to destination.
Using hill climbing we are able to increases the accuracy of proposed novel Algorithm but we
can further enhance this approach by using an evolutionary algorithm such as Genetic
Algorithm , with fitness value to consider parents in population them applying Selection,
Crossover and Mutuation function can further help us in improving routing in wireless sensor
network with much higher accuracy.

REFERENCES

Akkaya, K. & Younis, M. (2003). An energy-aware QoS routing protocol for wireless
sensor networks. Distributed Computing Systems Workshops, 2003. Proceedings. 23rd
International

Conference

on

(pp.

710715).

Bulitko, V., Sturtevant, N. & Kazakevich, M. (2005). Speeding up learning in real-time


search

via

automatic

state

abstraction.

AAAI

(Vol.

214,

pp.

13491354).

Jain, R. & Shrivastava, L. (2011). Study and performance comparison of AODV \& DSR on
the basis of path loss propagation models. International Journal of Advanced Science and
Technology,

32,

4552.

(IJAST).

Al-Karaki, J. N. & Kamal, A. E. (2004). Routing techniques in wireless sensor networks: a


survey.

Wireless

communications,

IEEE,

11(6),

628.

IEEE.

Karp, B. & Kung, H.-T. (2000). GPSR: Greedy perimeter stateless routing for wireless
networks. Proceedings of the 6th annual international conference on Mobile computing and
networking

(pp.

243254).

Koenig, S. (1998). Real-time heuristic search: Research issues. International Conference on


Artificial

Intelligence

Planning

Systems,

Pennsylvania

(June

1998).

Lee, G., Bulitko, V. & Nikolaidis, I. (2006). nLRTS: Improving distance vector routing in
sensor networks. Proceedings of the National Conference on Artificial Intelligence (AAAI),
Workshop

on

Learning

For

Search

(pp.

101107).

Nikolidakis, S. A., Kandris, D., Vergados, D. D. & Douligeris, C. (2013). Energy efficient
routing in wireless sensor networks through balanced clustering. Algorithms, 6(1), 2942.

S-ar putea să vă placă și