lemon/cost_scaling.h
changeset 938 a07b6b27fe69
parent 937 1226290a9b7d
child 1003 16f55008c863
equal deleted inserted replaced
22:13dba53e9603 23:c134a8d8384f
   485     /// of the class (or the last \ref reset() call), then the \ref reset()
   485     /// of the class (or the last \ref reset() call), then the \ref reset()
   486     /// function must be called.
   486     /// function must be called.
   487     ///
   487     ///
   488     /// \param method The internal method that will be used in the
   488     /// \param method The internal method that will be used in the
   489     /// algorithm. For more information, see \ref Method.
   489     /// algorithm. For more information, see \ref Method.
   490     /// \param factor The cost scaling factor. It must be larger than one.
   490     /// \param factor The cost scaling factor. It must be at least two.
   491     ///
   491     ///
   492     /// \return \c INFEASIBLE if no feasible flow exists,
   492     /// \return \c INFEASIBLE if no feasible flow exists,
   493     /// \n \c OPTIMAL if the problem has optimal solution
   493     /// \n \c OPTIMAL if the problem has optimal solution
   494     /// (i.e. it is feasible and bounded), and the algorithm has found
   494     /// (i.e. it is feasible and bounded), and the algorithm has found
   495     /// optimal flow and node potentials (primal and dual solutions),
   495     /// optimal flow and node potentials (primal and dual solutions),
   499     /// bounded over the feasible flows, but this algroithm cannot handle
   499     /// bounded over the feasible flows, but this algroithm cannot handle
   500     /// these cases.
   500     /// these cases.
   501     ///
   501     ///
   502     /// \see ProblemType, Method
   502     /// \see ProblemType, Method
   503     /// \see resetParams(), reset()
   503     /// \see resetParams(), reset()
   504     ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 8) {
   504     ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 16) {
       
   505       LEMON_ASSERT(factor >= 2, "The scaling factor must be at least 2");
   505       _alpha = factor;
   506       _alpha = factor;
   506       ProblemType pt = init();
   507       ProblemType pt = init();
   507       if (pt != OPTIMAL) return pt;
   508       if (pt != OPTIMAL) return pt;
   508       start(method);
   509       start(method);
   509       return OPTIMAL;
   510       return OPTIMAL;