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.

Breadth-First Search<br />

c○: Michael Kohlhase 426<br />

Idea: Expand shallowest unexpanded node<br />

Implementation: fringe is a FIFO queue, i.e. successors go in at the end of the queue<br />

Breadth-First Search<br />

A<br />

B C<br />

D E F G<br />

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

c○: Michael Kohlhase 427<br />

Idea: Expand shallowest unexpanded node<br />

Implementation: fringe is a FIFO queue, i.e. successors go in at the end of the queue<br />

A<br />

B C<br />

D E F G<br />

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

c○: Michael Kohlhase 428<br />

We will now apply the breadth-first search strategy to our running example: Traveling in Romania.<br />

Note that we leave out the green dashed nodes that allow us a preview over what the search tree<br />

will look like (if expanded). This gives a much<br />

Breadth-First Search: Romania<br />

Breadth-First Search: Romania<br />

Arad<br />

c○: Michael Kohlhase 429<br />

Arad<br />

Sibiu Timisoara Zerind<br />

241

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

Saved successfully!

Ooh no, something went wrong!