Index: src/lemon/bfs.h
===================================================================
--- src/lemon/bfs.h	(revision 1270)
+++ src/lemon/bfs.h	(revision 1283)
@@ -654,4 +654,27 @@
     ///@{
 
+    ///Copies the shortest path to \c t into \c p
+    
+    ///This function copies the shortest path to \c t into \c p.
+    ///If it \c \t is a source itself or unreachable, then it does not
+    ///alter \c p.
+    ///\todo Is it the right way to handle unreachable nodes?
+    ///\return Returns \c true if a path to \c t was actually copied to \c p,
+    ///\c false otherwise.
+    ///\sa DirPath
+    template<class P>
+    bool getPath(P &p,Node t) 
+    {
+      if(reached(t)) {
+	p.clear();
+	typename P::Builder b(p);
+	for(b.setStartNode(t);pred(t)!=INVALID;t=predNode(t))
+	  b.pushFront(pred(t));
+	b.commit();
+	return true;
+      }
+      return false;
+    }
+
     ///The distance of a node from the root(s).
 
Index: src/lemon/dfs.h
===================================================================
--- src/lemon/dfs.h	(revision 1236)
+++ src/lemon/dfs.h	(revision 1283)
@@ -661,4 +661,27 @@
     ///@{
 
+    ///Copies the path to \c t on the DFS tree into \c p
+    
+    ///This function copies the path on the DFS tree to \c t into \c p.
+    ///If it \c \t is a source itself or unreachable, then it does not
+    ///alter \c p.
+    ///\todo Is it the right way to handle unreachable nodes?
+    ///\return Returns \c true if a path to \c t was actually copied to \c p,
+    ///\c false otherwise.
+    ///\sa DirPath
+    template<class P>
+    bool getPath(P &p,Node t) 
+    {
+      if(reached(t)) {
+	p.clear();
+	typename P::Builder b(p);
+	for(b.setStartNode(t);pred(t)!=INVALID;t=predNode(t))
+	  b.pushFront(pred(t));
+	b.commit();
+	return true;
+      }
+      return false;
+    }
+
     ///The distance of a node from the root(s).
 
Index: src/lemon/dijkstra.h
===================================================================
--- src/lemon/dijkstra.h	(revision 1236)
+++ src/lemon/dijkstra.h	(revision 1283)
@@ -21,4 +21,6 @@
 ///\file
 ///\brief Dijkstra algorithm.
+///
+///\todo getPath() should be implemented! (also for BFS and DFS)
 
 #include <lemon/list_graph.h>
@@ -656,4 +658,27 @@
     ///@{
 
+    ///Copies the shortest path to \c t into \c p
+    
+    ///This function copies the shortest path to \c t into \c p.
+    ///If it \c \t is a source itself or unreachable, then it does not
+    ///alter \c p.
+    ///\todo Is it the right way to handle unreachable nodes?
+    ///\return Returns \c true if a path to \c t was actually copied to \c p,
+    ///\c false otherwise.
+    ///\sa DirPath
+    template<class P>
+    bool getPath(P &p,Node t) 
+    {
+      if(reached(t)) {
+	p.clear();
+	typename P::Builder b(p);
+	for(b.setStartNode(t);pred(t)!=INVALID;t=predNode(t))
+	  b.pushFront(pred(t));
+	b.commit();
+	return true;
+      }
+      return false;
+    }
+	  
     ///The distance of a node from the root.
 
Index: src/test/bfs_test.cc
===================================================================
--- src/test/bfs_test.cc	(revision 1220)
+++ src/test/bfs_test.cc	(revision 1283)
@@ -18,4 +18,5 @@
 #include <lemon/smart_graph.h>
 #include <lemon/bfs.h>
+#include <lemon/path.h>
 #include<lemon/concept/graph.h>
 
@@ -57,4 +58,6 @@
   b  = bfs_test.reached(n);
 
+  DirPath<Graph> pp(G);
+  bfs_test.getPath(pp,n);
 }
 
@@ -104,4 +107,8 @@
   check(bfs_test.dist(t)==3,"Bfs found a wrong path. " << bfs_test.dist(t));
 
+  DirPath<Graph> p(G);
+  check(bfs_test.getPath(p,t),"getPath() failed to set the path.");
+  check(p.length()==3,"getPath() found a wrong path.");
+  
 
   for(EdgeIt e(G); e==INVALID; ++e) {
Index: src/test/dfs_test.cc
===================================================================
--- src/test/dfs_test.cc	(revision 1233)
+++ src/test/dfs_test.cc	(revision 1283)
@@ -18,4 +18,5 @@
 #include <lemon/smart_graph.h>
 #include <lemon/dfs.h>
+#include <lemon/path.h>
 #include <lemon/concept/graph.h>
 
@@ -57,4 +58,6 @@
   b  = dfs_test.reached(n);
 
+  DirPath<Graph> pp(G);
+  dfs_test.getPath(pp,n);
 }
 
@@ -103,4 +106,8 @@
   dfs_test.run(s);  
   
+  DirPath<Graph> p(G);
+  check(dfs_test.getPath(p,t),"getPath() failed to set the path.");
+  check(p.length()==dfs_test.dist(t),"getPath() found a wrong path.");
+  
   for(NodeIt v(G); v!=INVALID; ++v) {
     check(dfs_test.reached(v),"Each node should be reached.");
Index: src/test/dijkstra_test.cc
===================================================================
--- src/test/dijkstra_test.cc	(revision 1220)
+++ src/test/dijkstra_test.cc	(revision 1283)
@@ -18,4 +18,5 @@
 #include <lemon/smart_graph.h>
 #include <lemon/dijkstra.h>
+#include <lemon/path.h>
 #include <lemon/maps.h>
 #include <lemon/concept/graph.h>
@@ -60,5 +61,7 @@
   //  pn = dijkstra_test.predNodeMap();
   b  = dijkstra_test.reached(n);
-  
+
+  DirPath<Graph> pp(G);
+  dijkstra_test.getPath(pp,n);
 }
 
@@ -115,4 +118,9 @@
 
 
+  DirPath<Graph> p(G);
+  check(dijkstra_test.getPath(p,t),"getPath() failed to set the path.");
+  check(p.length()==4,"getPath() found a wrong path.");
+  
+
   for(EdgeIt e(G); e!=INVALID; ++e) {
     Node u=G.source(e);
