CS440/ECE 448 Lecture 4: Search Intro
Slides by Svetlana Lazebnik, 9/2016 Modified by Mark Hasegawa-Johnson, 1/2019
CS440/ECE 448 Lecture 4: Search Intro Slides by Svetlana Lazebnik, - - PowerPoint PPT Presentation
CS440/ECE 448 Lecture 4: Search Intro Slides by Svetlana Lazebnik, 9/2016 Modified by Mark Hasegawa-Johnson, 1/2019 Types of agents Reflex agent Goal-directed agent Consider how the world WOULD BE Consider how the world IS
Slides by Svetlana Lazebnik, 9/2016 Modified by Mark Hasegawa-Johnson, 1/2019
Reflex agent
current percept
consequences of actions
Goal-directed agent
consequences of actions
evolves in response to actions
Source: D. Klein, P. Abbeel
1. Initial state, goal state, transition model 2. Actions, path cost
1. First data structure: a frontier list 2. Second data structure: a search tree 3. Third data structure: a “visited states” list
agents in fully observable, deterministic, discrete, static, known environments
Start state Goal state
We will consider the problem of designing goal-based agents in fully observable, deterministic, discrete, known environments
how “expensive” the path to the goal is
directed agent, not a utility-directed agent
you design a goal-seeking strategy that minimizes cost.
the solution, we assume that the agent can safely ignore its percepts (static environment, open-loop system)
performing a given action in a given state?
nonnegative step costs
lowest path cost for reaching the goal
Initial state Goal state
initial state
state
are the same thing
city B, you end up in city B
traveled)
transition model define the state space of the problem
state by any sequence of actions
where the nodes are states and links between nodes are actions
Romania problem?
United States
traveled
city to another
you visit a city, mark it as “visited.”
world states
1. Initial state, goal state, transition model 2. Actions, path cost
1. First data structure: a frontier list 2. Second data structure: a search tree 3. Third data structure: a “visited states” list
possible successor states
them to the frontier, if they’re not already there
and outcomes
starting state
successor states of that node’s state
sequence of actions
Starting state Successor state Action Goal state
initial state
state
are the same thing
frontier
Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest e
Start: Arad Goal: Bucharest e
explored set
explored
Start: Arad Goal: Bucharest
Start: Arad Goal: Bucharest
Explored: Arad
Start: Arad Goal: Bucharest Explored: Arad Sibiu
Start: Arad Goal: Bucharest Explored: Arad Sibiu Rimnicu Vilcea
Start: Arad Goal: Bucharest e Explored: Arad Sibiu Rimnicu Vilces Fagaras
Start: Arad Goal: Bucharest e Explored: Arad Sibiu Rinnicu Vilces Fagaras Pitesti
1. Initial state, goal state, transition model 2. Actions, path cost
1. First data structure: a frontier list 2. Second data structure: a search tree 3. Third data structure: a “visited states” list
try to find a solution as fast as possible
Example state space graph for a tiny search problem
Expansion order: (s,d,b,a, c,a, e,h,p,q, q, r,f,c,a, G)
http://xkcd.com/761/
infinite)
Fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path
à complete in finite spaces
No – returns the first solution it finds
Could be the time to reach a solution at maximum depth m: !{#$} Terrible if m is much larger than d But VERY FAST if there are LOTS of solutions
O(bm), i.e., linear space!
1. Initial state, goal state, transition model 2. Actions, path cost
1. First data structure: a frontier list 2. Second data structure: a search tree 3. Third data structure: a “visited states” list
CLOSEST to the starting state
frontier
Example from P. Abbeel and D. Klein
Expansion order: (s, d,e,p, b,c,e,h,r,q, a,a,h,r,p,q,f, p,q,f,q,c,G)
Yes (if branching factor b is finite). Even w/o repeated-state checking, it still works!!!
Yes – if cost = 1 per step (uniform cost search will fix this)
Number of nodes in a b-ary tree of depth d: !{#$} (d is the depth of the optimal solution)
!{#$}. --- much larger than DFS!
1. Initial state, goal state, transition model 2. Actions, path cost
1. First data structure: a frontier list 2. Second data structure: a search tree 3. Third data structure: a “visited states” list
from the initial state to that node
path cost
is modified so that a node’s value is computed only when it becomes nonzero
Expansion order: (s,p(1), d(3),b(4), e(5),r(7),f(8) e(9), G(10))
Yes (if branching factor b is finite). Even w/o repeated-state checking, it still works!!!
Yes
Number of nodes in a b-ary tree of depth d: !{#$} Priority queue is !{log( $}/node
!{#$} --- much larger than DFS! This might be a reason to use DFS.
Algorithm Complete? Optimal? Time complexity Space complexity Implement the Frontier as a… BFS
Yes If all step costs are equal !{#$} !{#$} Queue
DFS
No No !{#&} !{#'} Stack
UCS
Yes Yes !{#$ log+ ,} !{#$} Priority Queue
frontier.
GOAL?