1 29 10
play

1/29/10 CSE 3402: Intro to Artificial Intelligence CSE 3402: Intro - PDF document

1/29/10 CSE 3402: Intro to Artificial Intelligence CSE 3402: Intro to Artificial Intelligence Heuristic Search. Heuristic Search. Informed Search I Informed Search I Required Readings: Chapter 3, Sections 5 and In uninformed


  1. • 1/29/10 CSE 3402: Intro to Artificial Intelligence CSE 3402: Intro to Artificial Intelligence Heuristic Search. Heuristic Search. Informed Search I Informed Search I ● Required Readings: Chapter 3, Sections 5 and ● In uninformed search, we don’t try to 6, and Chapter 4, Section 1. evaluate which of the nodes on the frontier are most promising. We never “look-ahead” to the goal. ■ E.g., in uniform cost search we always expand the cheapest path. We don’t consider the cost of getting to the goal. ● Often we have some other knowledge about the merit of nodes, e.g., going the wrong direction in Romania. 1 1 2 2 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance Heuristic Search. Heuristic Search. Heuristic Search. Heuristic Search. ● Merit of a frontier node: different ● The idea is to develop a domain specific notions of merit. heuristic function h(n). ■ If we are concerned about the cost of the ● h(n) guesses the cost of getting to the goal solution, we might want a notion of merit from node n. of how costly it is to get to the goal from ● There are different ways of guessing this cost that search node. in different domains. I.e., heuristics are domain ■ If we are concerned about minimizing specific. computation in search we might want a notion of ease in finding the goal from that search node. ■ We will focus on the “cost of solution” notion of merit. 3 3 4 4 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance • 1

  2. • 1/29/10 Using only h(n) Using only h(n) 
 Heuristic Search. Heuristic Search. Greedy best-first search. Greedy best-first search. ● Convention: If h(n 1 ) < h(n 2 ) this means that we ● We use h(n) to rank the nodes on open. guess that it is cheaper to get to the goal from ■ Always expand node with lowest h-value. ● We are greedily trying to achieve a low cost solution. n 1 than from n 2 . ● However, this method ignores the cost of getting to n, so it can be lead astray exploring nodes that cost a lot to get to ● We require that but seem to be close to the goal: ■ h(n) = 0 for every node n that satisfies the goal. → cost = 10 S ● Zero cost of getting to a goal node from a goal → cost = 100 h(n1) = 200 h(n3) = 50 node. n1 n3 n2 Goal 5 5 6 6 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance A* search A* search Conditions on h(n) Conditions on h(n) ● Take into account the cost of getting to the node as ● We want to analyze the behavior of the well as our estimate of the cost of getting to the resultant search. goal from n. ● Completeness, time and space, optimality? ● Define ■ f(n) = g(n) + h(n) ● To obtain such results we must put some ● g(n) is the cost of the path to node n further conditions on the heuristic function ● h(n) is the heuristic estimate of the cost of getting to a h(n) and the search space. goal node from n. ● Now we always expand the node with lowest f- value on the frontier. ● The f-value is an estimate of the cost of getting to the goal via this node (path). 7 7 8 8 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance • 2

  3. • 1/29/10 Conditions on h(n): Admissible Conditions on h(n): Admissible Consistency/monotonicity. Consistency/monotonicity. ● c(n1 → n2) ≥ ε > 0. The cost of any ● Is a stronger condition than h(n) ≤ h*(n). transition is greater than zero and can’t be ● A monotone/consistent heuristic satisfies the arbitrarily small. triangle inequality (for all nodes n1,n2): ● Let h*(n) be the cost of an optimal path h(n1) ≤ c(n1 → n2) + h(n2) from n to a goal node ( ∞ if there is no path). Then an admissible heuristic satisfies the condition ● Note that there might be more than one ■ h(n) ≤ h*(n) transition (action) between n1 and n2, the ● i.e. h always underestimates of the true cost. inequality must hold for all of them. ● Hence ● Note that monotonicity implies admissibility. ■ h(g) = 0 Why? ■ For any goal node “g” 9 9 10 10 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance Intuition behind admissibility Intuition behind admissibility Intuition behind monotonicity Intuition behind monotonicity ● h(n) ≤ h*(n) means that the search ● h(n1) ≤ c(n1 → n2) + h(n2) won’t miss any promising paths. ■ This says something similar, but in addition one won’t be “locally” mislead. ■ If it really is cheap to get to a goal via n See next example. (i.e., both g(n) and h*(n) are low), then f(n) = g(n) + h(n) will also be low, and the search won’t ignore n in favor of more expensive options. ■ This can be formalized to show that admissibility implies optimality. 11 11 12 12 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance • 3

  4. • 1/29/10 Consequences of monotonicity Consequences of monotonicity Example: admissible but nonmonotonic Example: admissible but nonmonotonic ● The following h is not consistent since h(n2)>c(n2 → n4)+h(n4). But it is admissible. 1. The f-values of nodes along a path must be non-decreasing. S → cost = 200 h(n2) = 200 h(n1) =50 n1 n2 Let <Start → n1 → n2… → nk> be a path. We claim ■ → cost = 100 that 
 h(n3) =50 f(ni) ≤ f(ni+1) n3 n4 h(n4) = 50 Proof: {S} → {n1 [200+50=250], n2 [200+100=300]} ■ → {n2 [100+200=300], n3 [400+50=450]} f(ni) = c(Start → … → ni) + h(ni) 
 Goal → {n4 [200+50=250], n3 [400+50=450]} ≤ c(Start → … → ni) + c(ni → ni+1) + h(ni+1) 
 → {goal [300+0=300], n3 [400+50=450]} = c(Start → … → ni → ni+1) + h(ni+1) 
 We do find the optimal path as the heuristic is still = g(ni+1) + h(ni+1) 
 admissible. But we are mislead into ignoring n2 until = f(ni+1). after we expand n1. 13 13 14 14 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance Consequences of monotonicity Consequences of monotonicity Consequences of monotonicity Consequences of monotonicity 2. If n2 is expanded after n1, then f(n1) ≤ f(n2) When n is expanded every path with lower f-value 3. has already been expanded. Proof: Proof: Assume by contradiction that there exists a path  <Start, n0, n1, ni-1, ni, ni+1, …, nk> with f(nk) < f(n) and ni is its If n2 was on the frontier when n1 was expanded, ■ last expanded last expanded node. f(n1) ≤ f(n2) ● otherwise we would have expanded n2. Then ni+1 must be on the frontier while n is expanded:  a) by (1) f(ni+1) ≤ f(nk) since they lie along the same path. If n2 was added to the frontier after n1’s expansion, then let ■ b) since f(nk) < f(n) so we have f(ni+1) < f(n) n be an ancestor of n2 that was present when n1 was being expanded (this could be n1 itself). We have f(n1) ≤ f(n) since c) by (2) f(n) ≤ f(ni+1) since n is expanded before ni+1. A* chose n1 while n was present in the frontier. Also, since n * Contradiction from b&c! is along the path to n2, by property (1) we have f(n) ≤ f(n2). So, we have f(n1) ≤ f(n2). ● 15 15 16 16 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance • 4

  5. • 1/29/10 Consequences of monotonicity Consequences of monotonicity Consequences of monotonicity Consequences of monotonicity Complete. With a monotone heuristic, the first time A* ● 4. Yes, consider a least cost path to a goal node  expands a state, it has found the minimum cost SolutionPath = <Start → n1 → … → G> with cost ● path to that state. c(SolutionPath) ● Since each action has a cost ≥ ε > 0, there are only a finite ● number of nodes (paths) that have cost ≤ c(SolutionPath). Proof: All of these paths must be explored before any path of  ● cost > c(SolutionPath). * Let PATH1 = <Start, n0, n1, …, nk, n> be the first the first path So eventually SolutionPath, or some equal cost path to a ● to n found. We have f(path1) = c(PATH1) + h(n). goal must be expanded. Time and Space complexity. ● * Let PATH2 = <Start, m0,m1, …, mj, n> be another path When h(n) = 0, for all n to n found later. we have f(path2) = c(PATH2) + h(n).  h is monotone. ● A* becomes uniform-cost search!  * By property (3), f(path1) ≤ f(path2) 
 It can be shown that when h(n) > 0 for some n, the number of  nodes expanded can be no larger than uniform-cost. Hence the same bounds as uniform-cost apply. (These are  * hence: c(PATH1) ≤ c(PATH2) worst case bounds). 17 17 18 18 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance Consequences of monotonicity Consequences of monotonicity Search generated by monotonicity Search generated by monotonicity ● Optimality Yes, by (4) the first path to a goal node must  be optimal. ● Cycle Checking If we do cycle checking (e.g. using GraphSearch  instead of TreeSearch) it is still optimal. Because by property (4) we need keep only the first path to a node, rejecting all subsequent paths. 19 19 20 20 CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance CSE 3402 Winter 2010 Fahiem Bacchus & Yves Lesperance • 5

Recommend


More recommend