State Space Search 1/23/17 State space problems have A set of - - PowerPoint PPT Presentation

state space search
SMART_READER_LITE
LIVE PREVIEW

State Space Search 1/23/17 State space problems have A set of - - PowerPoint PPT Presentation

State Space Search 1/23/17 State space problems have A set of discrete states A distinguished start state A set of actions available to the agent in each state; An action function that, given a state and an action, returns a new


slide-1
SLIDE 1

State Space Search

1/23/17

slide-2
SLIDE 2

State space problems have

  • A set of discrete states
  • A distinguished start state
  • A set of actions available to the agent in each state;
  • An action function that, given a state and an

action, returns a new state

  • A set of goal states, often specified as a function
  • A way to measure solution quality
slide-3
SLIDE 3

When is state space search applicable?

  • The world can be described by discrete states.
  • The environment is fully observable and

deterministic.

  • We will relax this requirement later.
  • The agent’s objective is to reach a specific goal

state or set of states.

slide-4
SLIDE 4

The key idea

  • Embed states of the world in a graph, where:
  • Each node contains one state.
  • A directed edge (A,B) indicates that some action by the

agent can transition the world from state A to state B.

  • The agent can then search for a path in the graph

from start to goal.

  • The sequence of actions along the path constitutes

a plan the agent can execute to achieve its goal.

slide-5
SLIDE 5

Some important distinctions

  • States and actions come from the agent’s model of

the world.

  • Nodes and edges are part of the search graph data

structure.

  • Start is a state, goal is a set/function.
  • We don’t need to know the whole graph to do

search; we can build it incrementally.

slide-6
SLIDE 6

Example from the reading: delivery robot

Environment model Partial adjacency graph

slide-7
SLIDE 7

Delivery robot state space

  • State
  • Robot location
  • Package locations
  • Actions
  • Pick up package
  • Drop off package
  • Move to neighboring room
  • Start state: initial robot and package locations
  • Goal: all packages delivered, robot anywhere
slide-8
SLIDE 8

Exercise: describe the search space

  • What is a state?
  • Which is the start state?
  • What states is it adjacent to?
  • What states are those states

adjacent to?

  • Start drawing the graph.
  • What is the goal?

Lab 0: maze search

slide-9
SLIDE 9

Example: traffic jam puzzle

Puzzle objective: move the red car to the exit.

Start state One of many states in the goal set

slide-10
SLIDE 10

Actions available in the start state and the resulting neighbor states

slide-11
SLIDE 11

Exercise: describe the search space

  • What is a state?
  • What is an action?
  • How many actions are there?
  • Does it depend on the state?
  • What is the goal?
  • How many states satisfy it?
  • Bonus: what is the cost of an action?

Rubick’s cube

slide-12
SLIDE 12

Generic search algorithm

add start to frontier while frontier not empty get state from frontier if state is goal return end if for neighbor of state add neighbor to frontier end for end while

Procedure Search(G,S,goal) Inputs G: graph with nodes N and arcs A S: set of start nodes goal: Boolean function of states Output path from a member of S to a node for which goal is true or ⊥ if there are no solution paths Local Frontier: set of paths Frontier ←{⟨s⟩: s∈S} while (Frontier ≠{}) select and remove ⟨s0,...,sk⟩ from Frontier if ( goal(sk)) then return ⟨s0,...,sk⟩ Frontier ←Frontier ∪{⟨s0,...,sk,s⟩: ⟨sk,s⟩∈A} return ⊥

slide-13
SLIDE 13

Generic search algorithm

add start to frontier while frontier not empty get state from frontier if state is goal return end if for neighbor of state add neighbor to frontier end for end while

slide-14
SLIDE 14

DFS vs. BFS

slide-15
SLIDE 15

The rest of this week

select and remove state from Frontier

  • A FIFO frontier gives breadth-first search.
  • A LIFO frontier gives depth-first search.
  • A priority queue frontier allows more sophisticated

searches.

  • Uniform cost search prioritizes by cost-so-far.

What is an appropriate metric to use for “priority”? What characteristics of the search are we trying to

  • ptimize?