Index: src/test/dijkstra_heap_test.cc
===================================================================
--- src/test/dijkstra_heap_test.cc	(revision 1164)
+++ src/test/dijkstra_heap_test.cc	(revision 1194)
@@ -32,27 +32,58 @@
 
 #include <lemon/smart_graph.h>
+
+#include <lemon/graph_writer.h>
+#include <lemon/map_utils.h>
+
+
 #include <lemon/dimacs.h>
 #include <lemon/dijkstra.h>
 #include <lemon/time_measure.h>
+#include <lemon/graph_utils.h>
+
 #include <lemon/bin_heap.h>
 #include <lemon/fib_heap.h>
+#include <lemon/radix_heap.h>
 
 using namespace lemon;
 
-int main(int, char **) {
-  
-  typedef SmartGraph Graph;
-
-  typedef Graph::Edge Edge;
-  typedef Graph::Node Node;
-  typedef Graph::EdgeIt EdgeIt;
-  typedef Graph::NodeIt NodeIt;
-  typedef Graph::template EdgeMap<int> LengthMap;
-
-  Graph G;
+typedef ListGraph Graph;
+
+typedef Graph::Edge Edge;
+typedef Graph::Node Node;
+typedef Graph::EdgeIt EdgeIt;
+typedef Graph::NodeIt NodeIt;
+typedef Graph::EdgeMap<int> LengthMap;
+
+
+struct FibTraits : public DijkstraDefaultTraits<Graph, LengthMap> {
+  typedef FibHeap<Graph::Node, LengthMap::Value, Graph::NodeMap<int> > Heap;
+};
+
+struct RadixTraits : public DijkstraDefaultTraits<Graph, LengthMap> {
+  typedef RadixHeap<Graph::Node, Graph::NodeMap<int> > Heap;
+};
+
+
+int main(int argc, const char* argv[]) {
+  
+
+  Graph graph;
   Node s, t;
-  LengthMap cap(G);
-  readDimacsMaxFlow(std::cin, G, s, t, cap);
+  LengthMap cap(graph);
+  readDimacs(std::cin, graph, cap, s, t);
   Timer ts;
+
+  GraphWriter<Graph> writer(std::cout, graph);
+
+  IdMap<Graph, Node> nodeIdMap(graph);
+  writer.addNodeMap("id", nodeIdMap);
+
+  IdMap<Graph, Edge> edgeIdMap(graph);
+  writer.addEdgeMap("id", edgeIdMap);
+
+  writer.addEdgeMap("cap", cap);
+
+  writer.run();
     
   std::cout <<
@@ -60,19 +91,20 @@
 	    <<std::endl;
   std::cout<<"  on a graph with " << 
-    G.nodeNum() << " nodes and " << G.edgeNum() << " edges..."
+    countNodes(graph) << " nodes and " << countEdges(graph) << " edges..."
 	   << std::endl<<std::endl;
-  
+
+
   Dijkstra<Graph, LengthMap> 
-    dijkstra_test(G, cap);
+    dijkstra_test(graph, cap);
   ts.reset();
-  dijkstra_test.run(s);
+   dijkstra_test.run(s);
   std::cout << "elapsed time: " << ts << std::endl;
-  
+
   int error1=0;
   int error2=0;
 
-  for(EdgeIt e(G); e!=INVALID; ++e) {
-    Node u=G.source(e);
-    Node v=G.target(e);
+  for(EdgeIt e(graph); e!=INVALID; ++e) {
+    Node u=graph.source(e); 
+    Node v=graph.target(e);
     if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) > cap[e] )
       if ( dijkstra_test.reached(u) ) {
@@ -85,8 +117,8 @@
 
   NodeIt v;
-  for(NodeIt v(G); v!=INVALID; ++v) {
+  for(NodeIt v(graph); v!=INVALID; ++v) {
     if ( dijkstra_test.reached(v) ) {
       Edge e=dijkstra_test.pred(v);
-      Node u=G.source(e);
+      Node u=graph.source(e);
       if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) != cap[e] ) {
 	std::cout<<"Error in a shortest path tree edge! Difference: " 
@@ -109,9 +141,10 @@
 	    <<std::endl;
   std::cout<<"  on a graph with " << 
-    G.nodeNum() << " nodes and " << G.edgeNum() << " edges..."
+    countNodes(graph) << " nodes and " << countEdges(graph) << " edges..."
 	   << std::endl<<std::endl;
   
-  Dijkstra<Graph, LengthMap, FibHeap> 
-    dijkstra_test2(G, cap);
+
+  Dijkstra<Graph, LengthMap, FibTraits> 
+    dijkstra_test2(graph, cap);
   ts.reset();
   dijkstra_test2.run(s);
@@ -121,7 +154,7 @@
   error2=0;
 
-  for(EdgeIt e(G); e!=INVALID; ++e) {
-    Node u=G.source(e);
-    Node v=G.target(e);
+  for(EdgeIt e(graph); e!=INVALID; ++e) {
+    Node u=graph.source(e);
+    Node v=graph.target(e);
     if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) > cap[e] )
       if ( dijkstra_test2.reached(u) ) {
@@ -133,8 +166,8 @@
   }
 
-  for(NodeIt n(G); v!=INVALID; ++v) {
+  for(NodeIt n(graph); v!=INVALID; ++v) {
     if ( dijkstra_test2.reached(v) ) {
       Edge e=dijkstra_test2.pred(v);
-      Node u=G.source(e);
+      Node u=graph.source(e);
       if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) != cap[e] ) {
 	std::cout<<"Error in a shortest path tree edge! Difference: " 
@@ -150,4 +183,50 @@
 	    << " shortest path tree edge is erroneous."<<std::endl;
 
+  std::cout <<
+    "\n\n  Testing dijkstra.h with Radix heap implementation radix_heap.h,"
+	    <<std::endl;
+  std::cout<<"  on a graph with " << 
+    countNodes(graph) << " nodes and " << countEdges(graph) << " edges..."
+	   << std::endl<<std::endl;
+
+
+  Dijkstra<Graph, LengthMap, RadixTraits> 
+    dijkstra_test3(graph, cap);
+  ts.reset();
+  dijkstra_test3.run(s);
+  std::cout << "elapsed time: " << ts << std::endl;
+  
+
+  error1=0;
+  error2=0;
+
+  for(EdgeIt e(graph); e!=INVALID; ++e) {
+    Node u=graph.source(e);
+    Node v=graph.target(e);
+    if ( dijkstra_test3.dist(v) - dijkstra_test3.dist(u) > cap[e] )
+      if ( dijkstra_test3.reached(u) ) {
+	std::cout<<"Error! dist(target)-dist(source)- edge_length= " 
+		 <<dijkstra_test3.dist(v) - dijkstra_test3.dist(u) 
+	  - cap[e]<<std::endl;
+	++error1;
+      }
+  }
+
+  for(NodeIt n(graph); v!=INVALID; ++v) {
+    if ( dijkstra_test3.reached(v) ) {
+      Edge e=dijkstra_test3.pred(v);
+      Node u=graph.source(e);
+      if ( dijkstra_test3.dist(v) - dijkstra_test3.dist(u) != cap[e] ) {
+	std::cout<<"Error in a shortest path tree edge! Difference: " 
+		 <<std::abs(dijkstra_test3.dist(v) - dijkstra_test3.dist(u) 
+			    - cap[e])<<std::endl;
+	++error2;
+      }
+    }
+  }
+
+
+  std::cout << error1 << " non-tree and " << error2 
+	    << " shortest path tree edge is erroneous."<<std::endl;
 
   return 0;
