Docsity

Problem Solving and Search Algorithms: Understanding Single-State and Tree Search, Slides of Artificial Intelligence

Partial preview of the text

Download Problem Solving and Search Algorithms: Understanding Single-State and Tree Search and more Slides Artificial Intelligence in PDF only on Docsity!

Solving problems by searching

Chapter 3

Outline

 Problem-solving agents

 Problem types

 Problem formulation

 Example problems

 Basic search algorithms

Example: Romania

 On holiday in Romania; currently in Arad.

 Flight leaves tomorrow from Bucharest

 Formulate goal:

 be in Bucharest 

 Formulate problem:

 states: various cities  actions: drive between cities 

 Find solution:

 sequence of cities, e.g., Arad, Sibiu, Fagaras, BucharestDocsity.com

Example: Romania

Example: vacuum world

 Single-state, start in #5.

Solution?

Example: vacuum world

 Single-state, start in #5.

Solution? [Right, Suck]

 Sensorless, start in

{1,2,3,4,5,6,7,8} e.g.,

Right goes to {2,4,6,8}

Solution?

Example: vacuum world

 Sensorless, start in

{1,2,3,4,5,6,7,8} e.g.,

Right goes to {2,4,6,8}

Solution?

[Right,Suck,Left,Suck]

 Contingency  Nondeterministic: Suck may dirty a clean carpet  Partially observable: location, dirt at current location.  Percept: [L, Clean], i.e., start in #5 or #

Solution? [Right, if dirt then Suck] Docsity.com

Single-state problem formulation

A problem is defined by four items:

  1. initial state e.g., "at Arad"
  2. actions or successor function S(x) = set of action–state pairs  e.g., S(Arad) = {<Arad  Zerind, Zerind>, … } 
  3. goal test, can be  explicit, e.g., x = "at Bucharest"  implicit, e.g., Checkmate(x) 
  4. path cost (additive)  e.g., sum of distances, number of actions executed, etc.  c(x,a,y) is the step cost, assumed to be ≥ 0 

 A solution is a sequence of actions leading from the initial state to aDocsity.com

Vacuum world state space graph

 states?

 actions?

 goal test?

 path cost?

Vacuum world state space graph

 states? integer dirt and robot location

 actions? Left, Right, Suck

 goal test? no dirt at all locations

 path cost? 1 per action

Example: The 8-puzzle

 states? locations of tiles

 actions? move blank left, right, up, down

 goal test? = goal state (given)

 path cost? 1 per move

[Note: optimal solution of n-Puzzle family is NP-hard]

Example: robotic assembly

 states?: real-valued coordinates of robot joint

angles parts of the object to be assembled

 actions?: continuous motions of robot joints

 goal test?: complete assembly

Tree search example

Tree search example