Top "Depth-first-search" questions

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

TypeError: argument of type 'instance' is not iterable

So heres my code and it breaks at the line: if (suc not in sFrontier) or (suc not in sExplored): …

python python-2.7 depth-first-search pacman
How to implement dfs using recursion?

I'm trying to implement DFS with recursion using the following code, public static void dfs(int i, int[][] mat, boolean [] …

java recursion depth-first-search
Why is depth-first search claimed to be space efficient?

In an algorithms course I'm taking, it's said that depth-first search (DFS) is far more space efficient than breadth-first search (…

algorithm graph-algorithm breadth-first-search depth-first-search
How to find if a graph has a cycle?

I know this question has been asked many times in this forum and everywhere else in the internet. But before …

java algorithm graph depth-first-search
How do I learn Tarjan's algorithm?

I have been trying to learn Tarjan's algorithm from Wikipedia for 3 hours now, but I just can't make head or …

graph depth-first-search tarjans-algorithm
Find all cycles in graph, redux

I know there are a quite some answers existing on this question. However, I found none of them really bringing …

graph graph-theory depth-first-search triangle-count
Able to find path using DFS but not able specify the right directions to Pacman _ Python

I am working on an assignment found on an AI course page at berkley website for fun. I need to …

python depth-first-search pacman
Topological sort using DFS without recursion

I know the common way to do a topological sort is using DFS with recursion. But how would you do …

c++ algorithm stack depth-first-search topological-sort
Depth First Search Algorithm Prolog

I am hoping you could help me with this. I am trying to learn about Depth First search algorithm in …

algorithm prolog depth-first-search transitive-closure
Depth-First search in Python

I'm trying to do a Depth-First search in Python but it's not working. Basically we have a peg-solitaire board: [1,1,1,1,1,0,1,1,1,1] 1's …

python depth-first-search