1
Search: Uninformed Search
Material in part from http://www.cs.cmu.edu/~awm/tutorials Russel & Norvig Chap. 3
A Search Problem
- Find a path from START to GOAL
- Find the minimum number of transitions
b a d p q h e c f r
START GOAL
Search: Uninformed Search Russel & Norvig Chap. 3 Material in - - PDF document
Search: Uninformed Search Russel & Norvig Chap. 3 Material in part from http://www.cs.cmu.edu/~awm/tutorials A Search Problem GOAL a c b e f d START h r p q Find a path from START to GOAL Find the minimum number of
Material in part from http://www.cs.cmu.edu/~awm/tutorials Russel & Norvig Chap. 3
START GOAL
START GOAL
START GOAL
X x
START GOAL
N E S W
Protein design
http://www.blueprint.org/proteinfolding/trades/trades_problem.html
Scheduling/Manufacturing
http://www.ozone.ri.cmu.edu/projects/dms/dmsmain.html
Scheduling/Science
http://www.ozone.ri.cmu.edu/projects/hsts/hstsmain.html
Route planning Robot navigation
http://www.frc.ri.cmu.edu/projects/mars/dstar.html
Don’t necessarily know explicitly the structure of a search problem
START GOAL
succs(s) = Set of states that can be reached from s in one step
cost(s,s’) = Cost of taking a one-step transition from state s to state s’
START GOAL
START GOAL
START GOAL
START GOAL
START GOAL
0 steps 1 step
START GOAL
0 steps 1 step 2 steps
START GOAL
0 steps 1 step 2 steps 3 steps
START GOAL
0 steps 1 step 2 steps 3 steps 4 steps
START GOAL
START GOAL
X x
START GOAL
N E S W
Vk+1 empty set For each state s in Vk
For each state s’ in succs(s)
If s’ has not already been labeled Set previous(s’) s Add s’ into Vk+1
k k+1
Define Sk = GOAL, and forall i <= k, define Si-1 = previous(Si) Return path = {S1,.., Sk}
See maze example
Breadth First Search BFS Space Time Optimal Complete Algorithm
V3 V’3
START GOAL
V1 V’1 V2 V’2
Bi-directional Breadth First Search
BIBFS
Breadth First Search
BFS Space Time Optimal Complete Algorithm
START GOAL
START GOAL
http://www.leekillough.com/heaps/ Knuth&Sedwick ….
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s t PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
1. Pop the state s with the lowest path cost from PQ 2. Evaluate the path cost to all the successors of s 3. Add the successors of s to PQ
START GOAL
X x
START GOAL
N E S W
Bi-directional Breadth First Search BIBFS Uniform Cost Search UCS Breadth First Search BFS
Space Time Optimal Complete Algorithm
START START d START d b START d b a START d c START d c a START d e START d e r START d e r f START d e r f c START d e r f c a START d e r f GOAL
GOAL START
DFS (s’)
In a recursive implementation, the program stack keeps track of the states in the current path
Memory usage never exceeds maximum length of a path through the graph
START GOAL
May explore the same state over
problem?
START
GOAL
GOAL
BFS:
START
GOAL
GOAL
DFS:
Bi-directional Breadth First Search BIBFS Depth First Search DFS Uniform Cost Search UCS Breadth First Search BFS
Space Time Optimal Complete Algorithm
Because Bd may be much larger than the number of states d steps away from the start
X x
START GOAL
N E S W Try to guess MEMDFS for 2 different order of neighbors: E, N, W, S W, E, N, S
Bi- Direction. BFS BIBFS Memorizing DFS MEMD FS Path Check DFS PCDFS Uniform Cost Search UCS Breadth First Search BFS
Space Time Optimal Complete Algorithm
“Depth-Limited Search”
Nodes generated at depth 1
Nodes generated at depth 2 Nodes generated at
depth L
Bi- Direction. BFS BIBFS Iterative Deepening IDS Memorizing DFS MEMD FS Path Check DFS PCDFS Uniform Cost Search UCS Breadth First Search BFS
Space Time Optimal Complete Algorithm