4. Breadth-first search (BFS)
• Uninformed
• FIFO (Queue data
structure)
• Shallowest node
• Complete
• Optimal
• Time Complexity
– O(V+E)
– O(bd)
A
F
D
C
E
B
G
N
J
H I
M
K L
0
2
1
4
3
5. Depth-first search (DFS)
• Uninformed
• LIFO (Stack data
structure)
• Deepest node
• Incomplete
• Non-optimal
• Time Complexity
– O(V+E)
– O(bd)
A
F
D
C
E
B
G
N
J
H I
M
K L
0
2
1
4
3
7. Cost first search
Note visited:
A, C, B, D, G, E, L,
I, K, H, F, J, M, N
A
F
D
C
E
B
G
N
J
H I
M
K L
4
6
3
4
3
4
3
2
7
2
3
6
1
Child B C D G H E F I L J K M N
Cost 4 3 7 7 10 7 10 9 8 11 9 12 12
8. Algorithm
1. Generate all possible
solution.
2. Test to see if this is the
expected solution.
3. If the solution has been
found quit else go to step 1.
Generate and test