Problem Solving by Searching

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Informed search algorithms
Informed Search Algorithms
Informed search algorithms
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Informed search algorithms
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*
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Informed search algorithms
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
Cooperating Intelligent Systems Informed search Chapter 4, AIMA 2 nd ed Chapter 3, AIMA 3 rd ed.
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Informed search algorithms
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Informed search algorithms
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* 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.
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 searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
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*
Princess Nora University Artificial Intelligence Chapter (4) Informed search algorithms 1.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Informed Search I (Beginning of AIMA Chapter 4.1)
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:
Informed search algorithms Chapter 4 Slides derived in part from converted to powerpoint by Min-Yen.
Heuristic Search Foundations of Artificial Intelligence.
Local Search Algorithms and Optimization Problems
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
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.
Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete"
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.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence (CS 370D)
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
Informed search algorithms
Artificial Intelligence
Midterm Review.
Informed Search.
Presentation transcript:

Problem Solving by Searching CSC361 AI CSC361: Problem Solving & Search

Search Strategies: Classification Search Strategies can be Uninformed Search Strategy Informed Search Strategy Uninformed search strategies use only the information available in the problem definition. Informed search strategies use other domain specific information. AI CSC361: Problem Solving & Search

Informed Search Strategies Informed search strategies employ problem specific knowledge to make a choice of which node to select next.  This knowledge is formulated in the form of a function f(x). Best-first search Uniform Cost Search Greedy best-first search A* search AO* AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Best First Search Idea: Select the best node to goal check and expand. Which is the best node?  An evaluation function f(n) tell us which node is the best. The value returned by f(n) gives an estimate of the ‘desirability’ of node n. Or its closeness to the goal state. So the nodes in the Open List are ordered according to the values returned by f(n) and first node selected. AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Best First Search: UCS Example of Best First Search: Uniform Cost Search, Greedy Search, A*. UCS: its evaluation function is the total path cost incurred up to a node n. f(n) = g(n) = cost from start state to n. Drawback: g(n) does not direct search towards the goal, because it considers the cost incurred in the past not the cost that will be incurred in the future. AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search

Best First Search: Greedy Search Evaluation function f(n) = h(n) (a heuristic function) h(n) gives estimate of cost from n to goal e.g., hSLD(n) = straight-line distance from n to Bucharest Greedy search expands the node that appears to be closest to the goal AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search ARAD SIBIU TIMSOURA ZIRIND 253 329 374 ARAD 366 AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Greedy Search Complete? No – can get stuck in loops, e.g., Iasi  Neamt  Iasi  Neamt  Time? O(bm), but a good heuristic can give dramatic improvement Space? O(bm) -- keeps all nodes in memory Optimal? No AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search A* Search Idea: Considers cost to reach node n from start state and cost to reach goal from n. Evaluation function f(n) = g(n) + h(n) g(n) = cost so far to reach n h(n) = estimated cost from n to goal f(n) = estimated total cost of path through n to goal AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search 2 3 4 AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search 5 6 AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search A* Search Complete? Yes Time? O(bd) .. Exponential Space? Keeps all nodes in memory Optimal? Yes  provided that h(n) is admissible and consistent. AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Admissible Heuristic A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal state from n. An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic Example: hSLD(n) (never overestimates the actual road distance) Theorem: If h(n) is admissible, A* using TREE-SEARCH is optimal AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Admissible Heuristic For the 8-puzzle: h1(n) = No. of misplaced tiles  h1(S)= 8 h2(n) = sum of distances of tiles from their goal position  h2(S) = 3+1+2+2+2+3+3+2 = 18 AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Consistent Heuristic A heuristic is consistent if for every node n, every successor n' of n generated by any action a, h(n) ≤ c(n,a,n') + h(n') If h is consistent, we have f(n') = g(n') + h(n') = g(n) + c(n,a,n') + h(n') ≥ g(n) + h(n) = f(n) f(n) is non-decreasing along any path Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Dominance If h2(n) ≥ h1(n) for all n (both admissible) then h2 dominates h1 h2 is better for search Typical search costs (average number of nodes expanded): d=12 IDS = 3,644,035 nodes A*(h1) = 227 nodes A*(h2) = 73 nodes d=24 IDS = too many nodes A*(h1) = 39,135 nodes A*(h2) = 1,641 nodes AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AND-OR Search Graphs OR Graphs: The state-space graphs dealt with previously were OR graphs; from any state one-of the applicable actions is chosen to reach the goal. STATE 1 OR Node AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AND-OR Search Graphs AND-OR Graphs: In AND-OR graphs, from a state not one but all the paths may have to be pursued to reach the goal state. STATE 1 AND Node AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AND-OR Search Graphs How do AND-OR graphs arise? AND-OR graphs arise when it is advantageous to decompose a state into its components which are independent of each other. Example: Integration (See the handout) Example: Rewriting problem – found in syntax analysis. AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AND-OR Search Graphs Example: Rewriting Problem: Start State: (C, B, Z) Operators/actions: R1: C  (D, L) R2: C (B, M) R3: B (M, M) R4: Z  (B, B, M) Goal State: any state consisting only of M’s AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AO* How are AND-OR graphs searched with a best-first strategy? A* algorithm is not suitable Should we choose C to expand next? No, because total cost along C would be 3+4+1+1=9; Along B, 5+1=6 B is the best choice. A B C D h = 5 h = 3 h = 4 1 AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AO* Algorithm General search for AND-OR graphs: Initialize: {D1,..,Dn}  decompose initial state into independent components Di, if possible. Loop until {Di} is Empty Select: Select current path D* from {Di} according to some strategy and a node in D*. Goal Check: Do all leaves in the current path D* satisfy goal_test()? If Yes, return solution. AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search AO* Algorithm Expand: Expand node selected from D*. Decompose each state generated and add the components to {Di}. End. AI CSC361: Problem Solving & Search

Local Search Algorithms AI CSC361: Problem Solving & Search

Local Search Algorithms What type of problems can these algorithms be used to solve? Many problems (e.g. 8-queens, VLSI layout, ..) have the property that the state description of a goal itself contains all the information needed for a solution – the path by which the solution is reached is does not matter. These algorithms keep a single state and try to improve it. AI CSC361: Problem Solving & Search

Local Search Algorithms Put n queens on an n × n board with no two queens on the same row, column, or diagonal AI CSC361: Problem Solving & Search

Local Search Algorithms Generate-and-Test (the basic algorithm) Hill-Climbing Simple-Hill-Climbing Steepest-Ascent-Hill-Climbing Simulated Annealing Genetic Algorthms AI CSC361: Problem Solving & Search

Generate-and-Test Algorithm Generate a possible solution state. (Randomly or by improving the current state) Test if it is a solution state by comparing with the goal state. If the solution state has been found quit else go to step 1. AI CSC361: Problem Solving & Search

Hill-Climbing Algorithm "Like climbing Everest in thick fog with amnesia“ AI CSC361: Problem Solving & Search

Hill-Climbing Algorithm Problem: Algorithm depends on initial state, can get stuck in local maxima. AI CSC361: Problem Solving & Search

Hill-Climbing: 8-Queens h (n) = number of pairs of queens that are attacking each other, either directly or indirectly h (n) = 17 for this state AI CSC361: Problem Solving & Search

Hill-Climbing: 8-Queens h (n) = 1 for this state AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Hill-Climbing Problems with Hill-Climbing: Local Maxima Plateaus Ridges AI CSC361: Problem Solving & Search

AI CSC361: Problem Solving & Search Summary Informed search algorithms Local search algorithms AI CSC361: Problem Solving & Search