A * A path finding algorithm. A path finding algorithm. Given a - - PowerPoint PPT Presentation

a
SMART_READER_LITE
LIVE PREVIEW

A * A path finding algorithm. A path finding algorithm. Given a - - PowerPoint PPT Presentation

A * A path finding algorithm. A path finding algorithm. Given a state space, such as a 2-dimensional map, find a path from point A to point B in that space, if such a path exists. If such a path exists, return a path within certain criteria


slide-1
SLIDE 1
slide-2
SLIDE 2

A *

A path finding algorithm.

slide-3
SLIDE 3

A path finding algorithm.

Given a state space, such as a 2-dimensional map, find a path from point A to point B in that space, if such a path exists. If such a path exists, return a path within certain criteria - ie: shortest path, most straight path, avoiding certain areas, etc.

slide-4
SLIDE 4

The A * Algorithm

Developed in 1968 for solving different kind of problems such as the ‘15-puzzle’. Searches for the least costly path from a starting state to a goal state by examining adjacent states of a particular state.

slide-5
SLIDE 5

The A * Algorithm

Developed in 1968 for solving different kind of problems such as the ‘15-puzzle’. Searches for the least costly path from a starting state to a goal state by examining adjacent states of a particular state.

slide-6
SLIDE 6

Starting State Adjacent States Goal State

slide-7
SLIDE 7

Starting State Adjacent States Goal State

slide-8
SLIDE 8

Starting State Adjacent States Goal State

slide-9
SLIDE 9

The algorithm works by repeatedly examining the most promising unexplored adjacent state. A priority queue ‘Open’ contains all adjacent unexamined states, sorted in order of lowest cost. A list ‘Closed’ contains all examined states. Initially, the Closed list is empty, while the Open list contains a single starting state.

slide-10
SLIDE 10

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0)

slide-11
SLIDE 11

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0)

1 1 Adjacent States (1 move from start)

slide-12
SLIDE 12

A Simple Example

A B C 1 2 3

G

Open Closed

B1 (1) A2 (1)

1 1

A1 (0)

slide-13
SLIDE 13

A Simple Example

A B C 1 2 3

G

Open Closed

B1 (1) A2 (1)

1 1

slide-14
SLIDE 14

A Simple Example

A B C 1 2 3

G

Open Closed

B1 (1) A2 (1)

1 1

A1 (0)

slide-15
SLIDE 15

A Simple Example

A B C 1 2 3

G

Open Closed

B1 (1) A1 (0) A2 (1)

1 1

slide-16
SLIDE 16

A Simple Example

A B C 1 2 3

G

Open Closed

B1 (1) A1 (0) A2 (1)

1 1 2 2 Adjacent States (2 moves from start) 2

slide-17
SLIDE 17

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C1 (2) B2 (2) A3 (2)

2 2 1 1

B1 (1) A2 (1)

2

slide-18
SLIDE 18

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C1 (2) B2 (2) A3 (2)

2 2 2

slide-19
SLIDE 19

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C1 (2) B2 (2) A3 (2)

2 2 1 1

B1 (1) A2 (1)

2

slide-20
SLIDE 20

A Simple Example

A B C 1 2 3

G

Open Closed

C1 (2) A1 (0) B2 (2) A3 (2)

2 2 1 1

B1 (1) A2 (1)

2

slide-21
SLIDE 21

A Simple Example

A B C 1 2 3

G

Open Closed

C1 (2) A1 (0) B2 (2) A3 (2)

2 2 1 1

B1 (1) A2 (1)

2 Adjacent States (3 move from start) 3 3

slide-22
SLIDE 22

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C2 (3) B3 (3)

1 1

B1 (1) A2 (1)

3 3 2 2 2

A3 (2) B2 (2) C1 (2)

slide-23
SLIDE 23

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C2 (3) B3 (3)

1 1

B1 (1) A2 (1)

3 3

slide-24
SLIDE 24

A Simple Example

A B C 1 2 3

G

Open Closed

A1 (0) C2 (3) B3 (3)

1 1

B1 (1) A2 (1)

3 3 2 2 2

C1 (2) ...

slide-25
SLIDE 25

A Simple Example

A B C 1 2 3

Open Closed

C2 (3) A1 (0) B3 (3)

1 1

B1 (1) A2 (1)

3 3 2 2 2

C1 (2) ...

slide-26
SLIDE 26

A Simple Example

A B C 1 2 3

Open Closed

C2 (3) A1 (0) B3 (3)

1 1

B1 (1) A2 (1)

3 3 2 2 2

C1 (2) ...

4 Adjacent State is Goal!

slide-27
SLIDE 27

A Simple Example

It is now possible to construct a path back to the starting point.

A B C 1 2 3

1 3 2 4 1 2 2 3

slide-28
SLIDE 28

A Simple Example

This example is very simple, and every state within the 3x3 grid was explored. However, many optimizations can be made to the A * algorithm to increase efficiency. One such optimization is to add a Heuristic to the cost of each state evaluated. A good heuristic will increase efficiency - up to 100% in best cases.

slide-29
SLIDE 29

Heuristic

S G S G

Bad Heuristic Good Heuristic

Closed Search Space

slide-30
SLIDE 30

Summary

The A * algorithm will always return the most efficient path, if one exists. If there is no path, however, then the A * algorithm becomes inefficient, as all state space will be explored. The A * algorithm can be extended to support multiple goals and multiple start locations, and is generally very adaptable to many different problem domains, ranging from music to computer graphics.