in reply to Re: Depth First Search through Digraph Results in Memory Leak
in thread Depth First Search through Digraph Results in Memory Leak
I think that's okay. I'm using the algorithm from Goodrich & Tamassia's Data Structures and Algorithms in Java pg. 377. In pseudocode:
DirectedDFS(v):
Mark vertex v as marked.
for each outgoing edge (v, w) of v do
if vertex w has not been visited
then recursively call DFS(w).
Which makes sense to me since the objective is to locate all reachable vertices. Imagine the case where you had more than one edge connecting two vertices. You'd end up counting all the paths to a node but that isn't the goal, well at least not a transitive closure anyway.
"The dead do not recognize context" -- Kai, Lexx
|
---|
Replies are listed 'Best First'. | |
---|---|
Re3: Depth First Search through Digraph Results in Memory Leak
by Hofmator (Curate) on Jan 09, 2004 at 13:44 UTC | |
by djantzen (Priest) on Jan 09, 2004 at 14:00 UTC |
In Section
Seekers of Perl Wisdom