diff --git a/CHANGELOG b/CHANGELOG index c9c6ec2a97..300e704183 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -30,6 +30,7 @@ Interface changes - limits/primal to terminate the solve as soon as the primal bound is at least as good as this value, same as limits/objectivestop (deprecated) - limits/dual to terminate the solve as soon as the dual bound is at least as good as this value +- presolving/milp/internalmaxrounds to control the maximal rounds for each call of the milp presolver (PaPILO) ### New data structures diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 24306cc3c2..d62e3d2e2f 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -87,19 +87,20 @@ SCIP_RETCODE SCIPincludePresolMILP( #include "papilo/core/ProblemBuilder.hpp" #include "papilo/Config.hpp" -#define PRESOL_NAME "milp" -#define PRESOL_DESC "MILP specific presolving methods" -#define PRESOL_PRIORITY 9999999 /**< priority of the presolver (>= 0: before, < 0: after constraint handlers); combined with propagators */ -#define PRESOL_MAXROUNDS -1 /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */ -#define PRESOL_TIMING SCIP_PRESOLTIMING_MEDIUM /* timing of the presolver (fast, medium, or exhaustive) */ +#define PRESOL_NAME "milp" +#define PRESOL_DESC "MILP specific presolving methods" +#define PRESOL_PRIORITY 9999999 /**< priority of the presolver (>= 0: before, < 0: after constraint handlers); combined with propagators */ +#define PRESOL_MAXROUNDS -1 /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */ +#define PRESOL_TIMING SCIP_PRESOLTIMING_MEDIUM /* timing of the presolver (fast, medium, or exhaustive) */ /* default parameter values */ #define DEFAULT_THREADS 1 /**< maximum number of threads presolving may use (0: automatic) */ #define DEFAULT_MAXFILLINPERSUBST 3 /**< maximal possible fillin for substitutions to be considered */ #define DEFAULT_MAXSHIFTPERROW 10 /**< maximal amount of nonzeros allowed to be shifted to make space for substitutions */ #define DEFAULT_DETECTLINDEP 0 /**< should linear dependent equations and free columns be removed? (0: never, 1: for LPs, 2: always) */ -#define DEFAULT_MAXBADGESIZE_SEQ 15000 /**< the max badge size in Probing if PaPILO is executed in sequential mode*/ -#define DEFAULT_MAXBADGESIZE_PAR -1 /**< the max badge size in Probing if PaPILO is executed in parallel mode*/ +#define DEFAULT_MAXBADGESIZE_SEQ 15000 /**< the max badge size in Probing if PaPILO is executed in sequential mode */ +#define DEFAULT_MAXBADGESIZE_PAR -1 /**< the max badge size in Probing if PaPILO is executed in parallel mode */ +#define DEFAULT_INTERNAL_MAXROUNDS -1 /**< internal max rounds in PaPILO (-1: no limit, 0: model cleanup) */ #define DEFAULT_RANDOMSEED 0 /**< the random seed used for randomization of tie breaking */ #define DEFAULT_MODIFYCONSFAC 0.8 /**< modify SCIP constraints when the number of nonzeros or rows is at most this * factor times the number of nonzeros or rows before presolving */ @@ -125,8 +126,9 @@ struct SCIP_PresolData int lastnrows; /**< the number of rows from the last call */ int threads; /**< maximum number of threads presolving may use (0: automatic) */ int maxfillinpersubstitution; /**< maximal possible fillin for substitutions to be considered */ - int maxbadgesizeseq; /**< the max badge size in Probing if PaPILO is called in sequential mode*/ + int maxbadgesizeseq; /**< the max badge size in Probing if PaPILO is called in sequential mode */ int maxbadgesizepar; /**< the max badge size in Probing if PaPILO is called in parallel mode */ + int internalmaxrounds; /**< internal max rounds in PaPILO (-1: no limit, 0: model cleanup) */ int maxshiftperrow; /**< maximal amount of nonzeros allowed to be shifted to make space for substitutions */ int detectlineardependency; /**< should linear dependent equations and free columns be removed? (0: never, 1: for LPs, 2: always) */ int randomseed; /**< the random seed used for randomization of tie breaking */ @@ -343,6 +345,9 @@ SCIP_DECL_PRESOLEXEC(presolExecMILP) presolve.getPresolveOptions().threads = 1; #endif +#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3) + presolve.getPresolveOptions().maxrounds = data->internalmaxrounds; +#endif /* disable dual reductions that are not permitted */ if( !complete ) @@ -936,6 +941,14 @@ SCIP_RETCODE SCIPincludePresolMILP( presoldata->maxbadgesizepar = DEFAULT_MAXBADGESIZE_PAR; #endif +#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3) + SCIP_CALL(SCIPaddIntParam(scip, "presolving/" PRESOL_NAME "/internalmaxrounds", + "internal maxrounds for each milp presolving (-1: no limit, 0: model cleanup)", + &presoldata->internalmaxrounds, TRUE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX, NULL, NULL)); +#else + presoldata->internalmaxrounds = DEFAULT_INTERNAL_MAXROUNDS; +#endif + SCIP_CALL( SCIPaddBoolParam(scip, "presolving/" PRESOL_NAME "/enableparallelrows", "should the parallel rows presolver be enabled within the presolve library?",