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.

Else do<br />

Begin<br />

End<br />

insert the children of the front element,<br />

if exist, in any order at the rear end of<br />

the queue;<br />

Until the queue is empty;<br />

End.<br />

The breadth first search algorithm, presented above, rests on a simple<br />

principle. If the current node is not the goal add the offspring of the<br />

current in any order to the rear end of the queue <strong>and</strong> redefine the front<br />

element of the queue as the current. The algorithm terminates, when the goal<br />

is found.<br />

n 1<br />

n 2<br />

n3<br />

n 3 n 4<br />

Fig. 4.2: First few steps of breadth first search on the tree of fig. 4.1.<br />

Time Complexity<br />

n4<br />

n 4 n5 n6<br />

n 5 n 6 n 7 n 8<br />

For the sake of analysis, we consider a tree of equal branching factor from<br />

each node = b <strong>and</strong> largest depth = d. Since the goal is not located within<br />

depth (d-1), the number of false search [1], [2] is given by<br />

1+b+b 2 +b 3 + … + b d-1 = (b d -1) / (b-1) , b>>1.

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

Saved successfully!

Ooh no, something went wrong!