Skip to main content
Share Your Experience: Take the 2024 Developer Survey
15 votes
Accepted

Why is depth-first search an artificial intelligence algorithm?

This is a fundamentally a philosophical question. What makes AI AI? But first things, why would DFS be considered an AI algorithm? In its most basic form, DFS is a very general algorithm that is ...
Asher's user avatar
  • 436
3 votes
Accepted

Why does the adversarial search minimax algorithm use Depth-First Search (DFS) instead of Breadth-First Search (BFS)?

The primary reason is that Breadth-First Search requires much more memory (and this probably also makes it a little bit slower in practice, due to time required to allocate memory, jumping around in ...
Dennis Soemers's user avatar
  • 10.3k
2 votes
Accepted

How do I create the search tree for DFS applied to a grid map?

To draw the search tree, you just need to add as children the nodes that you found (i.e. the nodes that you add to the queue and that you may expand next). So, in your case, the root node of the tree ...
nbro's user avatar
  • 40.8k
2 votes
Accepted

How do the BFS and DFS search algorithms choose between nodes with the "same priority"?

BFS and DFS are usually applied to unweighted graphs (or, equivalently, to graphs where the edges have all the same weights). In this case, BFS is optimal, i.e., assuming a finite branching factor, it ...
nbro's user avatar
  • 40.8k
2 votes
Accepted

Does depth-first search always stop when it has found the leftmost solution?

One of the more standard assumptions when first introducing new students to search algorithms (like Depth-First Search, Breadth-First Search which you've also likely heard about or will hear about ...
Dennis Soemers's user avatar
  • 10.3k
1 vote
Accepted

How DFS may expand the same state many times via different paths in an acyclic state space?

First, note that the verb to expand has a specific meaning in this context: when you expand a node/state $s$, you try each action $a_1, \dots, a_n$ available from $s$, and each of these actions $a_i$ ...
nbro's user avatar
  • 40.8k
1 vote

How do the BFS and DFS search algorithms choose between nodes with the "same priority"?

Either one. The BFS algorithm and DFS algorithm do not specify. Typically, it's programmed as left-to-right, just because that's the way programmers think about trees. It doesn't have to be. Note that ...
Quitting Due To Antisemitism's user avatar
1 vote

Why is depth-first search an artificial intelligence algorithm?

DFS on its own would not typically be considered AI imo. It is a standard computer science deterministic algorithm. Instead an ...
WestCoastProjects's user avatar
1 vote
Accepted

Why does our AI play worse at even levels of depth?

When the number of levels is odd, it means the first player can do one more extra movement on the board. As it is an extensive form game, when decide using backward induction, as the last and the ...
OmG's user avatar
  • 1,816
1 vote
Accepted

Why do we use a last-in-first-out queue in depth-first search?

We use the LIFO queue, i.e. stack, for implementation of the depth-first search algorithm because depth-first search always expands the deepest node in the current frontier of the search tree. Norvig ...

Only top scored, non community-wiki answers of a minimum length are eligible