lemon/bfs.h
changeset 834 c2230649a493
parent 764 684964884a2e
child 835 c92296660262
equal deleted inserted replaced
27:6dd23ecb1a18 29:08422c1eaeb8
   699       return reached(t);
   699       return reached(t);
   700     }
   700     }
   701 
   701 
   702     ///Runs the algorithm to visit all nodes in the digraph.
   702     ///Runs the algorithm to visit all nodes in the digraph.
   703 
   703 
   704     ///This method runs the %BFS algorithm in order to
   704     ///This method runs the %BFS algorithm in order to visit all nodes
   705     ///compute the shortest path to each node.
   705     ///in the digraph.
   706     ///
       
   707     ///The algorithm computes
       
   708     ///- the shortest path tree (forest),
       
   709     ///- the distance of each node from the root(s).
       
   710     ///
   706     ///
   711     ///\note <tt>b.run(s)</tt> is just a shortcut of the following code.
   707     ///\note <tt>b.run(s)</tt> is just a shortcut of the following code.
   712     ///\code
   708     ///\code
   713     ///  b.init();
   709     ///  b.init();
   714     ///  for (NodeIt n(gr); n != INVALID; ++n) {
   710     ///  for (NodeIt n(gr); n != INVALID; ++n) {
  1044       return alg.reached(t);
  1040       return alg.reached(t);
  1045     }
  1041     }
  1046 
  1042 
  1047     ///Runs BFS algorithm to visit all nodes in the digraph.
  1043     ///Runs BFS algorithm to visit all nodes in the digraph.
  1048 
  1044 
  1049     ///This method runs BFS algorithm in order to compute
  1045     ///This method runs BFS algorithm in order to visit all nodes
  1050     ///the shortest path to each node.
  1046     ///in the digraph.
  1051     void run()
  1047     void run()
  1052     {
  1048     {
  1053       run(INVALID);
  1049       run(INVALID);
  1054     }
  1050     }
  1055 
  1051 
  1693       return reached(t);
  1689       return reached(t);
  1694     }
  1690     }
  1695 
  1691 
  1696     /// \brief Runs the algorithm to visit all nodes in the digraph.
  1692     /// \brief Runs the algorithm to visit all nodes in the digraph.
  1697     ///
  1693     ///
  1698     /// This method runs the %BFS algorithm in order to
  1694     /// This method runs the %BFS algorithm in order to visit all nodes
  1699     /// compute the shortest path to each node.
  1695     /// in the digraph.
  1700     ///
       
  1701     /// The algorithm computes
       
  1702     /// - the shortest path tree (forest),
       
  1703     /// - the distance of each node from the root(s).
       
  1704     ///
  1696     ///
  1705     /// \note <tt>b.run(s)</tt> is just a shortcut of the following code.
  1697     /// \note <tt>b.run(s)</tt> is just a shortcut of the following code.
  1706     ///\code
  1698     ///\code
  1707     ///  b.init();
  1699     ///  b.init();
  1708     ///  for (NodeIt n(gr); n != INVALID; ++n) {
  1700     ///  for (NodeIt n(gr); n != INVALID; ++n) {