commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1203539 - in /commons/sandbox/graph/trunk: pom.xml src/assembly/ src/main/assembly/ src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java
Date Fri, 18 Nov 2011 09:02:08 GMT
Author: simonetripodi
Date: Fri Nov 18 09:02:08 2011
New Revision: 1203539

URL: http://svn.apache.org/viewvc?rev=1203539&view=rev
Log:
moved assembly descriptors in the proper location

Added:
    commons/sandbox/graph/trunk/src/main/assembly/
      - copied from r1203230, commons/sandbox/graph/trunk/src/assembly/
Removed:
    commons/sandbox/graph/trunk/src/assembly/
Modified:
    commons/sandbox/graph/trunk/pom.xml
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java

Modified: commons/sandbox/graph/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1203539&r1=1203538&r2=1203539&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/pom.xml (original)
+++ commons/sandbox/graph/trunk/pom.xml Fri Nov 18 09:02:08 2011
@@ -128,8 +128,8 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <configuration>
           <descriptors>
-            <descriptor>src/assembly/bin.xml</descriptor>
-            <descriptor>src/assembly/src.xml</descriptor>
+            <descriptor>src/main/assembly/bin.xml</descriptor>
+            <descriptor>src/main/assembly/src.xml</descriptor>
           </descriptors>
           <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java?rev=1203539&r1=1203538&r2=1203539&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java
Fri Nov 18 09:02:08 2011
@@ -19,9 +19,40 @@ package org.apache.commons.graph.connect
  * under the License.
  */
 
+import static org.apache.commons.graph.visit.Visit.depthFirstSearch;
+
+import org.apache.commons.graph.DirectedGraph;
+import org.apache.commons.graph.Edge;
+import org.apache.commons.graph.Vertex;
+import org.apache.commons.graph.model.RevertedGraph;
+
+/**
+ * Contains the Kosaraju's strongly connected component algorithm implementation.
+ */
 public final class KosarajuSharir
 {
 
-    // TODO
+    /**
+     * This class can not be instantiated directly
+     */
+    private KosarajuSharir()
+    {
+        // do nothing
+    }
+
+    /**
+     * Applies the classical Kosaraju's algorithm to find the strongly connected components,
if exist.
+     *
+     * @param <V> the Graph vertices type.
+     * @param <E> the Graph edges type.
+     * @param graph the Graph which strongly connected component has to be verified.
+     */
+    public static <V extends Vertex, E extends Edge> void hasStronglyConnectedComponent(
DirectedGraph<V, E> graph ,
+                                                                                        
V source)
+    {
+        depthFirstSearch( graph, source, new KosarajuSharirVisitHandler<V, E>( source
) );
+
+        DirectedGraph<V, E> reverted = new RevertedGraph<V, E>( graph );
+    }
 
 }



Mime
View raw message