我试图了解维基百科上的深度有限搜索算法,并且试图弄清楚扩展节点到底意味着什么。我试图寻找答案,但我得到的只是更多的算法,这些算法表明必须扩展节点。
具体来说,stack := expand (node)
关于整个功能的说法是什么?
DLS(node, goal, depth)
{
if (node == goal)
return node;
push_stack(node);
while (stack is not empty)
{
if (depth > 0)
{
stack := expand (node)
node = stack.pop();
DLS(node, goal, depth-1);
}
else
// no operation
}
}