|NU Year||Set: 4.(a) Marks: 5 Year: 2008|
ADVANTAGES OF BREADTH-FIRST SEARCH
search will never get trapped exploring the useless path forever.
If there is a solution, BFS will definitely find it out.
If there is more than one solution then BFS can find the minimal one that requires less number of steps.
DISADVANTAGES OF BREADTH-FIRST SEARCH
The main drawback of Breadth-first search is its memory requirement. Since each level of the tree must be saved in order to generate the next level, and the amount of memory is proportional to the number of nodes stored, the space complexity of BFS is O(bd). As a result, BFS is severely space-bound in practice so will exhaust the memory available on typical computers in a matter of minutes.
If the solution is farther away from the root,breadth-first
search will consume a lot of time.
Advantages of Depth First Search:
Consumes less memory
Finds the larger distant element(from source vertex) in less time.
Disadvantages of BFS:
May not findoptimal
solution to the problem.
May get trapped in searching useless path.