CS 416 Artificial Intelligence

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Review: Search problem formulation
Informed search algorithms
Artificial Intelligence Presentation
An Introduction to Artificial Intelligence
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
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*
Review: Search problem formulation
Artificial Intelligence
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2005.
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
ITCS 3153 Artificial Intelligence Lecture 5 Informed Searches Lecture 5 Informed Searches.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
Cooperating Intelligent Systems Informed search Chapter 4, AIMA 2 nd ed Chapter 3, AIMA 3 rd ed.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
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.
CS 416 Artificial Intelligence Lecture 5 Informed Searches Lecture 5 Informed Searches.
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.
Chapter 4 Informed/Heuristic Search
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.
Advanced Artificial Intelligence Lecture 2: Search.
CS 312: Algorithm Design & Analysis Lecture #37: A* (cont.); Admissible Heuristics Credit: adapted from slides by Stuart Russell of UC Berkeley. This work.
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.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
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.
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.
CS 416 Artificial Intelligence Lecture 4 Finish Uninformed Searches Begin Informed Searches Lecture 4 Finish Uninformed Searches Begin Informed Searches.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Lecture 3: Uninformed Search
Informed Search Methods
Review: Tree search Initialize the frontier using the starting state
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Informed Search Methods
Informed Search and Exploration
Artificial Intelligence (CS 370D)
Artificial Intelligence Problem solving by searching CSC 361
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*
Lecture 1B: Search.
CS 4100 Artificial Intelligence
Artificial Intelligence Informed Search Algorithms
EA C461 – Artificial Intelligence
Searching for Solutions
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Artificial Intelligence Chapter 9 Heuristic Search
CSE 473 University of Washington
Announcements This Friday Project 1 due Talk by Jeniya Tabassum
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
State-Space Searches.
State-Space Searches.
The Rich/Knight Implementation
HW 1: Warmup Missionaries and Cannibals
Solving Problems by Searching
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
The Rich/Knight Implementation
Presentation transcript:

CS 416 Artificial Intelligence Lecture 5 Informed Searches

Something to think about Compare space complexity of BFS and UCS Textbook lists BFS space complexity as O(bd+1) BFS pays a cost for expanding the children of a node when it is testing the node for goal status Textbook lists UCS space complexity as O(bd) when e = 1 UCS keeps a list of unexpanded nodes and only explores the shallowest node on that list But UCS is essentially BFS with the option of exploring the best node rather than just moving across a depth level Could you transform the BFS algorithm to be O(bd)?

Informed Searches We are informed (in some way) about future states and future paths We use this information to make better decisions about which of many potential paths to pursue

A* Search Combine two costs Expand node with minimum f(n) f(n) = g(n) + h(n) g(n) = cost to get to n from the root h(n) = cost to get to goal from n admissible heurisitic h(n) is optimistic f(n) never overestimates cost of a solution through n Expand node with minimum f(n)

What does amissible buy us? Repeated states do not present problem for Tree-Search Went through proof last class For every suboptimal goal, there is a node on the path towards the optimal goal that would be selected first

Repeated States and Graph-Search Graph-Search always ignores all but the first occurrence of a state during search Lower cost path may be tossed So, don’t throw away subsequent occurrences Or, ensure that the optimal path to any repeated state is always the first one followed Additional constraint on heurisitic, consistency

Consistent (monotonic) h(n) Heuristic function must be monotonic for every node, n, and successor, n’, obtained with action a estimated cost of reaching goal from n is no greater than cost of getting to n’ plus estimated cost of reaching goal from n’ h(n) <= c(n, a, n’) + h(n’) This implies f(n) along any path are nondecreasing

Examples of consistent h(n) h(n) <= c(n, a, n’) + h(n’) recall h(n) is admissible The quickest you can get there from here is 10 minutes It may take more than 10 minutes, but not fewer After taking an action and learning the cost It took you two minutes to get here and you still have nine minutes to go We cannot learn… it took you two minutes to get here and you have seven minutes to go 10 2 9 10

Proof of monotonicity of f(n) If h(n) is consistent (monotonic) then f(n) along any path is nondecreasing suppose n’ is successor of n g(n’) = g(n) + c (n, a, n’) for some a f(n’) = g(n’) + h(n’) = g(n) + c(n, a, n’) + h(n’) >= g(n) + h(n) = f(n) monotonicity implies h(n) <= c(n, a, n’) + h(n’)

Contours Because f(n) is nondecreasing we can draw contours If we know C* We only need to explore contours less than C*

Properties of A* A* expands all nodes with f(n) < C* A* expands some (at least one) of the nodes on the C* contour before finding the goal A* expands no nodes with f(n) > C* these unexpanded nodes can be pruned

A* is Optimally Efficient Compared to other algorithms that search from root Compared to other algorithms using same heuristic No other optimal algorithm is guaranteed to expand fewer nodes than A* (except perhaps eliminating tie breaks at f(n) = C*)

Pros and Cons of A* A* is optimal and optimally efficient A* is still slow and bulky (space kills first) Number of nodes grows exponentially with the length to goal This is actually a function of heuristic, but they all have errors A* must search all nodes within this goal contour Finding suboptimal goals is sometimes only feasible soln Sometimes, better heuristics are non-admissible

Memory-bounded Heuristic Search Try to reduce memory needs Take advantage of heuristic to improve performance Iterative-deepening A* (IDA*) Recursive best-first search (RBFS) SMA*

Iterative Deepening A* Remember, as an uniformed search, this was a depth-first search where the max depth was iteratively increased As an informed search, we again perform depth-first search, but only nodes with f-cost less than or equal to smallest f- cost of nodes expanded at last iteration Example on board Don’t need to store ordered queue of best nodes What happens when f-cost is real-valued?

Recursive best-first search Depth-first combined with best alternative Keep track of options along fringe As soon as current depth-first exploration becomes more expensive of best fringe option back up to fringe, but update node costs along the way

Recursive best-first search box contains f-value of best alternative path available from any ancestor First, explore path to Pitesti Backtrack to Fagaras and update Fagaras Backtrack to Pitesti and update Pitesti

Quality of Iterative Deepening A* and Recursive best-first search RBFS O(bd) space complexity [if h(n) is admissible] Time complexity is hard to describe efficiency is heavily dependent on quality of h(n) same states may be explored many times IDA* and RBFS use too little memory even if you wanted to use more than O(bd) memory, these two could not provide any advantage

Simple Memory-bounded A* Use all available memory Follow A* algorithm and fill memory with new expanded nodes If new node does not fit free() stored node with worst f-value propagate f-value of freed node to parent SMA* will regenerate a subtree only when it is needed the path through subtree is unknown, but cost is known

Thrashing Typically discussed in OS w.r.t. memory The cost of repeatedly freeing and regenerating parts of the search tree dominate the cost of actual search time complexity will scale significantly if thrashing

Meta-foo What does meta mean in AI? Frequently it means step back a level from foo Metareasoning = reasoning about reasoning These informed search algorithms have pros and cons regarding how they choose to explore new levels a metalevel learning algorithm may combine learn how to combine techniques and parameterize search

Heuristic Functions 8-puzzle problem Avg Depth=22 Branching = approx 3 322 states 170,000 repeated

Heuristics The number of misplaced tiles Admissible because at least n moves required to solve n misplaced tiles The distance from each tile to its goal position No diagonals, so use Manhattan Distance As if walking around rectilinear city blocks also admissible

Compare these two heuristics Effective Branching Factor, b* If A* explores N nodes to find the goal at depth d b* = branching factor such that a uniform tree of depth d contains N+1 nodes N+1 = 1 + b* + (b*)2 + … + (b*)d b* close to 1 is ideal

Compare these two heuristics

Compare these two heuristics h2 is always better than h1 for any node, n, h2(n) >= h1(n) h2 dominates h1 Recall all nodes with f(n) < C* will be expanded? This means all nodes, h(n) < C* - g(n), will be expanded All nodes h2 expands will also be expanded by h1 and because h1 is smaller, others will be expanded as well