Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean to expand a node?

I'm trying to understand the algorithm for a Depth-Limited-Search on wikipedia, and I'm trying to figure out what exactly it means to expand a node. I attempted to search for an answer but all I got was more algorithms which state that nodes must be expanded.

Specifically, what is the line stack := expand (node) saying in regards to the whole function?

    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

      }
     }
like image 249
Rowhawn Avatar asked Feb 11 '11 02:02

Rowhawn


People also ask

How many nodes does a * Expand?

Here depth-first search and breadth-first search expand every node, whereas A* search expands 4 nodes.

Which of the generated nodes do we expand next?

After the selection phase, when a leaf node is reached, the tree is expanded in the so-called expansion phase.

Which strategy is defined by the order in which the nodes are expanded?

• General approach: best-first search; an instance of TREE- SEARCH (or GRAPH-SEARCH) – where a search strategy is defined by picking the order of node expansion. • With best-first, node is selected for expansion based on evaluation function f(n).

How do you expand node in Treeview?

Use TreeNode. Expand() on every node from the root to the leaf you wanted to be expanded, using Expand on the leaf node or the node you want to expand make only the node itself to show its subchildren.


1 Answers

In this context, it returns all the children of the node as a new stack. This is a very poorly-written bit of sample code though.

like image 68
Lily Ballard Avatar answered Nov 01 '22 18:11

Lily Ballard