44#ifndef SCIP_WITH_PAPILO
59#pragma GCC diagnostic ignored "-Wshadow"
60#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
61#pragma GCC diagnostic ignored "-Wredundant-decls"
64#if __GNUC__ == 12 && __GNUC__MINOR__ <= 2
65#pragma GCC diagnostic ignored "-Wstringop-overflow"
87#include "papilo/core/Presolve.hpp"
88#include "papilo/core/ProblemBuilder.hpp"
89#include "papilo/Config.hpp"
92#if !defined(PAPILO_API_VERSION)
93#define PAPILO_APIVERSION 0
94#elif !(PAPILO_API_VERSION + 0)
95#define PAPILO_APIVERSION 1
97#define PAPILO_APIVERSION PAPILO_API_VERSION
100#define PRESOL_NAME "milp"
101#define PRESOL_DESC "MILP specific presolving methods"
102#define PRESOL_PRIORITY 9999999
103#define PRESOL_MAXROUNDS (-1)
104#define PRESOL_TIMING SCIP_PRESOLTIMING_MEDIUM
107#define DEFAULT_THREADS 1
108#define DEFAULT_ABORTFAC_EXHAUSTIVE 0.0008
109#define DEFAULT_ABORTFAC_MEDIUM 0.0008
110#define DEFAULT_ABORTFAC_FAST 0.0008
111#define DEFAULT_DETECTLINDEP 0
112#define DEFAULT_INTERNAL_MAXROUNDS (-1)
113#define DEFAULT_MODIFYCONSFAC 0.8
115#define DEFAULT_RANDOMSEED 0
118#define DEFAULT_HUGEBOUND 1e8
121#define DEFAULT_ENABLEDOMCOL TRUE
122#define DEFAULT_ENABLEDUALINFER TRUE
123#define DEFAULT_ENABLEMULTIAGGR TRUE
124#define DEFAULT_ENABLEPARALLELROWS TRUE
125#define DEFAULT_ENABLEPROBING TRUE
126#define DEFAULT_ENABLESPARSIFY FALSE
129#define DEFAULT_MAXBADGESIZE_SEQ 15000
130#define DEFAULT_MAXBADGESIZE_PAR (-1)
131#define DEFAULT_MARKOWITZTOLERANCE 0.01
132#define DEFAULT_MAXFILLINPERSUBST 3
133#define DEFAULT_MAXSHIFTPERROW 10
136#define DEFAULT_FILENAME_PROBLEM "-"
137#define DEFAULT_VERBOSITY 0
144struct SCIP_PresolData
149 int maxfillinpersubstitution;
152 int internalmaxrounds;
154 int detectlineardependency;
158 SCIP_Bool enablesparsify;
159 SCIP_Bool enabledomcol;
160 SCIP_Bool enableprobing;
161 SCIP_Bool enabledualinfer;
162 SCIP_Bool enablemultiaggr;
163 SCIP_Bool enableparallelrows;
164 SCIP_Real modifyconsfac;
166 SCIP_Real markowitztolerance;
168 SCIP_Real abortfacexhaustive;
169 SCIP_Real abortfacmedium;
170 SCIP_Real abortfacfast;
172 char* filename =
NULL;
175using namespace papilo;
183Problem<SCIP_Real> buildProblem(
188 ProblemBuilder<SCIP_Real> builder;
194 builder.reserve(nnz, nrows, ncols);
197 builder.setNumCols(ncols);
198 for(
int i = 0;
i != ncols; ++
i)
203 builder.setColLb(
i, lb);
204 builder.setColUb(
i, ub);
207#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 1)
209 builder.setColImplInt(
i,
TRUE);
219 builder.setNumRows(nrows);
220 for(
int i = 0;
i != nrows; ++
i)
225 builder.addRowEntries(
i, rowlen, rowcols, rowvals);
229 builder.setRowLhs(
i, lhs);
230 builder.setRowRhs(
i, rhs);
236 builder.setObjOffset(0);
238#ifdef SCIP_PRESOLLIB_ENABLE_OUTPUT
243 return builder.build();
248Presolve<SCIP_Real> setupPresolve(
251 SCIP_Bool allowconsmodification
259 presolve.getPresolveOptions().substitutebinarieswithints =
false;
264 presolve.getPresolveOptions().removeslackvars =
false;
267 presolve.getPresolveOptions().maxfillinpersubstitution = data->maxfillinpersubstitution;
268 presolve.getPresolveOptions().markowitz_tolerance = data->markowitztolerance;
269 presolve.getPresolveOptions().maxshiftperrow = data->maxshiftperrow;
270 presolve.getPresolveOptions().hugeval = data->hugebound;
273 presolve.getPresolveOptions().detectlindep = allowconsmodification ? data->detectlineardependency : 0;
279 presolve.getPresolveOptions().threads = data->threads;
281#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3)
282 presolve.getPresolveOptions().maxrounds = data->internalmaxrounds;
287 presolve.getPresolveOptions().dualreds = 2;
289 presolve.getPresolveOptions().dualreds = 1;
291 presolve.getPresolveOptions().dualreds = 0;
294 using uptr = std::unique_ptr<PresolveMethod<SCIP_Real>>;
297 presolve.addPresolveMethod( uptr(
new SingletonCols<SCIP_Real>() ) );
298 presolve.addPresolveMethod( uptr(
new CoefficientStrengthening<SCIP_Real>() ) );
299 presolve.addPresolveMethod( uptr(
new ConstraintPropagation<SCIP_Real>() ) );
302 presolve.addPresolveMethod( uptr(
new SimpleProbing<SCIP_Real>() ) );
303 if( data->enableparallelrows )
304 presolve.addPresolveMethod( uptr(
new ParallelRowDetection<SCIP_Real>() ) );
307 presolve.addPresolveMethod( uptr(
new SingletonStuffing<SCIP_Real>() ) );
308#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 1)
309 DualFix<SCIP_Real> *dualfix =
new DualFix<SCIP_Real>();
310 dualfix->set_fix_to_infinity_allowed(
false);
311 presolve.addPresolveMethod( uptr( dualfix ) );
313 presolve.addPresolveMethod( uptr(
new DualFix<SCIP_Real>() ) );
315 presolve.addPresolveMethod( uptr(
new FixContinuous<SCIP_Real>() ) );
316 presolve.addPresolveMethod( uptr(
new SimplifyInequalities<SCIP_Real>() ) );
317 presolve.addPresolveMethod( uptr(
new SimpleSubstitution<SCIP_Real>() ) );
320 presolve.addPresolveMethod( uptr(
new ImplIntDetection<SCIP_Real>() ) );
321 if( data->enabledualinfer )
322 presolve.addPresolveMethod( uptr(
new DualInfer<SCIP_Real>() ) );
323 if( data->enableprobing )
325#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 1)
326 Probing<SCIP_Real> *probing =
new Probing<SCIP_Real>();
327 if(
presolve.getPresolveOptions().runs_sequential() )
329 probing->set_max_badge_size( data->maxbadgesizeseq );
333 probing->set_max_badge_size( data->maxbadgesizepar );
335 presolve.addPresolveMethod( uptr( probing ) );
337 presolve.addPresolveMethod( uptr(
new Probing<SCIP_Real>() ) );
338 if( data->maxbadgesizeseq != DEFAULT_MAXBADGESIZE_SEQ )
340 " The parameter 'presolving/milp/maxbadgesizeseq' can only be used with PaPILO 2.1.0 or later versions.\n");
342 if( data->maxbadgesizepar != DEFAULT_MAXBADGESIZE_PAR )
344 " The parameter 'presolving/milp/maxbadgesizepar' can only be used with PaPILO 2.1.0 or later versions.\n");
347 if( data->enabledomcol )
348 presolve.addPresolveMethod( uptr(
new DominatedCols<SCIP_Real>() ) );
349 if( data->enablemultiaggr )
350 presolve.addPresolveMethod( uptr(
new Substitution<SCIP_Real>() ) );
351 if( data->enablesparsify )
352 presolve.addPresolveMethod( uptr(
new Sparsify<SCIP_Real>() ) );
358#ifndef SCIP_PRESOLLIB_ENABLE_OUTPUT
360 presolve.setVerbosityLevel((VerbosityLevel) data->verbosity);
363#if PAPILO_APIVERSION >= 2
364 presolve.getPresolveOptions().abortfac = data->abortfacexhaustive;
365 presolve.getPresolveOptions().abortfacmedium = data->abortfacmedium;
366 presolve.getPresolveOptions().abortfacfast = data->abortfacfast;
409 data->lastncols = -1;
410 data->lastnrows = -1;
421 SCIP_Bool initialized;
423 SCIP_Bool infeasible;
433 if( data->lastncols != -1 && data->lastnrows != -1 &&
434 nvars > data->lastncols * 0.85 &&
435 nconss > data->lastnrows * 0.85 )
439 naddconss, ndelconss, nchgcoefs, nchgbds, nfixedvars) );
452 if( !initialized || !complete )
463 if( 0 != strncmp(data->filename, DEFAULT_FILENAME_PROBLEM, strlen(DEFAULT_FILENAME_PROBLEM)) )
466 " writing transformed problem to %s (only enforced constraints)\n", data->filename);
476 int oldnaggrvars = *naggrvars;
477 int oldnfixedvars = *nfixedvars;
478 int oldnchgbds = *nchgbds;
481 Problem<SCIP_Real> problem = buildProblem(
scip, matrix);
482 int oldnnz = problem.getConstraintMatrix().getNnz();
483 Presolve<SCIP_Real>
presolve = setupPresolve(
scip, data, allowconsmodification);
490#if (PAPILO_VERSION_MAJOR >= 2)
491 PresolveResult<SCIP_Real> res =
presolve.apply(problem,
false);
493 PresolveResult<SCIP_Real> res =
presolve.apply(problem);
495 data->lastncols = problem.getNCols();
496 data->lastnrows = problem.getNRows();
501 case PresolveStatus::kInfeasible:
504 " (%.1fs) MILP presolver detected infeasibility\n",
508 case PresolveStatus::kUnbndOrInfeas:
509 case PresolveStatus::kUnbounded:
512 " (%.1fs) MILP presolver detected unboundedness\n",
516 case PresolveStatus::kUnchanged:
518 data->lastncols =
nvars;
519 data->lastnrows = nconss;
521 " (%.1fs) MILP presolver found nothing\n",
525 case PresolveStatus::kReduced:
526 data->lastncols = problem.getNCols();
527 data->lastnrows = problem.getNRows();
534 VariableDomains<SCIP_Real>& varDomains = problem.getVariableDomains();
535 for(
int i = 0;
i != problem.getNCols(); ++
i )
537 assert( ! varDomains.flags[
i].test(ColFlag::kInactive) );
539 if( !varDomains.flags[
i].test(ColFlag::kLbInf) )
555 if( !varDomains.flags[
i].test(ColFlag::kUbInf) )
575 " (%.1fs) MILP presolver detected infeasibility\n",
582 std::vector<SCIP_VAR*> tmpvars;
583 std::vector<SCIP_Real> tmpvals;
586 int newnnz = problem.getConstraintMatrix().getNnz();
587 bool constraintsReplaced =
false;
588 if( newnnz == 0 || (allowconsmodification &&
591 newnnz <= data->modifyconsfac * oldnnz)) )
594 int newnrows = problem.getNRows();
596 constraintsReplaced =
true;
599 for(
int i = 0;
i < newnrows; ++
i )
606 *ndelconss += oldnrows;
607 *naddconss += newnrows;
609 for(
int i = 0;
i < oldnrows; ++
i )
616 const Vec<RowFlags>& rflags = problem.getRowFlags();
617 const auto& consmatrix = problem.getConstraintMatrix();
618 for(
int i = 0;
i < newnrows; ++
i )
620 auto rowvec = consmatrix.getRowCoefficients(
i);
621 const int* rowcols = rowvec.getIndices();
623 SCIP_Real* rowvals =
const_cast<SCIP_Real*
>(rowvec.getValues());
624 int rowlen = rowvec.getLength();
627 SCIP_Real lhs = rflags[
i].test(RowFlag::kLhsInf) ? -
SCIPinfinity(
scip) : consmatrix.getLeftHandSides()[
i];
628 SCIP_Real rhs = rflags[
i].test(RowFlag::kRhsInf) ?
SCIPinfinity(
scip) : consmatrix.getRightHandSides()[
i];
632 tmpvars.reserve(rowlen);
633 for(
int j = 0; j < rowlen; ++j )
634 tmpvars.push_back(
SCIPmatrixGetVar(matrix, res.postsolve.origcol_mapping[rowcols[j]]));
657#if PAPILO_APIVERSION >= 1
658 presolve.getStatistics().single_matrix_coefficient_changes > 0
660 presolve.getStatistics().ncoefchgs > 0
662 && !constraintsReplaced;
665 for( std::size_t
i = 0;
i != res.postsolve.types.size(); ++
i )
667 ReductionType type = res.postsolve.types[
i];
668 int first = res.postsolve.start[
i];
669 int last = res.postsolve.start[
i + 1];
673 case ReductionType::kFixedCol:
677 int col = res.postsolve.indices[first];
681 SCIP_Real value = res.postsolve.values[first];
700#if (PAPILO_VERSION_MAJOR >= 2)
701 case ReductionType::kSubstitutedColWithDual:
703 case ReductionType::kSubstitutedCol:
709 int startRowCoefficients = 0;
710 int lastRowCoefficients = 0;
712 if( type == ReductionType::kSubstitutedCol )
714 rowlen = last - first - 1;
715 col = res.postsolve.indices[first];
716 side = res.postsolve.values[first];
718 startRowCoefficients = first + 1;
719 lastRowCoefficients = last;
721#if (PAPILO_VERSION_MAJOR >= 2)
722 if( type == ReductionType::kSubstitutedColWithDual )
724 rowlen = (int) res.postsolve.values[first];
725 col = res.postsolve.indices[first + 3 + rowlen];
726 side = res.postsolve.values[first + 1];
728 startRowCoefficients = first + 3;
729 lastRowCoefficients = first + 3 + rowlen;
731 assert(side == res.postsolve.values[first + 2]);
732 assert(res.postsolve.indices[first + 1] == 0);
733 assert(res.postsolve.indices[first + 2] == 0);
735 assert( type == ReductionType::kSubstitutedCol || type == ReductionType::kSubstitutedColWithDual );
737 assert( type == ReductionType::kSubstitutedCol );
740 SCIP_Bool aggregated;
741 SCIP_Bool redundant =
FALSE;
742 SCIP_Real constant = 0.0;
745 SCIP_Real updatedSide;
748 SCIP_Real scalarx = res.postsolve.values[startRowCoefficients];
749 SCIP_Real scalary = res.postsolve.values[startRowCoefficients + 1];
763 SCIPdebugMsg(
scip,
"Aggregation of <%s> and <%s> rejected because they are already fixed.\n",
769 updatedSide = side - constant;
775 SCIP_Real colCoef = 0.0;
776 SCIP_Real updatedSide;
777 SCIP_Bool checklbimplied;
778 SCIP_Bool checkubimplied;
783 for( j = startRowCoefficients; j < lastRowCoefficients; ++j )
785 if( res.postsolve.indices[j] == col )
787 colCoef = res.postsolve.values[j];
794 tmpvars.reserve(rowlen);
795 tmpvals.reserve(rowlen);
809 SCIPdebugMsg(
scip,
"Multi-aggregation of <%s> rejected because it is already fixed.\n",
815 updatedSide = side - constant;
823 impliedlb = impliedub = updatedSide / colCoef;
825 for( j = startRowCoefficients; j < lastRowCoefficients; ++j )
830 if( res.postsolve.indices[j] == col )
833 coef = - res.postsolve.values[j] / colCoef;
873 tmpvals.push_back(coef);
874 tmpvars.push_back(
var);
878 if( j < lastRowCoefficients )
888 tmpvars.data(), tmpvals.data(), updatedSide / colCoef, &infeas, &aggregated) );
893 else if( constraintsReplaced && !redundant )
898 for(
int j = startRowCoefficients; j < lastRowCoefficients; ++j )
901 tmpvals.push_back(res.postsolve.values[j]);
907 tmpvars.size(), tmpvars.data(), tmpvals.data(), side, side ) );
921 case ReductionType::kParallelCol:
923#if PAPILO_VERSION_MAJOR > 1 || (PAPILO_VERSION_MAJOR == 1 && PAPILO_VERSION_MINOR >= 1)
924 case ReductionType::kFixedInfCol: {
927 if(!constraintsReplaced)
933 int column = res.postsolve.indices[first];
934 bool is_negative_infinity = res.postsolve.values[first] < 0;
937 if( is_negative_infinity )
950#if (PAPILO_VERSION_MAJOR >= 2)
951 case ReductionType::kVarBoundChange :
952 case ReductionType::kRedundantRow :
953 case ReductionType::kRowBoundChange :
954 case ReductionType::kReasonForRowBoundChangeForcedByRow :
955 case ReductionType::kRowBoundChangeForcedByRow :
956 case ReductionType::kSaveRow :
957 case ReductionType::kReducedBoundsCost :
958 case ReductionType::kColumnDualValue :
959 case ReductionType::kRowDualValue :
960 case ReductionType::kCoefficientChange :
962 SCIPerrorMessage(
"PaPILO: PaPILO should not return dual postsolving reductions in SCIP!!\n");
974 " (%.1fs) MILP presolver (%d rounds): %d aggregations, %d fixings, %d bound changes\n",
976 *nfixedvars - oldnfixedvars, *nchgbds - oldnchgbds);
998#if defined(PAPILO_VERSION_TWEAK) && PAPILO_VERSION_TWEAK != 0
999 String name = fmt::format(
"PaPILO {}.{}.{}.{}", PAPILO_VERSION_MAJOR, PAPILO_VERSION_MINOR, PAPILO_VERSION_PATCH, PAPILO_VERSION_TWEAK);
1001 String name = fmt::format(
"PaPILO {}.{}.{}", PAPILO_VERSION_MAJOR, PAPILO_VERSION_MINOR, PAPILO_VERSION_PATCH);
1004#if defined(PAPILO_GITHASH_AVAILABLE) && defined(PAPILO_TBB)
1005 String desc = fmt::format(
"parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB) [GitHash: {}]", PAPILO_GITHASH);
1006#elif !defined(PAPILO_GITHASH_AVAILABLE) && !defined(PAPILO_TBB)
1007 String desc(
"parallel presolve for integer and linear optimization (github.com/scipopt/papilo)");
1008#elif defined(PAPILO_GITHASH_AVAILABLE) && !defined(PAPILO_TBB)
1009 String desc = fmt::format(
"parallel presolve for integer and linear optimization (github.com/scipopt/papilo) [GitHash: {}]", PAPILO_GITHASH);
1010#elif !defined(PAPILO_GITHASH_AVAILABLE) && defined(PAPILO_TBB)
1011 String desc = fmt::format(
"parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB)");
1040 "maximum number of threads presolving may use (0: automatic)",
1041 &presoldata->threads,
FALSE, DEFAULT_THREADS, 0, INT_MAX,
NULL,
NULL) );
1043 presoldata->threads = DEFAULT_THREADS;
1047 "presolving/" PRESOL_NAME "/maxfillinpersubstitution",
1048 "maximal possible fillin for substitutions to be considered",
1049 &presoldata->maxfillinpersubstitution,
FALSE, DEFAULT_MAXFILLINPERSUBST, INT_MIN, INT_MAX,
NULL,
NULL) );
1053 "maximal amount of nonzeros allowed to be shifted to make space for substitutions",
1054 &presoldata->maxshiftperrow,
TRUE, DEFAULT_MAXSHIFTPERROW, 0, INT_MAX,
NULL,
NULL) );
1058 "the random seed used for randomization of tie breaking",
1061 if( DependentRows<double>::Enabled )
1064 "presolving/" PRESOL_NAME "/detectlineardependency",
1065 "should linear dependent equations and free columns be removed? (0: never, 1: for LPs, 2: always)",
1066 &presoldata->detectlineardependency,
TRUE, DEFAULT_DETECTLINDEP, 0, 2,
NULL,
NULL) );
1069 presoldata->detectlineardependency = DEFAULT_DETECTLINDEP;
1073 "modify SCIP constraints when the number of nonzeros or rows is at most this factor "
1074 "times the number of nonzeros or rows before presolving",
1075 &presoldata->modifyconsfac,
FALSE, DEFAULT_MODIFYCONSFAC, 0.0, 1.0,
NULL,
NULL) );
1079 "the markowitz tolerance used for substitutions",
1080 &presoldata->markowitztolerance,
FALSE, DEFAULT_MARKOWITZTOLERANCE, 0.0, 1.0,
NULL,
NULL) );
1084 "absolute bound value that is considered too huge for activity based calculations",
1087#if PAPILO_APIVERSION >= 2
1089 "abort threshold for exhaustive presolving in PAPILO",
1090 &presoldata->abortfacexhaustive,
TRUE, DEFAULT_ABORTFAC_EXHAUSTIVE, 0.0, 1.0,
NULL,
NULL) );
1092 "abort threshold for medium presolving in PAPILO",
1093 &presoldata->abortfacmedium,
TRUE, DEFAULT_ABORTFAC_MEDIUM, 0.0, 1.0,
NULL,
NULL) );
1095 "abort threshold for fast presolving in PAPILO",
1096 &presoldata->abortfacfast,
TRUE, DEFAULT_ABORTFAC_FAST, 0.0, 1.0,
NULL,
NULL) );
1098 presoldata->abortfacexhaustive = DEFAULT_ABORTFAC_EXHAUSTIVE;
1099 presoldata->abortfacmedium = DEFAULT_ABORTFAC_MEDIUM;
1100 presoldata->abortfacfast = DEFAULT_ABORTFAC_FAST;
1103#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 1)
1105 "maximal badge size in Probing in PaPILO if PaPILO is executed in sequential mode",
1106 &presoldata->maxbadgesizeseq,
FALSE, DEFAULT_MAXBADGESIZE_SEQ, -1, INT_MAX,
NULL,
NULL));
1109 "maximal badge size in Probing in PaPILO if PaPILO is executed in parallel mode",
1110 &presoldata->maxbadgesizepar,
FALSE, DEFAULT_MAXBADGESIZE_PAR, -1, INT_MAX,
NULL,
NULL));
1112 presoldata->maxbadgesizeseq = DEFAULT_MAXBADGESIZE_SEQ;
1113 presoldata->maxbadgesizepar = DEFAULT_MAXBADGESIZE_PAR;
1116#if PAPILO_VERSION_MAJOR > 2 || (PAPILO_VERSION_MAJOR == 2 && PAPILO_VERSION_MINOR >= 3)
1118 "internal maxrounds for each milp presolving (-1: no limit, 0: model cleanup)",
1119 &presoldata->internalmaxrounds,
TRUE, DEFAULT_INTERNAL_MAXROUNDS, -1, INT_MAX,
NULL,
NULL));
1121 presoldata->internalmaxrounds = DEFAULT_INTERNAL_MAXROUNDS;
1126 "should the parallel rows presolver be enabled within the presolve library?",
1127 &presoldata->enableparallelrows,
TRUE, DEFAULT_ENABLEPARALLELROWS,
NULL,
NULL) );
1131 "should the dominated column presolver be enabled within the presolve library?",
1132 &presoldata->enabledomcol,
TRUE, DEFAULT_ENABLEDOMCOL,
NULL,
NULL) );
1136 "should the dualinfer presolver be enabled within the presolve library?",
1137 &presoldata->enabledualinfer,
TRUE, DEFAULT_ENABLEDUALINFER,
NULL,
NULL) );
1141 "should the multi-aggregation presolver be enabled within the presolve library?",
1142 &presoldata->enablemultiaggr,
TRUE, DEFAULT_ENABLEMULTIAGGR,
NULL,
NULL) );
1146 "should the probing presolver be enabled within the presolve library?",
1147 &presoldata->enableprobing,
TRUE, DEFAULT_ENABLEPROBING,
NULL,
NULL) );
1151 "should the sparsify presolver be enabled within the presolve library?",
1152 &presoldata->enablesparsify,
TRUE, DEFAULT_ENABLESPARSIFY,
NULL,
NULL) );
1155 "filename to store the problem before MILP presolving starts (only enforced constraints)",
1156 &presoldata->filename,
TRUE, DEFAULT_FILENAME_PROBLEM,
NULL,
NULL) );
1159 "verbosity level of PaPILO (0: quiet, 1: errors, 2: warnings, 3: normal, 4: detailed)",
1160 &presoldata->verbosity,
FALSE, DEFAULT_VERBOSITY, 0, 4,
NULL,
NULL));
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
const char * SCIPgetProbName(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPincludePresolMILP(SCIP *scip)
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol,)
void SCIPpresolSetData(SCIP_PRESOL *presol, SCIP_PRESOLDATA *presoldata)
SCIP_PRESOLDATA * SCIPpresolGetData(SCIP_PRESOL *presol)
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol,)
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
SCIP_RETCODE SCIPsetPresolInit(SCIP *scip, SCIP_PRESOL *presol,)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPmultiaggregateVar(SCIP *scip, SCIP_VAR *var, int naggvars, SCIP_VAR **aggvars, SCIP_Real *scalars, SCIP_Real constant, SCIP_Bool *infeasible, SCIP_Bool *aggregated)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_Bool SCIPallowWeakDualReds(SCIP *scip)
SCIP_Bool SCIPallowStrongDualReds(SCIP *scip)
unsigned int SCIPinitializeRandomSeed(SCIP *scip, unsigned int initialseedvalue)
assert(minobj< SCIPgetCutoffbound(scip))
int SCIPmatrixGetNNonzs(SCIP_MATRIX *matrix)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetRowRhs(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool onlyifcomplete, SCIP_Bool *initialized, SCIP_Bool *complete, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nchgbds, int *nfixedvars)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
SCIP_CONS * SCIPmatrixGetCons(SCIP_MATRIX *matrix, int row)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
#define BMSclearMemory(ptr)
MILP presolver that calls the presolve library on the constraint matrix.
public methods for managing constraints
public methods for matrix
public methods for message output
public methods for presolvers
public methods for problem variables
#define DEFAULT_RANDOMSEED
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for presolving plugins
public methods for global and local (sub)problems
public methods for random numbers
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible, SCIP_Bool *vanished)
public methods for timing
public methods for SCIP variables
#define SCIP_DECL_PRESOLCOPY(x)
struct SCIP_PresolData SCIP_PRESOLDATA
#define SCIP_DECL_PRESOLFREE(x)
#define SCIP_DECL_PRESOLINIT(x)
#define SCIP_DECL_PRESOLEXEC(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED