[Lemon-commits] deba: r3399 - lemon/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Tue Nov 27 16:41:45 CET 2007
Author: deba
Date: Tue Nov 27 16:41:43 2007
New Revision: 3399
Modified:
lemon/trunk/lemon/dinitz_sleator_tarjan.h
lemon/trunk/lemon/edmonds_karp.h
lemon/trunk/lemon/goldberg_tarjan.h
lemon/trunk/lemon/preflow.h
Log:
Performance bug in Preflow
The initial relabeling moved each node to the lowest level
Doc bug fix
Modified: lemon/trunk/lemon/dinitz_sleator_tarjan.h
==============================================================================
--- lemon/trunk/lemon/dinitz_sleator_tarjan.h (original)
+++ lemon/trunk/lemon/dinitz_sleator_tarjan.h Tue Nov 27 16:41:43 2007
@@ -701,9 +701,10 @@
/// @}
- /// \name Query Functions
- /// The result of the %Dijkstra algorithm can be obtained using these
- /// functions.\n
+ /// \name Query Functions
+ /// The result of the Dinitz-Sleator-Tarjan algorithm can be
+ /// obtained using these functions.
+ /// \n
/// Before the use of these functions,
/// either run() or start() must be called.
Modified: lemon/trunk/lemon/edmonds_karp.h
==============================================================================
--- lemon/trunk/lemon/edmonds_karp.h (original)
+++ lemon/trunk/lemon/edmonds_karp.h Tue Nov 27 16:41:43 2007
@@ -467,7 +467,7 @@
/// @}
/// \name Query Functions
- /// The result of the %Dijkstra algorithm can be obtained using these
+ /// The result of the Edmonds-Karp algorithm can be obtained using these
/// functions.\n
/// Before the use of these functions,
/// either run() or start() must be called.
Modified: lemon/trunk/lemon/goldberg_tarjan.h
==============================================================================
--- lemon/trunk/lemon/goldberg_tarjan.h (original)
+++ lemon/trunk/lemon/goldberg_tarjan.h Tue Nov 27 16:41:43 2007
@@ -103,13 +103,13 @@
/// of the Goldberg's \ref Preflow "preflow" algorithm by using the \ref
/// DynamicTree "dynamic tree" data structure of Sleator and Tarjan.
///
- /// The original preflow algorithm with \e "highest label" or \e
- /// FIFO heuristic has \f$O(n^3)\f$ time complexity. The current
- /// algorithm improved this complexity to
- /// \f$O(nm\log(\frac{n^2}{m}))\f$. The algorithm builds limited
- /// size dynamic trees on the residual graph, which can be used to
- /// make multilevel push operations and gives a better bound on the
- /// number of non-saturating pushes.
+ /// The original preflow algorithm with \e highest \e label
+ /// heuristic has \f$O(n^2\sqrt{e})\f$ or with \e FIFO heuristic has
+ /// \f$O(n^3)\f$ time complexity. The current algorithm improved
+ /// this complexity to \f$O(nm\log(\frac{n^2}{m}))\f$. The algorithm
+ /// builds limited size dynamic trees on the residual graph, which
+ /// can be used to make multilevel push operations and gives a
+ /// better bound on the number of non-saturating pushes.
///
/// \param Graph The directed graph type the algorithm runs on.
/// \param CapacityMap The capacity map type.
@@ -965,11 +965,12 @@
/// @}
- /// \name Query Functions
- /// The result of the %Dijkstra algorithm can be obtained using these
- /// functions.\n
- /// Before the use of these functions,
- /// either run() or start() must be called.
+ /// \name Query Functions
+ /// The result of the Goldberg-Tarjan algorithm can be obtained
+ /// using these functions.
+ /// \n
+ /// Before the use of these functions, either run() or start() must
+ /// be called.
///@{
Modified: lemon/trunk/lemon/preflow.h
==============================================================================
--- lemon/trunk/lemon/preflow.h (original)
+++ lemon/trunk/lemon/preflow.h Tue Nov 27 16:41:43 2007
@@ -72,7 +72,7 @@
///
/// \sa Elevator
/// \sa LinkedElevator
- typedef LinkedElevator<Graph, typename Graph::Node> Elevator;
+ typedef Elevator<Graph, typename Graph::Node> Elevator;
/// \brief Instantiates an Elevator.
///
@@ -100,7 +100,7 @@
/// directed graph. The preflow algorithms are the fastest known max
/// flow algorithms. The current implementation use a mixture of the
/// \e "highest label" and the \e "bound decrease" heuristics.
- /// The worst case time complexity of the algorithm is \f$O(n^3)\f$.
+ /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{e})\f$.
///
/// The algorithm consists from two phases. After the first phase
/// the maximal flow value and the minimum cut can be obtained. The
@@ -407,6 +407,7 @@
queue.push_back(_target);
reached.set(_target, true);
while (!queue.empty()) {
+ _level->initNewLevel();
std::vector<Node> nqueue;
for (int i = 0; i < int(queue.size()); ++i) {
Node n = queue[i];
@@ -863,7 +864,7 @@
/// @}
/// \name Query Functions
- /// The result of the %Dijkstra algorithm can be obtained using these
+ /// The result of the %Preflow algorithm can be obtained using these
/// functions.\n
/// Before the use of these functions,
/// either run() or start() must be called.
More information about the Lemon-commits
mailing list