lemon/bfs.h
changeset 1787 932b8490caf0
parent 1763 49045f2d28d4
child 1799 990ef198f64d
equal deleted inserted replaced
11:5ea96e6a517f 12:7d646ff4be47
   190     int _queue_head,_queue_tail,_queue_next_dist;
   190     int _queue_head,_queue_tail,_queue_next_dist;
   191     int _curr_dist;
   191     int _curr_dist;
   192 
   192 
   193     ///Creates the maps if necessary.
   193     ///Creates the maps if necessary.
   194     
   194     
   195     ///\todo Error if \c G are \c NULL.
       
   196     ///\todo Better memory allocation (instead of new).
   195     ///\todo Better memory allocation (instead of new).
   197     void create_maps() 
   196     void create_maps() 
   198     {
   197     {
   199       if(!_pred) {
   198       if(!_pred) {
   200 	local_pred = true;
   199 	local_pred = true;
   608     ///Copies the shortest path to \c t into \c p
   607     ///Copies the shortest path to \c t into \c p
   609     
   608     
   610     ///This function copies the shortest path to \c t into \c p.
   609     ///This function copies the shortest path to \c t into \c p.
   611     ///If \c t is a source itself or unreachable, then it does not
   610     ///If \c t is a source itself or unreachable, then it does not
   612     ///alter \c p.
   611     ///alter \c p.
   613     ///\todo Is it the right way to handle unreachable nodes?
       
   614     ///\return Returns \c true if a path to \c t was actually copied to \c p,
   612     ///\return Returns \c true if a path to \c t was actually copied to \c p,
   615     ///\c false otherwise.
   613     ///\c false otherwise.
   616     ///\sa DirPath
   614     ///\sa DirPath
   617     template<class P>
   615     template<class P>
   618     bool getPath(P &p,Node t) 
   616     bool getPath(P &p,Node t) 
   645     ///if \c v is unreachable from the root(s) or \c v is a root. The
   643     ///if \c v is unreachable from the root(s) or \c v is a root. The
   646     ///shortest path tree used here is equal to the shortest path tree used in
   644     ///shortest path tree used here is equal to the shortest path tree used in
   647     ///\ref predNode().
   645     ///\ref predNode().
   648     ///\pre Either \ref run() or \ref start() must be called before using
   646     ///\pre Either \ref run() or \ref start() must be called before using
   649     ///this function.
   647     ///this function.
   650     ///\todo predEdge could be a better name.
       
   651     Edge predEdge(Node v) const { return (*_pred)[v];}
   648     Edge predEdge(Node v) const { return (*_pred)[v];}
   652 
   649 
   653     ///Returns the 'previous node' of the shortest path tree.
   650     ///Returns the 'previous node' of the shortest path tree.
   654 
   651 
   655     ///For a node \c v it returns the 'previous node'
   652     ///For a node \c v it returns the 'previous node'