Uninformed Search (2) Lecture 5 Introduction to Artificial - - PDF document

uninformed search 2
SMART_READER_LITE
LIVE PREVIEW

Uninformed Search (2) Lecture 5 Introduction to Artificial - - PDF document

Uninformed Search (2) Lecture 5 Introduction to Artificial Intelligence Introduction to Artificial Intelligence Hadi Moradi moradi@usc.edu 1 Review: BFS Completeness: Completeness: Yes, Time complexity: O(b d ) , S


slide-1
SLIDE 1

1

Uninformed Search (2)

Lecture 5 Introduction to Artificial Intelligence

1

Introduction to Artificial Intelligence Hadi Moradi moradi@usc.edu

Review: BFS

Completeness: Completeness:

Yes,

Time complexity:

O(b d),

Space complexity:

O(b d),

Optimality:

S A D

2

Optimality:

Yes b – max branching

factor

d – depth of the

least-cost solution

m – max depth

B D A E E C E E B B F D F B F C E A C G G G G F C

slide-2
SLIDE 2

2

Review: Uniform Cost

Completeness:

S

Yes,

Time complexity:

O(b d),

Space complexity:

O(b d),

Optimality:

S A D B D A E E E B B F 3 4 4 5 5 5 2 5 4

3 4 7 8 9 6 10 10 11 11

C E 4 5

11 11 12 12 13 13 13 13

4

3

Optimality:

Yes

B F C E A C G G G F C 3 D F G

13 13

Review: DFS

Completeness:

Yes

Completeness:

Yes,

Time complexity: O(b m), Space complexity:O(bm), Optimality:

No

b – max branching factor d – depth of the least-cost

solution

B S S A

4

solution

m – max depth

C E D F G

slide-3
SLIDE 3

3

Depth First Search

Problem: Not remembering the previous Problem: Not remembering the previous

states

Time complexity

Solution:

Combine the depth first search and breath first

5

p search

Depth-limited search

It i d th fi t h ith d th li it It is a depth-first search with depth limit

I mplementation:

Nodes at depth l have no successors.

Complete: Optimal:

6

p

slide-4
SLIDE 4

4

Iterative deepening search

Function Iterative-deepening-Search(problem) returns a solution, or failure p g (p ) , for depth = 0 to ∞ do result Depth-Limited-Search(problem, depth) if result succeeds then return result end return failure

7

Combines the best of breadth-first and depth-first search strategies.

  • Completeness:
  • Time complexity:
  • Space complexity:
  • Optimality:

Romania with step costs in km

8

slide-5
SLIDE 5

5

9 10

slide-6
SLIDE 6

6

11 12

slide-7
SLIDE 7

7

13 14

slide-8
SLIDE 8

8

15 16

slide-9
SLIDE 9

9

Iterative deepening complexity

Iterative deepening search may seem wasteful Iterative deepening search may seem wasteful

because so many states are expanded multiple times.

17

Bidirectional search

Both search forward from initial state

Both search forward from initial state,

and backwards from goal.

Stop when the two searches meet in

the middle.

18

Goal Goal Start Start

slide-10
SLIDE 10

10

Bidirectional search

1 QUEUE1 < 1 QUEUE1 < path only containing the root; path only containing the root;

  • 1. QUEUE1 <
  • 1. QUEUE1 < --
  • - path only containing the root;

path only containing the root; QUEUE2 < QUEUE2 < --

  • - path only containing the goal;

path only containing the goal; 2.

  • 2. WHILE

WHILE both QUEUEs are not empty both QUEUEs are not empty AND AND QUEUE1 and QUEUE2 do NOT share a state QUEUE1 and QUEUE2 do NOT share a state DO DO remove their first paths; remove their first paths; create their new paths (to all children); create their new paths (to all children);

19

p ( ); p ( ); reject their new paths with loops; reject their new paths with loops; add their new paths to back; add their new paths to back; 3.

  • 3. IF

IF QUEUE1 and QUEUE2 share a state QUEUE1 and QUEUE2 share a state THEN THEN success; success; ELSE ELSE failure; failure;

Bidirectional search

  • Completeness:
  • Completeness:
  • Time complexity:
  • Space complexity:
  • Optimality:

20

slide-11
SLIDE 11

11

Bidirectional search

Bidirectional search merits

Bidirectional search merits

Big difference for problems with branching

factor b in both directions

21

Bidirectional search

Bidirectional search issues

Predecessors of a node need to be generated What to do if there is no explicit list of goal

states?

22

What is the best search strategy for the two

searches?

slide-12
SLIDE 12

12

Comparing uninformed search strategies

Criterion Breadth Uniform DepthFirst DepthLim Iterative Bidirectional Time b^ d b^ d b^ m b^ l b^ d b^ (d/2) Space b^ d b^ d bm bl bd b^ (d/2) Optimal? Yes Yes No No Yes Yes

23

Complete? Yes Yes No Yes if l≥d Yes Yes

b – max branching factor of the search tree d – depth of the least-cost solution m – max depth of the state-space (may be infinity) l – depth cutoff

Summary

Problem formulation usually requires

Problem formulation usually requires

abstracting away real-world details to define a state space that can be explored using computer algorithms.

24

Once problem is formulated in abstract

form, complexity analysis helps us picking out best algorithm to solve problem.

slide-13
SLIDE 13

13

Summary

Variety of uninformed search strategies;

Variety of uninformed search strategies;

difference lies in method used to pick node that will be further expanded.

Iterative deepening search only uses

25

Iterative deepening search only uses

linear space and not much more time than other uniformed search strategies.