0% found this document useful (0 votes)
56 views31 pages

Lecture08 AI UMT Fall 2020 21 - V3

The document summarizes different search strategies including uniform-cost search, depth-first search, and depth-limited search. Uniform-cost search expands the lowest-cost node first using a priority queue. It is complete and optimal if step costs are positive. Depth-first search expands the deepest node first using a LIFO queue. It uses linear space but may have exponential running time and is not complete or optimal. Depth-limited search limits the depth of depth-first search to find shallow solutions first.

Uploaded by

sarah abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views31 pages

Lecture08 AI UMT Fall 2020 21 - V3

The document summarizes different search strategies including uniform-cost search, depth-first search, and depth-limited search. Uniform-cost search expands the lowest-cost node first using a priority queue. It is complete and optimal if step costs are positive. Depth-first search expands the deepest node first using a LIFO queue. It uses linear space but may have exponential running time and is not complete or optimal. Depth-limited search limits the depth of depth-first search to find shallow solutions first.

Uploaded by

sarah abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Lecture 08

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

• Complete – Yes, if step cost ≥ ε


• Time –
• Space –
• Optimal –
7
Uniform-cost search
• Expand least-cost unexpanded node

• Implementation:
• fringe – queue ordered by path cost, lowest first

• Complete – Yes, if step cost ≥ ε


• Time – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)) , where C* is
the cost of the optimal solution
• Space –
• Optimal –
8
Uniform-cost search
• Expand least-cost unexpanded node

• Implementation:
• fringe – queue ordered by path cost, lowest first

• Complete – Yes, if step cost ≥ ε


• Time – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)), where C* is
the cost of the optimal solution
• Space – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε))
• Optimal –
9
Uniform-cost search
• Expand least-cost unexpanded node

• Implementation:
• fringe – queue ordered by path cost, lowest first

• Complete – Yes, if step cost ≥ ε


• Time – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)), where C* is
the cost of the optimal solution
• Space – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε))
• Optimal – yes, nodes expanded in increasing order of g(n)
10
Uniform-cost search
• Expand least-cost unexpanded node
10
• Implementation:
• fringe – queue ordered by path cost, lowest first

• Complete – Yes, if step cost ≥ ε


• Time – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)), where C* is
the cost of the optimal solution
• Space – # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε))
• Optimal – yes, nodes expanded in increasing order of g(n)
11
Depth-first search
• Expand deepest unexpanded node

• 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:

Reminder  Time and space complexity are measure in terms of:


b – maximum branching factor of the search tree
d – depth of the least-cost solution
m – maximum depth of the state space (may be infinity)
25
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:
• 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

You might also like