Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence (CS 370D)

Similar presentations


Presentation on theme: "Artificial Intelligence (CS 370D)"— Presentation transcript:

1 Artificial Intelligence (CS 370D)
Princess Noura bint Abdulrahman University College of Computer and Information Sciences Artificial Intelligence (CS 370D) Uninformed Search Algorithms ( examples) L. Maram ALShablan

2 Breadth First Search L. Maram ALShablan

3 Breadth First Search Given the following state space (tree search), traverse this tree to find node O and give the sequence of visited nodes when using BFS. A B C E D F G H I J K L O M N L. Maram ALShablan

4 Breadth First Search A, A B C E D L. Maram ALShablan

5 Breadth First Search A, B A B C E D F G L. Maram ALShablan

6 Breadth First Search A, B,C A B C E D F G H L. Maram ALShablan

7 Breadth First Search A,B,C,D A B C E D F G H I J L. Maram ALShablan

8 Breadth First Search A,B,C,D,E A B C E D F G H I J L. Maram ALShablan

9 Breadth First Search A,B,C,D,E,F, A B C E D F G H I J
L. Maram ALShablan

10 Breadth First Search A,B,C,D,E,F,G A B C E D F G H I J K L
L. Maram ALShablan

11 Breadth First Search A,B,C,D,E,F,G,H A B C E D F G H I J K L
L. Maram ALShablan

12 Breadth First Search A,B,C,D,E,F,G,H,I A B C E D F G H I J K L M
L. Maram ALShablan

13 Breadth First Search A,B,C,D,E,F,G,H,I,J, A B C E D F G H I J K L M N
L. Maram ALShablan

14 Breadth First Search A,B,C,D,E,F,G,H,I,J,K, A B C E D F G H I J K L M
N L. Maram ALShablan

15 Breadth First Search A,B,C,D,E,F,G,H,I,J,K,L A B C E D F G H I J K L O
M N L. Maram ALShablan

16 Breadth First Search A,B,C,D,E,F,G,H,I,J,K,L,M, A B C E D F G H I J K
O M N L. Maram ALShablan

17 Breadth First Search A,B,C,D,E,F,G,H,I,J,K,L,M,N, A B C E D F G H I J
O M N L. Maram ALShablan

18 Breadth First Search A,B,C,D,E,F,G,H,I,J,K,L,M,N, O A B C E D F G H I
L. Maram ALShablan

19 Breadth First Search Answer:
The sequence of visited nodes: A,B,C,D,E,F,G,H,I,J,K,L,M,N, O Success A B C E D F G H I J K L O M N L. Maram ALShablan

20 Depth First Search DFS L. Maram ALShablan

21 Depth First Search (DFS)
Given the following state space (tree search), traverse this tree to find node O and give the sequence of visited nodes when using DFS. A B C E D F G H I J K L O M N L. Maram ALShablan

22 Depth First Search A, A B C E D L. Maram ALShablan

23 Depth First Search A,B, A B C E D F G L. Maram ALShablan

24 Depth First Search A,B,F, A B C E D F G L. Maram ALShablan

25 Depth First Search A,B,F, B,G, A B C E D F G K L L. Maram ALShablan

26 Depth First Search A,B,F, B,G,K, A B C E D F G K L L. Maram ALShablan

27 Depth First Search A,B,F, B,G,K, G,L, A B C E D F G K L O
L. Maram ALShablan

28 Depth First Search A,B,F, B,G,K, G,L, O: Goal State A B C E D F G K L
L. Maram ALShablan

29 Depth First Search Answer:
The sequence of visited nodes: A,B,F,B, G,K, G,L, O Success A B C E D F G K L O L. Maram ALShablan

30 Depth-Limited Search DLS L. Maram ALShablan

31 Depth-Limited Search (DLS)
Given the following state space (tree search), traverse this tree to find node O and give the sequence of visited nodes when using DLS (Limit = 2) Limit = 0 A B C E D F G H I J K L O M N Limit = 1 Limit = 2 L. Maram ALShablan

32 Depth-Limited Search (DLS)
B C D E Limit = 2 L. Maram ALShablan

33 Depth-Limited Search (DLS)
A,B, A B C E D F G Limit = 2 L. Maram ALShablan

34 Depth-Limited Search (DLS)
A,B,F cutoff A B C E D F G Limit = 2 L. Maram ALShablan

35 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff A B C D E Limit = 2 F G L. Maram ALShablan

36 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff A B C E D F G H Limit = 2 L. Maram ALShablan

37 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff B, A, C, H cutoff A B C D E Limit = 2 F G H L. Maram ALShablan

38 Depth-Limited Search (DLS)
Maram M. Alshablan Depth-Limited Search (DLS) A,B,F cutoff B,G, cutoff B, A, C, H cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

39 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff B, A, C, H cutoff C,A,D,I cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

40 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff B, A, C, H cutoff C,A,D,I cutoff D,J cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

41 Depth-Limited Search (DLS)
B C D E Limit = 2 F G H I J L. Maram ALShablan

42 Depth-Limited Search (DLS)
A,B,F cutoff B,G, cutoff B, A, C, H cutoff C,A,D,I cutoff D,J cutoff D,A,E Failure A B C D E Limit = 2 F G H I J L. Maram ALShablan

43 Depth-Limited Search (DLS)
Answer: Failure (no solution) Because the goal is beyond the limit 2 (the goal depth is 4) A B C E D F G H I J K L O M N Limit = 2 L. Maram ALShablan

44 Iterative Deepening Search
IDS L. Maram ALShablan

45 Iterative Deepening Search (IDS)
Given the following state space (tree search), traverse this tree to find node O and give the sequence of visited nodes when using IDS till limit 4 Limit = 0 A B C E D F G H I J K L O M N Limit = 1 Limit = 2 Limit = 3 L. Maram ALShablan Limit = 4

46 Limit = 0 A L. Maram ALShablan

47 Iteration# Answer A, Failure Limit = 0 A L. Maram ALShablan

48 A Limit = 1 B C D E L. Maram ALShablan

49 A, Failure A, B cutoff A Limit = 1 B C D E Iteration# Answer 1
A, Failure 1 A, B cutoff A Limit = 1 B C D E L. Maram ALShablan

50 A, Failure A, B cutoff A, C cutoff A Limit = 1 B C D E Iteration#
Answer A, Failure 1 A, B cutoff A, C cutoff A Limit = 1 B C D E L. Maram ALShablan

51 A, B cutoff A, C cutoff A,D cutoff
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A Limit = 1 B C D E L. Maram ALShablan

52 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure A Limit = 1 B C D E L. Maram ALShablan

53 A Limit = 1 B C D E L. Maram ALShablan

54 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A B C D E Limit = 2 L. Maram ALShablan

55 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A B C D E Limit = 2 F G L. Maram ALShablan

56 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff A B C D E Limit = 2 F G L. Maram ALShablan

57 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff A B C D E Limit = 2 F G L. Maram ALShablan

58 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff A B C D E Limit = 2 F G H L. Maram ALShablan

59 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff A B C D E Limit = 2 F G H L. Maram ALShablan

60 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

61 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

62 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff D, J cutoff A B C D E Limit = 2 F G H I J L. Maram ALShablan

63 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff D, J cutoff D,A,E failure A B C D E Limit = 2 F G H I J L. Maram ALShablan

64 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff D, J cutoff D,A,E failure A B C E D F G H I J K L O M N Limit = 2 L. Maram ALShablan

65 A, B cutoff A, C cutoff A,D cutoff A, E failure
Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff D, J cutoff D,A,E failure 3 A B C D E Limit = 3 L. Maram ALShablan

66 A B C D E F G Limit = 3 L. Maram ALShablan

67 A B C D E F G Limit = 3 L. Maram ALShablan

68 A B C D E F G Limit = 3 K L L. Maram ALShablan

69 A B C D E F G Limit = 3 K L L. Maram ALShablan

70 A,B,F B,G,K cutoff G,L cutoff
Iteration# Answer 3 A,B,F B,G,K cutoff G,L cutoff A B C D E F G Limit = 3 K L L. Maram ALShablan

71 A B C D E F G H Limit = 3 K L L. Maram ALShablan

72 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff
Iteration# Answer 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff A B C D E F G H Limit = 3 K L L. Maram ALShablan

73 A B C D E F G H I J Limit = 3 K L L. Maram ALShablan

74 A B C D E F G H I J Limit = 3 K L M L. Maram ALShablan

75 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff
Iteration# Answer 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff A B C D E F G H I J Limit = 3 K L M L. Maram ALShablan

76 A B C D E F G H I J N Limit = 3 K L M L. Maram ALShablan

77 Iteration# Answer 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff I,D,J,N cutoff A B C D E F G H I J N Limit = 3 K L M L. Maram ALShablan

78 A B C D E F G H I J N Limit = 3 K L M L. Maram ALShablan

79 Iteration# Answer 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff I,D,J,N cutoff J,D,A,E failure A B C E D F G H I J K L O M N Limit = 3 L. Maram ALShablan

80 Iteration# Answer 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff I,D,J,N cutoff J,D,A,E failure 4 A B C D E L. Maram ALShablan Limit = 4

81 A B C D E F G L. Maram ALShablan Limit = 4

82 A,B,F cutoff A B C D E F G Limit = 4 Iteration# Answer 4
L. Maram ALShablan Limit = 4

83 A B C D E F G K L L. Maram ALShablan Limit = 4

84 A,B,F cutoff B,G,K cutoff A B C D E F G K L Limit = 4 Iteration#
Answer 4 A,B,F cutoff B,G,K cutoff A B C D E F G K L L. Maram ALShablan Limit = 4

85 A,B,F cutoff B,G,K cutoff A B C D E F G K L Limit = 4 O Iteration#
Answer 4 A,B,F cutoff B,G,K cutoff A B C D E F G K L L. Maram ALShablan Limit = 4 O

86 A,B,F cutoff B,G,K cutoff G,L,O Success
Iteration# Answer 4 A,B,F cutoff B,G,K cutoff G,L,O Success A B C D E F G K L L. Maram ALShablan Limit = 4 O

87 Iterative Deepening Search (IDS)
Answer: Iteration# Answer A, Failure 1 A, B cutoff A, C cutoff A,D cutoff A, E failure 2 A, B,F cutoff B, G cutoff B, A, C, H cutoff C,A,D,I cutoff D, J cutoff D,A,E failure 3 A,B,F cutoff B,G,K cutoff G,L cutoff G,B,A,C,H cutoff C,A,D,I,M cutoff I,D,J,N cutoff J,D,A,E failure 4 A,B,F cutoff B,G,K cutoff G,L,O Success L. Maram ALShablan

88 Uniform Cost Search UCS L. Maram ALShablan

89 Uniform Cost Search (UCS)
Consider the search space of Figure 1, where state a is the initial state and G is the goal state. Assume that the actions are ordered according to their resulting state alphabetically. For example the action (a; b) comes before (a; c). L. Maram ALShablan

90 L. Maram ALShablan

91 The final explored list: a-d-c-f-b-e-G The final frontier list: empty.
The solution found: (a,d,c,b,e,G). The cost of the solution: 6. L. Maram ALShablan


Download ppt "Artificial Intelligence (CS 370D)"

Similar presentations


Ads by Google