Hi all. I've a little doubt on DFS algorithm implemented in the DefaultVisitAlgorithmsSelector.
I think that the visit doesn't serch in depth but in a breadth way. here is a little code snippet: [ ... ] while ( visitingGraph && !vertexStack.isEmpty() ) { V v = vertexStack.pop(); if ( handler.discoverVertex( v ) ) { Iterator<V> connected = ( graph instanceof DirectedGraph ) ? ( (DirectedGraph<V, E>) graph ).getOutbound( v ).iterator() : graph.getConnectedVertices( v ).iterator(); while ( connected.hasNext() ) { V w = connected.next(); if ( !visitedVertices.contains( w ) ) { E e = graph.getEdge( v, w ); if ( handler.discoverEdge( v, e, w ) ) { [ ... ] I think that the algo explores the edge, and than fires handler.discoverEdge( v, e, w ), in breadth and not in depth, doesn't it? best regards -- Marco Speranza <marcospera...@apache.org> Google Code: http://code.google.com/u/marco.speranza79/
signature.asc
Description: Message signed with OpenPGP using GPGMail