Lecture 02 – Part B Problem Solving by Searching Search Methods :

Slides:



Advertisements
Similar presentations
EcoTherm Plus WGB-K 20 E 4,5 – 20 kW.
Advertisements

Números.
AGVISE Laboratories %Zone or Grid Samples – Northwood laboratory
EuroCondens SGB E.
Worksheets.
Slide 1Fig 26-CO, p.795. Slide 2Fig 26-1, p.796 Slide 3Fig 26-2, p.797.
Slide 1Fig 25-CO, p.762. Slide 2Fig 25-1, p.765 Slide 3Fig 25-2, p.765.
David Burdett May 11, 2004 Package Binding for WS CDL.
Create an Application Title 1Y - Youth Chapter 5.
Add Governors Discretionary (1G) Grants Chapter 6.
CALENDAR.
CHAPTER 18 The Ankle and Lower Leg
The 5S numbers game..
A Fractional Order (Proportional and Derivative) Motion Controller Design for A Class of Second-order Systems Center for Self-Organizing Intelligent.
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Break Time Remaining 10:00.
The basics for simulations
Heuristic Search Russell and Norvig: Chapter 4 Slides adapted from:
Chapter 4: Informed Heuristic Search
Lights Out Issues Questions? Comment from me.
Review: Search problem formulation
Heuristic Search. Best First Search A* Heuristic Search Heuristic search exploits additional knowledge about the problem that helps direct search to.
Informed Search Algorithms
Informed Search and Exploration
PP Test Review Sections 6-1 to 6-6
MM4A6c: Apply the law of sines and the law of cosines.
Regression with Panel Data
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Lecture 4: Informed/Heuristic Search
Informed search strategies
Informed Search Problems
Informed search algorithms
Progressive Aerobic Cardiovascular Endurance Run
Biology 2 Plant Kingdom Identification Test Review.
MaK_Full ahead loaded 1 Alarm Page Directory (F11)
Facebook Pages 101: Your Organization’s Foothold on the Social Web A Volunteer Leader Webinar Sponsored by CACO December 1, 2010 Andrew Gossen, Senior.
Artificial Intelligence
When you see… Find the zeros You think….
Before Between After.
Slide R - 1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Prentice Hall Active Learning Lecture Slides For use with Classroom Response.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Informed search algorithms This lecture topic Chapter Next lecture topic Chapter (Please read lecture topic material before and after each.
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Static Equilibrium; Elasticity and Fracture
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Resistência dos Materiais, 5ª ed.
Clock will move after 1 minute
Lial/Hungerford/Holcomb/Mullins: Mathematics with Applications 11e Finite Mathematics with Applications 11e Copyright ©2015 Pearson Education, Inc. All.
Select a time to count down from the clock above
1.step PMIT start + initial project data input Concept Concept.
9. Two Functions of Two Random Variables
1 Dr. Scott Schaefer Least Squares Curves, Rational Representations, Splines and Continuity.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
Schutzvermerk nach DIN 34 beachten 05/04/15 Seite 1 Training EPAM and CANopen Basic Solution: Password * * Level 1 Level 2 * Level 3 Password2 IP-Adr.
A* Search Introduction to AI. What is an A* Search? A greedy search method minimizes the cost to the goal by using an heuristic function, h(n). It works.
Problem Solving and Search in AI Heuristic Search
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Problem Solving by Searching Search Methods : informed (Heuristic) search.
Artificial Intelligence Problem solving by searching.
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Heuristic Search Foundations of Artificial Intelligence.
Artificial Intelligence (CS 370D)
Artificial Intelligence Problem solving by searching CSC 361
Presentation transcript:

Lecture 02 – Part B Problem Solving by Searching Search Methods : Lecture 02 – Part B Problem Solving by Searching Search Methods : Informed (Heuristic) search

Using problem specific knowledge to aid searching Without incorporating knowledge into searching, one can have no bias (i.e. a preference) on the search space. Without a bias, one is forced to look everywhere to find the answer. Hence, the complexity of uninformed search is intractable. Search everywhere!!

Using problem specific knowledge to aid searching With knowledge, one can search the state space as if he was given “hints” when exploring a maze. Heuristic information in search = Hints Leads to dramatic speed up in efficiency. A B C E D F G H I J K L O M N Search only in this subtree!!

More formally, why heuristic functions work? In any search problem where there are at most b choices at each node and a depth of d at the goal node, a naive search algorithm would have to, in the worst case, search around O(bd) nodes before finding a solution (Exponential Time Complexity). Heuristics improve the efficiency of search algorithms by reducing the effective branching factor from b to (ideally) a low constant b* such that 1 =< b* << b

Heuristic Functions A heuristic function is a function f(n) that gives an estimation on the “cost” of getting from node n to the goal state – so that the node with the least cost among all possible choices can be selected for expansion first. Three approaches to defining f: f measures the value of the current state (its “goodness”) f measures the estimated cost of getting to the goal from the current state: f(n) = h(n) where h(n) = an estimate of the cost to get from n to a goal f measures the estimated cost of getting to the goal state from the current state and the cost of the existing path to it. Often, in this case, we decompose f: f(n) = g(n) + h(n) where g(n) = the cost to get to n (from initial state)

Approach 1: f Measures the Value of the Current State Usually the case when solving optimization problems Finding a state such that the value of the metric f is optimized Often, in these cases, f could be a weighted sum of a set of component values: N-Queens Example: the number of queens under attack … Data mining Example: the “predictive-ness” (a.k.a. accuracy) of a rule discovered

Approach 2: f Measures the Cost to the Goal A state X would be better than a state Y if the estimated cost of getting from X to the goal is lower than that of Y – because X would be closer to the goal than Y 8–Puzzle h1: The number of misplaced tiles (squares with number). h2: The sum of the distances of the tiles from their goal positions.

Approach 3: f measures the total cost of the solution path (Admissible Heuristic Functions) A heuristic function f(n) = g(n) + h(n) is admissible if h(n) never overestimates the cost to reach the goal. Admissible heuristics are “optimistic”: “the cost is not that much …” However, g(n) is the exact cost to reach node n from the initial state. Therefore, f(n) never over-estimate the true cost to reach the goal state through node n. Theorem: A search is optimal if h(n) is admissible. I.e. The search using h(n) returns an optimal solution. Given h2(n) > h1(n) for all n, it’s always more efficient to use h2(n). h2 is more realistic than h1 (more informed), though both are optimistic.

Traditional informed search strategies Greedy Best First Search “Always chooses the successor node with the best f value” where f(n) = h(n) We choose the one that is nearest to the final state among all possible choices A* Search Best first search using an “admissible” heuristic function f that takes into account the current cost g Always returns the optimal solution path

Informed (Huristic) Search Strategies Greedy Best-FirstSearch eval-fn: f(n) = h(n)

An implementation of Best First Search function BEST-FIRST-SEARCH (problem, eval-fn) returns a solution sequence, or failure queuing-fn = a function that sorts nodes by eval-fn return GENERIC-SEARCH (problem,queuing-fn)

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Best First Search 99 211 G H 80 Start Goal 97 101 75 118 111 140 State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I f(n) = h (n) = straight-line distance heuristic

Greedy Best First Search State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I Start A

Greedy Search: Tree Search State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [329] C 140 E [253] From A, straight distance is 366 Among C, E, B -> E is nearer, so expand E

Greedy Search: Tree Search State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [329] C 140 E [253] 99 80 [193] G F [178] A [366]

Greedy Search: Tree Search State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [329] C 140 E [253] 99 80 [193] G F [178] A [366] 211 I [0] [253] E Goal

Greedy Search: Tree Search State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [329] C 140 E [253] 99 80 [193] G F [178] A [366] 211 I [0] [253] E Goal dist(A-E-F-I) = 140 + 99 + 211 = 450

Greedy Best First Search : Optimal ? Start State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F Not optimal 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic dist(A-E-G-H-I) =140+80+97+101=418 Goal

Greedy Best First Search : Optimal ? Start State Heuristic: h(n) A 366 B 374 ** C 250 D 244 E 253 F 178 G 193 H 98 I A 75 118 B C 140 111 E D 80 99 G F If for some reason, lets say straight distance from C is 250, then what happened? 97 H 211 101 I f(n) = h (n) = straight-line distance heuristic Goal

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [250] C 140 E [253]

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [250] C 140 E [253] 111 [244] D

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [250] C 140 E [253] 111 [244] D Infinite Branch ! [250] C

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [250] C 140 E [253] 111 [244] D Infinite Branch ! [250] C [244] D

Greedy Search: Tree Search State h(n) A 366 B 374 C 250 D 244 E 253 F 178 G 193 H 98 I Start A 75 118 B [374] [250] C 140 E [253] 111 [244] D Even not complete Infinite Branch ! [250] C [244] D

Greedy Search: Time and Space Complexity ? Start A 75 Greedy search is not optimal. Greedy search is incomplete without systematic checking of repeated states. In the worst case, the Time and Space Complexity of Greedy Search are both O(bm) Where b is the branching factor and m the maximum path length 118 B C 140 111 E D 80 99 G F 97 H 211 101 I Goal

Informed Search Strategies A* Search eval-fn: f(n)=g(n)+h(n)

A* (A Star) Greedy Search minimizes a heuristic h(n) which is an estimated cost from a node n to the goal state. However, although greedy search can considerably cut the search time (efficient), it is neither optimal nor complete. Uniform Cost Search minimizes the cost g(n) from the initial state to n. UCS is optimal and complete but not efficient. New Strategy: Combine Greedy Search and UCS to get an efficient algorithm which is complete and optimal.

A* (A Star) A* uses a heuristic function which combines g(n) and h(n) f(n) = g(n) + h(n) g(n) is the exact cost to reach node n from the initial state. Cost so far up to node n. h(n) is an estimation of the remaining cost to reach the goal.

A* (A Star) g(n) f(n) = g(n)+h(n) n h(n)

A* Search A B D C E F I 99 211 G H 80 Start Goal 97 101 75 118 111 140 State Heuristic: h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I f(n) = g(n) + h (n) g(n): is the exact cost to reach node n from the initial state.

A* Search: Tree Search Start A State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start

A* Search: Tree Search C[447] = 118 + 329 E[393] = 140 + 253 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] C[447] = 118 + 329 E[393] = 140 + 253 B[449] = 75 + 374 C[447] = 118 + 329 E[393] = 140 + 253 B[449] = 75 + 374

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413]

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413] 97 H [415]

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413] 97 H [415] 101 I Goal [418]

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413] 97 H I [415] [450] 101 I Goal [418]

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413] 97 H I [415] [450] 101 I Goal [418]

A* Search: Tree Search A Start 118 75 140 E [393] B [449] C [447] 80 State h(n) A 366 B 374 C 329 D 244 E 253 F 178 G 193 H 98 I A Start 118 75 140 E [393] B [449] C [447] 80 99 G F [417] [413] 97 H I [415] [450] 101 I Goal [418]

Conditions for optimality h(N) h(N’) c(N,N’) Conditions for optimality Admissibility An admissible heuristic never overestimates the cost to reach the goal Straight-line distance hSLD obviously is an admissible heuristic Admissibility / Monotonicity The admissible heuristic h is consistent (or satisfies the monotone restriction) if for every node N and every successor N’ of N: h(N)  c(N,N’) + h(N’) (triangular inequality) A consistent heuristic is admissible. A* is optimal if h is admissible or consistent

A* Algorithm A* with systematic checking for repeated states An Example: Map Searching

SLD Heuristic: h() Straight Line Distances to Bucharest Town SLD Arad 366 Bucharest Craiova 160 Dobreta 242 Eforie 161 Fagaras 178 Giurgiu 77 Hirsova 151 Iasi 226 Lugoj 244 Town SLD Mehadai 241 Neamt 234 Oradea 380 Pitesti 98 Rimnicu 193 Sibiu 253 Timisoara 329 Urziceni 80 Vaslui 199 Zerind 374 We can use straight line distances as an admissible heuristic as they will never overestimate the cost to the goal. This is because there is no shorter distance between two cities than the straight line distance. Press space to continue with the slideshow.

Distances Between Cities Arad Bucharest Oradea Zerind Faragas Neamt Iasi Vaslui Hirsova Eforie Urziceni Giurgui Pitesti Sibiu Dobreta Craiova Rimnicu Mehadia Timisoara Lugoj 87 92 142 86 98 211 101 90 99 151 71 75 140 118 111 70 120 138 146 97 80

Greedy Search in Action … Map Searching

Press space to see an Greedy search of the Romanian map featured in the previous slide. Note: Throughout the animation all nodes are labelled with f(n) = h(n). However,we will be using the abbreviations f, and h to make the notation simpler Once Arad is expanded we look for the node with the lowest cost. Sibiu has the lowest value for f. (The straight line distance from Sibiu to the goal state is 253 miles. This gives a total of 253 miles). Press space to move to this node and expand it. We begin with the initial state of Arad. The straight line distance from Arad to Bucharest (or h value) is 366 miles. This gives us a total value of ( f = h ) 366 miles. Press space to expand the initial state of Arad. We now expand Sibiu (that is, we expand the node with the lowest value of f ). Press space to continue the search. We now expand Fagaras (that is, we expand the node with the lowest value of f ). Press space to continue the search. Zerind Oradea F= 374 F= 374 F= 380 F= 380 F= 366 F= 366 Arad Fagaras Sibiu F= 178 F= 178 F= 253 F=253 Bucharest F= 193 F= 193 F= 329 F= 329 F= 0 Rimnicu Timisoara

A* in Action … Map Searching

Arad Bucharest(2) Bucharest Bucharest Bucharest Bucharest We now expand Fagaras (that is, we expand the node with the lowest value of f ). Press space to continue the search. In actual fact, the algorithm will not really recognise that we have found Bucharest. It just keeps expanding the lowest cost nodes (based on f ) until it finds a goal state AND it has the lowest value of f. So, we must now move to Fagaras and expand it. Press space to continue. Once Rimnicu is expanded we look for the node with the lowest cost. As you can see, Pitesti has the lowest value for f. (The cost to reach Pitesti from Arad is 317 miles, and the straight line distance from Pitesti to the goal state is 98 miles. This gives a total of 415 miles). Press space to move to this node and expand it. Once Arad is expanded we look for the node with the lowest cost. Sibiu has the lowest value for f. (The cost to reach Sibiu from Arad is 140 miles, and the straight line distance from Sibiu to the goal state is 253 miles. This gives a total of 393 miles). Press space to move to this node and expand it. Once Fagaras is expanded we look for the lowest cost node. As you can see, we now have two Bucharest nodes. One of these nodes ( Arad – Sibiu – Rimnicu – Pitesti – Bucharest ) has an f value of 418. The other node (Arad – Sibiu – Fagaras – Bucharest(2) ) has an f value of 450. We therefore move to the first Bucharest node and expand it. Press space to continue We have just expanded a node (Pitesti) that revealed Bucharest, but it has a cost of 418. If there is any other lower cost node (and in this case there is one cheaper node, Fagaras, with a cost of 417) then we need to expand it in case it leads to a better solution to Bucharest than the 418 solution we have already found. Press space to continue. We have now arrived at Bucharest. As this is the lowest cost node AND the goal state we can terminate the search. If you look back over the slides you will see that the solution returned by the A* search pattern ( Arad – Sibiu – Rimnicu – Pitesti – Bucharest ), is in fact the optimal solution. Press space to continue with the slideshow. We now expand Sibiu (that is, we expand the node with the lowest value of f ). Press space to continue the search. We now expand Pitesti (that is, we expand the node with the lowest value of f ). Press space to continue the search. We begin with the initial state of Arad. The cost of reaching Arad from Arad (or g value) is 0 miles. The straight line distance from Arad to Bucharest (or h value) is 366 miles. This gives us a total value of ( f = g + h ) 366 miles. Press space to expand the initial state of Arad. Press space to see an A* search of the Romanian map featured in the previous slide. Note: Throughout the animation all nodes are labelled with f(n) = g(n) + h(n). However,we will be using the abbreviations f, g and h to make the notation simpler We now expand Rimnicu (that is, we expand the node with the lowest value of f ). Press space to continue the search. Zerind Oradea F= 75 + 374 F= 449 F= 291 + 380 F= 671 F= 0 + 366 F= 366 Arad Fagaras Sibiu F= 239 + 178 F= 417 F= 140 + 253 F= 393 Bucharest(2) F= 220 + 193 F= 413 F= 118 + 329 F= 447 F= 450 + 0 F= 450 Rimnicu Timisoara Bucharest Bucharest Bucharest Bucharest F= 418 + 0 F= 418 Pitesti F= 317 + 98 F= 415 Craiova F= 366 + 160 F= 526

Informed Search Strategies Iterative Deepening A*

Iterative Deepening A*:IDA* Use f(N) = g(N) + h(N) with admissible and consistent h Each iteration is depth-first with cutoff on the value of f of expanded nodes

IDA* Algorithm In the first iteration, we determine a “f-cost limit” – cut-off value f(n0) = g(n0) + h(n0) = h(n0), where n0 is the start node. We expand nodes using the depth-first algorithm and backtrack whenever f(n) for an expanded node n exceeds the cut-off value. If this search does not succeed, determine the lowest f-value among the nodes that were visited but not expanded. Use this f-value as the new limit value – cut-off value and do another depth-first search. Repeat this procedure until a goal node is found.

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 Cutoff=4

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 4 6 Cutoff=4

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 4 5 6 Cutoff=4

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 5 4 6 4 5 6 Cutoff=4

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 6 5 4 4 6 5 6 Cutoff=4

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 Cutoff=5

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 4 6 Cutoff=5

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 4 5 6 Cutoff=5

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 6 4 5 6 Cutoff=5 7

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 5 6 4 5 6 7 Cutoff=5

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 5 5 6 4 5 6 7 Cutoff=5

8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles 4 5 5 6 4 5 6 7 Cutoff=5

The Effect of Heuristic Accuracy on Performance An Example: 8-puzzle Heuristic Evaluation The Effect of Heuristic Accuracy on Performance An Example: 8-puzzle

Admissible heuristics E.g., for the 8-puzzle: h1(n) = number of misplaced tiles h2(n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) h1(S) = ? h2(S) = ?

Admissible heuristics E.g., for the 8-puzzle: h1(n) = number of misplaced tiles h2(n) = total Manhattan distance (i.e., no. of squares from desired location of each tile) h1(S) = ? 8 h2(S) = ? 3+1+2+2+2+3+3+2 = 18

Dominance If h2(n) ≥ h1(n) for all n (both admissible) then h2 dominates h1 h2 is better for search Why? Typical search costs (average number of nodes expanded): d=12 IDS = 3,644,035 nodes A*(h1) = 227 nodes A*(h2) = 73 nodes d=24 IDS = too many nodes A*(h1) = 39,135 nodes A*(h2) = 1,641 nodes Self Study

When to Use Search Techniques The search space is small, and There are no other available techniques, or It is not worth the effort to develop a more efficient technique The search space is large, and There is no other available techniques, and There exist “good” heuristics

Conclusions Frustration with uninformed search led to the idea of using domain specific knowledge in a search so that one can intelligently explore only the relevant part of the search space that has a good chance of containing the goal state. These new techniques are called informed (heuristic) search strategies. Even though heuristics improve the performance of informed search algorithms, they are still time consuming especially for large size instances.

References Chapter 3 of “Artificial Intelligence: A modern approach” by Stuart Russell, Peter Norvig. Chapter 4 of “Artificial Intelligence Illuminated” by Ben Coppin