CSE 473: Artificial Intelligence
Autumn 2018
Problem Spaces & Search
Steve Tanimoto
With slides from : Dieter Fox, Dan Weld, Dan Klein, Stuart Russell, Andrew Moore, Luke Zettlemoyer
CSE 473: Artificial Intelligence Autumn 2018 Problem Spaces & - - PowerPoint PPT Presentation
CSE 473: Artificial Intelligence Autumn 2018 Problem Spaces & Search Steve Tanimoto With slides from : Dieter Fox, Dan Weld, Dan Klein, Stuart Russell, Andrew Moore, Luke Zettlemoyer Outline Search Problems Uninformed Search
With slides from : Dieter Fox, Dan Weld, Dan Klein, Stuart Russell, Andrew Moore, Luke Zettlemoyer
Agent Sensors ? Actuators Environment
Percepts Actions
4
with cost = distance
“N”, 1.0 “E”, 1.0
represented by arcs
costs
in memory (so we don’t)
S
G d b p q c e h a f r Ridiculously tiny search graph for a tiny search problem
“E”, 1.0 “N”, 1.0
This is now / start Possible futures
S
a b d p a c e p h f r q q c
G
a q e p h f r q q c G a
S G
d b p q c e h a f r
We construct both on demand – and we construct as little as possible. Each NODE in in the search tree is an entire PATH in the state space graph.
S
G b a
S G
d b p q c e h a f r
Strategy: expand a deepest node first Implementation: Fringe is a LIFO stack S G
d b p q c e h a f r
S
a b d p a c e p h f r q q c
G
a q e p h f r q q c
G
a S G
d b p q c e h a f r q p h f d b a c e r
Strategy: expand a deepest node first Implementation: Fringe is a LIFO stack
… b 1 node b nodes b2 nodes bm nodes m tiers
… b 1 node b nodes b2 nodes bm nodes m tiers
depth or cost
S
a b d p a c e p h f r q q c
G
a q e p h f r q q c
G
a
S
G d b p q c e h a f r Search Tiers Strategy: expand a shallowest node first Implementation: Fringe is a FIFO queue
… b 1 node b nodes b2 nodes bm nodes d tiers bd nodes
Algorithm Complete Optimal Time Space DFS
w/ Path Checking
BFS N unless
finite
N O(bm) O(bm) Y Y O(bd) O(bd)
Iterative deepening uses DFS as a subroutine:
length 1 or less.
….and so on.
Algorithm Complete Optimal Time Space DFS
w/ Path Checking
BFS ID Y N O(bm) O(bm) Y Y O(bd) O(bd) Y Y O(bd) O(bd)
… b
32
Notice that BFS finds the shortest path in terms of number of
START
GOAL
d b p q c e h a f r 2 9 2 8 1 8 2 3 1 4 4 15 1 3 2 2
START
GOAL
d b p q c e h a f r 2 9 2 8 1 8 2 3 1 4 4 15 1 3 2 2
S
a b d p a c e p h f r q q c
G
a q e p h f r q q c
G
a Strategy: expand a cheapest node first: Fringe is a priority queue (priority: cumulative cost) S G
d b p q c e h a f r
3 9 1 16 4 11 5 7 13 8 10 11 17 11 6 3 9 1 1 2 8 8 2 15 1 2 Cost contours 2
…
depth” is roughly C*/ε
positive, yes!
b C*/ε “tiers” C ≤ 3 C ≤ 2 C ≤ 1
Start Goal … c 3 c 2 c 1
Algorithm Complete Optimal Time Space DFS
w/ Path Checking
BFS UCS Y N O(bm) O(bm) Y Y O(bd) O(bd) Y* Y O(bC*/ε) O(bC*/ε)
… b
priority queues (i.e. collections
priorities)
you can avoid the log(n)
priority queue, by using stacks and queues
implementation that takes a variable queuing object