Lecture4

Lecture4 - CS221 Lecture notes Heuristic search, local...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS221 Lecture notes Heuristic search, local search In the last lecture, we introduced uninformed search, and then showed how, if we know something about the particular problem, we can achieve better performance using heuristic search. In particular, we introduced the widely used A algorithm, which we show again in Figure 1 for convenience. Recall also that we defined a heuristic h as a function mapping from states s S to the non-negative real numbers, which estimates the minimum cost of reaching a goal from s . In todays lecture, we will now prove several key properties of A search. Then, we discuss how to actually construct heuristic functions. Finally, we will describe local search search algorithms, and close with a discussion of optimization search problems. For convenience, we have summarized most of the notation well use in this set of notes in Figure 2. PriorityQueue q; q.insert(initialState, h(initialState)); while (!q.isEmpty()){ node = q.remove(); if (goalTest(node)) return node; foreach (n in successors(node, operators)) q.insert(n, f(n) + g(n)); } return FAIL; Figure 1: Pseudocode for A search. 1 CS221 Fall 2007 2 s a state in search space n a node in the search tree n g A goal node g ( n ) The cost of the path to node n h ( h ) The heuristic function evaluated at n h ( n ) The actual cost of the least-cost path from n to a goal state f ( n ) The estimated cost of the least-cost path through n to a goal, f ( n ) = g ( n ) + h ( n ) f ( n ) The cost of the least-cost path to a goal state which passes through n f ( n ) = g ( n ) + h ( n ) Pa ( n ) The parent of node n in the search tree. Figure 2: Notation used in this lecture. 1 Optimality of A * search One basic question to ask about any search algorithm is whether it is com- plete . Recall that a search algorithm is complete if it is guaranteed to find some path to a goal state whenever such a path exists. Under fairly mild assumptions, we can show that A is complete. We will not present the proof here, but the interested reader is referred to Chapter 4 of the textbook. A more interesting question is optimality . A search algorithm is optimal if it is guaranteed to find the least-cost path to a goal state, provided a path to the goal exists. To prove the optimality of A search, we first need a definition. Definition. A heuristic function h is admissible if it never underestimates the true cost to get to the goal; in order words, if for any state s , we have h ( s ) h ( s ). Theorem 1.1.: If h is an admissible heuristic function, then A search with h is optimal. Proof. Our overall strategy is to take n g , the first goal node to be expanded, and show that it represents an optimal path. Since A returns the first goal node expanded, this implies the optimality of A ....
View Full Document

Page1 / 16

Lecture4 - CS221 Lecture notes Heuristic search, local...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online