Lecture08 AI UMT Fall 2020 21 - V3
Lecture08 AI UMT Fall 2020 21 - V3
Artificial Intelligence
CS-3431w (V3)
Instructor: Dr. Syed Mohammad Irteza
Assistant Professor, Department of Computer Science
21 November, 2020
Previous Lecture
• Tree Search Algorithms
• Example: Path-finding in Romania
• Search Strategies
• Breadth First Search
• Uniform Cost Search
2
Today’s Lecture
• Search Strategies
• Uniform Cost Search
• Depth First Search
• Depth Limited Search
• Iterative Deepening Search
3
Uniform-cost search
• Expand least-cost unexpanded node
• Implementation:
• fringe – queue ordered by path cost, lowest first
4
Uniform-cost search (example)
10
5
Uniform-cost search
• Expand least-cost unexpanded node
• Implementation:
• fringe – queue ordered by path cost, lowest first
• Complete –
• Time –
• Space –
• Optimal –
6
Uniform-cost search
• Expand least-cost unexpanded node
• Implementation:
• fringe – queue ordered by path cost, lowest first
• Implementation:
• fringe – queue ordered by path cost, lowest first
• Implementation:
• fringe – queue ordered by path cost, lowest first
• Implementation:
• fringe – queue ordered by path cost, lowest first
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
12
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
13
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
14
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
15
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
16
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
17
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
18
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
19
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
20
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
21
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
22
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
23
Depth-first search
• Expand deepest unexpanded node
• Implementation:
• fringe – LIFO queue, i.e., put successors at front
24
Properties of DFS (depth-first search)
• Complete:
• Time:
• Space:
• Optimal:
26
Properties of DFS
• Complete: No, fails in infinite-depth spaces, spaces with loops
• Modify to avoid repeated states along a path
• complete in finite spaces
• Time: O(bm): terrible if m is much larger than d
• But if solutions are dense, may be much faster than BFS
• Space:
• Optimal:
27
Properties of DFS
• Complete: No, fails in infinite-depth spaces, spaces with loops
• Modify to avoid repeated states along a path
• complete in finite spaces
• Time: O(bm): terrible if m is much larger than d
• But if solutions are dense, may be much faster than BFS
• Space: O(bm): i.e., linear space!
• Optimal:
28
Properties of DFS
• Complete: No, fails in infinite-depth spaces, spaces with loops
• Modify to avoid repeated states along a path
• complete in finite spaces
• Time: O(bm): terrible if m is much larger than d
• But if solutions are dense, may be much faster than BFS
• Space: O(bm): i.e., linear space!
• Optimal: No
29
Depth-limited search (DLS)
• The same as DFS with depth limit l
• i.e., nodes at depth l have no successors
30
Depth-limited search (DLS)
• The same as DFS with depth limit l
• i.e., nodes at depth l have no successors
31