Professional Documents
Culture Documents
Problem Set 1
Problem Set 1
S -> A
S -> C
S -> A -> D
S -> C -> B
S -> C -> E
S -> A x
S -> C x
max_depth = 2:
S -> A
S -> A -> C x
S -> A -> D x
S -> C
S -> C -> A x
S -> C -> B x
S -> C -> E x
max_depth = 3:
1
S -> A
S -> A -> C
S -> A -> D
SAC = 12 + 5 + 16 = 33
SAD = 12 + 6 + 2 = 20
SC = 6 + 16 = 22
SAC = 12 + 5 + 16 = 33
SADF = 12 + 6 + 2 + 5 = 25
SADG = 12 + 6 + 3 + 0 = 21
SADH = 12 + 6 + 9 + 12 = 39
SC = 6 + 16 = 22
(expand smallest SC, add edges from C (SADG is a potential solution that can't
be expanded further))
SAC = 12 + 5 + 16 = 33
SADF = 12 + 6 + 2 + 5 = 25
SADG = 12 + 6 + 3 + 0 = 21 (potential solution)
SADH = 12 + 6 + 9 + 12 = 39
SCA = 6 + 5 + 9 = 20
SCB = 6 + 8 + 24 = 38
SCE = 6 + 11 + 27 = 44
2
(expand smallest SCA, add edges from A (we don't expand edges that loop back
onto the path))
SAC = 12 + 5 + 16 = 33
SADF = 12 + 6 + 2 + 5 = 25
SADG = 12 + 6 + 3 + 0 = 21 (potential solution)
SADH = 12 + 6 + 9 + 12 = 39
SCAD = 6 + 5 + 6 + 2 = 19
SCB = 6 + 8 + 24 = 38
SCE = 6 + 11 + 27 = 44
SAC = 12 + 5 + 16 = 33
SADF = 12 + 6 + 2 + 5 = 25
SADG = 12 + 6 + 3 + 0 = 21 (potential solution)
SADH = 12 + 6 + 9 + 12 = 39
SCADF = 6 + 5 + 6 + 2 = 19
SCADG = 6 + 5 + 6 + 3 = 20 (potential solution)
SCADH = 6 + 5 + 6 + 9 = 26
SCB = 6 + 8 + 24 = 38
SCE = 6 + 11 + 27 = 44
The solution found is SCADG, which is the optimal solution because it is the
shortest path from the start (S) to the goal (G). A* found the solution because
it used a heuristic that did not overestimate the path cost. Furthermore, A*
explored all possible (non-looping) paths from the start to the goal.