Search
George Konidaris gdk@cs.duke.edu
Spring 2016
(pictures: Wikipedia)
Search George Konidaris gdk@cs.duke.edu Spring 2016 (pictures: - - PowerPoint PPT Presentation
Search George Konidaris gdk@cs.duke.edu Spring 2016 (pictures: Wikipedia) Search Basic to problem solving: How to take action to reach a goal? Search Specifically: Problem can be in various states . Start in an initial state .
George Konidaris gdk@cs.duke.edu
(pictures: Wikipedia)
Basic to problem solving:
Specifically:
Set of states
S s ∈ S A a(s) → s0 g(s) → {0, 1} C(s, a, s0) → R+ (S, s, A, g, C)
Find a sequence of actions and corresponding states
a1, ..., an s1, ..., sn si = ai(si−1), i = 1, ..., n s0 = s g(sn) = 1
n
X
i=1
C(si−1, a, si)
Find a sequence of actions and corresponding states
a1, ..., an s1, ..., sn si = ai(si−1), i = 1, ..., n s0 = s g(sn) = 1
n
X
i=1
C(si−1, a, si)
start state
Find a sequence of actions and corresponding states
a1, ..., an s1, ..., sn si = ai(si−1), i = 1, ..., n s0 = s g(sn) = 1
n
X
i=1
C(si−1, a, si)
start state legal moves
Find a sequence of actions and corresponding states
a1, ..., an s1, ..., sn si = ai(si−1), i = 1, ..., n s0 = s g(sn) = 1
n
X
i=1
C(si−1, a, si)
start state legal moves end at the goal
Find a sequence of actions and corresponding states
a1, ..., an s1, ..., sn si = ai(si−1), i = 1, ..., n s0 = s g(sn) = 1
n
X
i=1
C(si−1, a, si)
start state legal moves end at the goal minimize sum of costs - rational agent
Sudoku
Flights - e.g., ITA Software.
Classical conceptualization of search.
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
3 3 5 1 6 9 8 3 1 4
Breadth (branching factor)
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
breadth
Depth
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
depth
O(bd)
Expand the tree one node at a time. Frontier: set of nodes in tree, but not expanded.
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
Key to a search algorithm: which node to expand next?
Uninformed strategy:
s0 s1
s0 s1 s2
s0 s1 s2 X
s0 s1 s2 X s3
worst case: solution on this branch
O(bd+1 − bd−m) = O(bd+1)
worst case: search is here
b-1 nodes open at each level
O((b − 1)d) = O(bd)
worst case: search is here
b-1 nodes open at each level
O((b − 1)d) = O(bd)
worst case: search is here
b-1 nodes open at each level
O((b − 1)d) = O(bd)
worst case: search is here
b-1 nodes open at each level
O((b − 1)d) = O(bd)
worst case: search is here
b-1 nodes open at each level
O((b − 1)d) = O(bd)
Properties:
depth).
easy to implement recursively OR manage frontier using LIFO queue. O(bd+1) O(bd)
s0 s1
s0 s1 s2
s0 s1 s2 s3
s0 s1 s2 s3 s4
s0 s1 s2 s3 s4 s5
O(bm+1)
O(bm+1)
Properties:
Yes.
Yes for constant cost.
cost - must maintain a large frontier.
O(bm+1) O(bm+1)
Combine these two strengths.
complete … because it fails to explore other branches.
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
s0 s1 s2 s3 s4 s5 s6 s8 s7 s10 s9
Optimal for constant cost! Proof?
It duplicates work.
many for binary tree.)
visited m + 1 times visited m times
m
X
i=0
bi(m − i + 1) = b(bm+1 − m − 2) + m + 1 (b − 1)2
bm+1 − 1 b − 1
Key Insight:
search method when the state space is large and the depth of the solution is unknown.” (R&N)
Informed searches … what if you know something about the the solution?