Iterative Deepening Search Introduction to AI Iterative deepening

  • Slides: 6
Download presentation
Iterative Deepening Search Introduction to AI

Iterative Deepening Search Introduction to AI

Iterative deepening search • The problem with depth-limited search is deciding on a suitable

Iterative deepening search • The problem with depth-limited search is deciding on a suitable depth parameter. To avoid this problem there is another search called iterative deepening search (IDS). • This search method tries all possible depth limits; first 0, then 1, then 2 etc. , until a solution is found. • IDS may seem wasteful as it is expanding nodes multiple times. But the overhead is small in comparison to the growth of an exponential search tree • For large search spaces where is the depth of the solution is not known IDS is normally the preferred search method. • The following slide illustrates an iterative deepening search of 26 nodes (states) with an initial state of node A and a goal state of node L. Press space to see the example node set.

The example node set Initial state B A C D E F Goal state

The example node set Initial state B A C D E F Goal state G H I J K L M N O P Q S T U V W X Y Z R Press space to see a IDS of the example node set

A We begin initial state: the node Node A iswith thenour expanded and removed

A We begin initial state: the node Node A iswith thenour expanded and removed labeled A. queue. This node is space. added to the from the Press queue. Press space to continue As this is the 0 th iteration of the search, we cannot search past any level greater than zero. This iteration now ends, and we begin the 1 st iteration. Press space to begin the search Size of Queue: 01 Queue: Empty A Nodes expanded: 10 Current Action: Expanding Current level: 0 n/a ITERATIVE DEEPENING SEARCH PATTERN (0 th ITERATION)

We Node The now B search isback expanded now track moves to and expand

We Node The now B search isback expanded now track moves to and expand removed to level node one from C, of and the queue. theprocess node Press set. continues. space. Press space Presstospace. continue B C A D Node We again A is expanded, begin withthen our initial removed state: from the node queue, labeled and. A. the Note revealed that the nodes 1 st iteration are added carriestoon thefrom front the. Press 0 th, and space. therefore the ‘nodes expanded’ value is already set to 1. Press space to continue E F As this is the 1 st iteration of the search, we cannot search past any level greater than level one. This iteration now ends, and we begin a 2 nd iteration. Press space to begin continue thethe search Size of Queue: 012345 Queue: Empty A F B, C, D, E, F C, D, F E, D, E, F Nodes expanded: 7654321 Current Action: Expanding Backtracking Current level: 10 n/a ITERATIVE DEEPENING SEARCH PATTERN (1 st ITERATION)

Node Bexpanding ismove expanded and The search then tothe level of After node G

Node Bexpanding ismove expanded and The search then tothe level of After node G we backtrack We now tomoves level two ofrevealed theone nodes added to the front of queue. the node set. Press space to the continue to expand node H. continue. The process then set. Press space to Press spaceuntil to continues goal state. Press space B A C G H I D J K Node We again Awe is begin removed with from our. Athe initial queue state: and Again, expand node to reveal the node each revealed labeled node A. is Note added thattothe 2 nd front of level one nodes. Press space. iteration the queue. carries Press on space. from the 1 st, and therefore the ‘nodes expanded’ value is already set to 7 (1+6). Press space to E F continue the search L Node L is located on the second level and the search returns a solution on its second iteration. Press space to end. Press space to continue the search Size of Queue: 034561 Queue: Empty A J, B, G, H, C, I, J, D, K, L, D, C, E, D, H, D, C, L, E, F D, E, D, C, E, FF E, E, D, FFFE, F Nodes expanded: 16 987 10 11 12 13 14 15 Current. SEARCH Action: Backtracking Expanding FINISHED Current level: 210 n/a ITERATIVE DEEPENING SEARCH PATTERN (2 nd ITERATION)