[Lemon-commits] [lemon_svn] deba: r2703 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:54:36 CET 2006
Author: deba
Date: Tue Apr 18 09:02:32 2006
New Revision: 2703
Modified:
hugo/trunk/lemon/bellman_ford.h
hugo/trunk/lemon/edmonds_karp.h
Log:
Doc fix
Modified: hugo/trunk/lemon/bellman_ford.h
==============================================================================
--- hugo/trunk/lemon/bellman_ford.h (original)
+++ hugo/trunk/lemon/bellman_ford.h Tue Apr 18 09:02:32 2006
@@ -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;
}
}
Modified: hugo/trunk/lemon/edmonds_karp.h
==============================================================================
--- hugo/trunk/lemon/edmonds_karp.h (original)
+++ hugo/trunk/lemon/edmonds_karp.h Tue Apr 18 09:02:32 2006
@@ -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 <typename _Graph, typename _Number,
+ typename _CapacityMap, typename _FlowMap, typename _Tolerance>
+#else
template <typename _Graph, typename _Number,
typename _CapacityMap = typename _Graph::template EdgeMap<_Number>,
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();
More information about the Lemon-commits
mailing list