Searching. Assume goal- or utilitybased. Next task to achieve is to determine the best path to the goal

Similar documents
3 SOLVING PROBLEMS BY SEARCHING

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

Artificial Intelligence

Informed search algorithms. Chapter 4

Artificial Intelligence

Searching with Partial Information

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

Informed Search Methods

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

Outline. Informed Search. Recall: Uninformed Search. An Idea. Heuristics Informed search techniques More on heuristics Iterative improvement

ARTIFICIAL INTELLIGENCE. Informed search

Introduction to Computer Science and Programming for Astronomers

CS 380: Artificial Intelligence Lecture #4

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

Problem Solving & Heuristic 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 strategies (Section ) Source: Fotolia

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Downloaded from ioenotes.edu.np

Informed search algorithms. Chapter 4

mywbut.com Informed Search Strategies-I

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

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

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

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

Chapters 3-5 Problem Solving using Search

Outline. Best-first search

DFS. Depth-limited Search

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

Outline. Best-first search

Artificial Intelligence

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

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

Artificial Intelligence

Review Search. This material: Chapter 1 4 (3 rd ed.) Read Chapter 18 (Learning from Examples) for next week

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

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

Foundations of AI. 4. Informed Search Methods. Heuristics, Local Search Methods, Genetic Algorithms. Wolfram Burgard & Bernhard Nebel

Search. CS 3793/5233 Artificial Intelligence Search 1

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

CS 4700: Artificial Intelligence

Solving problems by searching

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

Informed/Heuristic Search

Problem Solving and Search

Informed Search and Exploration

Informed Search and Exploration for Agents

Artificial Intelligence

Artificial Intelligence Informed search. Peter Antal

Expert Systems (Graz) Heuristic Search (Klagenfurt) - Search -

Solving Problems: Intelligent Search

Informed Search CS457 David Kauchak Fall 2011

Solving Problems by Searching

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

Foundations of AI. 4. Informed Search Methods. Heuristics, Local Search Methods, Genetic Algorithms

Search : Lecture 2. September 9, 2003

Uninformed Search Methods

Route planning / Search Movement Group behavior Decision making

Solving Problems by Searching

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. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Lecture 4: Informed/Heuristic Search

Lecture 9. Heuristic search, continued. CS-424 Gregory Dudek

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY REPRESENTATION OF KNOWLEDGE PART A

Informed Search Algorithms. Chapter 4

INTRODUCTION TO HEURISTIC SEARCH

CS 4700: Foundations of Artificial Intelligence

Midterm Examination CS540-2: Introduction to Artificial Intelligence

Informed Search and Exploration

Heuristic Search: A* CPSC 322 Search 4 January 19, Textbook 3.6 Taught by: Vasanth

Solving problems by searching

State Spaces

Last time: Problem-Solving

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 23 January, 2018

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

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

Robot Programming with Lisp

Informed (heuristic) search (cont). Constraint-satisfaction search.

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

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Artificial Intelligence

Heuristic Search. Heuristic Search. Heuristic Search. CSE 3401: Intro to AI & LP Informed Search

Outline. Informed Search. Recall: Uninformed Search. An Idea. Heuristics Informed search techniques More on heuristics Iterative improvement

Solving problems by searching

COMP9414: Artificial Intelligence Informed Search

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

CSC384: Intro to Artificial Intelligence Search III

Solving Problems by Searching

Heuristic Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA

COMP9414: Artificial Intelligence Informed Search

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

Chapter 3. A problem-solving agent is a kind of goal-based agent. It decide what to do by finding sequences of actions that lead to desirable states.

mywbut.com Informed Search Strategies-II

Problem Solving: Informed Search

Problem Solving and Searching

Artificial Intelligence

CPS 170: Artificial Intelligence Search

Local Search and Optimization Chapter 4. Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld )

Artificial Intelligence (part 4c) Strategies for State Space Search. (Informed..Heuristic search)

Transcription:

Searching Assume goal- or utilitybased agents: state information ability to perform actions goals to achieve Next task to achieve is to determine the best path to the goal CSC384 Lecture Slides Steve Engels, 2005 Slide 1 of 20

Search Domains Searching is the act of navigating through various agent states, until it reaches the goal state set of possible intermediate states is called the state space In general, searching problems assume a finite set of states limit search domain to realistic boundaries reduce the granularity of state measurements S CSC384 Lecture Slides Steve Engels, 2005 Slide 2 of 20 G

Search Domains (cont d) State space is determined by the possible values that the agent s state can have, as a result of the actions that can be performed Must have an initial state and one or more goal states Usually drawn as a graph, with nodes representing the possible states and edges representing the transitions between them Each transition has a path cost associated with it. Path costs are generally non-negative, and assumed to be 1 if not specified. A successor function produces all the sets of available actions and subsequent states, given a current state. A solution consists of the path from initial state to goal state. CSC384 Lecture Slides Steve Engels, 2005 Slide 3 of 20

Searching Examples 8-tile puzzle 1 2 3 4 5 6 7 8 1 2 3 4 6 7 5 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 CSC384 Lecture Slides Steve Engels, 2005 Slide 4 of 20

8-Queens puzzle Searching Examples place 8 queens on a chessboard so that no two queens attack each other. purely generate-and-test: ~64 8 solutions using successor functions: ~8 8 possible states to explore n-queens problem: place n queens on an nxn board CSC384 Lecture Slides Steve Engels, 2005 Slide 5 of 20

SAT Problem Searching Examples Made of literals and clauses in conjunctive normal form literal = propositional symbol or its negation (e.g. P, P) clause = disjunction of literals; 3-clause is a disjunction of 3 literals (e.g. P V Q V R) conjunctive normal form = conjunction of clauses. Example: (P V Q V R) Λ ( P V Q V R) Λ ( P V R V S) Λ (P V S V T) All satisfiability problems can be represented as SAT problems Searching all possible solutions is NP complete. CSC384 Lecture Slides Steve Engels, 2005 Slide 6 of 20

Search Criteria When evaluating a search technique, use the following metrics: Completeness: Does the search algorithm guarantee a solution, if one exists? Optimality: Does it find the best solution, if multiple solutions exist? Efficiency: What kind of time and/or space does it take in finding a solution? Treat search space like maze or road map; assume the ability to backtrack to previous forks in search space, in dead end cases Searching produces search tree (no loops) CSC384 Lecture Slides Steve Engels, 2005 Slide 7 of 20

Uninformed Searches A search strategy is called uninformed if it has no other knowledge about the search space, other than the successive states at each stage i.e. plotting a course without a map CSC384 Lecture Slides Steve Engels, 2005 Slide 8 of 20

Breadth-first Search Breadth-first search expands the start state first, and then expands successive states, one level at a time. Slow, but guaranteed to find the closest solution (if one exists) Complexity analysis: Time: O(b d ) Space: O(b d ) (b is the branching factor, the maximum number of successor states possible. d is the depth of the solution in the search tree) Like level-order traversal E N O P A B C D F Expanded nodes: G H I J K L M Q A B C D E F G H I J K L M N O P Q R S R S CSC384 Lecture Slides Steve Engels, 2005 Slide 9 of 20

Depth-first Search Depth-first search expands states down a single branch of the search tree until the goal or a dead end is reached (requires backtracking) Faster, but dangerous. Can explore far past solution depth, and the first solution isn t guaranteed to be the best possible. Complexity analysis: Time: O(b L ) Space: O(bL) (L is the maximum reasonable search depth) Like preorder traversal CSC384 Lecture Slides Steve Engels, 2005 Slide 10 of 20 E N O P A B C D F Expanded nodes: G H I J K L M Q A B E N O P F G C H I Q R J D K S L M R S

Uniform Cost Search Breadth-first search assumes that all transitions have a uniform path cost. Uniform cost search expands unexplored states with the lowest path cost from the start state Given uniform path costs, this variation behaves just like breadth-first. Originated from Dijkstra s algorithm for finding the past cost between two points CSC384 Lecture Slides Steve Engels, 2005 Slide 11 of 20

Iterative Deepening Depth-first search can overshoot the solution depth or produce a sub-optimal solution Iterative deepening attempts to combine the solutionfinding benefits of breadth-first with the space efficiency of depth-first. Perform depth-first search to a limited depth L (e.g. 3) If solution is not found, repeat with larger L (e.g. 6) Complexity analysis: Time: O(b d A ) Space: O(bd) B C D Wastes some time and E F I K space, but not too much N O P G H J L M Q R S Expanded nodes: A A B C D A B E F G C H I J D K L M A B E CSC384 Lecture Slides Steve Engels, 2005 Slide 12 of 20

Backwards & Bidirectional Search Variations of breadth or iterative deepening search Backward search = begin search at goal state, end at start state. Doesn t work as well with multiple goal states, and branching factor might be different in reverse. Bidirectional search = Begin search at start and goal states simultaneously, search until common state is found. Time & space complexity: O(b d/2 ) CSC384 Lecture Slides Steve Engels, 2005 Slide 13 of 20

Searching with Uncertainty Two possible problems can arise when searching: incomplete knowledge of states (sensorless problem) uncertain outcome of actions (contingency problem) Sensorless problems produce a belief state space, where each belief state is the set of possible states that the agent could be in (see Figure 3.21 in text) must find set of actions that lead to a belief state that contains nothing but goal states in it Contingency problems arise when the outcome of an action can be one of several possible states agent must behave sensibly for whatever new state it is in, even if this makes planning difficult CSC384 Lecture Slides Steve Engels, 2005 Slide 14 of 20

Heuristic Searches Also known as informed searches A heuristic is a rule of thumb that allows an agent to estimate the distance between a particular state and the goal Heuristic function = estimated cost of path from current state n to goal state h(n) e.g. straight-line heuristic: direct distance between current position and destination on a map Heuristic searches ignore path cost information, and focus instead on seeking the solution CSC384 Lecture Slides Steve Engels, 2005 Slide 15 of 20

Heuristic Example 8-tile puzzle out-of-place heuristic Manhattan heuristic Heuristic at goal should = 0 1 2 3 6 8 7 5 4 4 7 5 8 2 3 1 6 8 7 5 4 4 8 1 2 3 6 8 7 5 4 5 8 1 2 3 7 6 8 5 4 CSC384 Lecture Slides Steve Engels, 2005 Slide 16 of 20

Greedy Search Greedy searches look at the best available states, given an appropriate heuristic function Best-first search explores the state that is closest to the goal, according to the heuristic Also known as gradient descent or hill-climbing algorithms Advantage: space usage is O(1) Disadvantage: can get stuck at a local minimum Variations to greedy search: Beam search = search the m most promising nodes Gradient with backup = allow the search to backtrack if stuck Overall best-first = choose best state to explore across entire unexplored frontier CSC384 Lecture Slides Steve Engels, 2005 Slide 17 of 20

A* ( A-star ) Search Combines current path cost with estimated remaining past cost (e.g. MapQuest) A* is a best-first search on f(n) = g(n) + h(n) f(n) is A* value for state n g(n) is the path cost to get to state n h(n) is the heuristic cost of cheapest estimated solution In order for a search using A* to return the optimal result, h(n) must be an admissable heuristic, meaning that it must never overestimate the distance to the goal (always optimistic estimate) optimistic estimate ensures that the states along the solution path always have a value smaller than the optimal solution CSC384 Lecture Slides Steve Engels, 2005 Slide 18 of 20

A* Search (cont d) To use graph searching algorithms with A* to obtain optimal paths, h(n) should also be consistent consistency: h(n) g(n, n ) + h(n ) n,n are on solution path consistent heuristics should not overestimate any segment of the path leads to wrong choices at that segment consistent heuristics are always admissable (stricter than admissability, since consistent heuristics underestimate each segment in the solution path, whereas admissable heuristics apply to the entire path) CSC384 Lecture Slides Steve Engels, 2005 Slide 19 of 20

Avoiding Local Maxima Local maxima occur when a state space does not gravitate towards a single solution, but has smaller pockets that a heuristic search might be drawn to Requires techniques to escape from these pockets, to determine if they are the true best solution Simulated annealing = allows a change in the variables, according to a specified temperature and variable energy Genetic algorithms = randomly interchange variables of different solutions, or mutate certain variables Typically only applicable to domains like SAT CSC384 Lecture Slides Steve Engels, 2005 Slide 20 of 20