1 / 30

Recursive Best-First Search

Recursive Best-First Search. RBFS is a linear-space algorithm that expands nodes in best-first order even with a non-monotonic cost function and generates fewer nodes than iterative deepening with a monotonic cost function. SRBFS uses a local cost threshold for each recursive call.

pancho
Download Presentation

Recursive Best-First Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recursive Best-First Search • RBFS is a linear-space algorithm that expands nodes in best-first order even with a non-monotonic cost function and generates fewer nodes than iterative deepening with a monotonic cost function.

  2. SRBFS uses a local cost threshold for each recursive call. It takes 2 arguments: a node an upper bound It explores the subtree below the node as long as it contains frontier nodes whose costs do not exceed the upped bound. Every node has an upper bound on cost. Upper bound=min(upper bound on it’s parent,current value of it’s lowest cost brother) Simple Recursive Best-First Search

  3. 5 2 2 1 Expand the root and compute the costs of the children SRBFS example with non-monotonic cost function

  4. 5 5 1 2 2 2 2 4 1 3 Expand the right child , evaluate grandchildren. The recursive call terminates and return the minimum value of children Expand the root and compute the costs of the children SRBFS example with non-monotonic cost function

  5. 5 5 1 5 2 2 3 2 3 2 2 4 1 3 Expand the right child , evaluate grandchildren. The recursive call terminates and return the minimum value of children The backed-up value of 3 is stored as the new value of the right child Expand the root and compute the costs of the children SRBFS example with non-monotonic cost function

  6. 1 1 1 SRBFS example with cost equal to depth

  7. SRBFS example with cost equal to depth 1 1 1 2 2

  8. 1 2 2 SRBFS example with cost equal to depth

  9. 1 2 2 2 2 2 SRBFS example with cost equal to depth

  10. 1 2 2 2 2 2 3 3 SRBFS example with cost equal to depth

  11. 1 2 2 2 3 2 SRBFS example with cost equal to depth

  12. 1 2 2 2 3 2 3 3 SRBFS example with cost equal to depth

  13. 1 2 2 3 3 SRBFS example with cost equal to depth

  14. 3 2 SRBFS example with cost equal to depth

  15. SRBFS -The Algorithm SRBFS ( node: N ,bound B) IF f( N) > B RETURN f(n) IF N is a goal, EXIT algorithm IF N has no children, RETURN infinity FOR each child Ni of N, F[i] := f(Ni) sort Ni and F[i] in increasing order of F[i] IF only one child, F[2] = infinity WHILE (F[1]  B and f[1] < infinity) F[1] := SRBFS (N1, MIN(B, F[2])) insert N1 and F[1] in sorted order RETURN F[1]

  16. 7 8 7 8 8 8 2 2 2 SRBFS -Unefficiency • SRBFS expands nodes in best-first order, even if the cost function is non-monotonic.Unfortunately, however, SRBFS is inefficient - much of the work done is redundant. Continuing the previous example will reach this state

  17. 7 7 8 8 8 8 2 7 2 7 2 7 Full Recursive Best-First Search • The way to avoid this inefficiency is for children to inherit their parent’s values as their own, if the parent’s values are greater than the children’s values. Inefficiency of SRBFS and its solution.

  18. Full Recursive Best-First Search • In order to be expanded, the upper bound on a node must be at least as large as its stored value. • If a node has been previously expanded, its stored value will be greater than its static value. • If the stored value of a node is greater than its static value, its stored value is the minimum of the last stored values of its children. In general, a parent’s stored value is passed down to its children, which inherit the value only if it exceeds both the parent’s static value and the child’s static value.

  19. Full RBFS -The Algorithm RBFS ( node: N ,value: F(N), bound B) IF f( N) > B RETURN f(n) IF N is a goal, EXIT algorithm IF N has no children, RETURN infinity FOR each child Ni of N, F[i] := f(Ni) IF f(N) < F(N) THEN F[i] := MAX (F(N), f(Ni)) ELSE F[i] := f(Ni) sort Ni and F[i] in increasing order of F[i] IF only one child, F[2] = infinity WHILE (F[1]  B and f[1] < infinity) F[1] := SRBFS (N1, MIN(B, F[2])) insert N1 and F[1] in sorted order RETURN F[1]

  20. 3 4 4 Full Recursive Best-First Search Example

  21. 3 4 4 3 3 3 Full Recursive Best-First Search Example

  22. 3 4 4 3 3 3 3 3 3 Full Recursive Best-First Search Example

  23. 3 4 4 Full Recursive Best-First Search Example 3 3 3 3 3 3 4 4

  24. RBFS vs SRBFS • RBFS behaves differently depending on whether it is expanding new nodes, or previously expanded nodes: • New nodes - proceeds like Best-First. • Previously expanded nodes - behaves like BFS until it reaches a lowest - cost node.Then it reverts back to Best-First.

  25. Space Complexity of SRBFS and RBFS where b is the branching factor and d is the maximum search depth. The space complexity of SRBFS and RBFS is O(bd)

  26. Time Complexity of SRBFS and RBFS • The asymptotic time complexity of SRBFS and RBFS is the number of node generations. • The actual number of nodes generated depends on the particular cost function.

  27. Worst case Time Complexity • As with ID, the worst-case time complexity occurs when • all nodes have unique cost values. • they must be arranged so that successive nodes in an ordered sequence of cost values are in different subtrees of the root node.

  28. 0 2 1 6 c 4 c 3 5 c 13 c 7 9 8 10 12 14 11 Worst case Time Complexity • In order to expand each new node to depth d, both SRBFS and RBFS must abandon their current path all the way back to the root.

  29. Worst case Time Complexity The worst case time complexity of SRBFS and RBFS is O(b2d-1)

  30. RBFS vs. ID • If the cost function is non-monotonic, the two algorithms are not directly comparable. • RBFS generate fewer nodes than ID on average. • If the expected number of zero-cost children of a node is less then 1, then DFBnB will run in exponential time in the search depth but the space complexity is linear.

More Related