equal
deleted
inserted
replaced
591 /// |
591 /// |
592 ///\pre init() must be called and at least one node should be added |
592 ///\pre init() must be called and at least one node should be added |
593 ///with addSource() before using this function. |
593 ///with addSource() before using this function. |
594 /// |
594 /// |
595 ///This method runs the %BFS algorithm from the root node(s) |
595 ///This method runs the %BFS algorithm from the root node(s) |
596 ///in order to |
596 ///in order to compute the shortest path to \c dest. |
597 ///compute the |
597 ///The algorithm computes |
598 ///shortest path to \c dest. The algorithm computes |
|
599 ///- The shortest path to \c dest. |
598 ///- The shortest path to \c dest. |
600 ///- The distance of \c dest from the root(s). |
599 ///- The distance of \c dest from the root(s). |
601 void start(Node dest) |
600 void start(Node dest) |
602 { |
601 { |
603 bool reach = false; |
602 bool reach = false; |
613 /// |
612 /// |
614 ///\param nm must be a bool (or convertible) node map. The |
613 ///\param nm must be a bool (or convertible) node map. The |
615 ///algorithm will stop when it reaches a node \c v with |
614 ///algorithm will stop when it reaches a node \c v with |
616 /// <tt>nm[v]</tt> true. |
615 /// <tt>nm[v]</tt> true. |
617 /// |
616 /// |
618 ///\return The reached node \c v with <tt>nm[v]<\tt> true or |
617 ///\return The reached node \c v with <tt>nm[v]</tt> true or |
619 ///\c INVALID if no such node was found. |
618 ///\c INVALID if no such node was found. |
620 template<class NM> |
619 template<class NM> |
621 Node start(const NM &nm) |
620 Node start(const NM &nm) |
622 { |
621 { |
623 Node rnode = INVALID; |
622 Node rnode = INVALID; |
1515 /// |
1514 /// |
1516 ///\param nm must be a bool (or convertible) node map. The |
1515 ///\param nm must be a bool (or convertible) node map. The |
1517 ///algorithm will stop when it reaches a node \c v with |
1516 ///algorithm will stop when it reaches a node \c v with |
1518 /// <tt>nm[v]</tt> true. |
1517 /// <tt>nm[v]</tt> true. |
1519 /// |
1518 /// |
1520 ///\return The reached node \c v with <tt>nm[v]<\tt> true or |
1519 ///\return The reached node \c v with <tt>nm[v]</tt> true or |
1521 ///\c INVALID if no such node was found. |
1520 ///\c INVALID if no such node was found. |
1522 template <typename NM> |
1521 template <typename NM> |
1523 Node start(const NM &nm) { |
1522 Node start(const NM &nm) { |
1524 Node rnode = INVALID; |
1523 Node rnode = INVALID; |
1525 while ( !emptyQueue() && rnode == INVALID ) { |
1524 while ( !emptyQueue() && rnode == INVALID ) { |