Uniform-Cost Search Example
Nodes Expanded: S A D B C E G Solution found: S B G This is the only uninformed search that worries about costs.
return GENERAL-SEARCH(problem, ENQUEUE-BY-PATH-COST)
expanded
node nodes list
---- ----------
{ S }
S { A(1) B(5) C(8) }
A { D(4) B(5) C(8) E(8) G(10) } (note, we don't return G)
D { B(5) C(8) E(8) G(10) }
B { C(8) E(8) G(9) G(10) }
C { E(8) G(9) G(10) G(13) }
E { G(9) G(10) G(13) }
G { }
Solution path found is S B G <-- this G has cost 9, not 10
Number of nodes expanded (including goal node) = 7