Search Strategies Reading: Russell’s Chapter 3 1.

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Uninformed search strategies
Lecture 3: Uninformed Search
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Blind Search by Prof. Jean-Claude Latombe
Uninformed (also called blind) search algorithms) This Lecture Chapter Next Lecture Chapter (Please read lecture topic material before.
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Search Search plays a key role in many parts of AI. These algorithms provide the conceptual backbone of almost every approach to the systematic exploration.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
1 Lecture 3: 18/4/1435 Uninformed search strategies Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence (CS 461D)
Uninformed (also called blind) search algorithms This Lecture Read Chapter Next Lecture Read Chapter (Please read lecture topic material.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Artificial Intelligence for Games Depth limited search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Searching the search space graph
Artificial Intelligence Chapter 3: Solving Problems by Searching
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
1 Lecture 3 Uninformed Search
Lecture 3 Uninformed Search.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
Artificial Intelligence
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Prof. Carla P. Gomes Module: Search I (Reading R&N: Chapter.
Lecture 3: Uninformed Search
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Pengantar Kecerdasan Buatan
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
Uninformed Search Methods
Problem Solving by Searching
Uninformed (also called blind) search algorithms This Lecture Read Chapter Next Lecture Read Chapter (Please read lecture topic material.
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
WEEK 5 LECTURE -A- 23/02/2012 lec 5a CSC 102 by Asma Tabouk Introduction 1 CSC AI Basic Search Strategies.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Uninformed Search Chapter 3.4.
Uninformed Search Strategies
Solving problems by searching
Artificial Intelligence
Principles of Computing – UFCFA3-30-1
Presentation transcript:

Search Strategies Reading: Russell’s Chapter 3 1

Search strategies A search strategy is defined by picking the order of node expansion A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: Strategies are evaluated along the following dimensions: –completeness: does it always find a solution if one exists? –time complexity: number of nodes generated/expanded –space complexity: maximum number of nodes in memory –optimality: does it always find a least-cost solution? Time and space complexity are measured in terms of Time and space complexity are measured in terms of –b: maximum branching factor of the search tree –d: depth of the least-cost solution –m: maximum depth of the state space (may be ∞) 2

Uninformed search strategies Uninformed search strategies use only the information available in the problem definition Uninformed search strategies use only the information available in the problem definition Breadth-first search Breadth-first search Uniform-cost search Uniform-cost search Depth-first search Depth-first search Depth-limited search Depth-limited search Iterative deepening search Iterative deepening search 3

Breadth-first search Expand shallowest unexpanded node Expand shallowest unexpanded node Implementation: Implementation: –fringe is a FIFO queue, i.e., new successors go at end 4

Breadth-first search Expand shallowest unexpanded node Expand shallowest unexpanded node Implementation: Implementation: –fringe is a FIFO queue, i.e., new successors go at end 5

Breadth-first search Expand shallowest unexpanded node Expand shallowest unexpanded node Implementation: Implementation: –fringe is a FIFO queue, i.e., new successors go at end 6

Breadth-first search Expand shallowest unexpanded node Expand shallowest unexpanded node Implementation: Implementation: –fringe is a FIFO queue, i.e., new successors go at end 7

Properties of breadth-first search Complete? Yes (if b is finite) Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + (b d+1 -b) = O(b d+1 ) Time? 1+b+b 2 +b 3 +… +b d + (b d+1 -b) = O(b d+1 ) Space? O(b d+1 ) (keeps every node in memory) Space? O(b d+1 ) (keeps every node in memory) Optimal? Yes (if cost = 1 per step) Optimal? Yes (if cost = 1 per step) Space is the bigger problem (more than time) Space is the bigger problem (more than time) 8

BFS; evaluation Two lessons: Two lessons: –Memory requirements are a bigger problem than its execution time. –Exponential complexity search problems cannot be solved by uninformed search methods for any but the smallest instances. Table is based on: b = 10; 10000/second; 1000 bytes/node DEPTH2NODESTIMEMEMORY seconds 1 megabyte seconds 106 megabytes minutes 10 gigabytes hours 1 terabyte days 101 terabytes years 10 petabytes years 1 exabyte 9

Uniform-cost search Extension of BFS: Extension of BFS: –Expand node with lowest path cost Implementation: fringe = queue ordered by path cost. Implementation: fringe = queue ordered by path cost. UCS is the same as BFS when all step-costs are equal. UCS is the same as BFS when all step-costs are equal. 10

Uniform-cost search Completeness: Completeness: –YES, if step-cost >  (small positive constant) Time complexity: Time complexity: –Assume C* the cost of the optimal solution. –Assume that every action costs at least  –Worst-case: Space complexity: Space complexity: –The same as time complexity Optimality: Optimality: –nodes expanded in order of increasing path cost. –YES, if complete. 11

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 12

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 13

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 14

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 15

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 16

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 17

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 18

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 19

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 20

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 21

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 22

Depth-first search Expand deepest unexpanded node Expand deepest unexpanded node Implementation: Implementation: –fringe = LIFO queue, i.e., put successors at front 23

Properties of depth-first search Complete? No: fails in infinite-depth spaces, spaces with loops Complete? No: fails in infinite-depth spaces, spaces with loops –Modify to avoid repeated states along path  complete in finite spaces Time? O(b m ): terrible if m is much larger than d Time? O(b m ): terrible if m is much larger than d – but if solutions are dense, may be much faster than breadth-first Space? O(bm), i.e., linear space! Space? O(bm), i.e., linear space! Optimal? No Optimal? No 24

Depth-limited search = depth-first search with depth limit l, i.e., nodes at depth l have no successors Recursive implementation: 25

Is DFS with depth limit l. Is DFS with depth limit l. –i.e. nodes at depth l have no successors. –Problem knowledge can be used Solves the infinite-path problem. Solves the infinite-path problem. If l < d then incompleteness results. If l < d then incompleteness results. If l > d then not optimal. If l > d then not optimal. Time complexity: Time complexity: Space complexity: Space complexity: Depth-limited search 26

Iterative deepening search 27

Iterative deepening search 28

Properties of iterative deepening search Complete? Yes Complete? Yes Time? (d+1)b 0 + d b 1 + (d-1)b 2 + … + b d = O(b d ) Time? (d+1)b 0 + d b 1 + (d-1)b 2 + … + b d = O(b d ) Space? O(bd) Space? O(bd) Optimal? Yes, if step cost = 1 Optimal? Yes, if step cost = 1 29

ID search, evaluation Completeness: –YES (no infinite paths) Time complexity: –Algorithm seems costly due to repeated generation of certain states. –Node generation: –level d: once –level d-1: 2 –level d-2: 3 –… –level 2: d-1 –level 1: d Num. Comparison for b=10 and d=5 solution at far right 30

Summary of algorithms 31

Repeated states Failure to detect repeated states can turn a linear problem into an exponential one! Failure to detect repeated states can turn a linear problem into an exponential one! 32

Graph search 33

Bidirectional search Two simultaneous searches from start an goal. –Motivation: Check whether the node belongs to the other fringe before expansion. Space complexity is the most significant weakness. Complete and optimal if both searches are BFS. 34

How to search backwards? The predecessor of each node should be efficiently computable. –When actions are easily reversible. 35