Author: tn
Date: Tue Mar 6 20:41:53 2012
New Revision: 1297700
URL: http://svn.apache.org/viewvc?rev=1297700&view=rev
Log:
added javadoc, added gabow algo to scc benchmark, removed obsolete Kosaraju
visit handler
Removed:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirVisitHandler.java
Modified:
commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/scc/SCCAlgorithmBenchmarkTestCase.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirAlgorithm.java
Modified:
commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/scc/SCCAlgorithmBenchmarkTestCase.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/scc/SCCAlgorithmBenchmarkTestCase.java?rev=1297700&r1=1297699&r2=1297700&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/scc/SCCAlgorithmBenchmarkTestCase.java
(original)
+++
commons/sandbox/graph/trunk/src/benchmarks/java/org/apache/commons/graph/scc/SCCAlgorithmBenchmarkTestCase.java
Tue Mar 6 20:41:53 2012
@@ -93,6 +93,13 @@ public final class SCCAlgorithmBenchmark
}
@Test
+ public void performCheriyanMehlhornGabow()
+ {
+ Set<Set<BaseLabeledVertex>> actual = findStronglyConnectedComponent(
graph ).applyingCheriyanMehlhornGabow();
+ assertTrue( actual.size() > 0 );
+ }
+
+ @Test
public void performTarjan()
{
Set<Set<BaseLabeledVertex>> actual = findStronglyConnectedComponent(
graph ).applyingTarjan();
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java?rev=1297700&r1=1297699&r2=1297700&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/DefaultSccAlgorithmSelector.java
Tue Mar 6 20:41:53 2012
@@ -23,7 +23,6 @@ import java.util.Set;
import org.apache.commons.graph.DirectedGraph;
import org.apache.commons.graph.Edge;
-import org.apache.commons.graph.Graph;
import org.apache.commons.graph.Vertex;
/**
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirAlgorithm.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirAlgorithm.java?rev=1297700&r1=1297699&r2=1297700&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirAlgorithm.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/scc/KosarajuSharirAlgorithm.java
Tue Mar 6 20:41:53 2012
@@ -38,21 +38,26 @@ import org.apache.commons.graph.model.Re
/**
* Implements the classical Kosaraju's algorithm to find the strongly
connected components
- *
+ *
* @param <V> the Graph vertices type.
* @param <E> the Graph edges type.
- * @param <G> the directed graph type
+ * @param <G> the directed graph type
*/
final class KosarajuSharirAlgorithm<V extends Vertex, E extends Edge, G
extends DirectedGraph<V, E>>
{
-
+ /** The graph. */
private final G graph;
- public KosarajuSharirAlgorithm( G graph )
+ /**
+ * Create a new {@link KosarajuSharirAlgorithm} instance for the given
{@link Graph}.
+ *
+ * @param graph the {@link Graph} on which to apply the algorithm
+ */
+ public KosarajuSharirAlgorithm( final G graph )
{
this.graph = graph;
}
-
+
/**
* Applies the classical Kosaraju's algorithm to find the strongly
connected components of
* a vertex <code>source</code>.
@@ -79,7 +84,6 @@ final class KosarajuSharirAlgorithm<V ex
/**
* Applies the classical Kosaraju's algorithm to find the strongly
connected components.
*
- * @param source the source vertex to start the search from
* @return the input graph strongly connected component.
*/
public Set<Set<V>> applyingKosarajuSharir()