color(position)foreach successor adjacent to node"position"ifsuccessoriscolored, skip itifnextisthe goal node, stop the searchelse, dfs(successor) end end //Simple bfsstructure node position pos node*parent end function bfs(node start_position) add start_position to the queuewhilethe queueisnot...
find the node with the least f on the open list, call it"q"pop q off the open list generate q's 8 successors and set their parents to qforeach successorifsuccessoristhe goal, stop the search successor.g= q.g +distance between successor and q successor.h= distancefromgoal to successor...