Upload
britanni-tillman
View
8
Download
0
Embed Size (px)
DESCRIPTION
Optimised Search Techniques. Basic Idea. BFS brances out to all surrounding nodes No discrimination based on direction of target node. BFS example. S. E. BFS example. S. E. BFS example. S. E. BFS example. S. E. BFS example. S. Large area needlessly explored. E. Alternatives. - PowerPoint PPT Presentation
Citation preview
Optimised Search Techniques
Basic Idea
BFS brances out to all surrounding nodesNo discrimination based on direction of
target node
BFS example
S
E
BFS example
S
E
BFS example
S
E
BFS example
S
E
BFS example
S
E
Large area needlessly explored
Alternatives
Best-First Search:Branch out to nodes which intuitively seem to be the closest to the destinationUse heuristics to estimate distances to destination nodeGreedy algorithm
However, a better solution exists
A* algorithm
A* is an improvement over Best-First SearchNodes are given weights based on:
Cost to reach the nodeEstimated cost to reach the end node
Manhattan Distance
Manhattan distance - sum of the absolute distances between coordinates
M(x1,y1,x2,y2) = |x1-x2| + |y1-y2|
Reflection of distance between points if travel only parallel to axes
Implementation of A*
Using Manhattan distance as an heuristic to estimate distance to end point
w(x,y) = c(x,y) + M(x,y,xE,yE)
Item in priority queue with lowest weight popped off
Surrounding nodes added with calculated weights
A* example
S
E
A* example
S
E
9
7
A* example
S
E
9
7
7
9
A* example
S
E
9
7
7
9
7
A* example
S
E
9
7
7
9
77
7
A* example
S
E
9
7
7
9
77
77
9
9
9
9
9
11
11
11
11
Comparison: BFS vs A*
S
E
S
E
BFS A*
Special cases of A*
Dijkstra's Algorithm is a case of A* with the weighting based solely on cost:w(x,y) = c(x,y)
Breadth-First Search is just A* with all nodes have a weight of 0:w(x,y) = 0