Lecture 6 - State Space Search - Uninformed Search
Lecture 6 - State Space Search - Uninformed Search
Announcement
First announced quiz in next lecture (Monday 28 Jan).
Course – Lecture 4, 5 and 6 (Week2).
Search Trees
This is now / start
A search tree:
A “what if” tree of plans and their outcomes
The start state is the root node
Children correspond to successors
Nodes show states, but correspond to PLANS that achieve those states
For most problems, we can never actually build the whole tree
Lecture 06 – State space search strategies: Uninformed search
Applied Artificial Intelligence
a G entire PATH in d e p
b c the state b c e h r q
d
e
f
space graph. h r p q f
a a
S h We construct
p q f q c G
p r
q both on a
q c G
demand – and
a
we construct
as little as
possible.
Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Consider this 4-state graph: How big is its search tree (from S)?
S G
Search strategies
Uninformed search Local search and optimization
• Breadth-first, depth-first search Hill-climbing
• Uniform cost search Simulated annealing
• Depth limited search Genetic algorithms
• Iterative deepening search Bayesian approaches (Markov chain
Informed (heuristic) search Monte Carlo)
• Greedy best-first
• A*
• Memory-bounded heuristic search
• And more….
Tree Search
Search:
Expand out potential plans (tree nodes)
Maintain a fringe of partial plans under consideration
Try to expand as few tree nodes as possible
Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Important ideas:
Fringe
Expansion
Exploration strategy
Depth-First Search
Depth-First Search
Strategy: expand a G
b c
a deepest node
e
first d f
S h
Implementation: p q r
Fringe is a LIFO
stack S
d e p
b c e h r q
a a h r p q f
p q f q c G
q c G a
a Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Is it complete? bm nodes
m could be infinite, so only if we prevent
cycles (more later)
Is it optimal?
No, it finds the “leftmost” solution,
regardless of depth or cost
Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Breadth-First Search
Breadth-First Search
Strategy: expand a G
b c
a shallowest
d e
node first f
S h
Implementation: p q r
Fringe is a FIFO
queue S
d e p
Search
b c e h r q
Tiers
a a h r p q f
p q f q c G
q c G a
a Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Is it complete? bm nodes
s must be finite if a solution exists, so yes!
Is it optimal?
Only if costs are all 1 (more on costs later)
Iterative Deepening
Idea: get DFS’s space advantage with BFS’s
time / shallow-solution advantages
b
Run a DFS with depth limit 1. If no solution… …
Run a DFS with depth limit 2. If no solution…
Run a DFS with depth limit 3. …..
Cost-Sensitive Search
GOAL
a
2 2
b c
3
2
1 8
2 e
3 d f
9 8 2
START
h
1 4 2
p 4 r
1 q
5
BFS finds the shortest path in terms of number of actions.
It does not find the least-cost path. We will now cover
a similar algorithm which does find the least-cost path.
Lecture 06 – State space search strategies: Uninformed search
Applied Artificial Intelligence
Fringe is a priority S 9 h 8 2 1
p r
queue (priority: 1 q
15
cumulative cost)
S 0
d 3 e 9 p 1
b 4 c 11 e 5 h 17 r 11 q 16
Cost a 6 a h 13 r 7 p q f
contou
p q f 8 q c G
rs
q 11 c G 10 a
a Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
Is it complete?
Assuming best solution has a finite cost and minimum arc cost
is positive, yes!
Is it optimal?
Yes! (Proof next lecture via A*)
Lecture 06 – State space search strategies: Uninformed search
CE451 Applied Artificial Intelligence
The bad:
Explores options in every “direction”
No information about goal location
Start Goal
Video of Demo Maze with Deep/Shallow Water --- DFS, BFS, or UCS? (part 1)
Video of Demo Maze with Deep/Shallow Water --- DFS, BFS, or UCS? (part 2)
Video of Demo Maze with Deep/Shallow Water --- DFS, BFS, or UCS? (part 3)
Partially adapted from lecture slides from Stanford University, UCIrvine, and UC
Berkeley.
Some videos taken from UC Berkeley website.
Contents from George F. Luger, AI: Structures and strategies for complex problem
solving, 6th Ed.