107k views
3 votes
When would DFS be a better choice than A* search?

1 Answer

4 votes

Final answer:

DFS is preferred over A* when memory is limited, a satisfactory solution is acceptable, or when goals are deep in the search space, as DFS is more memory-efficient than A*.

Step-by-step explanation:

Depth-first search (DFS) may be a better choice than A* search in scenarios where the search space is very large and memory is a limiting factor. DFS uses less memory as it stores only the path from the root to the current node and does not require holding all child pointers in memory. Additionally, if the solution does not need to be optimal, but just satisfactory, or if we know that the goal is often found deep in the search space, DFS can be more efficient than A* which prioritizes finding the least-cost path and requires more memory to store potential paths in the priority queue.

User Hoseong Jeon
by
8.8k points