From c4481bcb62cd155e85d6e818a8af7d995ca76fa0 Mon Sep 17 00:00:00 2001 From: Alexander Hoen Date: Thu, 7 Mar 2024 10:43:34 +0100 Subject: [PATCH 01/10] 3682: introduce new parameter to control the rounds of papilo --- CHANGELOG | 3 +++ src/scip/presol_milp.cpp | 25 ++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2aab85367e..2ec1e4857e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -28,6 +28,9 @@ Interface changes ### New parameters +- presolving/milp/internalmaxrounds to control the maximal rounds of the milp presolver (PaPILO) + + ### New data structures Build system diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 24306cc3c2..05fe20633d 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -87,11 +87,11 @@ 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) */ @@ -100,6 +100,7 @@ SCIP_RETCODE SCIPincludePresolMILP( #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_INTERNAL_MAXROUNDS -1 /**< internal max rounds in PaPILO (-1: no limit)*/ #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 */ @@ -127,6 +128,7 @@ struct SCIP_PresolData 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 maxbadgesizepar; /**< the max badge size in Probing if PaPILO is called in parallel mode */ + int internalmaxrounds; /**< internal max rounds in PaPILO (-1: no limit)*/ 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,11 @@ 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 +943,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 in milp presolving", + &presoldata->internalmaxrounds, FALSE, 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?", From c2aeaf58afa6a785faa39c07aa1ffc6c95a78cec Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 11:28:09 +0100 Subject: [PATCH 02/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 05fe20633d..b0ae873edc 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -87,8 +87,8 @@ 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_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) */ From c06146e6f8037113d33506d8ad4e3565425a6355 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 11:28:14 +0100 Subject: [PATCH 03/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index b0ae873edc..cfdb1f0bff 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -346,7 +346,6 @@ SCIP_DECL_PRESOLEXEC(presolExecMILP) #endif #if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3) - presolve.getPresolveOptions().maxrounds = data->internalmaxrounds; #endif From b2782c46816a13d896450e8c7ce3a1c35ff562b0 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 11:28:27 +0100 Subject: [PATCH 04/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index cfdb1f0bff..79e771dd48 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -349,7 +349,6 @@ SCIP_DECL_PRESOLEXEC(presolExecMILP) presolve.getPresolveOptions().maxrounds = data->internalmaxrounds; #endif - /* disable dual reductions that are not permitted */ if( !complete ) presolve.getPresolveOptions().dualreds = 0; From 13017dc7a3612a5c243aa459bba29780ba368ff2 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 13:05:25 +0100 Subject: [PATCH 05/10] Apply 1 suggestion(s) to 1 file(s) --- CHANGELOG | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2ec1e4857e..bba59bb535 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -28,8 +28,7 @@ Interface changes ### New parameters -- presolving/milp/internalmaxrounds to control the maximal rounds of the milp presolver (PaPILO) - +- presolving/milp/internalmaxrounds to control the maximal rounds for each call of the milp presolver (PaPILO) ### New data structures From ac83a14bd480a95b1e78a43297ea63d32227c0fc Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 13:05:28 +0100 Subject: [PATCH 06/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 79e771dd48..998d1334a3 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -943,7 +943,7 @@ SCIP_RETCODE SCIPincludePresolMILP( #if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3) SCIP_CALL(SCIPaddIntParam(scip, "presolving/" PRESOL_NAME "/internalmaxrounds", - "(internal) maxrounds in milp presolving", + "internal maxrounds for each milp presolving", &presoldata->internalmaxrounds, FALSE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX, NULL, NULL)); #else presoldata->internalmaxrounds = DEFAULT_INTERNAL_MAXROUNDS; From 674bd1449364b4636488e10ca40a54a79aa79b9c Mon Sep 17 00:00:00 2001 From: Alexander Hoen Date: Tue, 12 Mar 2024 13:41:40 +0100 Subject: [PATCH 07/10] Indicate model cleanup --- src/scip/presol_milp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 998d1334a3..19cd5c512a 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -100,7 +100,7 @@ SCIP_RETCODE SCIPincludePresolMILP( #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_INTERNAL_MAXROUNDS -1 /**< internal max rounds in PaPILO (-1: no limit)*/ +#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 */ @@ -128,7 +128,7 @@ struct SCIP_PresolData 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 maxbadgesizepar; /**< the max badge size in Probing if PaPILO is called in parallel mode */ - int internalmaxrounds; /**< internal max rounds in PaPILO (-1: no limit)*/ + 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 */ @@ -943,7 +943,7 @@ SCIP_RETCODE SCIPincludePresolMILP( #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", + "internal maxrounds for each milp presolving (-1: no limit, 0: model cleanup)", &presoldata->internalmaxrounds, FALSE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX, NULL, NULL)); #else presoldata->internalmaxrounds = DEFAULT_INTERNAL_MAXROUNDS; From bfb362da924c122b774c588d1aae336380a700a4 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 13:46:04 +0100 Subject: [PATCH 08/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 19cd5c512a..2fc2a39b68 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -126,9 +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 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 */ From 8030725091762d3a12bcd7c010dafb16193dac89 Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Tue, 12 Mar 2024 13:46:10 +0100 Subject: [PATCH 09/10] Apply 1 suggestion(s) to 1 file(s) --- src/scip/presol_milp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index 2fc2a39b68..f0846f6a2b 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -98,9 +98,9 @@ SCIP_RETCODE SCIPincludePresolMILP( #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_INTERNAL_MAXROUNDS -1 /**< internal max rounds in PaPILO (-1: no limit, 0: model cleanup)*/ +#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 */ From 260f26c420aeb761e8875aa4e8b7841f79b85dce Mon Sep 17 00:00:00 2001 From: Dominik Kamp Date: Thu, 14 Mar 2024 13:04:24 +0100 Subject: [PATCH 10/10] Advance internal maxrounds --- src/scip/presol_milp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scip/presol_milp.cpp b/src/scip/presol_milp.cpp index f0846f6a2b..d62e3d2e2f 100644 --- a/src/scip/presol_milp.cpp +++ b/src/scip/presol_milp.cpp @@ -944,7 +944,7 @@ SCIP_RETCODE SCIPincludePresolMILP( #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, FALSE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX, NULL, NULL)); + &presoldata->internalmaxrounds, TRUE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX, NULL, NULL)); #else presoldata->internalmaxrounds = DEFAULT_INTERNAL_MAXROUNDS; #endif