note
djantzen
<p>
I think that's okay. I'm using the algorithm from Goodrich & Tamassia's <i>Data Structures and Algorithms in Java</i> pg. 377. In pseudocode:
<p>
DirectedDFS(v):<br>
Mark vertex <i>v</i> as marked.<br>
<b>for</b> each outgoing edge (<i>v, w</i>) of v <b>do</b><br>
<b>if</b> vertex <i>w</i> has not been visited<br> <b>then</b> recursively call DFS(w).
<p>
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 <i>paths</i> to a node but that isn't the goal, well at least not a transitive closure anyway.
<p>
<div class="pmsig"><div class="pmsig-131165">
<hr>
"The dead do not recognize context" -- Kai, <i>Lexx</i>
</div></div>
319780
320051