04 05 AI UninformedSearch
04 05 AI UninformedSearch
Search
q ← newQueue();
node ← initNode;
while
(isNotGoalNode(node))
expandNode(node, q);
do comment: Adds unvisited new successors of node to q.
node ← dequeue(q);
return (node);
Bread first search contd.
mark(node);
n ∈ children(node)
for each
if (notMarked(n))
do then q.add(n);
chp
comment: The function children uses the succ function.
BFS properties
node ← initNode;
while (isNotGoalNode(node))
do node ← getChild(node);
return (node);