Top "Depth-first-search" questions

Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph.

Iterative deepening vs depth-first search

I keep reading about iterative deepening, but I don't understand how it differs from depth-first search. I understood that depth-first …

algorithm search artificial-intelligence depth-first-search iterative-deepening
Simple Java 2d array maze sample

I am working or understanding how to create a simple java 2d maze that should look like this: int [][] maze = { {1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,1,0,1,0,1,0,0,0,0,0,1}, {1,0,1,0,0,0,1,0,1,1,1,0,1}, {1,0,0,0,1,1,1,0,0,0,0,0,1}, {1,0,1,0,0,0,0,0,1,1,1,0,1}, {1,0,1,0,1,1,1,0,1,0,0,0,1}, {1,0,1,0,1,0,0,0,1,1,1,0,1}, {1,0,1,0,1,1,1,0,1,0,1,0,1}, {1,0,0,0,0,0,0,0,0,0,1,0,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1} }; …

java multidimensional-array depth-first-search maze
Time/Space Complexity of Depth First Search

I've looked at various other StackOverflow answer's and they all are different to what my lecturer has written in his …

algorithm time-complexity depth-first-search space-complexity
Is A* the best pathfinding algorithm?

It is generally said that A* is the best algorithm to solve pathfinding problems. Is there any situation when A* …

path-finding a-star depth-first-search breadth-first-search
Is Pre-Order traversal on a binary tree same as Depth First Search?

It seems to me like Pre-order traversal and DFS are same as in both the cases we traverse till the …

algorithm tree binary-tree depth-first-search preorder
Difference between Breadth First Search, and Iterative deepening

I understand BFS, and DFS, but for the life of me cannot figure out the difference between iterative deepening and …

search depth-first-search breadth-first-search iterative-deepening
Difference between 'backtracking' and 'branch and bound'

In backtracking we use both bfs and dfs. Even in branch and bound we use both bfs and dfs in …

depth-first-search backtracking breadth-first-search branch-and-bound
Solving 8-Puzzle using DFS

I am looking for code in java that implement DFS and BFS for the 8-puzzle game by given initial state : 1 2 3 8 0 4 7 6 5 …

java artificial-intelligence depth-first-search sliding-tile-puzzle state-space
Finding the longest cycle in a directed graph using DFS

I need to find the longest cycle in a directed graph using DFS. I once saw this Wikipedia article describing …

algorithm graph-theory depth-first-search
Finding the number of paths of given length in a undirected unweighted graph

'Length' of a path is the number of edges in the path. Given a source and a destination vertex, I …

algorithm graph routes depth-first-search breadth-first-search