14.07.2013 Views

Prohledávání stavového prostoru I: BFS & DFS

Prohledávání stavového prostoru I: BFS & DFS

Prohledávání stavového prostoru I: BFS & DFS

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.

Cybernetics and Artificial Intelligence 2012/SS<br />

Assignment:<br />

Part B<br />

Implement the A* algorithm. The result is going to be the shortest path between the<br />

starting a target node specified by the user. Design and use a heuristic function. Use<br />

the provided GUI libraries (if applicable). The state-space is specified by a planar<br />

graph.<br />

Guidelines for implementation:<br />

1. Open the AStar.java source file in the project. This class implements the<br />

InformedSearchingAlgorithm interface. In contrast with the previous task,<br />

findWay() receives both the starting and target node.<br />

2. Change the run configuration to “astar” (hit the arrow next to the combo box<br />

with “” and choose “astar”).<br />

Notes for implementation:<br />

Do not create any other files, put all the necessary code into the AStar.java<br />

source file.<br />

Questions:<br />

Which of the algorithms usually (in our case) returns the shortest path?<br />

How many states the <strong>BFS</strong> and <strong>DFS</strong> algorithms are going to expand in the<br />

worst case?<br />

In what sense is the path found by <strong>BFS</strong> the shortest one?<br />

What conditions must the heuristic function satisfy in order to be sure that the<br />

A* algorithm actually returns the shortest path with certainty?<br />

What is a monotonic heuristic function?<br />

What heuristic function have you chosen?<br />

Is it necessary to implement the algorithm in its full generality, or is it possible<br />

to perform some simplifications?<br />

How to submit?<br />

1. The deadline for all three tasks (<strong>BFS</strong>, <strong>DFS</strong>, A*) is the next seminar.<br />

2. Only <strong>BFS</strong> and A* are submitted into CW. <strong>DFS</strong> is evaluated by your teacher, in<br />

person.

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

Saved successfully!

Ooh no, something went wrong!