A* Search Example: f(n) = g(n) + h(n)

Consider the following search space where the start state is S and the goal state is G. The left figure shows the arcs labeled with the costs of the associated operators. The right figure shows the states labeled with the value of the heuristic function, h, if it is ever applied at that state.


Edge Costs



Heuristic = Estimated Costs = h(n)

    node
    expanded    nodes list
    ----        ------------------
                { S(8) }
      S         { A(9) B(9) C(11) }
      A		{ B(9) G(10) C(11) D(inf) E(inf) }
      B		{ G(9) G(10) C(11) D(inf) E(inf) }     
      G	 	{ C(11) D(inf) E(inf) }

    Solution path found is S B G.  #nodes expanded = 4.

Still pretty fast. And optimal, too.