commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1137163 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java
Date Sat, 18 Jun 2011 10:48:42 GMT
Author: simonetripodi
Date: Sat Jun 18 10:48:41 2011
New Revision: 1137163

URL: http://svn.apache.org/viewvc?rev=1137163&view=rev
Log:
default (breadth|depht)firstSearch algoritms produce now, as output, the search tree

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java?rev=1137163&r1=1137162&r2=1137163&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/visit/Visit.java Sat
Jun 18 10:48:41 2011
@@ -48,8 +48,9 @@ public final class Visit
      */
     public final <V extends Vertex, E extends Edge<V>> Graph<V, E> breadthFirstSearch(
Graph<V, E> graph, V source )
     {
-        breadthFirstSearch( graph, source, null );
-        return null;
+        VisitGraphBuilder<V, E> visitGraphBuilder = new VisitGraphBuilder<V, E>();
+        breadthFirstSearch( graph, source, visitGraphBuilder );
+        return visitGraphBuilder.getVisitGraph();
     }
 
     /**
@@ -138,8 +139,9 @@ public final class Visit
      */
     public final <V extends Vertex, E extends Edge<V>> Graph<V, E> depthFirstSearch(
Graph<V, E> graph, V source )
     {
-        depthFirstSearch( graph, source, null );
-        return null;
+        VisitGraphBuilder<V, E> visitGraphBuilder = new VisitGraphBuilder<V, E>();
+        depthFirstSearch( graph, source, visitGraphBuilder );
+        return visitGraphBuilder.getVisitGraph();
     }
 
     /**



Mime
View raw message