cour1
cour1
Informed Search
• Informed Search
• Heuristics
• Greedy Search
• A* Search
Informed Search
3
Search Problems
Search Problems
• A search problem consists of:
• A state space
“E”, 1.0
• A start state and a goal test
• Solution?
What’s in a State Space?
The world state includes every last detail of the environment
A search state keeps only the details needed for planning (abstraction)
• How many
• World states?
120x(230)x(122)x4
• States for pathing?
120
• States for eat-all-dots?
120x(230)
Safe Passage
Possible futures
• 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
Tree Search vs Graph Search
function TREE_SEARCH(problem) returns a solution, or failure
initialize the frontier as a specific work list (stack, queue, priority queue)
add initial state of problem to frontier
loop do
if the frontier is empty then
return failure
choose a node and remove it from the frontier
if the node contains a goal state then
return the corresponding solution
• 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*)
function UNIFORM-COST-SEARCH(problem) returns a solution, or failure
initialize the explored set to be empty
initialize the frontier as a priority queue using g(n) as the priority
add initial state of problem to frontier with priority g(S) = 0
loop do
if the frontier is empty then
return failure
choose a node and remove it from the frontier
if the node contains a goal state then
return the corresponding solution
add the node state to the explored set
for each resulting child from node
if the child state is not already in the frontier or explored set then
add child to the frontier
else if the child is already in the frontier with higher g(n) then
replace that frontier node with child
Search Heuristics
A heuristic is:
A function that estimates how close a state is to a goal
Designed for a particular search problem
Pathing?
Examples: Manhattan distance, Euclidean distance for
pathing
10
5
11.2