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: Romania<br />

c○: Michael Kohlhase 430<br />

Arad<br />

Sibiu Timisoara Zerind<br />

Arad Fagaras Oradea R. Vilcea<br />

Breadth-First Search:Romania<br />

c○: Michael Kohlhase 431<br />

Arad<br />

Sibiu Timisoara Zerind<br />

Arad Fagaras Oradea R. Vilcea Arad Lugoj<br />

Breadth-First Search:Romania<br />

c○: Michael Kohlhase 432<br />

Arad<br />

Sibiu Timisoara Zerind<br />

Arad Fagaras Oradea R. Vilcea Arad Lugoj Oradea Arad<br />

Breadth-first search: Properties<br />

c○: Michael Kohlhase 433<br />

Complete Yes (if b is finite)<br />

Time 1 + b + b 2 + b 3 + . . . + b d + b(b d − 1) ∈ O(b d+1 )<br />

i.e. exponential in d<br />

Space O(b d+1 ) (keeps every node in memory)<br />

Optimal Yes (if cost = 1 per step), not optimal in general<br />

Disadvantage: Space is the big problem(can easily generate nodes at 5MB/sec so 24hrs = 430GB)<br />

Optimal?: if cost varies for different steps, there might be better solutions below the level of<br />

the first solution.<br />

An alternative is to generate all solutions and then pick an optimal one. This works only, if<br />

m is finite.<br />

c○: Michael Kohlhase 434<br />

The next idea is to let cost drive the search. For this, we will need a non-trivial cost function: we<br />

242

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

Saved successfully!

Ooh no, something went wrong!