lemon/belmann_ford.h
changeset 1765 f15b3c09481c
parent 1763 49045f2d28d4
child 1781 dca4c8a54e0a
equal deleted inserted replaced
5:779698c51923 6:dbe59e50e971
    19 
    19 
    20 ///\ingroup flowalgs
    20 ///\ingroup flowalgs
    21 /// \file
    21 /// \file
    22 /// \brief BelmannFord algorithm.
    22 /// \brief BelmannFord algorithm.
    23 ///
    23 ///
    24 /// \todo getPath() should be implemented! (also for BFS and DFS)
       
    25 
    24 
    26 #include <lemon/list_graph.h>
    25 #include <lemon/list_graph.h>
    27 #include <lemon/invalid.h>
    26 #include <lemon/invalid.h>
    28 #include <lemon/error.h>
    27 #include <lemon/error.h>
    29 #include <lemon/maps.h>
    28 #include <lemon/maps.h>
   492     /// \brief Copies the shortest path to \c t into \c p
   491     /// \brief Copies the shortest path to \c t into \c p
   493     ///    
   492     ///    
   494     /// This function copies the shortest path to \c t into \c p.
   493     /// This function copies the shortest path to \c t into \c p.
   495     /// If it \c t is a source itself or unreachable, then it does not
   494     /// If it \c t is a source itself or unreachable, then it does not
   496     /// alter \c p.
   495     /// alter \c p.
   497     /// \todo Is it the right way to handle unreachable nodes?
   496     ///
   498     /// \return Returns \c true if a path to \c t was actually copied to \c p,
   497     /// \return Returns \c true if a path to \c t was actually copied to \c p,
   499     /// \c false otherwise.
   498     /// \c false otherwise.
   500     /// \sa DirPath
   499     /// \sa DirPath
   501     template <typename Path>
   500     template <typename Path>
   502     bool getPath(Path &p, Node t) {
   501     bool getPath(Path &p, Node t) {
   526     /// to \c v. It is \ref INVALID if \c v is unreachable from the root or 
   525     /// to \c v. It is \ref INVALID if \c v is unreachable from the root or 
   527     /// if \c v=s. The shortest path tree used here is equal to the shortest 
   526     /// if \c v=s. The shortest path tree used here is equal to the shortest 
   528     /// path tree used in \ref predNode(). 
   527     /// path tree used in \ref predNode(). 
   529     /// \pre \ref run() must be called before using
   528     /// \pre \ref run() must be called before using
   530     /// this function.
   529     /// this function.
   531     /// \todo predEdge could be a better name.
       
   532     Edge predEdge(Node v) const { return (*_pred)[v]; }
   530     Edge predEdge(Node v) const { return (*_pred)[v]; }
   533 
   531 
   534     /// \brief Returns the 'previous node' of the shortest path tree.
   532     /// \brief Returns the 'previous node' of the shortest path tree.
   535     ///
   533     ///
   536     /// For a node \c v it returns the 'previous node' of the shortest path 
   534     /// For a node \c v it returns the 'previous node' of the shortest path