G5AIAI Introduction to AI Graham Kendall Heuristic Searches.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
Informed search strategies
Informed search algorithms
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
Solving Problem by Searching
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Problem Solving by Searching
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
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.
Artificial Intelligence
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
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.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Informed Search Include specific knowledge to efficiently conduct the search and find the solution.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
CSC3203: AI for Games Informed search (1) Patrick Olivier
Informed Search I (Beginning of AIMA Chapter 4.1)
Artificial Intelligence Problem solving by searching.
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Introduction to Artificial Intelligence (G51IAI)
Heuristic Functions. A Heuristic is a function that, when applied to a state, returns a number that is an estimate of the merit of the state, with respect.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chap 4: Searching Techniques Artificial Intelligence Dr.Hassan Al-Tarawneh.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Department of Computer Science
Heuristic Search Introduction to Artificial Intelligence
Artificial Intelligence Problem solving by searching CSC 361
Chap 4: Searching Techniques Artificial Intelligence Dr.Hassan Al-Tarawneh.
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
EA C461 – Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
Informed search algorithms
Chap 4: Searching Techniques
Artificial Intelligence
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Presentation transcript:

G5AIAI Introduction to AI Graham Kendall Heuristic Searches

G5AIAI Heuristic Searches Heuristic Searches - Characteristics Has some domain knowledge Usually more efficient than blind searches Sometimes called an informed search Heuristic searches work by deciding which is the next best node to expand (there is no guarantee that it is the best node)

G5AIAI Heuristic Searches Heuristic Searches - Characteristics Heuristic searches estimate the cost to the goal from its current position. It is usual to denote the heuristic evaluation function by h(n) Compare this with something like Uniform Cost Search which chooses the lowest code node thus far ( g(n) )

G5AIAI Heuristic Searches Heuristic Searches - Implementation - 1 Implementation is achieved by sorting the nodes based on the evaluation function; h(n)

G5AIAI Heuristic Searches Heuristic Searches - Implementation - 2 Function BEST-FIRST-SEARCH(problem, EVAL-FN) returns a solution sequence Inputs : problem, a problem Eval-Fn, an evaluation function Queueing-Fn = a function that orders nodes by EVAL- FN Return GENERAL-SEARCH(problem,Queueing-Fn)

G5AIAI Heuristic Searches Heuristic Searches - Example H sld (n) = straight line distance between n and the goal location

G5AIAI Heuristic Searches Heuristic Searches - Greedy Search So named as it takes the biggest “bite” it can out of the problem. That is, it seeks to minimise the estimated cost to the goal by expanding the node estimated to be closest to the goal state Function GREEDY-SEARCH(problem) returns a solution of failure Return BEST-FIRST-SEARCH(problem,h)

G5AIAI Heuristic Searches Heuristic Searches - Greedy Search It is only concerned with short term aims It is possible to get stuck in an infinite loop (consider being in Iasi and trying to get to Fagaras) unless you check for repeated states It is not optimal It is not complete Time and space complexity is O(B m ); where m is the depth of the search tree

G5AIAI Heuristic Searches Heuristic Searches - A* Algorithm Combines the cost so far and the estimated cost to the goal. That is fn = g(n) + h(n) This gives us an estimated cost of the cheapest solution through n It can be proved to be optimal and complete providing that the heuristic is admissible. That is the heuristic must never over estimate the cost to reach the goal But, the number of nodes that have to be searched still grows exponentially

G5AIAI Heuristic Searches Heuristic Searches - A* Algorithm Function A*-SEARCH(problem) returns a solution of failure Return BEST-FIRST-SEARCH(problem, g + h)

G5AIAI Heuristic Searches Heuristic Searches - A* Algorithm - Example

G5AIAI Heuristic Searches Heuristic Searches - Example Problem Initial StateGoal State

G5AIAI Heuristic Searches Heuristic Searches - A* Algorithm Typical solution is about twenty steps Branching factor is approximately three. Therefore a complete search would need to search 3 20 states. But by keeping track of repeated states we would only need to search 9! (362,880) states But even this is a lot (imagine having all these in memory) Our aim is to develop a heuristic that does not over estimate (it is admissible) so that we can use A* to find the optimal solution

G5AIAI Heuristic Searches Heuristic Searches - Possible Heuristics H 1 = the number of tiles that are in the wrong position (=7) H 2 = the sum of the distances of the tiles from their goal positions using the Manhattan Distance (=18) Both are admissible but which one is best?

G5AIAI Heuristic Searches Test from 100 runs with varying solution depths H 2 looks better as fewer nodes are expanded. But why?

G5AIAI Heuristic Searches Effective Branching Factor  H 2 has a lower branching factor and so fewer nodes are expanded  Therefore, one way to measure the quality of a heuristic is to find its average branching factor  H 2 has a lower EBF and is therefore the better heuristic

G5AIAI Introduction to AI Graham Kendall End of Heuristic Searches