Informed Search I (Beginning of AIMA Chapter 4.1)

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Lights Out Issues Questions? Comment from me.
Informed search algorithms
Informed Search Algorithms
Notes Dijstra’s Algorithm Corrected syllabus.
Informed search algorithms
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Solving Problem by Searching
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Problem Solving by Searching
Informed search.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution 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
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Pag.1 Artificial Intelligence Informed search algorithms Chapter 4, Sections 1-5.
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Informed search algorithms
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
Informed search algorithms
2013/10/17 Informed search A* algorithm. Outline 2 Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
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.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
CS 380: Artificial Intelligence Lecture #4 William Regli.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
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.
Princess Nora University Artificial Intelligence Chapter (4) Informed search algorithms 1.
CSC3203: AI for Games Informed search (1) Patrick Olivier
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.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
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:
Pengantar Kecerdasan Buatan 4 - Informed Search and Exploration AIMA Ch. 3.5 – 3.6.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Heuristic Search Foundations of Artificial Intelligence.
Introduction to Artificial Intelligence (G51IAI)
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Informed Search 1.
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.
Search Methodologies Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Romania with step costs in km
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
Heuristic Search Introduction to Artificial Intelligence
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*
Informed Search II.
CS 4100 Artificial Intelligence
COMP 8620 Advanced Topics in AI
Informed search algorithms
Informed search algorithms
Artificial Intelligence
Artificial Intelligence
Informed Search.
Presentation transcript:

Informed Search I (Beginning of AIMA Chapter 4.1) CIS 391 Fall 2008

Today!! Outline A* - Optimal Search using Knowledge PART I Informed = use problem-specific knowledge Best-first search and its variants A* - Optimal Search using Knowledge Proof of Optimality of A* A* for maneuvering AI agents in games Heuristic functions? How to invent them PART II Local search and optimization Hill climbing, local beam search, genetic algorithms,… Local search in continuous spaces Online search agents Today!! CIS 391 - Intro to AI

Breadth First Search for Games, Robots, … Pink: Starting Point Blue: Goal Teal: Scanned squares Darker: Closer to starting point… Graphics from http://theory.stanford.edu/~amitp/GameProgramming/ (A great site for practical AI & game Programming CIS 391 - Intro to AI

An optimal informed search algorithm We add a heuristic estimate of distance to the goal Yellow: examined nodes with high estimated distance Blue: examined nodes with low estimated distance CIS 391 - Intro to AI

Breadth first in a world with obstacles CIS 391 - Intro to AI

Informed search in a world with obstacles CIS 391 - Intro to AI

Is Uniform Cost Search the best we can do Is Uniform Cost Search the best we can do? Consider finding a route from Bucharest to Arad.. Arad 118 CIS 391 - Intro to AI

A Better Idea… Node expansion based on some estimate of distance to the goal, extending current path General approach of informed search: Best-first search: node is selected for expansion based on an evaluation function f(n) Implementation: Sort fringe queue in decreasing order of desirability. Special cases: greedy search, A* search CIS 391 - Intro to AI

Romania with city-to-city distances & straight-line distances in km Arad 118 Romania with city-to-city distances & straight-line distances in km CIS 391 - Intro to AI

A heuristic function Let evaluation function f(n) = h(n) (heuristic) h(n) = estimated cost of the cheapest path from node n to goal node. If n is goal then h(n)=0 Here: hSLD(n) = straight-line distance from n to Bucharest [dictionary]“A rule of thumb, simplification, or educated guess that reduces or limits the search for solutions in domains that are difficult and poorly understood.” Heuristic knowledge is useful, but not necessarily correct. Heuristic algorithms use heuristic knowledge to solve a problem. A heuristic function here takes a state and returns an estimate of the distance to the goal. Heureka! ---Archimedes CIS 391 - Intro to AI

Greedy best-first search (BFS) Expands the node that appears to be closest to goal Expands nodes based on f(n) = h(n) (Again, h(n)): Some heuristic estimate of cost from n to goal) Ignores cost so far to get to that node (g(n)) Here, h(n) = hSLD(n) = straight-line distance from n to Bucharest CIS 391 - Intro to AI

Greedy best-first search example Open queue: Arad Initial State = Arad Goal State = Bucharest CIS 391 - Intro to AI

Greedy best-first search example Open queue: Sibiu Timisoara Zerind CIS 391 - Intro to AI

Greedy best-first search example Open queue: Fararas Rimnicu Vilcea Timisoara Arad Zerind Oradea CIS 391 - Intro to AI

Greedy best-first search example Open queue: Bucharest Rimnicu Vilcea Timisoara Sibiu Arad Zerind Oradea Goal reached !! CIS 391 - Intro to AI

Properties of greedy best-first search Optimal? No! Found: Arad  Sibiu  Fagaras  Bucharest (450km) Shorter: Arad  Sibiu  Rimnicu Vilcea  Pitesti Bucharest (418km) Arad 118 CIS 391 - Intro to AI

Properties of greedy best-first search Complete? No – can get stuck in loops, e.g., Iasi  Neamt  Iasi  Neamt … Initial Goal CIS 391 - Intro to AI

Properties of greedy best-first search Complete? No – can get stuck in loops, e.g., Iasi  Neamt  Iasi  Neamt  Time? O(bm) – worst case (like Depth First Search) But a good heuristic can give dramatic improvement Space? O(bm) – keeps all nodes in memory Optimal? No CIS 391 - Intro to AI

A* search Implementation: Expand the node n with minimum f(n) Best-known form of best-first search. Key Idea: avoid expanding paths that are already expensive. Evaluation function f(n)=g(n) + h(n) g(n) the cost (so far) to reach the node h(n) estimated cost to get from the node to the goal f(n) estimated total cost of path through n to goal Implementation: Expand the node n with minimum f(n) CIS 391 - Intro to AI

Admissible heuristics h(n) must be an admissible heuristic A heuristic is admissible if it never overestimates the cost to reach the goal; i.e. it is optimistic Formally: n, where n is a node: h(n)  h*(n) where h*(n) is the true cost from n h(n)  0 so h(G)=0 for any goal G. Example: hSLD(n) never overestimates the actual road distance Theorem: If h(n) is admissible, A* using Tree Search is optimal CIS 391 - Intro to AI

A* search example Open queue: Arad We start with our initial state Arad. We make a node and add it to the open queue. Since it’s the only thing on the open queue, we expand the node. Implementation: The open queue is just a priority queue (or heap) that sorts the nodes inside of it according to their g()+h() score. CIS 391 - Intro to AI

A* search example We add the three nodes we found to the open queue. Sibiu Timisoara Zerind We add the three nodes we found to the open queue. We sort them according to the g()+h() calculation. CIS 391 - Intro to AI

A* search example Open queue: Rimricu Vicea Fagaras Timisoara Zerind Arad Oradea When we expand Sibiu, we run into Arad again. Note that we’ve already expanded this node once; but we still add it to the open queue again. CIS 391 - Intro to AI

A* search example Open queue: Rimricu Vicea Fagaras Timisoara Zerind Arad Oradea We see that Rimricu Vicea is at the top of the open queue; so, it’s the next node we will expand. CIS 391 - Intro to AI

A* search example We expand Rimricu Vicea. Open queue: Fagaras Pitesti Timisoara Zerind Craiova Sibiu Arad Oradea We expand Rimricu Vicea. CIS 391 - Intro to AI

A* search example Open queue: Fagaras Pitesti Timisoara Zerind Craiova Sibiu Arad Oradea Fagaras will be the next node we should expand – it’s at the top of the sorted open queue. CIS 391 - Intro to AI

A* search example Open queue: Pitesti Timisoara Zerind Bucharest Craiova Sibiu Arad Oradea When we expand Fagaras, we find Bucharest, but we’re not done. The algorithm doesn’t end until we “expand” the goal node – it has to be at the top of the open queue. CIS 391 - Intro to AI

A* search example Open queue: Pitesti Timisoara Zerind Bucharest Craiova Sibiu Arad Oradea It looks like Pitesti is the next node we should expand. CIS 391 - Intro to AI

A* search example Open queue: Bucharest Timisoara Zerind Craiova Rimricu Vicea Sibiu Arad Oradea Note that we just found a better value for Bucharest! We also found a worse value for Craiova. CIS 391 - Intro to AI

A* search example Open queue: Bucharest Timisoara Zerind Craiova Rimricu Vicea Sibiu Arad Oradea Now it looks like Bucharest is at the top of the open queue… CIS 391 - Intro to AI

A* search example Now we “expand” the node for Bucharest. Open queue: Bucharest Timisoara Zerind Craiova Rimricu Vicea Sibiu Arad Oradea Now we “expand” the node for Bucharest. We’re done! (And we know the path that we’ve found is optimal.) CIS 391 - Intro to AI