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.

as they are in UCS and BFS.<br />

For completeness, we need repeated state checking as the example shows. This enforces complete<br />

enumeration of state space (provided that it is finite), and thus gives us completeness.<br />

Note that nothing prevents from all nodes nodes being searched in worst case; e.g. if the<br />

heuristic function gives us the same (low) estimate on all nodes except where the heuristic misestimates<br />

the distance to be high. So in the worst case, greedy search is even worse than BFS,<br />

where d (depth of first solution) replaces m.<br />

The search procedure cannot be optional, since actual cost of solution is not considered.<br />

For both, completeness and optimality, therefore, it is necessary to take the actual cost of<br />

partial solutions, i.e. the path cost, into account. This way, paths that are known to be expensive<br />

are avoided.<br />

A ∗ search<br />

Idea: Avoid expanding paths that are already expensive (make use of actual cost)<br />

The simplest way to combine heuristic and path cost is to simply add them.<br />

Definition 603 The evaluation function for A ∗ -search is given by f(n) = g(n) + h(n),<br />

where g(n) is the path cost for n and h(n) is the estimated cost to goal from n.<br />

Thus f(n) is the estimated total cost of path through n to goal<br />

Definition 604 Best-First-Search with evaluation function g + h is called astarSearch<br />

search.<br />

c○: Michael Kohlhase 478<br />

This works, provided that h does not overestimate the true cost to achieve the goal. In other<br />

words, h must be optimistic wrt. the real cost h ∗ . If we are too pessimistic, then non-optimal<br />

solutions have a chance.<br />

A ∗ search: Admissibility<br />

Definition 605 (Admissibility of heuristic) h(n) is called admissible if (0 ≤<br />

h(n) ≤ h ∗ (n)) for all nodes n, where h ∗ (n) is the true cost from n to goal.<br />

(In particular: h(G) = 0 for goal G)<br />

Example 606 Straight-line distance never overestimates the actual road distance<br />

(triangle inequality)<br />

Thus hSLD(n) is admissible.<br />

A ∗ Search: Admissibility<br />

c○: Michael Kohlhase 479<br />

Theorem 607 A ∗ search with admissible heuristic is optimal<br />

Proof: We show that sub-optimal nodes are never selected by A ∗<br />

P.1 Suppose a suboptimal goal G has been generated then we are in the following situation:<br />

n<br />

start<br />

O G<br />

255

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

Saved successfully!

Ooh no, something went wrong!