A* for graphs♦ Re-expands a node if it find a better path to the node♦ Finds optimal solutions even if the heuristic is inconsistentfunction A*( problem) returns asolution,orfailureclosed ← an empty setfringe ← alistcontainingMake-Node(Initial-State[problem])loop doif fringe is empty then return failurenode ← Remove-Front(fringe)if Goal-Test[problem]appliedtoState(node)succeedsreturn nodeinsert node into closedfor each node n ∈ Expand(node, problem) doif there is a node m ∈ closed ∪ fringe such thatState(m)=State(n)andf (m) ≤ f(n)then do nothingelseinsert n into fringe after the last node m such that f(m) ≤ f(n)endCMSC 421: Chapter 4, Sections 1–2
View Full Document