Changes in lemon/bfs.h [281:e9b4fbe163f5:287:bb40b6db0a58] in lemon
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/bfs.h
r281 r287 605 605 /// 606 606 ///This method runs the %BFS algorithm from the root node(s) 607 ///in order to compute the shortest path to \c dest.607 ///in order to compute the shortest path to \c t. 608 608 /// 609 609 ///The algorithm computes 610 /// the shortest path to \c dest,611 /// the distance of \c dest from the root(s).610 /// the shortest path to \c t, 611 /// the distance of \c t from the root(s). 612 612 /// 613 613 ///\pre init() must be called and at least one root node should be … … 621 621 /// } 622 622 ///\endcode 623 void start(Node dest)623 void start(Node t) 624 624 { 625 625 bool reach = false; 626 while ( !emptyQueue() && !reach ) processNextNode( dest, reach);626 while ( !emptyQueue() && !reach ) processNextNode(t, reach); 627 627 } 628 628 … … 662 662 } 663 663 664 ///Runs the algorithm from the given node.664 ///Runs the algorithm from the given source node. 665 665 666 666 ///This method runs the %BFS algorithm from node \c s … … 686 686 687 687 ///This method runs the %BFS algorithm from node \c s 688 ///in order to compute the shortest path to \c t.689 /// 690 /// \return The length of the shortest <tt>s</tt><tt>t</tt> path,691 /// if \c t is reachable form \c s, \c 0 otherwise.688 ///in order to compute the shortest path to node \c t 689 ///(it stops searching when \c t is processed). 690 /// 691 ///\return \c true if \c t is reachable form \c s. 692 692 /// 693 693 ///\note Apart from the return value, <tt>b.run(s,t)</tt> is just a … … 698 698 /// b.start(t); 699 699 ///\endcode 700 intrun(Node s,Node t) {700 bool run(Node s,Node t) { 701 701 init(); 702 702 addSource(s); 703 703 start(t); 704 return reached(t) ? _curr_dist : 0;704 return reached(t); 705 705 } 706 706 … … 1617 1617 /// 1618 1618 /// This method runs the %BFS algorithm from the root node(s) 1619 /// in order to compute the shortest path to \c dest.1619 /// in order to compute the shortest path to \c t. 1620 1620 /// 1621 1621 /// The algorithm computes 1622 ///  the shortest path to \c dest,1623 ///  the distance of \c dest from the root(s).1622 ///  the shortest path to \c t, 1623 ///  the distance of \c t from the root(s). 1624 1624 /// 1625 1625 /// \pre init() must be called and at least one root node should be … … 1633 1633 /// } 1634 1634 /// \endcode 1635 void start(Node dest) {1635 void start(Node t) { 1636 1636 bool reach = false; 1637 while ( !emptyQueue() && !reach ) processNextNode( dest, reach);1637 while ( !emptyQueue() && !reach ) processNextNode(t, reach); 1638 1638 } 1639 1639 … … 1673 1673 } 1674 1674 1675 /// \brief Runs the algorithm from the given node.1675 /// \brief Runs the algorithm from the given source node. 1676 1676 /// 1677 1677 /// This method runs the %BFS algorithm from node \c s … … 1692 1692 addSource(s); 1693 1693 start(); 1694 } 1695 1696 /// \brief Finds the shortest path between \c s and \c t. 1697 /// 1698 /// This method runs the %BFS algorithm from node \c s 1699 /// in order to compute the shortest path to node \c t 1700 /// (it stops searching when \c t is processed). 1701 /// 1702 /// \return \c true if \c t is reachable form \c s. 1703 /// 1704 /// \note Apart from the return value, <tt>b.run(s,t)</tt> is just a 1705 /// shortcut of the following code. 1706 ///\code 1707 /// b.init(); 1708 /// b.addSource(s); 1709 /// b.start(t); 1710 ///\endcode 1711 bool run(Node s,Node t) { 1712 init(); 1713 addSource(s); 1714 start(t); 1715 return reached(t); 1694 1716 } 1695 1717
Note: See TracChangeset
for help on using the changeset viewer.