state space search
play

State Space Search 1/25/16 Reading Quiz Q1: What is the forward - PowerPoint PPT Presentation

State Space Search 1/25/16 Reading Quiz Q1: What is the forward branching factor of a node in a search graph? a) The number of paths from the start to the node. b) The number of paths from the node to the goal. c) The number of edges


  1. State Space Search 1/25/16

  2. Reading Quiz Q1: What is the forward branching factor of a node in a search graph? a) The number of paths from the start to the node. b) The number of paths from the node to the goal. c) The number of edges terminating at the node. d) The number of edges originating at the node

  3. When is state space search applicable? ● The world can be described by discrete states. ● The environment is fully observable and deterministic. ● The agent’s objective is to reach some goal state.

  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.

  5. Some important distinctions ● States and nodes are not completely synonymous. ○ A state is a configuration of the world. ○ A node is a data structure. It contains a state, a parent pointer or other connection information, and possibly additional bookkeeping. ● Likewise, actions and edges are related but not identical. ● Start is a state; goal is a proposition. ○ The agent has a fixed start state. ○ There may be many states that achieve the goal. We describe this with a function.

  6. Example: robot navigation ● The state must describe the robot’s location. ○ The state might also need to track package locations, etc. ○ The state may ignore some information (e.g. o105-o107) ● The robot can drive to nearby locations. ○ States between which the robot can drive directly are connected in the search graph. ● We need a start state: o103 ● We need a goal function: state == storage note: this graph is incomplete

  7. Exercise: describe the search space. ● What 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 function? ● Do we need to track any additional information?

  8. Example: traffic jam puzzle start state one of many states satisfying the goal proposition

  9. Next states reachable in one move from the start state

  10. Exercise: model this as a search problem. ● We are given a 3-quart and 4-quart pitcher. ● The pitchers have no markings that show partial quantities. ● Either pitcher can be filled from a faucet. ● The contents of either pitcher can be poured down a drain. ● Water may be poured from one pitcher to the other until either the pouring pitcher is empty or the receiving pitcher is full. ● We want to measure 2 quarts of water. Describe the state representation. How many total states are there? What is the start state? What are its neighbors? Draw a little bit of the graph. How can we recognize a goal state?

  11. Generic search algorithm Procedure Search( G,S,goal ) add start to frontier Inputs add start to parents G : graph with nodes N and arcs A while frontier not empty and goal not found S : set of start nodes get state from frontier goal : Boolean function of states add state to walls or free Output if state is free path from a member of S to a node for add state to parents which goal is true add neighbors of state to frontier or ⊥ if there are no solution paths end if Local end while Frontier : set of paths Frontier ← { ⟨ s ⟩ : s ∈ S} while ( Frontier ≠{} ) select and remove ⟨ s 0 ,...,s k ⟩ from Frontier if ( goal(s k ) ) then return ⟨ s 0 ,...,s k ⟩ Frontier ← Frontier ∪ { ⟨ s 0 ,...,s k ,s ⟩ : ⟨ s k ,s ⟩ ∈ A} return ⊥

  12. The rest of this week (and the rest of chapter 3) select and remove ⟨ s 0 ,...,s k ⟩ from Frontier ● A FIFO frontier gives breadth-first search. ● A LIFO frontier gives depth-first search. ● A priority queue frontier allows more sophisticated searches. What is an appropriate metric to use for “priority”? What characteristics of the search are we trying to optimize?

  13. Generic search algorithm 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 ⟨ s 0 ,...,s k ⟩ from Frontier if ( goal(s k ) ) then return ⟨ s 0 ,...,s k ⟩ Frontier ← Frontier ∪ { ⟨ s 0 ,...,s k ,s ⟩ : ⟨ s k ,s ⟩ ∈ A} return ⊥

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend