[Lemon-commits] Peter Kovacs: Change the default scaling factor ...

Lemon HG hg at lemon.cs.elte.hu
Thu Mar 17 18:16:28 CET 2011


details:   http://lemon.cs.elte.hu/hg/lemon/rev/a07b6b27fe69
changeset: 1049:a07b6b27fe69
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Tue Mar 15 19:54:11 2011 +0100
description:
	Change the default scaling factor in CostScaling (#417)

diffstat:

 lemon/cost_scaling.h |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff --git a/lemon/cost_scaling.h b/lemon/cost_scaling.h
--- a/lemon/cost_scaling.h
+++ b/lemon/cost_scaling.h
@@ -487,7 +487,7 @@
     ///
     /// \param method The internal method that will be used in the
     /// algorithm. For more information, see \ref Method.
-    /// \param factor The cost scaling factor. It must be larger than one.
+    /// \param factor The cost scaling factor. It must be at least two.
     ///
     /// \return \c INFEASIBLE if no feasible flow exists,
     /// \n \c OPTIMAL if the problem has optimal solution
@@ -501,7 +501,8 @@
     ///
     /// \see ProblemType, Method
     /// \see resetParams(), reset()
-    ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 8) {
+    ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 16) {
+      LEMON_ASSERT(factor >= 2, "The scaling factor must be at least 2");
       _alpha = factor;
       ProblemType pt = init();
       if (pt != OPTIMAL) return pt;



More information about the Lemon-commits mailing list