0
4
0
| ... | ... |
@@ -388,12 +388,46 @@ |
| 388 | 388 |
|
| 389 | 389 |
If you want to find minimum cut just between two distinict nodes, |
| 390 | 390 |
see the \ref max_flow "maximum flow problem". |
| 391 | 391 |
*/ |
| 392 | 392 |
|
| 393 | 393 |
/** |
| 394 |
@defgroup min_mean_cycle Minimum Mean Cycle Algorithms |
|
| 395 |
@ingroup algs |
|
| 396 |
\brief Algorithms for finding minimum mean cycles. |
|
| 397 |
|
|
| 398 |
This group contains the algorithms for finding minimum mean cycles. |
|
| 399 |
|
|
| 400 |
The \e minimum \e mean \e cycle \e problem is to find a directed cycle |
|
| 401 |
of minimum mean length (cost) in a digraph. |
|
| 402 |
The mean length of a cycle is the average length of its arcs, i.e. the |
|
| 403 |
ratio between the total length of the cycle and the number of arcs on it. |
|
| 404 |
|
|
| 405 |
This problem has an important connection to \e conservative \e length |
|
| 406 |
\e functions, too. A length function on the arcs of a digraph is called |
|
| 407 |
conservative if and only if there is no directed cycle of negative total |
|
| 408 |
length. For an arbitrary length function, the negative of the minimum |
|
| 409 |
cycle mean is the smallest \f$\epsilon\f$ value so that increasing the |
|
| 410 |
arc lengths uniformly by \f$\epsilon\f$ results in a conservative length |
|
| 411 |
function. |
|
| 412 |
|
|
| 413 |
LEMON contains three algorithms for solving the minimum mean cycle problem: |
|
| 414 |
- \ref Karp "Karp"'s original algorithm. |
|
| 415 |
- \ref HartmannOrlin "Hartmann-Orlin"'s algorithm, which is an improved |
|
| 416 |
version of Karp's algorithm. |
|
| 417 |
- \ref Howard "Howard"'s policy iteration algorithm. |
|
| 418 |
|
|
| 419 |
In practice, the Howard algorithm proved to be by far the most efficient |
|
| 420 |
one, though the best known theoretical bound on its running time is |
|
| 421 |
exponential. |
|
| 422 |
Both Karp and HartmannOrlin algorithms run in time O(ne) and use space |
|
| 423 |
O(n<sup>2</sup>+e), but the latter one is typically faster due to the |
|
| 424 |
applied early termination scheme. |
|
| 425 |
*/ |
|
| 426 |
|
|
| 427 |
/** |
|
| 394 | 428 |
@defgroup graph_properties Connectivity and Other Graph Properties |
| 395 | 429 |
@ingroup algs |
| 396 | 430 |
\brief Algorithms for discovering the graph properties |
| 397 | 431 |
|
| 398 | 432 |
This group contains the algorithms for discovering the graph properties |
| 399 | 433 |
like connectivity, bipartiteness, euler property, simplicity etc. |
| ... | ... |
@@ -16,13 +16,13 @@ |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_HARTMANN_ORLIN_H |
| 20 | 20 |
#define LEMON_HARTMANN_ORLIN_H |
| 21 | 21 |
|
| 22 |
/// \ingroup |
|
| 22 |
/// \ingroup min_mean_cycle |
|
| 23 | 23 |
/// |
| 24 | 24 |
/// \file |
| 25 | 25 |
/// \brief Hartmann-Orlin's algorithm for finding a minimum mean cycle. |
| 26 | 26 |
|
| 27 | 27 |
#include <vector> |
| 28 | 28 |
#include <limits> |
| ... | ... |
@@ -87,22 +87,23 @@ |
| 87 | 87 |
#endif |
| 88 | 88 |
typedef lemon::Tolerance<LargeValue> Tolerance; |
| 89 | 89 |
typedef lemon::Path<Digraph> Path; |
| 90 | 90 |
}; |
| 91 | 91 |
|
| 92 | 92 |
|
| 93 |
/// \addtogroup |
|
| 93 |
/// \addtogroup min_mean_cycle |
|
| 94 | 94 |
/// @{
|
| 95 | 95 |
|
| 96 | 96 |
/// \brief Implementation of the Hartmann-Orlin algorithm for finding |
| 97 | 97 |
/// a minimum mean cycle. |
| 98 | 98 |
/// |
| 99 | 99 |
/// This class implements the Hartmann-Orlin algorithm for finding |
| 100 | 100 |
/// a directed cycle of minimum mean length (cost) in a digraph. |
| 101 |
/// It is an improved version of \ref Karp "Karp's original algorithm |
|
| 101 |
/// It is an improved version of \ref Karp "Karp"'s original algorithm, |
|
| 102 | 102 |
/// it applies an efficient early termination scheme. |
| 103 |
/// It runs in time O(ne) and uses space O(n<sup>2</sup>+e). |
|
| 103 | 104 |
/// |
| 104 | 105 |
/// \tparam GR The type of the digraph the algorithm runs on. |
| 105 | 106 |
/// \tparam LEN The type of the length map. The default |
| 106 | 107 |
/// map type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". |
| 107 | 108 |
#ifdef DOXYGEN |
| 108 | 109 |
template <typename GR, typename LEN, typename TR> |
| ... | ... |
@@ -16,13 +16,13 @@ |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_HOWARD_H |
| 20 | 20 |
#define LEMON_HOWARD_H |
| 21 | 21 |
|
| 22 |
/// \ingroup |
|
| 22 |
/// \ingroup min_mean_cycle |
|
| 23 | 23 |
/// |
| 24 | 24 |
/// \file |
| 25 | 25 |
/// \brief Howard's algorithm for finding a minimum mean cycle. |
| 26 | 26 |
|
| 27 | 27 |
#include <vector> |
| 28 | 28 |
#include <limits> |
| ... | ... |
@@ -87,20 +87,23 @@ |
| 87 | 87 |
#endif |
| 88 | 88 |
typedef lemon::Tolerance<LargeValue> Tolerance; |
| 89 | 89 |
typedef lemon::Path<Digraph> Path; |
| 90 | 90 |
}; |
| 91 | 91 |
|
| 92 | 92 |
|
| 93 |
/// \addtogroup |
|
| 93 |
/// \addtogroup min_mean_cycle |
|
| 94 | 94 |
/// @{
|
| 95 | 95 |
|
| 96 | 96 |
/// \brief Implementation of Howard's algorithm for finding a minimum |
| 97 | 97 |
/// mean cycle. |
| 98 | 98 |
/// |
| 99 | 99 |
/// This class implements Howard's policy iteration algorithm for finding |
| 100 | 100 |
/// a directed cycle of minimum mean length (cost) in a digraph. |
| 101 |
/// This class provides the most efficient algorithm for the |
|
| 102 |
/// minimum mean cycle problem, though the best known theoretical |
|
| 103 |
/// bound on its running time is exponential. |
|
| 101 | 104 |
/// |
| 102 | 105 |
/// \tparam GR The type of the digraph the algorithm runs on. |
| 103 | 106 |
/// \tparam LEN The type of the length map. The default |
| 104 | 107 |
/// map type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". |
| 105 | 108 |
#ifdef DOXYGEN |
| 106 | 109 |
template <typename GR, typename LEN, typename TR> |
| ... | ... |
@@ -16,13 +16,13 @@ |
| 16 | 16 |
* |
| 17 | 17 |
*/ |
| 18 | 18 |
|
| 19 | 19 |
#ifndef LEMON_KARP_H |
| 20 | 20 |
#define LEMON_KARP_H |
| 21 | 21 |
|
| 22 |
/// \ingroup |
|
| 22 |
/// \ingroup min_mean_cycle |
|
| 23 | 23 |
/// |
| 24 | 24 |
/// \file |
| 25 | 25 |
/// \brief Karp's algorithm for finding a minimum mean cycle. |
| 26 | 26 |
|
| 27 | 27 |
#include <vector> |
| 28 | 28 |
#include <limits> |
| ... | ... |
@@ -87,20 +87,21 @@ |
| 87 | 87 |
#endif |
| 88 | 88 |
typedef lemon::Tolerance<LargeValue> Tolerance; |
| 89 | 89 |
typedef lemon::Path<Digraph> Path; |
| 90 | 90 |
}; |
| 91 | 91 |
|
| 92 | 92 |
|
| 93 |
/// \addtogroup |
|
| 93 |
/// \addtogroup min_mean_cycle |
|
| 94 | 94 |
/// @{
|
| 95 | 95 |
|
| 96 | 96 |
/// \brief Implementation of Karp's algorithm for finding a minimum |
| 97 | 97 |
/// mean cycle. |
| 98 | 98 |
/// |
| 99 | 99 |
/// This class implements Karp's algorithm for finding a directed |
| 100 | 100 |
/// cycle of minimum mean length (cost) in a digraph. |
| 101 |
/// It runs in time O(ne) and uses space O(n<sup>2</sup>+e). |
|
| 101 | 102 |
/// |
| 102 | 103 |
/// \tparam GR The type of the digraph the algorithm runs on. |
| 103 | 104 |
/// \tparam LEN The type of the length map. The default |
| 104 | 105 |
/// map type is \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". |
| 105 | 106 |
#ifdef DOXYGEN |
| 106 | 107 |
template <typename GR, typename LEN, typename TR> |
0 comments (0 inline)