diff -u -r /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph-mod
diff -u -r /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph/src/structural_properties.c /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph-mod/src/structural_properties.c
--- /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph/src/structural_properties.c	2012-08-06 15:41:56.000000000 +0100
+++ /Users/mjreed/main/R/Rpackage-sources/igraph_nightly_0.7-2913-20120806/igraph-mod/src/structural_properties.c	2012-08-07 00:11:10.000000000 +0100
@@ -5161,6 +5161,7 @@
  * 
  * \example examples/simple/igraph_get_shortest_paths_dijkstra.c
  */
+
 int igraph_get_shortest_paths_dijkstra(const igraph_t *graph,
                                        igraph_vector_ptr_t *vertices,
 				       igraph_vector_ptr_t *edges,
@@ -5180,8 +5181,7 @@
        maximum heap and we need a minimum heap.
      - we don't use IGRAPH_INFINITY in the distance vector during the
        computation, as IGRAPH_FINITE() might involve a function call 
-       and we want to spare that. So we store distance+1.0 instead of 
-       distance, and zero denotes infinity.
+       and we want to spare that. So -1 denotes infinity.
      - `parents' assigns the predecessors of all vertices in the
        shortest path tree to the vertices. In this implementation, the
        vertex ID + 1 is stored, zero means unreachable vertices.
@@ -5224,6 +5224,7 @@
   IGRAPH_FINALLY(igraph_lazy_inclist_destroy, &inclist);
 
   IGRAPH_VECTOR_INIT_FINALLY(&dists, no_of_nodes);
+  for(i=0;i<no_of_nodes;i++) VECTOR(dists)[i]=-1.0;
 
   parents = igraph_Calloc(no_of_nodes, long int);
   if (parents == 0) IGRAPH_ERROR("Can't calculate shortest paths", IGRAPH_ENOMEM);
@@ -5242,7 +5243,7 @@
     }
   }
 
-  VECTOR(dists)[(long int)from] = 1.0;	/* zero distance */
+  VECTOR(dists)[(long int)from] = 0.0;	/* zero distance */
   parents[(long int)from] = 0;
   igraph_2wheap_push_with_index(&Q, from, 0);
     
@@ -5266,15 +5267,15 @@
       long int tto=IGRAPH_OTHER(graph, edge, minnei);
       igraph_real_t altdist=mindist + VECTOR(*weights)[edge];
       igraph_real_t curdist=VECTOR(dists)[tto];
-      if (curdist==0) {
+      if (curdist<0) {
         /* This is the first non-infinite distance */
-        VECTOR(dists)[tto] = altdist+1.0;
+	VECTOR(dists)[tto] = altdist;
         parents[tto] = edge+1;
         IGRAPH_CHECK(igraph_2wheap_push_with_index(&Q, tto, -altdist));
-      } else if (altdist < curdist-1) {
+      } else if (altdist < curdist) {
 	      /* This is a shorter path */
-        VECTOR(dists)[tto] = altdist+1.0;
-        parents[tto] = edge+1;
+	VECTOR(dists)[tto] = altdist;
+	parents[tto] = edge+1;
         IGRAPH_CHECK(igraph_2wheap_modify(&Q, tto, -altdist));
       }
     }
@@ -5337,6 +5338,7 @@
   return 0;
 }
 
+
 /** 
  * \function igraph_get_shortest_path_dijkstra
  * Weighted shortest path from one vertex to another one.
