15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

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.

c○: Michael Kohlhase 441<br />

If step cost is negative, the same situation as in breadth-first search can occur: later solutions may<br />

be cheaper than the current one.<br />

If step cost is 0, one can run into infinite branches. UC search then degenerates into depth-first<br />

search, the next kind of search algorithm. Even if we have infinite branches, where the sum of<br />

step costs converges, we can get into trouble 18 EdNote:18<br />

Worst case is often worse than BF search, because large trees with small steps tend to be<br />

searched first. If step costs are uniform, it degenerates to BF search.<br />

Depth-first search<br />

Idea: Expand deepest unexpanded node<br />

Definition 599 (Implementation) depth first search is tree search where the fringe is<br />

organized as a LIFO queue (a stack), i.e. successors go in at front of queue<br />

Note: Depth-first search can perform infinite cyclic excursions<br />

Need a finite, non-cyclic search space (or repeated-state checking)<br />

Depth-First Search<br />

c○: Michael Kohlhase 442<br />

A<br />

B C<br />

D E F G<br />

H I J K L M N O<br />

Depth-First Search<br />

A<br />

B C<br />

D E F G<br />

H I J K L M N O<br />

Depth-First Search<br />

18 EdNote: say how<br />

245<br />

c○: Michael Kohlhase 443<br />

c○: Michael Kohlhase 444

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

Saved successfully!

Ooh no, something went wrong!