lemon/bfs.h
changeset 2317 6d3ed14efb68
parent 2306 42cce226b87b
child 2335 27aa03cd3121
equal deleted inserted replaced
21:3b42281b75d2 22:0ecdafb12357
   585     void start()
   585     void start()
   586     {
   586     {
   587       while ( !emptyQueue() ) processNextNode();
   587       while ( !emptyQueue() ) processNextNode();
   588     }
   588     }
   589     
   589     
   590     ///Executes the algorithm until \c dest is the next node to processed.
   590     ///Executes the algorithm until \c dest is reached.
   591 
   591 
   592     ///Executes the algorithm until \c dest is the next node to processed.
   592     ///Executes the algorithm until \c dest is reached.
   593     ///
   593     ///
   594     ///\pre init() must be called and at least one node should be added
   594     ///\pre init() must be called and at least one node should be added
   595     ///with addSource() before using this function.
   595     ///with addSource() before using this function.
   596     ///
   596     ///
   597     ///This method runs the %BFS algorithm from the root node(s)
   597     ///This method runs the %BFS algorithm from the root node(s)
   613     ///
   613     ///
   614     ///\pre init() must be called and at least one node should be added
   614     ///\pre init() must be called and at least one node should be added
   615     ///with addSource() before using this function.
   615     ///with addSource() before using this function.
   616     ///
   616     ///
   617     ///\param nm must be a bool (or convertible) node map. The
   617     ///\param nm must be a bool (or convertible) node map. The
   618     ///algorithm will stop when for the next processable node \c v is
   618     ///algorithm will stop when it reached a node \c v with
   619     ///<tt>nm[v]</tt> true.
   619     ///<tt>nm[v]</tt> true.
   620     ///\todo query the reached target
   620     ///\todo query the reached target
   621     template<class NM>
   621     template<class NM>
   622     void start(const NM &nm)
   622     void start(const NM &nm)
   623     {
   623     {
  1500     /// with addSource() before using this function.
  1500     /// with addSource() before using this function.
  1501     void start() {
  1501     void start() {
  1502       while ( !emptyQueue() ) processNextNode();
  1502       while ( !emptyQueue() ) processNextNode();
  1503     }
  1503     }
  1504     
  1504     
  1505     /// \brief Executes the algorithm until \c dest will be next processed.
  1505     /// \brief Executes the algorithm until \c dest is reached.
  1506     ///
  1506     ///
  1507     /// Executes the algorithm until \c dest will be next processed.
  1507     /// Executes the algorithm until \c dest is reached.
  1508     ///
  1508     ///
  1509     /// \pre init() must be called and at least one node should be added
  1509     /// \pre init() must be called and at least one node should be added
  1510     /// with addSource() before using this function.
  1510     /// with addSource() before using this function.
  1511     void start(Node dest) {
  1511     void start(Node dest) {
  1512       bool reached = false;
  1512       bool reached = false;
  1521     ///
  1521     ///
  1522     /// \pre init() must be called and at least one node should be added
  1522     /// \pre init() must be called and at least one node should be added
  1523     /// with addSource() before using this function.
  1523     /// with addSource() before using this function.
  1524     ///
  1524     ///
  1525     ///\param nm must be a bool (or convertible) node map. The
  1525     ///\param nm must be a bool (or convertible) node map. The
  1526     ///algorithm will stop when it reaches a node \c v with
  1526     ///algorithm will stop when it reached a node \c v with
  1527     ///<tt>nm[v]</tt> true.
  1527     ///<tt>nm[v]</tt> true.
  1528     template <typename NM>
  1528     template <typename NM>
  1529     void start(const NM &nm) {
  1529     void start(const NM &nm) {
  1530       bool reached = false;
  1530       bool reached = false;
  1531       while (!emptyQueue() && !reached) {
  1531       while (!emptyQueue() && !reached) {