1
20kviews
Explain Depth Limited Search
1 Answer
1
872views

In order to avoid the infinite loop condition arising in DFS, in depth limited search technique, depth-first search is carried out with a predetermined depth limit.

As in case of DFS in DLS we can use the same fringe implemented as queue.

Additionally the level of each node needs to be calculated to check whether it is within the specified depth limit.

Depth-limited search can terminate with two conditions:

  1. If the solution is found.

  2. If there is no solution within given depth limit.

Process: If depth is fixed to 2, DLS carries out depth first search till second level in the search tree.

enter image description here

Algorithm:

  1. Determine the start node and the search depth.

  2. Check if the current node is the goal node.

If not: Do nothing

If yes:return

  1. Check if the current node is within the specified search depth

If not: Do nothing

If yes:Expand the node and save all of its successors in a stack.

  1. Call DLS recursively for all nodes of the stack and go back to step 2.

Performance evaluation:

Completeness: Its complete if shallowest goal is beyond the depth limit.

Optimality: Non optimal, as the depth chosen can be greater than d.

Time complexity: Same as DFS, O(b1), where 1 is the specified depth limit.

Space Complexity: Same as DFS, O(b1), where 1 is specified depth limit.

Please log in to add an answer.