# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1363436075 -3600
# Node ID 7bf489cf624efd8023bb1a9ba91302a12415fea0
# Parent dbaf21739390aee540985c2ce919f3025bff545e
Minor fixes and improvements in the doc (#459)
diff --git a/doc/groups.dox b/doc/groups.dox
a
|
b
|
|
392 | 392 | |
393 | 393 | This group contains the algorithms for finding minimum cost flows and |
394 | 394 | circulations \ref amo93networkflows. For more information about this |
395 | | problem and its dual solution, see \ref min_cost_flow |
| 395 | problem and its dual solution, see: \ref min_cost_flow |
396 | 396 | "Minimum Cost Flow Problem". |
397 | 397 | |
398 | 398 | LEMON contains several algorithms for this problem. |
… |
… |
|
484 | 484 | most efficient one, though the best known theoretical bound on its running |
485 | 485 | time is exponential. |
486 | 486 | Both \ref KarpMmc "Karp" and \ref HartmannOrlinMmc "Hartmann-Orlin" algorithms |
487 | | run in time O(ne) and use space O(n<sup>2</sup>+e), but the latter one is |
488 | | typically faster due to the applied early termination scheme. |
| 487 | run in time O(ne) and use space O(n<sup>2</sup>+e). |
489 | 488 | */ |
490 | 489 | |
491 | 490 | /** |
diff --git a/lemon/capacity_scaling.h b/lemon/capacity_scaling.h
a
|
b
|
|
68 | 68 | /// of the successive shortest path algorithm for finding a |
69 | 69 | /// \ref min_cost_flow "minimum cost flow" \ref amo93networkflows, |
70 | 70 | /// \ref edmondskarp72theoretical. It is an efficient dual |
71 | | /// solution method. |
| 71 | /// solution method, which runs in polynomial time |
| 72 | /// \f$O(e\log U (n+e)\log n)\f$, where <i>U</i> denotes the maximum |
| 73 | /// of node supply and arc capacity values. |
72 | 74 | /// |
73 | 75 | /// This algorithm is typically slower than \ref CostScaling and |
74 | 76 | /// \ref NetworkSimplex, but in special cases, it can be more |
diff --git a/lemon/concepts/bpgraph.h b/lemon/concepts/bpgraph.h
a
|
b
|
|
997 | 997 | |
998 | 998 | /// \brief The base node of the iterator. |
999 | 999 | /// |
1000 | | /// Returns the base node of the given incomming arc iterator |
| 1000 | /// Returns the base node of the given incoming arc iterator |
1001 | 1001 | /// (i.e. the target node of the corresponding arc). |
1002 | 1002 | Node baseNode(InArcIt) const { return INVALID; } |
1003 | 1003 | |
1004 | 1004 | /// \brief The running node of the iterator. |
1005 | 1005 | /// |
1006 | | /// Returns the running node of the given incomming arc iterator |
| 1006 | /// Returns the running node of the given incoming arc iterator |
1007 | 1007 | /// (i.e. the source node of the corresponding arc). |
1008 | 1008 | Node runningNode(InArcIt) const { return INVALID; } |
1009 | 1009 | |
diff --git a/lemon/concepts/digraph.h b/lemon/concepts/digraph.h
a
|
b
|
|
409 | 409 | |
410 | 410 | /// \brief The base node of the iterator. |
411 | 411 | /// |
412 | | /// Returns the base node of the given incomming arc iterator |
| 412 | /// Returns the base node of the given incoming arc iterator |
413 | 413 | /// (i.e. the target node of the corresponding arc). |
414 | 414 | Node baseNode(InArcIt) const { return INVALID; } |
415 | 415 | |
416 | 416 | /// \brief The running node of the iterator. |
417 | 417 | /// |
418 | | /// Returns the running node of the given incomming arc iterator |
| 418 | /// Returns the running node of the given incoming arc iterator |
419 | 419 | /// (i.e. the source node of the corresponding arc). |
420 | 420 | Node runningNode(InArcIt) const { return INVALID; } |
421 | 421 | |
diff --git a/lemon/concepts/graph.h b/lemon/concepts/graph.h
a
|
b
|
|
757 | 757 | |
758 | 758 | /// \brief The base node of the iterator. |
759 | 759 | /// |
760 | | /// Returns the base node of the given incomming arc iterator |
| 760 | /// Returns the base node of the given incoming arc iterator |
761 | 761 | /// (i.e. the target node of the corresponding arc). |
762 | 762 | Node baseNode(InArcIt) const { return INVALID; } |
763 | 763 | |
764 | 764 | /// \brief The running node of the iterator. |
765 | 765 | /// |
766 | | /// Returns the running node of the given incomming arc iterator |
| 766 | /// Returns the running node of the given incoming arc iterator |
767 | 767 | /// (i.e. the source node of the corresponding arc). |
768 | 768 | Node runningNode(InArcIt) const { return INVALID; } |
769 | 769 | |
diff --git a/lemon/concepts/graph_components.h b/lemon/concepts/graph_components.h
a
|
b
|
|
875 | 875 | /// This function gives back the next arc in the iteration order. |
876 | 876 | void next(Arc&) const {} |
877 | 877 | |
878 | | /// \brief Return the first arc incomming to the given node. |
| 878 | /// \brief Return the first arc incoming to the given node. |
879 | 879 | /// |
880 | | /// This function gives back the first arc incomming to the |
| 880 | /// This function gives back the first arc incoming to the |
881 | 881 | /// given node. |
882 | 882 | void firstIn(Arc&, const Node&) const {} |
883 | 883 | |
884 | | /// \brief Return the next arc incomming to the given node. |
| 884 | /// \brief Return the next arc incoming to the given node. |
885 | 885 | /// |
886 | | /// This function gives back the next arc incomming to the |
| 886 | /// This function gives back the next arc incoming to the |
887 | 887 | /// given node. |
888 | 888 | void nextIn(Arc&) const {} |
889 | 889 | |
diff --git a/lemon/cost_scaling.h b/lemon/cost_scaling.h
a
|
b
|
|
96 | 96 | /// It is a highly efficient primal-dual solution method, which |
97 | 97 | /// can be viewed as the generalization of the \ref Preflow |
98 | 98 | /// "preflow push-relabel" algorithm for the maximum flow problem. |
| 99 | /// It is a polynomial algorithm, its running time complexity is |
| 100 | /// \f$O(n^2e\log(nK))\f$, where <i>K</i> denotes the maximum arc cost. |
99 | 101 | /// |
100 | 102 | /// In general, \ref NetworkSimplex and \ref CostScaling are the fastest |
101 | 103 | /// implementations available in LEMON for solving this problem. |
… |
… |
|
1269 | 1271 | int u = _buckets[r]; |
1270 | 1272 | _buckets[r] = _bucket_next[u]; |
1271 | 1273 | |
1272 | | // Search the incomming arcs of u |
| 1274 | // Search the incoming arcs of u |
1273 | 1275 | LargeCost pi_u = _pi[u]; |
1274 | 1276 | int last_out = _first_out[u+1]; |
1275 | 1277 | for (int a = _first_out[u]; a != last_out; ++a) { |
diff --git a/lemon/cycle_canceling.h b/lemon/cycle_canceling.h
a
|
b
|
|
51 | 51 | /// \ref goldberg89cyclecanceling. |
52 | 52 | /// The most efficent one is the \ref CANCEL_AND_TIGHTEN |
53 | 53 | /// "Cancel-and-Tighten" algorithm, thus it is the default method. |
54 | | /// It runs in strongly polynomial time, but in practice, it is typically |
55 | | /// orders of magnitude slower than the scaling algorithms and |
56 | | /// \ref NetworkSimplex. |
| 54 | /// It runs in strongly polynomial time O(n<sup>2</sup>e<sup>2</sup>log(n)), |
| 55 | /// but in practice, it is typically orders of magnitude slower than |
| 56 | /// the scaling algorithms and \ref NetworkSimplex. |
57 | 57 | /// (For more information, see \ref min_cost_flow_algs "the module page".) |
58 | 58 | /// |
59 | 59 | /// Most of the parameters of the problem (except for the digraph) |
diff --git a/lemon/hartmann_orlin_mmc.h b/lemon/hartmann_orlin_mmc.h
a
|
b
|
|
99 | 99 | /// This class implements the Hartmann-Orlin algorithm for finding |
100 | 100 | /// a directed cycle of minimum mean cost in a digraph |
101 | 101 | /// \ref hartmann93finding, \ref dasdan98minmeancycle. |
102 | | /// It is an improved version of \ref KarpMmc "Karp"'s original algorithm, |
103 | | /// it applies an efficient early termination scheme. |
104 | | /// It runs in time O(ne) and uses space O(n<sup>2</sup>+e). |
| 102 | /// This method is based on \ref KarpMmc "Karp"'s original algorithm, but |
| 103 | /// applies an early termination scheme. It makes the algorithm |
| 104 | /// significantly faster for some problem instances, but slower for others. |
| 105 | /// The algorithm runs in time O(ne) and uses space O(n<sup>2</sup>+e). |
105 | 106 | /// |
106 | 107 | /// \tparam GR The type of the digraph the algorithm runs on. |
107 | 108 | /// \tparam CM The type of the cost map. The default |
… |
… |
|
274 | 275 | /// found cycle. |
275 | 276 | /// |
276 | 277 | /// If you don't call this function before calling \ref run() or |
277 | | /// \ref findCycleMean(), it will allocate a local \ref Path "path" |
278 | | /// structure. The destuctor deallocates this automatically |
| 278 | /// \ref findCycleMean(), a local \ref Path "path" structure |
| 279 | /// will be allocated. The destuctor deallocates this automatically |
279 | 280 | /// allocated object, of course. |
280 | 281 | /// |
281 | 282 | /// \note The algorithm calls only the \ref lemon::Path::addFront() |
diff --git a/lemon/howard_mmc.h b/lemon/howard_mmc.h
a
|
b
|
|
282 | 282 | /// found cycle. |
283 | 283 | /// |
284 | 284 | /// If you don't call this function before calling \ref run() or |
285 | | /// \ref findCycleMean(), it will allocate a local \ref Path "path" |
286 | | /// structure. The destuctor deallocates this automatically |
| 285 | /// \ref findCycleMean(), a local \ref Path "path" structure |
| 286 | /// will be allocated. The destuctor deallocates this automatically |
287 | 287 | /// allocated object, of course. |
288 | 288 | /// |
289 | 289 | /// \note The algorithm calls only the \ref lemon::Path::addBack() |
diff --git a/lemon/karp_mmc.h b/lemon/karp_mmc.h
a
|
b
|
|
270 | 270 | /// found cycle. |
271 | 271 | /// |
272 | 272 | /// If you don't call this function before calling \ref run() or |
273 | | /// \ref findCycleMean(), it will allocate a local \ref Path "path" |
274 | | /// structure. The destuctor deallocates this automatically |
| 273 | /// \ref findCycleMean(), a local \ref Path "path" structure |
| 274 | /// will be allocated. The destuctor deallocates this automatically |
275 | 275 | /// allocated object, of course. |
276 | 276 | /// |
277 | 277 | /// \note The algorithm calls only the \ref lemon::Path::addFront() |
diff --git a/lemon/list_graph.h b/lemon/list_graph.h
a
|
b
|
|
445 | 445 | ///\note The moved arcs are joined to node \c u using changeSource() |
446 | 446 | ///or changeTarget(), thus \c ArcIt and \c OutArcIt iterators are |
447 | 447 | ///invalidated for the outgoing arcs of node \c v and \c InArcIt |
448 | | ///iterators are invalidated for the incomming arcs of \c v. |
| 448 | ///iterators are invalidated for the incoming arcs of \c v. |
449 | 449 | ///Moreover all iterators referencing node \c v or the removed |
450 | 450 | ///loops are also invalidated. Other iterators remain valid. |
451 | 451 | /// |
diff --git a/lemon/network_simplex.h b/lemon/network_simplex.h
a
|
b
|
|
1503 | 1503 | } |
1504 | 1504 | } |
1505 | 1505 | } else { |
1506 | | // Find the min. cost incomming arc for each demand node |
| 1506 | // Find the min. cost incoming arc for each demand node |
1507 | 1507 | for (int i = 0; i != int(demand_nodes.size()); ++i) { |
1508 | 1508 | Node v = demand_nodes[i]; |
1509 | 1509 | Cost c, min_cost = std::numeric_limits<Cost>::max(); |