# HG changeset patch # User deba # Date 1145343752 0 # Node ID ebf3b2962554dac2890a51eb4bd8296c4b079f52 # Parent 0b1fc1566fdbf045449fe46829835f68ae6641f8 Doc fix diff -r 0b1fc1566fdb -r ebf3b2962554 lemon/bellman_ford.h --- a/lemon/bellman_ford.h Tue Apr 18 07:01:55 2006 +0000 +++ b/lemon/bellman_ford.h Tue Apr 18 07:02:32 2006 +0000 @@ -420,11 +420,20 @@ /// \brief Executes one round from the bellman ford algorithm. /// - /// If the algoritm calculated the distances in the previous round - /// strictly for all at most k length paths then it will calculate the - /// distances strictly for all at most k + 1 length paths. With k - /// iteration this function calculates the at most k length paths. - /// \return %True when the algorithm have not found more shorter paths. + /// If the algoritm calculated the distances in the previous round + /// exactly for all at most \f$ k \f$ length path lengths then it will + /// calculate the distances exactly for all at most \f$ k + 1 \f$ + /// length path lengths. With \f$ k \f$ iteration this function + /// calculates the at most \f$ k \f$ length path lengths. + /// + /// \warning The paths with limited edge number cannot be retrieved + /// easily with \ref getPath() or \ref predEdge() functions. If you + /// need the shortest path and not just the distance you should store + /// after each iteration the \ref predEdgeMap() map and manually build + /// the path. + /// + /// \return %True when the algorithm have not found more shorter + /// paths. bool processNextRound() { for (int i = 0; i < (int)_process.size(); ++i) { _mask->set(_process[i], false); @@ -526,13 +535,21 @@ /// \pre init() must be called and at least one node should be added /// with addSource() before using this function. /// - /// This method runs the %BellmanFord algorithm from the root node(s) - /// in order to compute the shortest path with at most \c length edge - /// long paths to each node. The algorithm computes - /// - The shortest path tree. + /// This method runs the %BellmanFord algorithm from the root + /// node(s) in order to compute the shortest path lengths with at + /// most \c num edge. + /// + /// \warning The paths with limited edge number cannot be retrieved + /// easily with \ref getPath() or \ref predEdge() functions. If you + /// need the shortest path and not just the distance you should store + /// after each iteration the \ref predEdgeMap() map and manually build + /// the path. + /// + /// The algorithm computes + /// - The predecessor edge from each node. /// - The limited distance of each node from the root(s). - void limitedStart(int length) { - for (int i = 0; i < length; ++i) { + void limitedStart(int num) { + for (int i = 0; i < num; ++i) { if (processNextRound()) break; } } diff -r 0b1fc1566fdb -r ebf3b2962554 lemon/edmonds_karp.h --- a/lemon/edmonds_karp.h Tue Apr 18 07:01:55 2006 +0000 +++ b/lemon/edmonds_karp.h Tue Apr 18 07:02:32 2006 +0000 @@ -41,10 +41,10 @@ /// edges should be passed to the algorithm through the /// constructor. /// - /// The time complexity of the algorithm is O(n * e^2) in worst case. - /// Always try the preflow algorithm instead of this if you does not - /// have some additional reason than to compute the optimal flow which - /// has O(n^3) time complexity. + /// The time complexity of the algorithm is \f$ O(n * e^2) \f$ in + /// worst case. Always try the preflow algorithm instead of this if + /// you does not have some additional reason than to compute the + /// optimal flow which has \f$ O(n^3) \f$ time complexity. /// /// \param _Graph The directed graph type the algorithm runs on. /// \param _Number The number type of the capacities and the flow values. @@ -53,10 +53,15 @@ /// \param _Tolerance The tolerance class to handle computation problems. /// /// \author Balazs Dezso +#ifdef DOXYGEN + template +#else template , typename _FlowMap = typename _Graph::template EdgeMap<_Number>, typename _Tolerance = Tolerance<_Number> > +#endif class EdmondsKarp { public: @@ -107,9 +112,6 @@ /// \param capacity The capacity of the edges. /// \param flow The flow of the edges. /// \param tolerance Tolerance class. - /// Except the graph, all of these parameters can be reset by - /// calling \ref source, \ref target, \ref capacityMap and \ref - /// flowMap, resp. EdmondsKarp(const Graph& graph, Node source, Node target, const CapacityMap& capacity, FlowMap& flow, const Tolerance& tolerance = Tolerance()) @@ -239,10 +241,11 @@ /// \brief runs the algorithm. /// /// It is just a shorthand for: - /// \code + /// + ///\code /// ek.init(); /// ek.start(); - /// \endcode + ///\endcode void run() { init(); start();