commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1360096 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
Date Wed, 11 Jul 2012 10:17:34 GMT
Author: simonetripodi
Date: Wed Jul 11 10:17:34 2012
New Revision: 1360096

URL: http://svn.apache.org/viewvc?rev=1360096&view=rev
Log:
queues can be referenced as Queue instance rather than specialized FibonacciHeap

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java?rev=1360096&r1=1360095&r2=1360096&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
(original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/spanning/DefaultSpanningTreeAlgorithmSelector.java
Wed Jul 11 10:17:34 2012
@@ -27,6 +27,7 @@ import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Queue;
 import java.util.Set;
 
 import org.apache.commons.graph.Graph;
@@ -172,7 +173,7 @@ final class DefaultSpanningTreeAlgorithm
         checkNotNull( weightOperations, "The Kruskal algorithm cannot be calculated with
null weight operations" );
         final Set<V> settledNodes = new HashSet<V>();
 
-        final FibonacciHeap<WE> orderedEdges =
+        final Queue<WE> orderedEdges =
                         new FibonacciHeap<WE>( new WeightedEdgesComparator<W, WE>(
weightOperations, weightedEdges ) );
 
         for ( WE edge : graph.getEdges() )
@@ -219,7 +220,7 @@ final class DefaultSpanningTreeAlgorithm
 
         final ShortestEdges<V, WE, W> shortestEdges = new ShortestEdges<V, WE, W>(
graph, source, weightOperations, weightedEdges );
 
-        final FibonacciHeap<V> unsettledNodes = new FibonacciHeap<V>( shortestEdges
);
+        final Queue<V> unsettledNodes = new FibonacciHeap<V>( shortestEdges );
         unsettledNodes.add( source );
 
         final Set<WE> settledEdges = new HashSet<WE>();
@@ -247,7 +248,7 @@ final class DefaultSpanningTreeAlgorithm
                 }
             }
         }
-        
+
         return shortestEdges.createSpanningTree();
     }
 



Mime
View raw message