Professional Documents
Culture Documents
B
IS
o And h(N) is estimated cost from n to Goal node
- Notice that n is referred as intermediate node(s) that takes us to the goal state.
ol
Now let’s consider the following graph
ho
Sc
rt
sa
ad
He
-
d
oo
qs
Ma
S = start node
G = Goal node
M.
Notice all other intermediate nodes are n nodes. The value(s) mentioned in black on the edge(s)
s
are the actual cost. And the values mentioned in red are estimated or heuristic cost.
au
Notice that the cost of moving from S→C → D is equals to the cost of moving from S→B i.e. 16.
We need to explore both of the paths.
S→B→F = 4 + 5 + 11 = 20 or S→B→E = 4 + 12 + 4 = 20
B
Example:
IS
Find the shortest path between the Home and School nodes using the A* algorithm.
Show your working in the table provided.
ol
ho
Sc
rt
sa
ad
He
-
d
oo
qs
Ma
A 1 10 11
B 5 7 12
s
C 4 9 13
au
B 1+3 = 4 7 11
Gh
E 1+6 = 7 3 10
F 7+1 = 8 3 11
School 7+5 = 12 0 12
School 8+3 = 11 0 11