Presentation is loading. Please wait.

Presentation is loading. Please wait.

A* Path Finding Ref: A-star tutorial.

Similar presentations


Presentation on theme: "A* Path Finding Ref: A-star tutorial."— Presentation transcript:

1 A* Path Finding Ref: A-star tutorial

2 The Problem start target wall Find a path of lowest cost Given

3 Terminology Node Traversal cost: F = G + H Open list & closed list
Parent node; current node Traversal cost: F = G + H G: movement cost from starting point H: heuristic cost to the target (e.g., Manhattan distance) Open list & closed list Closed: traversal cost already determined Heuristics: (wiki) experience-based techniques for problem solving, learning, and discovery. Manhattan distance

4 A* Algorithm Take the node of lowest cost from open list; switch it to closed list; name it current node For its reachable and non-closed neighbors: If not in open list, add them. Make current node their parent. Evaluate costs G & H. Else (already in open), revise parent using G. update cost. Stop when: target is added to closed list Open list is empty (fail to find target). No path

5 Example Open: (0,1),(0,2),(0,3),(1,1),(1,3),(2,1),(2,2),(2,3) Closed:(1,2) (0,4) (1,2) (5,2) (0,0) (6,0)

6 Open: (0,1),(0,2),(0,3),(1,1),(1,3),(2,1),(2,3) Closed: (1,2),(2,2) (0,4) 10+10<14 (1,2) (5,2) (0,0) (6,0)

7 Open: (0,1),(0,2),(0,3),(1,1),(1,3),(2,3),(1,0),(2,0)
Closed: (1,2),(2,2),(2,1) (0,0) (0,4) (6,0) This neighbor is NOT added due to the “cut-corner” constraint

8

9 Finally,

10 Dijkstra, Best-first, A* Ref: url
Comparison Dijkstra, Best-first, A* Ref: url

11 Dijkstra Algorithm Repeatedly examines the closest not-yet-examined vertex, adding its vertices to the set of vertices to be examined. expands outwards from the starting point until it reaches the goal. guaranteed to find a shortest path from the starting point to the goal

12 Best-First Search Instead of selecting the vertex closest to the starting point, it selects the vertex closest to the goal. (Greedy) Best-First-Search is not guaranteed to find a shortest path.

13 Dijkstra better than Best first

14 A* combines the advantages of both

15 Implementation (google code)


Download ppt "A* Path Finding Ref: A-star tutorial."

Similar presentations


Ads by Google