Heuristic Search. CPSC 470/570 Artificial Intelligence Brian Scassellati

Similar documents
A.I.: Informed Search Algorithms. Chapter III: Part Deux

Problem Solving and Search

Solving problems by searching

Heuristic (Informed) Search

Informed Search Algorithms

3 SOLVING PROBLEMS BY SEARCHING

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Informed Search Methods

Artificial Intelligence

Ar#ficial)Intelligence!!

Problem Solving & Heuristic Search

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

Informed/Heuristic Search

Artificial Intelligence

Informed Search and Exploration

Today s s lecture. Lecture 3: Search - 2. Problem Solving by Search. Agent vs. Conventional AI View. Victor R. Lesser. CMPSCI 683 Fall 2004

Informed search algorithms. Chapter 4

CS 771 Artificial Intelligence. Informed Search

S A E RC R H C I H NG N G IN N S T S A T T A E E G R G A R PH P S

Informed search methods

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Artificial Intelligence. Sina Institute, University of Birzeit

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

Solving Problem by Searching. Chapter 3

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Lecture 4: Informed/Heuristic Search

Chapter 3: Informed Search and Exploration. Dr. Daisy Tang

Solving Problems by Searching

Informed search algorithms

Dr. Mustafa Jarrar. Chapter 4 Informed Searching. Sina Institute, University of Birzeit

Searching with Partial Information

Lecture 2: Fun with Search. Rachel Greenstadt CS 510, October 5, 2017

Informed search algorithms. Chapter 4

Informed Search and Exploration

ARTIFICIAL INTELLIGENCE. Informed search

Solving Problems by Searching

Solving problems by searching

Solving problems by searching

Artificial Intelligence

mywbut.com Informed Search Strategies-I

CS 380: Artificial Intelligence Lecture #4

Solving problems by searching

Outline. Best-first search

CS 380: Artificial Intelligence Lecture #3

Informed search. Soleymani. CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2016

Chapter 2. Blind Search 8/19/2017

Artificial Intelligence

Informed Search and Exploration for Agents

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

Informed Search and Exploration

Solving problems by searching

Outline. Best-first search

Outline. Solving problems by searching. Problem-solving agents. Example: Romania

Class Overview. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 2. Problem Solving Agents. Problem Solving Agents: Assumptions

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

CS 520: Introduction to Artificial Intelligence. Lectures on Search

AI: Week 2. Tom Henderson. Fall 2014 CS 5300

CS:4420 Artificial Intelligence

Artificial Intelligence

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel

Chapter 3: Solving Problems by Searching

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

Informed search strategies (Section ) Source: Fotolia

Chapter 3 Solving problems by searching

Informed search methods

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Dan Klein, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

ITCS 6150 Intelligent Systems. Lecture 5 Informed Searches

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

Efficient memory-bounded search methods

4. Solving Problems by Searching

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

Informed Search and Exploration

Last time: Problem-Solving

Problem Solving as Search. CMPSCI 383 September 15, 2011

Heuris'c Search. Reading note: Chapter 4 covers heuristic search.

CS 8520: Artificial Intelligence

Informed search algorithms. Chapter 4, Sections 1 2 1

Ar#ficial)Intelligence!!

DFS. Depth-limited Search

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday

Search : Lecture 2. September 9, 2003

COMP9414: Artificial Intelligence Informed Search

Uninformed Search. Problem-solving agents. Tree search algorithms. Single-State Problems

CPS 170: Artificial Intelligence Search

Artificial Intelligence p.1/49. n-queens. Artificial Intelligence p.2/49. Initial state: the empty board or a board with n random

ARTIFICIAL INTELLIGENCE (CSC9YE ) LECTURES 2 AND 3: PROBLEM SOLVING

Solving problems by searching

Artificial Intelligence

COMP9414: Artificial Intelligence Informed Search

Lecture 5 Heuristics. Last Time: A* Search

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km

Artificial Intelligence

Search Algorithms. Uninformed Blind search. Informed Heuristic search. Important concepts:

Set 2: State-spaces and Uninformed Search. ICS 271 Fall 2015 Kalev Kask

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4

Heuristic (Informed) Search

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Informed search algorithms

Problem solving and search

Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013

Transcription:

Heuristic Search CPSC 470/570 Artificial Intelligence Brian Scassellati

Goal Formulation 200 Denver 300 200 200 Chicago 150 200 Boston 50 1200 210 75 320 255 Key West New York Well-defined function that identifies both the goal states and the conditions under which to achieve the goal Fly from Boston to Quality might depend on Least amount of money Fewest number of transfers Shortest amount of time in the air Shortest amount of time in airports

Problem Formulation Well-defined problems Fully observable Deterministic Discrete set of possible actions (operations) State space: the set of all states that are reachable from an initial state by any sequence of actions Path: sequence of actions leading from one state to another

Problem Formulation Goal: spend less $ State space: flights and their costs Path: sequence of flights Picking the right level of abstraction 200 Denver 300 200 200 1200 Chicago 150 200 210 320 Boston 50 New York 75 Fly from Boston to Chicago Directions to the airport Move left leg 18 inches forward 255 Key West

How to Search: Generating Sequences and Data Structures Depth 0 Boston 1 Chicago New York Key West 2 Denver 3 200 Denver 300 200 200 1200 Chicago 150 200 210 320 Boston 50 New York 75 4 5 255 Key West Branching Factor b=3

Measuring Performance Completeness: is the strategy guaranteed to find a solution when one exists? Time Complexity: how long does it take to find a solution? Space Complexity: how much memory does it require to perform the search? Optimality: Does the strategy find the bestquality solution when more than one solution exists?

Types of Blind Search Breadth-First Search Depth-First Search Depth Limited Search Iterative Deepening Search Bi-directional Search

Improving Blind Search: Avoiding Repeated States Boston Chicago New York Key West Denver Simple caching could be used to store the expected values of sub-trees. Must maintain a table of all visited states and the result Change the rules for generating the tree Do not generate repeated states Do not generate paths with cycles

Heuristic Functions These techniques are all still brute-force Can we do anything more intelligent? If we could identify an evaluation function, which described how valuable each state was in obtaining the goal, then we could simply always choose to expand the leaf node with the best value. A heuristic function is an inexact estimate of the evaluation function. 3 4 4 2 5 6 1 0 2 9 3 5 1 3 5 0

Greedy Best-First Search 658 Chicago Boston 856 Chicago 1863 945 1447 1371 752 870 853 1057 Key West Boston Key West Rely on a heuristic function to determine which node to expand Better name is bestguess-first search Airline example Find the shortest path from Boston to

Greedy Best-First-Search 658 1863 1447 870 Boston 856 Chicago 945 1371 752 853 1057 Key West Minimize estimated cost to reach a goal (in this case, the distance to ) Boston h=2299 Straight Line Distance to Boston 2299 Chicago 1447 1444 Key West 1927 870 658 h=658 h=0 3377 Chicago h=1447 h=0 2303 Total Distance Flown h=1444 h=870 h=0 2567 h=1444 h=870 h=0 3846 Key West h=1927 h=870 h=0 3298

Greedy Best-First-Search Optimal? No, as the previous example demonstrated Complete? No, just as depth first search Worst-case time complexity? O(b m ) where b=branch factor, m=max. depth Worst-case space complexity? Same as time complexity entire tree kept in memory Actual time/space complexity Depends on the quality of the heuristic function

A* Search 658 1863 1447 870 Chicago 752 853 1057 Key West Boston 856 945 1371 Combine Greedy search with Uniform Cost Search Minimize the total path cost (f) = actual path so far (g) + estimate of future path to goal (h) Boston f=0+2299 f=2299 Distance to Boston 2299 Chicago 1447 1444 Key West 1927 870 658 f=(856+1863)+658 f=3377 3377 Chicago f=856+1447 f=2303 f=(856+1447)+0 f=2303 2303 Total Distance Flown f=945+1444 f=2389 2567 Key West f=1371+1927 f=3298 3846 3298

How does A* Search Work? The heuristic function h must be admissible It must never over-estimate the cost to reach the goal Most obvious heuristics are monotonic If the total path cost is non-monotonic as you move down the tree, you can substitute a monotonic function based on the parent Allows the above contour interpretation

Proving the Optimality of A* Unexpanded node on the path to G Optimal goal state (cost f*) Sub-optimal goal state (cost > f*) Assume that G 2 has been chosen for expansion over n Because h is admissible f* f(n) If n is not chosen for expansion over G 2, we must have f(n) f(g 2 ) Combining these, we get f* f(g 2 ) However, this violates our assertion that G 2 is sub-optimal Therefore, A* never selects a sub-optimal goal for expansion

Completeness of A* A* expands nodes in order of increasing f When would a solution not be found? Node with an infinite branching factor A path with a finite path cost but an infinite number of nodes A* is complete when There is a finite branching factor Every operator costs at least some positive ε

Complexity of A* Computation time is limited by the quality of the heuristic function (but is still exponential) Issue #1 : Choosing the right heuristic function can have a large impact More serious problem is that all generated nodes need to be kept in memory Issue #2 : Can we limit the memory requirements?

Issue #1: Choosing a Heuristic Functions Must be admissible (never over-estimate) Heuristics for the 8-Puzzle h1 = number of tiles in the wrong position h2 = sum of the distances of the tiles from their goal positions (city block distance)

Effect of Heuristic Accuracy on Performance in the 8-puzzle Compare iterative-deepening with A* using h1 (# misplaced tiles) and h2 (city block distance) Effective branching factor b* Number of expanded nodes = 1 + b* + (b*) 2 + + (b*) depth b* remains relatively constant across many measurements Always better to use a heuristic with higher values, so long as it does not over-estimate

Issue #2 Limiting Memory Utilization If we can maintain a bound on the memory, we might be willing to wait for a solution Two techniques for Memory Bounded Search: Iterative deepening A* (IDA*) Recursive Best-First-Search (RBFS)

Iterative Deepening A* Search (IDA*) Each iteration is a depth-first search with a limit based on f rather than on depth Complete and optimal (with same caveats as A*) Requires space proportional to the longest path that it explores Can have competitive time complexity, since the overhead of maintaining the nodes in memory is greatly reduced

Problems with IDA* In the TSP, different heuristic function value for each state Each contour contains only one additional node If A* expands N nodes, the IDA* will expand 1+2+3+4+ +N = O(N 2 ) nodes If N is too large for memory, N 2 is too long to wait Runs into problems because it recalculates every node

Recursive Best-First Search (RBFS) A 10 A 10 20 12 B 20 C 29 D 12 B 20 C 29 D 26 E F 14 G 16 26 E 16 F 14 18 G 16 18 H 30 I 17 J K 33 18 H 30 I 17 J K 33 total path cost (f) = actual path so far (g) + heuristic estimate of future path to goal (h) Red values best f-value in an alternate branch

Recursive Best-First Search (RBFS) RBFS will be complete given sufficient memory to store the shallowest solution path be optimal if the heuristic function is admissible (and you have enough memory to store the solution) Both RBFS and IDA* use not enough memory. Require at most linear space with the depth of the tree