You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/06/18 02:11:39 UTC

svn commit: r1137095 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java

Author: simonetripodi
Date: Sat Jun 18 00:11:39 2011
New Revision: 1137095

URL: http://svn.apache.org/viewvc?rev=1137095&view=rev
Log:
discriminated which are connected vertices in edges, avoid to assuming facts that can be violated

Modified:
    commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java

Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java
URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java?rev=1137095&r1=1137094&r2=1137095&view=diff
==============================================================================
--- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java (original)
+++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/shortestpath/Dijkstra.java Sat Jun 18 00:11:39 2011
@@ -20,6 +20,7 @@ package org.apache.commons.graph.shortes
  */
 
 import static java.lang.String.format;
+import static org.apache.commons.graph.utils.Edges.getConnectedVertex;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -105,7 +106,7 @@ public final class Dijkstra
                                                                : graph.getEdges( vertex );
             for ( WE edge : edges )
             {
-                V v = edge.getTail();
+                V v = getConnectedVertex( vertex, edge );
 
                 // skip node already settled
                 if ( !settledNodes.contains( v ) )