| ... | ... |
@@ -478,39 +478,40 @@ |
| 478 | 478 |
/// .supplyMap(sup).run(); |
| 479 | 479 |
/// \endcode |
| 480 | 480 |
/// |
| 481 | 481 |
/// This function can be called more than once. All the given parameters |
| 482 | 482 |
/// are kept for the next call, unless \ref resetParams() or \ref reset() |
| 483 | 483 |
/// is used, thus only the modified parameters have to be set again. |
| 484 | 484 |
/// If the underlying digraph was also modified after the construction |
| 485 | 485 |
/// of the class (or the last \ref reset() call), then the \ref reset() |
| 486 | 486 |
/// function must be called. |
| 487 | 487 |
/// |
| 488 | 488 |
/// \param method The internal method that will be used in the |
| 489 | 489 |
/// algorithm. For more information, see \ref Method. |
| 490 |
/// \param factor The cost scaling factor. It must be |
|
| 490 |
/// \param factor The cost scaling factor. It must be at least two. |
|
| 491 | 491 |
/// |
| 492 | 492 |
/// \return \c INFEASIBLE if no feasible flow exists, |
| 493 | 493 |
/// \n \c OPTIMAL if the problem has optimal solution |
| 494 | 494 |
/// (i.e. it is feasible and bounded), and the algorithm has found |
| 495 | 495 |
/// optimal flow and node potentials (primal and dual solutions), |
| 496 | 496 |
/// \n \c UNBOUNDED if the digraph contains an arc of negative cost |
| 497 | 497 |
/// and infinite upper bound. It means that the objective function |
| 498 | 498 |
/// is unbounded on that arc, however, note that it could actually be |
| 499 | 499 |
/// bounded over the feasible flows, but this algroithm cannot handle |
| 500 | 500 |
/// these cases. |
| 501 | 501 |
/// |
| 502 | 502 |
/// \see ProblemType, Method |
| 503 | 503 |
/// \see resetParams(), reset() |
| 504 |
ProblemType run(Method method = PARTIAL_AUGMENT, int factor = |
|
| 504 |
ProblemType run(Method method = PARTIAL_AUGMENT, int factor = 16) {
|
|
| 505 |
LEMON_ASSERT(factor >= 2, "The scaling factor must be at least 2"); |
|
| 505 | 506 |
_alpha = factor; |
| 506 | 507 |
ProblemType pt = init(); |
| 507 | 508 |
if (pt != OPTIMAL) return pt; |
| 508 | 509 |
start(method); |
| 509 | 510 |
return OPTIMAL; |
| 510 | 511 |
} |
| 511 | 512 |
|
| 512 | 513 |
/// \brief Reset all the parameters that have been given before. |
| 513 | 514 |
/// |
| 514 | 515 |
/// This function resets all the paramaters that have been given |
| 515 | 516 |
/// before using functions \ref lowerMap(), \ref upperMap(), |
| 516 | 517 |
/// \ref costMap(), \ref supplyMap(), \ref stSupply(). |
0 comments (0 inline)