Artificial Intelligence: Anurag Upadhyay
Artificial Intelligence: Anurag Upadhyay
Anurag Upadhyay
Characteristics of BFS
BFS will not get trapped exploring a blind alley. If there is a solution, BFS is guaranteed to find it. If there are multiple solutions, then a minimal solution will be found. Queue data structure is used. As it has to remember each node at a level it takes more memory and is slower.
Characteristics of DFS
DFS requires less memory as only the nodes on the current path are stored. By chance, DFS may find a solution without examining much of the search space at all. Uses Stack data structure. Takes less memory and is faster. Better if we just have to determine if there is a solution present or not.
(4,3 )
(4,0 )
(4,3 )