Loading...

PPT – 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. PowerPoint presentation | free to download - id: 55db68-NzNlM

The Adobe Flash plugin is needed to view this content

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.

Simple Recursive Best-First Search

- 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 boundmin(upper bound on its

parent,current value of its lowest cost brother)

SRBFS example with non-monotonic cost function

SRBFS example with non-monotonic cost function

SRBFS example with non-monotonic cost function

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

?1

1

1

2

2

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS example with cost equal to depth

SRBFS -The Algorithm

SRBFS ( node N ,bound B) IF f( N) gt B RETURN

f(n) IF N is a goal, EXIT algorithm IF N has no

children, RETURN infinity FOR each child Ni of N,

Fi f(Ni) sort Ni and Fi in increasing

order of Fi IF only one child, F2

infinity WHILE (F1 ? B and f1 lt

infinity) F1 SRBFS (N1, MIN(B,

F2)) insert N1 and F1 in sorted order RETURN

F1

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

Full Recursive Best-First Search

- The way to avoid this inefficiency is for

children to inherit their parents values as

their own, if the parents values are greater

than the childrens values.

Inefficiency of SRBFS and its solution.

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 parents stored value is passed

down to its children, which inherit the value

only if it exceeds both the parents static value

and the childs static value.

Full RBFS -The Algorithm

RBFS ( node N ,value F(N), bound B) IF f( N) gt

B RETURN f(n) IF N is a goal, EXIT algorithm IF N

has no children, RETURN infinity FOR each child

Ni of N, Fi f(Ni) IF f(N) lt F(N) THEN Fi

MAX (F(N), f(Ni)) ELSE Fi f(Ni) sort Ni

and Fi in increasing order of Fi IF only one

child, F2 infinity WHILE (F1 ? B and f1 lt

infinity) F1 SRBFS (N1, MIN(B,

F2)) insert N1 and F1 in sorted order RETURN

F1

Full Recursive Best-First Search Example

Full Recursive Best-First Search Example

Full Recursive Best-First Search Example

Full Recursive Best-First Search Example

3

3

?3

3

3

?3

4

4

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.

Space Complexity of SRBFS and RBFS

The space complexity of SRBFS and RBFS is O(bd)

- where b is the branching factor and d is the

maximum search depth.

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.

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.

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.

Worst case Time Complexity

The worst case time complexity of SRBFS and RBFS

is O(b2d-1)

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.