commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1203524 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
Date Fri, 18 Nov 2011 08:33:08 GMT
Author: simonetripodi
Date: Fri Nov 18 08:33:07 2011
New Revision: 1203524

URL: http://svn.apache.org/viewvc?rev=1203524&view=rev
Log:
strongly connected component implementation switched to LinkedHashSet to preserve the order

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java?rev=1203524&r1=1203523&r2=1203524&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
Fri Nov 18 08:33:07 2011
@@ -22,7 +22,7 @@ package org.apache.commons.graph.connect
 import static java.lang.Math.min;
 
 import java.util.HashMap;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
@@ -50,7 +50,7 @@ public final class Tarjan
     {
         final Map<V, TarjanVertexMetaInfo> verticesMetaInfo = new HashMap<V, TarjanVertexMetaInfo>();
         final Stack<V> s = new Stack<V>();
-        final Set<V> stronglyConnectedComponent = new HashSet<V>();
+        final Set<V> stronglyConnectedComponent = new LinkedHashSet<V>();
         Integer index = 0;
 
         for ( V vertex : graph.getVertices() )



Mime
View raw message