DA* is Ethe
goal state.
xample ◆⇣
A X
XX 1
✓⌘
XXX ◆⇣
z C
4
✓⌘
*
2
9
?⇡
2
◆⇣
B XX
?
✓⌘ XXX ◆⇣
X
z
6
D
✓⌘
h(A) = 8
h(B) = 3
h(C) = 7
h(D) = 0
START = A GOAL = D would change if cycle checking is used, and how
Fahiem Bacchus, CSC384 Introduc8on to Ar8ficial Intelligence, University of Toronto, 1 That is, the path n1 ! n2 ! n3 would be written [n1 , n2 , n3 ]. Unde
he frontier, indicate the f , g and h values of the final node in the path
A* 5 and h(m) = 7 write “12=5+7” underneath m, Remember to ge
t, g(m) followed by h(m).
• Successive states of OPEN: Items on OPEN are <Node, g-‐val+h-‐val = f-‐val> w the path to the goal found by A⇤ .
Where Node = [s0, s2 …] a sequence of states rt state and D is the goal state.
represen8ng the path. ◆⇣
A X
XX 1
✓⌘
XXX ◆⇣
z C
h(A) = 8
4
✓⌘
e path that is expanded at each stage.
2
*
h(B) = 3
9
?⇡
2
◆⇣
h(C) = 7
B XX
h(D) = 0
?
✓⌘ XXX ◆⇣
X
z
6
D
✓⌘
2 c
w the
search
would
change
cycleUniversity checking
used, and how it would
Fahiem Bacchus, CSC384 Introduc8on to Ar8ficial if
Intelligence, of Toronto, is
a general manner.
A* 3
Algorithm Execution
{<[A],0+8=8>} 1. Trace the execution of A⇤ for the graph shown below.
{<[A,C], 1+7=8>, <•[A,B] 4+3 = 7>} configurations of the frontier where the ele
Show =
the
successive
{<[A,C], 1+7=8>, <[A,B,C] are paths.
is, the path
n1 ! n2 =
! 1n0+0=10>} 3 would be written [n
= 6That
+7=13>, <[A,B,D] element of the frontier, indicate the f , g and h values of the final
{<[A,C,B], 3+3=6>, <if[A,C,D], 0+0=10>, [A,B,C] = 6+7=13>, g(m) = 5 1
and
h(m) = 7 <
write
“12=5+7”
underneath m, Re
order right, g(m) followed by h(m).
<
[A,B,D] =
1
0+0=10>} • Indicate the path that is expanded at each stage.
{<[A,C,B,C] = 5+7=12>, <[A,C,B,D] = 9+0= 9>, • Finally show the path to the goal found by A⇤ .
<[A,C,D], 10+0=10>, <[A,B,C] = 6+7=13>, • A is the start state and D is the goal state.
<[A,B,D] = 10+0=10>} ◆⇣
A X
Node selected for expansion XX 1
✓⌘
XXX ◆⇣
z C
h(A) = 8
reaches a goal. 4
✓⌘
*
2
h(B) = 3
9
?⇡
2
◆⇣
h(C) = 7
B XX
Green = next node expanded h(D) = 0
XX
?
✓⌘
◆⇣
Fahiem Bacchus, CSC384 Introduc8on to Ar8ficial Intelligence, niversity of Toronto, (a)
Indicate
how Uthe
search
would
z
6 XX
D
✓⌘
change if cycle checking is used,3 an
• A is the start state and D is the goal state.
A* Path Checking ◆⇣
XXX 1
✓⌘
X
◆⇣
XX
{<[A],0+8=8>} z C
h(A) = 8
4
✓⌘
*
2
h(B) = 3
{<[A,C], 1+7=8, <[A,B] = 4+3 = 7>} 9
?⇡
2
{<[A,C], 1+7=8, <[A,B,C] = 6+7=13>, ◆⇣
h(C) = 7
B XX
h(D) = 0
XXX ◆⇣
?
✓⌘
X
z
6
<[A,B,D] = 10+0=10>} D
✓⌘
{<[A,C,B], 3+3=6>, <[A,C,D], 10+0=10>, <[A,B,C] = 6+7=13>, (a) Indicate how the search would change if cycle checking is used, and
if path checking is used.
<[A,B,D] = 10+0=10>} (b) Is the heuristic admissible? Is it monontonic?
{[A,C,B,C] = 5+7=12, [A,C,B,D] = 9+0= 9, <[A,C,D], 10+0=10>, 4<[A,B,C] = 6+7=13>, Simple Proofs
<[A,B,D] = 10+0=10>} ⇤
A
1. Let h (n) denote the cost of an optimal path from n to a goal node,
cost of an optimal path from the start node s to n. Finally let C ⇤ be eq
Red pruned by coptimal
ycle checking. solution (optimal path from s to a goal node).
Prove that the f value of every node expanded by A⇤ using an admissi
greater than C ⇤ .
2. Prove that if h(n) = h⇤ (n) for all n, then whenever A⇤ expands a node
4 Fahiem Bacchus, CSC384 Introduc8on to Ar8ficial Intelligence, University of Toronto, optimal
path
to a goal.
• A is the start state and D is the goal state.
A* Full Cycle Checking ◆⇣
XXX 1
✓⌘
X
◆⇣
XX
{<[A],0+8=8>} z C
h(A) = 8
4
✓⌘
*
2
h(B) = 3
{<[A,C], 1+7=8, <[A,B] = 4+3 = 7>} 9
?⇡
2
{<[A,C], 1+7=8, <[A,B,C] = 6+7=13>, ◆⇣
h(C) = 7
B XX
h(D) = 0
XXX ◆⇣
?
✓⌘
X
z
6
<[A,B,D] = 10+0=10>} D
✓⌘
{<[A,C,B], 3+3=6>, <[A,C,D], 10+0=10>, (a) Indicate how
the search=would
change if cycle checking is used, and
<[A,B,C] = 6+7=13>, <[A,B,D] 10+0=10>} if path checking is used.
{[A,C,B,C] = 5+7=12, [A,C,B,D] = 9+0= 9, <[A,C,D], (b) Is the heuristic admissible? Is it monontonic?
10+0=10>, <[A,B,C] = 6+7=13>, <[A,B,D] 10+0=10>} 4 = Simple
Proofs
A
1. Let h⇤ (n) denote the cost of an optimal path from n to a goal node,
cost of an optimal path from the start node s to n. Finally let C ⇤ be eq
optimal solution (optimal path from s to a goal node).
Prove that the f value of every node expanded by A⇤ using an admissi
greater than C ⇤ .
2. Prove that if h(n) = h⇤ (n) for all n, then whenever A⇤ expands a node
5 Fahiem Bacchus, CSC384 Introduc8on to Ar8ficial Intelligence, University of Toronto, optimal
path
to a goal.
A* Short QuesAons • If h(n) is admissible and s is the start node how is h(s) related to the cost of the solu8on eventually found by A*? • If there is a solu8on, then during its opera8on A* always has at least one prefix of an op8mal path to a goal on OPEN. • What happens when h(n) = h*(n) a. A* only expands nodes that lie on an op8mal path to the goal b. Does this mean that A* will find an solu8on in 8me linear in the length of an op8mal solu8on? CSC384, University of Toronto 6
© Copyright 2026 Paperzz