state space search
play

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


  1. State Space Search 1/23/17

  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

  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.

  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 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.

  6. Example from the reading: delivery robot Environment model Partial adjacency graph

  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

  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. Lab 0: maze search • What is the goal?

  9. Example: traffic jam puzzle Puzzle objective: move the red car to the exit. Start state One of many states in the goal set

  10. Actions available in the start state and the resulting neighbor states

  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? Rubick’s cube • Bonus: what is the cost of an action?

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

  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

  14. DFS vs. BFS

  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 optimize?

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