23
Using Path-Finding Algorithms of Graph Algorithms of Graph Theory for Route- Theory for Route- Searching in Searching in Geographical Geographical Information Systems Information Systems By By Radhika Kumaran Radhika Kumaran 09MW13 09MW13 I ME Software Engg I ME Software Engg

Using Path-Finding Algorithms of Graph Theory for Route-Searching

Embed Size (px)

Citation preview

Page 1: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Using Path-Finding Algorithms of Using Path-Finding Algorithms of Graph Theory for Route-Graph Theory for Route-Searching in Geographical Searching in Geographical Information SystemsInformation Systems

By By Radhika KumaranRadhika Kumaran

09MW1309MW13I ME Software EnggI ME Software Engg

Page 2: Using Path-Finding Algorithms of Graph Theory for Route-Searching

AbstractAbstract

► This paper deals with graph theory application in large-scale geographical data searching and visualization.

► A comparison of two path-finding algorithms of graph theory, i.e. blind-search and A* algorithm, that results into the selection of the second one for implementation within a geographical information system.

► The main goal is to process the terrain map representation in the form of a graph during route-searching between start and target positions, and during the visualization and animation of the results of this search.

Page 3: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Introduction to GraphsIntroduction to Graphs

► Graphs can be imagined as a set of points (vertices) interconnected by lines (edges).

► The edges can have specified direction (orientation). ► Paths are sequences of vertices and edges between them. ► Path-finding between two graph points is used in many areas,

like GPS navigation, CAD systems (auto-routing in design of circuit boards), and applications of artificial intelligence, computer games, virtual reality, military forces or robotics.

► The main aim is to pass through environment in secure form and to avoid of obstacles.

Page 4: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Introduction to GISIntroduction to GIS► A geographical information system (GIS) is an

information system (IS) designed to work with data that represent geographical or spatial coordinates.

► These data can be further analyzed and statistically evaluated.

► Another way to specify a GIS is that it is a specialized IS defined as a collection of computer hardware and software and geographical data designed for effective gathering, retaining, editing, processing, analysis and visualization of all kinds of geographical information.

► Generally, it is a spatial specialized IS.► Being an IS, GIS has to provide information

Page 5: Using Path-Finding Algorithms of Graph Theory for Route-Searching

DefinitionsDefinitions

Let G = (V, E) be a coherent graph and let Distance d(u, v)between vertices u and v of graph G be the shortest path.Vertices distance d(u, v) of graph G has the followingproperties:• d(u,v) 0;u = v,• d(u,v) = d(v,u),• z V : d(u,v) d(u,z) + d(z,v). And 1. For every vertex u belongs to V the number e(u,G) = maxd(u,v), is called eccentricity of vertex u.2. Number P(G) = max e(v,G), v belongs to V is average ofgraph G.3. Number r(G) = min e(v,G), v belongs to V is radius ofgraph G.

Page 6: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Concepts in Maps, Routes and Concepts in Maps, Routes and AlgorithmsAlgorithms

► The basic working structure of algorithms is the map, which is represented as a set M = N x N (two dimensional quadratic grid).

► Square is a member of set M.► Every square represents position in map and has its

own coordinates [x,y] according to beginning Pm. ► Squares [x1,y1] and [x2,y2] are neighbors, if (|x1–x2|

=1 and |y1–► y2|<=1) or (|x1–x2|<=1 and |y1–y2|=1). ► The beginning in map Pm is a defined square. ► Function to assign regress or wieght to squares

wm: M ->R+ U infinity► The route length is the sum of all regresses of the

squares.

Page 7: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Algorithms for Route Algorithms for Route SearchingSearching

► There are several algorithms for route-searching in static maps:

• blind-search• divide & conquer• breadth–first search• bidirectional breadth–first search• depth-first search• iterative depth-first search• Dijkstra’s algorithm• best-first search• Dijkstra’s algorithm with heuristics (A*)

Page 8: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Blind Search AlgorithmBlind Search Algorithm

► Search based on “Progress till Collision”.”.► The evaluation process is as follows: abs[(ex tx ) + (ey ty )], (8) where ex,y are the [x,y] coordinates of the actuallyevaluated

square and tx,y are coordinates of target squareon the map.► This algorithm works with aim on one square and usually does

not take to consider the whole evaluating function w, but only two states + or 1 and doesnot cosider regress.

► The evaluation process is as follows: abs[(ex -tx ) + (ey - ty )], where e(x,y) are co ordinates of the

evaluated square and t(x,y) co ordinates of the target square.

Page 9: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Advantages of Blind SearchAdvantages of Blind Search

► speed, ►low memory requirements and►simple implementation.

Page 10: Using Path-Finding Algorithms of Graph Theory for Route-Searching

A* AlgorithmA* Algorithm

► The A* algorithm is a natural generalization of Dijkstra’s algorithm and the scanning is based only on heuristics.

► In A* the element classification process is done by a binary heap.

► All square near the evaluated square are also evaluated in eight directions.

► Function g(x) is evaluated from the starting square. If the evaluated square is in the diagonal, then the number 14 is assigned to this square, and if not, then number 10 is assigned to this square,i.e g(x)=14 or 12.

► As heuristics, the Manhattan method is used h(x)=10* [abs(ex - tx ) + abs(ey - ty )] f(x)= g(x) + h(x)

Page 11: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Contd…Contd…

► Two values are stored for every already processed vertex:

1.d[v] will store the length of the shortest path to the vertex,

2. p[v] will be the vertex before v on the path.► The algorithm also uses two sets: OPEN and

CLOSED.

1.OPEN is the set of vertices to process,

2.CLOSED is the set of vertices already processed.

Page 12: Using Path-Finding Algorithms of Graph Theory for Route-Searching

A* Algorithm WorkingA* Algorithm Working► At the beginning, the starting vertex is inserted into OPEN.► The iteration cycle starts with the choose of the vertex n with

best value of f(n). ► This vertex will be inserted into set CLOSED and all from n

reachable vertices v are selected, and if they are not in set OPEN, they will be inserted with p[v]=n and the corresponding value of d[v]=d[n]+l(n,v), where l(n,v)=wg(v) is the cost function for the selected edge from n.

► If v was already a member of OPEN, we need to test if the new path is shorter than the old by comparing d[v]<d[n]+l(n,v).

► If the comparison fails, we need to update the values p[v] and d[v].

► The presented cycle continues until the target is found or the set OPEN is empty.

► After the algorithm had finished, we need to reconstruct the path using values of p[v].

Page 13: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Improving A* Algorithm’s Improving A* Algorithm’s EfficiencyEfficiency

► The A* algorithm can be made more efficient by The A* algorithm can be made more efficient by using techniques like optimizing the number of using techniques like optimizing the number of vertices in the set OPEN and CLOSED.vertices in the set OPEN and CLOSED.

► This can decrease memory usage and fasten the A* This can decrease memory usage and fasten the A* algorithmalgorithm.

► The optimum values for the OPEN and CLOSED set The optimum values for the OPEN and CLOSED set are experimentally found to be 1000 and 3000 are experimentally found to be 1000 and 3000 respectively.respectively.

Page 14: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Case Study-1Case Study-1

► Blind Search Blind Search Algorithm gives this Algorithm gives this routeroute

► A* algorithm gives A* algorithm gives thisthis

Page 15: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Case Study-2Case Study-2

► Blind Search Blind Search Algorithm gets into Algorithm gets into an infinite loop and an infinite loop and never finds the path.never finds the path.

► A* Algorithm A* Algorithm efficiently finds the efficiently finds the path.path.

Page 16: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Case Study-3Case Study-3

► Route found by Route found by Blind Search Blind Search AlgorithmAlgorithm

► Route found by A* Route found by A* AlgorithmAlgorithm

Page 17: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Comparison of Squares Comparison of Squares Searched by both the Searched by both the

Algorithms Algorithms ► The number of The number of

squares searched squares searched by blind search is by blind search is more than that of more than that of A* as evident from A* as evident from the graph.the graph.

Page 18: Using Path-Finding Algorithms of Graph Theory for Route-Searching

3D – Case Study3D – Case Study

► Upper left corner has also two buttons: 1 – openmap, 2 – options. Options are like map resolution etc.

► right corner are navigation buttons (3 – minimize, 4 –close).

► The number 5 indicates the search button.On selecting this last option, a search dialog opens .

Page 19: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Contd..Contd..

► 6 is the field for the search query

► 7 is the results displaying area

► 8 is for search Execution► 9 is for animation button ► 10 is the Path display

button ► 11 is object display

button.► 12 is close dialog button

Page 20: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Contd..Contd..

► Using the A* search Using the A* search algorithm technique algorithm technique on entering a area to on entering a area to be searched the path be searched the path is displayed.is displayed.

► Lower resolution Lower resolution might miss out might miss out narrow paths.narrow paths.

► Buttons 13 and 16 are Buttons 13 and 16 are for classical for classical navigation.navigation.

Page 21: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Results of the Case StudyResults of the Case Study

► From the case study on the algorithms some From the case study on the algorithms some conclusions can be made like:conclusions can be made like:

1. 1. The blind-search algorithm is fast but is not accurate enough and can be used in maps with low number ofbobstacles

2. Despite time results (the speed of this algorithm is not the fastest), this algorithm is reliable on 100% and has provided better results.

3.The optimization techniques of set size restrictions

were useful and brought higher speed into execution of path-finding.

Page 22: Using Path-Finding Algorithms of Graph Theory for Route-Searching

ConclusionConclusion

► As the map is the core of any GIS, a possible way of use of path-finding on graphs within such a system is the mapping of these maps onto searchable graphs

► Collision detection is the main aim of the algorithms, but, as this article implies, the information system area should follow these trends as well by implementing its algorithms into the visualization and searching modules.

► Future GIS would include 3D interfaces as well.

Page 23: Using Path-Finding Algorithms of Graph Theory for Route-Searching

Thank YouThank You