06.03.2013 Views

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.3.2 Iterative Deepening A* Algorithm<br />

The iterative deepening search algorithm, discussed earlier, searches the goal<br />

node in a depth first manner at limited depth. In each pass the depth is<br />

increased by one level to test the presence of the goal node in that level. The<br />

A* algorithm, on the other h<strong>and</strong>, in each pass, selects the least cost (f ) node<br />

for expansion. The iterative deepening A* (or IDA*) algorithm presented<br />

below attempts to combine the partial features of iterative deepening <strong>and</strong> A*<br />

algorithms together. Here, the heuristic measure is used to check the depth<br />

cut-off, rather than the order of the selection of nodes for expansion. The<br />

algorithm is formally presented below.<br />

Procedure IDA*<br />

Begin<br />

1. Initialize the current depth cut-off c = 1;<br />

2. Push a set of starting nodes into a stack; Initialize the cut-off at<br />

next iteration c’ = ∝;<br />

3. While the stack is not empty do<br />

Begin<br />

Pop stack <strong>and</strong> get the topmost element n;<br />

If n is the goal, Then report success <strong>and</strong><br />

return n with the path from the starting node<br />

Else do<br />

Begin<br />

For each child n’ of n<br />

End;<br />

If f(n’) ≤ c Then push n’ into the stack<br />

Else assign c’ := min (c’, f(n’));<br />

End For;<br />

End While;<br />

4. If the stack is empty <strong>and</strong> c’ = ∝ Then stop <strong>and</strong> exit;<br />

5. If the stack is empty <strong>and</strong> c’≠ ∝ Then assign c:= c’ <strong>and</strong> return to step 2;<br />

End.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!