摘要
国立台湾大学于天立教授的视频笔记
Search
For example:
Inital state :No queen on the board
Actions : Add a queen on the board where the square is empty
Transition model : return the board with a queen added to the spacified squere
Goal test : 8 queens are on the board ,none attacked
Path cost : numbers of trials
Different States space will be have different Solution space
b:maximum branching factor of the search tree
d:depth of the least-cost solution
m:maximum depth of the state space (may be ∞ \infty ∞)
Uniformed Search 无信息搜索
Uniformed strategies use only the information available in the problem definition
Breadth-first search(BFS)
1,Expand the shallowest unexpanded node
2,FIFO queue
Completeness | Optimality | Time complexity | Space complexity |
---|---|---|---|
yes(if b is finite) | yes | O ( b d ) O(b^d) O(bd) | O ( b d ) O(b^d) O(bd) |
Uniform-cost search
an special example of BFS
expand the unexpanded node with the lowest path cost
Priority queue orderd by g ( n ) g(n) g(n)
equivalent to BFS if step costs all equal
For TREE-SEARCH , priority queue gives the cheapest path first
For GRAPH_SEARCH , if the node is already in the frontier , need to find the minimum cost , and call DECREASEKEY as needed
Completeness | Optimality | Time complexity | Space complexity |
---|---|---|---|
yes | yes | O ( b 1 + ⌊ C ∗ ϵ ⌋ ) O(b^{1+\lfloor \frac{C^*}{\epsilon}\rfloor}) O(b1+⌊ϵC∗⌋) | O ( b 1 + ⌊ C ∗ ϵ ⌋ ) O(b^{1+\lfloor \frac{C^*}{\epsilon}\rfloor}) O(b1+⌊ϵC∗⌋) |
Depth-first search(DFS)
1,expand the deepest unexpand node
2,stack
Completeness | Optimality | Time complexity | Space complexity |
---|---|---|---|
No | No | O ( b m ) O(b^m) O(bm) | O ( m ) O(m) O(m) !!! linear |
Depth-limited search
Iterative deepening search(IDS)
Call DLS iteratively with increasing depth limit
Seems to be wasteful , but actually not
Combine the benefits of BFS and DFS
for depth = 0 to $\infty$
result = DLS(problem,depth)
if result != cutoff
return result
Completeness | Optimality | Time complexity | Space complexity |
---|---|---|---|
Yes | Yes only if step cost = 1 | O ( b d ) O(b^d) O(bd) | O ( b d ) O(bd) O(bd) |
Bidirectional Search
Summay
a:if b is finite
b:if b is finite and step cost >= ϵ \epsilon ϵ
c:unless , , , >= d
d:if b is finite and both direction use complete search like BFS
e:if all steps cost are identical
Criterion | Breadth-first search | Uniform-Cost | Depth-first search(DFS) | Depth-limited search | Iterative deepening search(IDS) | Bi-Directional |
---|---|---|---|---|---|---|
Completeness | Y a Y^a Y |