diff -r c1e936e6a46b -r 27aa03cd3121 lemon/floyd_warshall.h --- a/lemon/floyd_warshall.h Fri Jan 05 10:59:18 2007 +0000 +++ b/lemon/floyd_warshall.h Mon Jan 08 10:39:59 2007 +0000 @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -480,27 +481,15 @@ ///@{ - /// \brief 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. - /// \return Returns \c true if a path to \c t was actually copied to \c p, - /// \c false otherwise. - /// \sa DirPath - template - bool getPath(Path &p, Node source, Node target) { - if (connected(source, target)) { - p.clear(); - typename Path::Builder b(target); - for(b.setStartNode(target); predEdge(source, target) != INVALID; - target = predNode(target)) { - b.pushFront(predEdge(source, target)); - } - b.commit(); - return true; - } - return false; + typedef PredMatrixMapPath Path; + + ///Gives back the shortest path. + + ///Gives back the shortest path. + ///\pre The \c t should be reachable from the \c t. + Path path(Node s, Node t) + { + return Path(*graph, *_pred, s, t); } /// \brief The distance between two nodes.