Artificial Intelligence

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

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

Informed Search and Exploration for Agents

Informed search algorithms. Chapter 4

Outline. Best-first search

Outline. Best-first search

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

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

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

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

Artificial Intelligence

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

CS:4420 Artificial Intelligence

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

ARTIFICIAL INTELLIGENCE. Informed search

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

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

CS 380: Artificial Intelligence Lecture #4

Informed/Heuristic Search

Introduction to Artificial Intelligence. Informed Search

Problem Solving and Search

Informed search algorithms. Chapter 4, Sections 1 2 1

Artificial Intelligence

Lecture 4: Informed/Heuristic Search

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

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies

Informed search algorithms

CS 771 Artificial Intelligence. Informed Search

Solving problems by searching

Artificial Intelligence. Informed search methods

Informed search algorithms

Artificial Intelligence Informed search. Peter Antal

Artificial Intelligence

Informed search strategies (Section ) Source: Fotolia

Outline for today s lecture. Informed Search. Informed Search II. Review: Properties of greedy best-first search. Review: Greedy best-first search:

Informed Search and Exploration

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

Informed Search Methods

Last time: Problem-Solving

Informed Search and Exploration

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

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

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

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

2006/2007 Intelligent Systems 1. Intelligent Systems. Prof. dr. Paul De Bra Technische Universiteit Eindhoven

Problem solving and search

Problem Solving & Heuristic Search

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 331: Artificial Intelligence Informed Search. Informed Search

CS 331: Artificial Intelligence Informed Search. Informed Search

Informed Search and Exploration

Informed Search. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli Page 1

mywbut.com Informed Search Strategies-I

Informed Search Algorithms

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

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

Informed Search A* Algorithm

Planning, Execution & Learning 1. Heuristic Search Planning

Artificial Intelligence: Search Part 2: Heuristic search

DFS. Depth-limited Search

Robot Programming with Lisp

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

Outline for today s lecture. Informed Search I. One issue: How to search backwards? Very briefly: Bidirectional search. Outline for today s lecture

Informed search algorithms. (Based on slides by Oren Etzioni, Stuart Russell)

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

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

TDT4136 Logic and Reasoning Systems

Artificial Intelligence

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Informed search algorithms

Informed Search and Exploration

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

Problem Solving: Informed Search

Informed search algorithms

Downloaded from ioenotes.edu.np

Chapter4. Tree Search (Reviewed, Fig. 3.9) Best-First Search. Search Strategies. Best-First Search (cont.-2) Best-First Search (cont.

Informed search methods

Solving problems by searching

Solving problems by searching

Informed Search and Exploration

Solving Problems: Intelligent Search

TDDC17. Intuitions behind heuristic search. Recall Uniform-Cost Search. Best-First Search. f(n) =... + h(n) g(n) = cost of path from root node to n

Informed Search Algorithms. Chapter 4

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria

Problem solving and search

Artificial Intelligence Informed search. Peter Antal Tadeusz Dobrowiecki

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

Informed search methods

Search : Lecture 2. September 9, 2003

CPS 170: Artificial Intelligence Search

CS 4700: Foundations of Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

Informed Search CS457 David Kauchak Fall 2011

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

Informed search algorithms

Informed search algorithms

Artificial Intelligence

TDDC17. Intuitions behind heuristic search. Best-First Search. Recall Uniform-Cost Search. f(n) =... + h(n) g(n) = cost of path from root node to n

Lecture 5 Heuristics. Last Time: A* Search

Transcription:

Artificial Intelligence Informed Search and Exploration Chapter 4 (4.1 4.2) A General Search algorithm: Chapter 3: Search Strategies Task : Find a sequence of actions leading from the initial state to a goal state 1. Initialize the search tree with the initial state. 2. Report failure if search tree is empty 3. Move to a leaf node according to a strategy 4. Ready if a goal state. 5. Expand the current state by generating successors to the current state. Add them to the search tree as leaves. 6. Repeat from 2. Chapter 3: Search Strategies Uninformed search: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first Depth-limited Iterative deepening Chapter 4: Informed Search and Exploration Informed search: Use heuristics to guide the search Best first search Greedy search A* search Local search and Optimization: Hill-climbing Simulated annealing Genetic algorithm Informed Search Searching in Large Problems We talked about building goal-based agents using search strategies But the strategies we discussed were uninformed because the agent is given nothing more than the problem definition Now informed search strategies Some search spaces of problems are too large to search efficiently using uninformed methods Sometimes we have additional domain knowledge about the problem that we can use to inform the agent that is searching Often there is extra knowledge that can be used to guide the search: To do this, we use heuristics (informed guesses) Heuristic means serving to aid discovery 1

Best-First Search (BeFS) The General search algorithm can handle an evaluation function that controls which leaf node to expand This function returns a number describing the desirability of expanding the node A Best-first search uses the following strategy to select next leaf node: Move to the node with best value of the evaluation function Best-First Search Best-first search is a generic informed search strategy that uses an evaluation function f(n), incorporating some kind of domain knowledge The leaf nodes are normally collected in a queue for reasons of efficiency The queue is kept ordered according to the value on the evaluation function f(n) is used to sort states in the open list using a priority queue (like UCS) Best-First (??) Search Best-First Search General Search algorithm: 1. Set N to be a sorted list of initial nodes. 2. If N is empty, then exit and signal failure. 3. Set n to be the first node in N, and remove n from N. 4. If n is a goal node, then exit and signal success. 5. Otherwise, add the children of n to N, sort the nodes in N according to the value on their evaluation function, and return to step 2. Special cases: Greedy search A* search Heuristic Searching Heuristic Searching We define a heuristic function h(n): Is computed from the state at node n Uses domain-specific information in some way Heuristics can estimate the goodness of a particular node (or state) n: How close is n to a goal node? What might be the minimal cost path from n to a goal node? We will formalize a heuristic function h(n) as follows: h(n) 0 for all nodes n h(n) = 0 implies that n is a goal node h(n) = implies that n is a dead end from which a goal cannot be reached 2

Greedy Search Greedy Search Greedy search is the best-first search strategy, with a simple evaluation function of f(n) = h(n) Estimation function: h(n) = estimate of cost from n to goal (heuristic) It relies only on the heuristic to select what is currently believed to be closest to the goal state Greedy search minimizes the estimated cost to the goal Incomplete: can start down an infinite path and never return. Not optimal: minimizes cost one step ahead only For example: h SLD (n) = straight-line distance from n to Bucharest Greedy search expands first the node that appears to be closest to the goal, according to h(n) Romania with h SLD in km Greedy Search Example Greedy Search Example Greedy Search Example 3

Greedy Search Example Greedy Search Example Minimal? Optimal? Minimal? Yes Optimal? No Romania with h SLD in km Greedy Search Issues Greedy Search is generally faster than the uninformed methods It has more knowledge about the problem domain! Resembles DFS in that it tends to follow a path that is initially good, and Properties of Greedy Search A* Search Complete? Time? No can get stuck in loops e.g., Iasi > Neamt > Iasi > Neamt > Complete in finite space with repeated- state checking O(b m ) but a good heuristic can give dramatic improvement Idea: avoid expanding paths that are already expensive Uniform-cost search, minimize the cost of the path so far, g(n), it is optimal and complete, but can be very inefficient We combine Uniform-cost search and Greedy search to get the advantages of both Space? O(b m ) keeps all nodes in memory Optimal? No (a better solution could exist through an expensive node) Evaluation function: f(n) = g(n) + h(n) with: g(n) cost so far to reach n h(n) estimated cost to goal from n f(n) estimated cheapest total cost of path through n to goal 4

Heuristic Functions Admissible Heuristics Heuristic functions are good for helping us find good solutions quickly But it is difficult to design accurate heuristics! They can be expensive to compute They can make errors estimating the costs These problems keep informed searches like the A* search from being complete and optimal There is hope! We can add a constraint on our heuristic function h(n) is called a admissible if it never overestimates the cost to the goal from node n A* search uses an admissible heuristic, that is, h(n) h*(n) where h*(n) is the true cost to the goal from n For example: h SLD (n) never overestimates actual road distance Theorem: A* search is optimal A* Search Algorithm A* Search Algorithm The leaf nodes are normally collected in a queue The queue is kept sorted according to the value on the evaluation function f(n)=g(n)+h(n) Order the nodes in the fringe in increasing values of f(n) 1. Set N to be the start node. 2. If N is empty, then exit and signal failure. 3. Set n to be the first node in N, and remove n from N. 4. If n is a goal node, then exit and signal success. 5. Otherwise, add the children of n to N, sort the nodes in N according to the value on their f(n), and return to step 2. Properties of A* Search Properties of A* Search When we conduct an A search using an admissible heuristic, it is called A* search Complete? Yes, unless infinitely many nodes with f f(g) A* search is complete if The branching factor is finite Every action has a fixed cost A* search is optimal provided that h(n) never overestimates the cost to reach the goal Very good search method, but with complexity problems Time? Space? Optimal? Exponential in [(relative error in h) x (length of solution)] Keeps all nodes in memory Yes cannot expand f i+1 until f i is finished 5

Romania with Step Costs in km A* Search Example A* Search Example A* Search Example A* Search Example A* Search Example 6

A* Search Example Optimality of A* (standard proof) Suppose some suboptimal goal G 2 has been generated and is in the queue. Let n be an unexpanded node on a shortest path to an optimal goal G 1. Memory Bounded Search Devising Heuristics Iterative Deepening A* (IDA*) Simplified Memory Bounded A* (SMA*) Often done by relaxing the problem See AIMA2e for more details The goal of admissible heuristics is to get as close as possible to the actual cost without going over Trade-off: A really good h(n) might be expensive to compute Could we find the solution faster with a simpler one? Devising Heuristics Devising Heuristics If h(n) = h*(n) for all n: Only nodes on optimal solution are searched No unnecessary work We know the actual cost from n to goal If h(n) = 0 for all n: Heuristic is still admissible A* is identical to UCS If h 1 (n) h 2 (n) h*(n) for each non-goal node n: We say h 2 dominates h 1 h 2 is closer to actual cost, but is still admissible A* using h 1 (i.e. A 1 *) expands at least as many, if not more nodes than A 2 * A 2 * is said to be better informed than A 1 * The closer h is to h*, the fewer nodes will need to be expanded; the more accurate the search will be 7

Devising Heuristics If h 1 (n) h 2 (n) h*(n) for each non-goal node n: We say h 2 dominates h 1 h 2 is closer to actual cost, but is still admissible A* using h 1 (i.e. A 1 *) expands at least as many, if not more nodes than A 2 * A 2 * is said to be better informed than A 1 * Exemple: 8-puzzle!! When to Use Search Techniques? The search space is small, and There is 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 Summary Summary Heuristic function Greedy search Admissible heuristic and A* IDA* SMA* Devising Heuristic A* is complete and optimal Summary Best-first search = general search, where the minimum-cost nodes (according to some measure) are expanded first Greedy search = best-first with the estimated cost to reach the goal as a heuristic measure - Generally faster than uninformed search - not optimal -not complete A* search = best-first with measure = path cost so far + estimated path cost to goal - combines advantages of uniform-cost and greedy searches - complete, optimal and optimally efficient - space complexity still exponential Next Time! Iterative improvement Hill climbing Simulated annealing Genetic Algorithm 8