From 75ebf5f05d880d673684416dc55cd1c61fed1399 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:13:41 +0200 Subject: [PATCH 01/17] change #if 0 to #ifdef SCIP_DISABLED_CODE if well documented --- src/scip/cons_linear.c | 9 ++++++--- src/scip/cons_linking.c | 11 ++++++++--- src/scip/cons_xor.c | 5 +++-- src/scip/expr_product.c | 3 ++- src/scip/misc.c | 2 +- src/scip/presol_gateextraction.c | 3 ++- src/scip/presolve.c | 2 +- src/scip/primal.c | 3 ++- src/scip/prop_pseudoobj.c | 9 ++++++--- src/scip/prop_rootredcost.c | 9 +++++---- src/scip/scip_solve.c | 6 +++--- src/scip/var.c | 6 +++--- 12 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/scip/cons_linear.c b/src/scip/cons_linear.c index ad016457e7..6078f06637 100644 --- a/src/scip/cons_linear.c +++ b/src/scip/cons_linear.c @@ -8465,7 +8465,8 @@ SCIP_RETCODE extractCliques( i = nposbinvars + nnegbinvars - 1; j = i - 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */ assert(SCIPisFeasGE(scip, binvarvals[i], threshold)); #endif @@ -8625,7 +8626,8 @@ SCIP_RETCODE extractCliques( i = nposbinvars + nnegbinvars - 1; j = i - 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check if the variable should not have already been fixed to one */ assert(!SCIPisFeasGT(scip, binvarvals[i], threshold)); #endif @@ -8784,7 +8786,8 @@ SCIP_RETCODE extractCliques( j = 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check if the variable should not have already been fixed to one */ assert(!SCIPisFeasLT(scip, -binvarvals[0], threshold)); #endif diff --git a/src/scip/cons_linking.c b/src/scip/cons_linking.c index 0ee080052e..1838c8acbb 100644 --- a/src/scip/cons_linking.c +++ b/src/scip/cons_linking.c @@ -1551,7 +1551,9 @@ SCIP_Bool checkCons( return SCIPisFeasEQ(scip, linksum, linkvarval) && SCIPisFeasEQ(scip, setpartsum, 1.0); } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following should work, but does not seem to be tested well. */ + /** transfer aggregated integer variables to the corresponding binary variables */ static SCIP_RETCODE aggregateVariables( @@ -2919,7 +2921,9 @@ SCIP_DECL_CONSPRESOL(consPresolLinking) } } -#if 0 +#ifdef SCIP_DISABLED_CODE + /* The following should work, but does not seem to be tested well. */ + /* transfer aggregated linking variables to the corresponding binary variables */ assert(conshdlrdata->varmap != NULL); SCIP_CALL( aggregateVariables(scip, conshdlrdata->varmap, conss, nconss, naggrvars, &cutoff) ); @@ -3178,7 +3182,8 @@ SCIP_DECL_CONSDEACTIVE(consDeactiveLinking) static SCIP_DECL_CONSENABLE(consEnableLinking) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /* The following might help, but it would need to be tested whether it speeds up the solution process. */ SCIP_CONSHDLRDATA* conshdlrdata; SCIP_CONSDATA* consdata; diff --git a/src/scip/cons_xor.c b/src/scip/cons_xor.c index a2eb3f9a31..9126116691 100644 --- a/src/scip/cons_xor.c +++ b/src/scip/cons_xor.c @@ -3464,7 +3464,8 @@ SCIP_RETCODE cliquePresolve( if( !consdata->deleteintvar ) return SCIP_OKAY; -#if 0 /* try to evaluate if clique presolving should only be done multiple times when the constraint changed */ +#ifdef SCIP_DISABLED_CODE + /* try to evaluate if clique presolving should only be done multiple times when the constraint changed */ if( !consdata->changed ) return SCIP_OKAY; #endif @@ -4468,7 +4469,7 @@ SCIP_RETCODE preprocessConstraintPairs( consdataSort(consdata0); assert(consdata0->sorted); -#if 0 +#ifdef SCIP_DISABLED_CODE /* if aggregation in the core of SCIP is not changed we do not need to call applyFixing, this would be the correct * way */ diff --git a/src/scip/expr_product.c b/src/scip/expr_product.c index 79fc3bec03..71486c509e 100644 --- a/src/scip/expr_product.c +++ b/src/scip/expr_product.c @@ -548,7 +548,8 @@ SCIP_RETCODE mergeProductExprlist( if( !issignpower1 && !issignpower2 ) { /* and both are normal power, then add to unsimplifiedchildren the resulting expr of simplify(base^(expo1 + expo2)) */ -#if 0 /* TODO we should not loose the implicit base >= 0 constraint, if there is one, but then we should look at bounds on base; simplify currently doesn't */ +#ifdef SCIP_DISABLED_CODE + /* TODO we should not loose the implicit base >= 0 constraint, if there is one, but then we should look at bounds on base; simplify currently doesn't */ /* * unless expo1 or expo2 are fractional but expo1+expo2 is not fractional, then we better keep the original * the reason for that is that x^fractional implies a constraint x >= 0 diff --git a/src/scip/misc.c b/src/scip/misc.c index e505039a46..9aaed87484 100644 --- a/src/scip/misc.c +++ b/src/scip/misc.c @@ -8709,7 +8709,7 @@ void btnodeFreeLeaf( assert((*node)->left == NULL); assert((*node)->right == NULL); -#if 0 +#ifdef SCIP_DISABLED_CODE /* remove reference from parent node */ if( (*node)->parent != NULL ) { diff --git a/src/scip/presol_gateextraction.c b/src/scip/presol_gateextraction.c index 25b5f42668..6a064522c1 100644 --- a/src/scip/presol_gateextraction.c +++ b/src/scip/presol_gateextraction.c @@ -1291,7 +1291,8 @@ SCIP_DECL_PRESOLEXEC(presolExecGateextraction) *result = SCIP_DIDNOTRUN; -#if 0 /* need to include cons_knapsack on top of this file */ +#ifdef SCIP_DISABLED_CODE + /* need to include cons_knapsack on top of this file */ /* check for possible knapsacks that form with a logicor a weak relaxation of an and-constraint * * the weak relaxation of an and-constraint looks like: diff --git a/src/scip/presolve.c b/src/scip/presolve.c index 5b72e6d009..79e961fa3b 100644 --- a/src/scip/presolve.c +++ b/src/scip/presolve.c @@ -1099,7 +1099,7 @@ SCIP_RETCODE SCIPshrinkDisjunctiveVarSet( */ implbinvarsexist = (SCIPprobGetNImplBinVars(scip->transprob) > 0); -#if 0 +#ifdef SCIP_DISABLED_CODE /* @todo do the cleanup here rather than before calling SCIPshrinkDisjunctiveVarSet()? */ if( usebin ) { diff --git a/src/scip/primal.c b/src/scip/primal.c index c1c52c737a..c8a14aecc4 100644 --- a/src/scip/primal.c +++ b/src/scip/primal.c @@ -699,7 +699,8 @@ SCIP_RETCODE primalAddSol( SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, set, messagehdlr, stat, transprob, NULL, NULL, FALSE, FALSE) ) ); -#if 0 /* this is not a valid debug check, but can be used to track down numerical troubles */ +#ifdef SCIP_DISABLED_CODE + /* this is not a valid debug check, but can be used to track down numerical troubles */ #ifndef NDEBUG /* check solution again completely * it fail for different reasons: diff --git a/src/scip/prop_pseudoobj.c b/src/scip/prop_pseudoobj.c index 81dc5dd6d8..92f0bca77e 100644 --- a/src/scip/prop_pseudoobj.c +++ b/src/scip/prop_pseudoobj.c @@ -2582,7 +2582,8 @@ SCIP_RETCODE propagateCutoffboundGlobally( return SCIP_OKAY; } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG /* check that the abort criteria for the binary variables works */ for( ; v < nminactvars; ++v ) @@ -2732,7 +2733,8 @@ SCIP_RETCODE propagateCutoffboundBinvars( return SCIP_OKAY; } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG /* check that the abort criteria for the binary variables works */ for( ; v < nminactvars; ++v ) @@ -3363,7 +3365,8 @@ SCIP_RETCODE propagateLowerbound( } } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG /* check that the abort criteria for the binary variables works */ for( ; v < nmaxactvars && !cutoff; ++v ) diff --git a/src/scip/prop_rootredcost.c b/src/scip/prop_rootredcost.c index 1740e10be9..8ae2a307ac 100644 --- a/src/scip/prop_rootredcost.c +++ b/src/scip/prop_rootredcost.c @@ -485,10 +485,11 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( /* store the index of the variable which is not globally fixed */ propdata->glbfirstnonfixed = v; -#if 0 /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may - * have evaluated variables with a really small difference in their reduced cost values but with really huge - * lpobjval as the same - */ +#ifdef SCIP_DISABLED_CODE + /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may + * have evaluated variables with a really small difference in their reduced cost values but with really huge + * lpobjval as the same + */ #ifndef NDEBUG /* check that the abort criteria works; that means none of the remaining binary variables can be fixed */ for( ; v < propdata->nredcostbinvars && !(*cutoff); ++v ) diff --git a/src/scip/scip_solve.c b/src/scip/scip_solve.c index 4c18881603..e6b98f475c 100644 --- a/src/scip/scip_solve.c +++ b/src/scip/scip_solve.c @@ -673,7 +673,7 @@ SCIP_RETCODE presolveRound( SCIP_EVENT event; SCIP_Bool aborted; SCIP_Bool lastranpresol; -#if 0 +#ifdef SCIP_DISABLED_CODE int oldpresolstart = 0; int oldpropstart = 0; int oldconsstart = 0; @@ -723,7 +723,7 @@ SCIP_RETCODE presolveRound( i = *presolstart; j = *propstart; k = *consstart; -#if 0 +#ifdef SCIP_DISABLED_CODE oldpresolstart = i; oldpropstart = j; oldconsstart = k; @@ -1078,7 +1078,7 @@ SCIP_RETCODE presolveRound( SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend, propstart, propend, consstart, consend) ); } -#if 0 +#ifdef SCIP_DISABLED_CODE /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */ else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs ) diff --git a/src/scip/var.c b/src/scip/var.c index 00fa4be081..c12befa8e5 100644 --- a/src/scip/var.c +++ b/src/scip/var.c @@ -2702,7 +2702,7 @@ SCIP_RETCODE varFreeParents( parentvar->data.aggregate.var = NULL; break; -#if 0 +#ifdef SCIP_DISABLED_CODE /* The following code is unclear: should the current variable be removed from its parents? */ case SCIP_VARSTATUS_MULTAGGR: assert(parentvar->data.multaggr.vars != NULL); @@ -9039,7 +9039,7 @@ SCIP_RETCODE varProcessAddHoleLocal( assert(SCIPsetIsEQ(set, newlb, var->locdom.lb)); assert(SCIPsetIsEQ(set, newub, var->locdom.ub)); -#if 0 +#ifdef SCIP_DISABLED_CODE /* issue bound change event */ assert(SCIPvarIsTransformed(var) == (var->eventfilter != NULL)); if( var->eventfilter != NULL ) @@ -13551,7 +13551,7 @@ SCIP_Real SCIPvarGetImplRedcost( int probindex = SCIPvarGetProbindex(clqvar) + 1; assert(0 < probindex && probindex < nentries); -#if 0 +#ifdef SCIP_DISABLED_CODE /* check that the variable was not yet visited or does not appear with two contradicting implications, -> * can appear since there is no guarantee that all these infeasible bounds were found */ From b38d83fc62ee75ef3a4a9e1d2a144e2334254b90 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:14:10 +0200 Subject: [PATCH 02/17] remove old code that does not seem to be necessary --- src/scip/tree.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/scip/tree.c b/src/scip/tree.c index 834690b935..01be9349e0 100644 --- a/src/scip/tree.c +++ b/src/scip/tree.c @@ -2149,10 +2149,6 @@ SCIP_RETCODE SCIPnodeAddHoleinfer( SCIP_Bool* added /**< pointer to store whether the hole was added, or NULL */ ) { -#if 0 - SCIP_VAR* infervar; -#endif - assert(node != NULL); assert((SCIP_NODETYPE)node->nodetype == SCIP_NODETYPE_FOCUSNODE || (SCIP_NODETYPE)node->nodetype == SCIP_NODETYPE_PROBINGNODE @@ -2195,10 +2191,6 @@ SCIP_RETCODE SCIPnodeAddHoleinfer( left, right, node->depth, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), infercons != NULL ? "cons" : "prop", infercons != NULL ? SCIPconsGetName(infercons) : (inferprop != NULL ? SCIPpropGetName(inferprop) : "-"), inferinfo); -#if 0 - /* remember variable as inference variable, and get corresponding active variable, bound and bound type */ - infervar = var; -#endif SCIP_CALL( SCIPvarGetProbvarHole(&var, &left, &right) ); if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR ) From db62f3a6c56d88f10700b993404828a2e0ce20bd Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:14:30 +0200 Subject: [PATCH 03/17] change #if 0 to #ifdef SCIP_MORE_DEBUG --- src/scip/prop_probing.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/scip/prop_probing.c b/src/scip/prop_probing.c index a4209e7360..446a14cd07 100644 --- a/src/scip/prop_probing.c +++ b/src/scip/prop_probing.c @@ -1292,8 +1292,7 @@ SCIP_RETCODE SCIPapplyProbingVar( { proplbs[i] = SCIPvarGetLbLocal(vars[i]); propubs[i] = SCIPvarGetUbLocal(vars[i]); -#if 0 -#ifdef SCIP_DEBUG +#ifdef SCIP_MORE_DEBUG if( SCIPisGT(scip, proplbs[i], SCIPvarGetLbGlobal(vars[i])) ) { SCIPdebugMsg(scip, " -> <%s>[%g,%g] >= %g\n", SCIPvarGetName(vars[i]), @@ -1304,7 +1303,6 @@ SCIP_RETCODE SCIPapplyProbingVar( SCIPdebugMsg(scip, " -> <%s>[%g,%g] <= %g\n", SCIPvarGetName(vars[i]), SCIPvarGetLbGlobal(vars[i]), SCIPvarGetUbGlobal(vars[i]), propubs[i]); } -#endif #endif } } From 9cd936780390336c0c6b05d4e51500c6a92a001d Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:16:07 +0200 Subject: [PATCH 04/17] remove unused callbacks --- src/scip/nlhdlr_perspective.c | 22 ---------------------- src/scip/nlhdlr_soc.c | 32 -------------------------------- 2 files changed, 54 deletions(-) diff --git a/src/scip/nlhdlr_perspective.c b/src/scip/nlhdlr_perspective.c index 2804dc1e22..ca087128ef 100644 --- a/src/scip/nlhdlr_perspective.c +++ b/src/scip/nlhdlr_perspective.c @@ -1241,15 +1241,6 @@ SCIP_DECL_NLHDLRFREEEXPRDATA(nlhdlrFreeExprDataPerspective) return SCIP_OKAY; } -/** callback to be called in initialization */ -#if 0 -static -SCIP_DECL_NLHDLRINIT(nlhdlrInitPerspective) -{ /*lint --e{715}*/ - return SCIP_OKAY; -} -#endif - /** callback to be called in deinitialization */ static SCIP_DECL_NLHDLREXIT(nlhdlrExitPerspective) @@ -1495,19 +1486,6 @@ SCIP_DECL_NLHDLRINITSEPA(nlhdlrInitSepaPerspective) return SCIP_OKAY; } - -#if 0 -/** separation deinitialization method of a nonlinear handler (called during CONSEXITSOL) */ -static -SCIP_DECL_NLHDLREXITSEPA(nlhdlrExitSepaPerspective) -{ /*lint --e{715}*/ - SCIPerrorMessage("method of perspective nonlinear handler not implemented yet\n"); - SCIPABORT(); /*lint --e{527}*/ - - return SCIP_OKAY; -} -#endif - /** nonlinear handler enforcement callback * * "Perspectivies" cuts produced by other nonlinear handlers. diff --git a/src/scip/nlhdlr_soc.c b/src/scip/nlhdlr_soc.c index 690e00538f..d6d4c52106 100644 --- a/src/scip/nlhdlr_soc.c +++ b/src/scip/nlhdlr_soc.c @@ -2404,37 +2404,6 @@ SCIP_DECL_NLHDLRFREEEXPRDATA(nlhdlrFreeExprDataSoc) return SCIP_OKAY; } - -/** callback to be called in initialization */ -#if 0 -static -SCIP_DECL_NLHDLRINIT(nlhdlrInitSoc) -{ /*lint --e{715}*/ - SCIPerrorMessage("method of soc nonlinear handler not implemented yet\n"); - SCIPABORT(); /*lint --e{527}*/ - - return SCIP_OKAY; -} -#else -#define nlhdlrInitSoc NULL -#endif - - -/** callback to be called in deinitialization */ -#if 0 -static -SCIP_DECL_NLHDLREXIT(nlhdlrExitSoc) -{ /*lint --e{715}*/ - SCIPerrorMessage("method of soc nonlinear handler not implemented yet\n"); - SCIPABORT(); /*lint --e{527}*/ - - return SCIP_OKAY; -} -#else -#define nlhdlrExitSoc NULL -#endif - - /** callback to detect structure in expression tree */ static SCIP_DECL_NLHDLRDETECT(nlhdlrDetectSoc) @@ -3164,7 +3133,6 @@ SCIP_RETCODE SCIPincludeNlhdlrSoc( SCIPnlhdlrSetCopyHdlr(nlhdlr, nlhdlrCopyhdlrSoc); SCIPnlhdlrSetFreeHdlrData(nlhdlr, nlhdlrFreehdlrdataSoc); SCIPnlhdlrSetFreeExprData(nlhdlr, nlhdlrFreeExprDataSoc); - SCIPnlhdlrSetInitExit(nlhdlr, nlhdlrInitSoc, nlhdlrExitSoc); SCIPnlhdlrSetSepa(nlhdlr, nlhdlrInitSepaSoc, nlhdlrEnfoSoc, NULL, nlhdlrExitSepaSoc); SCIPnlhdlrSetSollinearize(nlhdlr, nlhdlrSollinearizeSoc); From 51a600937f0c6b22ed1a6ea0b96ae0213e5197b5 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:16:31 +0200 Subject: [PATCH 05/17] remove code since it seems to be experimental --- src/scip/heur_bound.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/scip/heur_bound.c b/src/scip/heur_bound.c index 4364504528..1ac44d25d6 100644 --- a/src/scip/heur_bound.c +++ b/src/scip/heur_bound.c @@ -168,24 +168,9 @@ SCIP_RETCODE applyBoundHeur( SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, &infeasible, NULL) ); } - /* try to repair probing */ + /* stop if infeasible (todo: could also try to backtrack) */ if( infeasible ) - { -#if 0 - SCIP_CALL( SCIPbacktrackProbing(scip, SCIPgetProbingDepth(scip) - 1) ); - - /* fix the last variable, which was fixed the reverse bound */ - SCIP_CALL( SCIPfixVarProbing(scip, var, SCIPvarGetUbLocal(var)) ); - - /* propagate fixings */ - SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, &infeasible, NULL) ); - - SCIPdebugMsg(scip, "backtracking ended with %sfeasible problem\n", (infeasible ? "in" : "")); - - if( infeasible ) -#endif - break; - } + break; } SCIPdebugMsg(scip, "probing ended with %sfeasible problem\n", infeasible ? "in" : ""); From 49e55f55385bef76510883912ee586a77471439d Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:20:44 +0200 Subject: [PATCH 06/17] change #if 0 to #ifdef SCIP_DISABLED_CODE with documentation --- src/scip/cons_cumulative.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index 27447ac89b..79e9246afd 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -410,7 +410,8 @@ SCIP_RETCODE computeImpliedEst( int* est /**< pointer to store the implied earliest start time */ ) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /* there is a bug below */ SCIP_VAR** vbdvars; SCIP_VAR* vbdvar; SCIP_Real* vbdcoefs; @@ -422,7 +423,7 @@ SCIP_RETCODE computeImpliedEst( (*est) = SCIPconvertRealToInt(scip, SCIPvarGetLbLocal(var)); -#if 0 +#ifdef SCIP_DISABLED_CODE /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */ nvbdvars = SCIPvarGetNVlbs(var); @@ -479,7 +480,8 @@ SCIP_RETCODE computeImpliedLct( int* lct /**< pointer to store the implied latest completion time */ ) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /* there is a bug below */ SCIP_VAR** vbdvars; SCIP_VAR* vbdvar; SCIP_Real* vbdcoefs; @@ -490,7 +492,7 @@ SCIP_RETCODE computeImpliedLct( (*lct) = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(var)) + duration; -#if 0 +#ifdef SCIP_DISABLED_CODE /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */ nvbdvars = SCIPvarGetNVubs(var); From 42f025261263d1a98774222bd0cf6c82f78a49cf Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:21:28 +0200 Subject: [PATCH 07/17] remove code that does not seem to be near usability --- src/scip/cons_cumulative.c | 106 ------------------------------------- 1 file changed, 106 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index 79e9246afd..233bea888c 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -2738,112 +2738,6 @@ SCIP_RETCODE resolvePropagationCoretimes( return SCIP_OKAY; } -#if 0 -/** repropagation of edge finding algorithm simplified version from Petr Vilim only a small subset is reported such that - * energy in total and for bound change is enough - */ -static -SCIP_RETCODE resolvePropagationEdgeFinding( - SCIP* scip, /**< SCIP data structure */ - int nvars, /**< number of start time variables (activities) */ - SCIP_VAR** vars, /**< array of start time variables */ - int* durations, /**< array of durations */ - int hmin, /**< left bound of time axis to be considered (including hmin) */ - int hmax, /**< right bound of time axis to be considered (not including hmax) */ - SCIP_VAR* infervar, /**< variable whose bound change is to be explained */ - INFERINFO inferinfo, /**< inference info containing position of correct bdchgids */ - SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */ - SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */ - SCIP_Bool usebdwidening, /**< should bound widening be used during conflict analysis? */ - SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */ - ) -{ - int est; - int lct; - int j; - - /* ???????????????????? do bound widening */ - - assert(scip != NULL); - assert(nvars > 0); - assert(inferInfoGetProprule(inferinfo) == PROPRULE_2_EDGEFINDING); - - SCIPdebugMsg(scip, "repropagate edge-finding with short reasons for variable <%s>\n", SCIPvarGetName(infervar)); - - if( boundtype == SCIP_BOUNDTYPE_LOWER ) - { - SCIP_CALL( SCIPaddConflictLb(scip, infervar, bdchgidx) ); - } - else - { - SCIP_CALL( SCIPaddConflictUb(scip, infervar, bdchgidx) ); - } - - est = inferInfoGetData1(inferinfo); - lct = inferInfoGetData2(inferinfo); - assert(est < lct); - - /* collect the energies of all variables in [est_omega, lct_omega] */ - for( j = 0; j < nvars; ++j ) - { - SCIP_VAR* var; - SCIP_Bool left; - SCIP_Bool right; - int duration; - int lb; - int ub; - - var = vars[j]; - assert(var != NULL); - - if( var == infervar ) - { - if( explanation != NULL ) - explanation[j] = TRUE; - - continue; - } - - lb = SCIPconvertRealToInt(scip, SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE)); - ub = SCIPconvertRealToInt(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE)); - - duration = durations[j]; - assert(duration > 0); - - /* in case the earliest start time is equal to hmin we have to also consider the jobs which run in that region - * since we use adjusted jobs during the propagation - */ - left = (est == hmin && lb + duration > hmin) || lb >= est; - - /* in case the latest completion time is equal to hmax we have to also consider the jobs which run in that region - * since we use adjusted jobs during the propagation - */ - right = (lct == hmax && ub < hmax) || ub + duration <= lct; - - /* store all jobs running in [est_omega; lct_omega] */ - if( left && right ) - { - /* check if bound widening should be used */ - if( usebdwidening ) - { - SCIP_CALL( SCIPaddConflictRelaxedLb(scip, var, bdchgidx, (SCIP_Real)(lct - duration)) ); - SCIP_CALL( SCIPaddConflictRelaxedUb(scip, var, bdchgidx, (SCIP_Real)(est)) ); - } - else - { - SCIP_CALL( SCIPaddConflictLb(scip, var, bdchgidx) ); - SCIP_CALL( SCIPaddConflictUb(scip, var, bdchgidx) ); - } - - if( explanation != NULL ) - explanation[j] = TRUE; - } - } - - return SCIP_OKAY; -} -#endif - /** compute the minimum overlaps w.r.t. the duration of the job and the time window [begin,end) */ static int computeOverlap( From a5d4d3e9f74fab607f7e518d440b91c99721408b Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:22:40 +0200 Subject: [PATCH 08/17] turn some #if 0 to #ifdef SCIP_DISABLED_CODE --- src/scip/cons_cumulative.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index 233bea888c..ad49d003d7 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -1444,7 +1444,9 @@ SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipCp) return SCIP_OKAY; } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following code should work, but is currently not used. */ + /** solve single cumulative condition using SCIP and the time indexed formulation */ static SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipMip) @@ -10797,7 +10799,9 @@ SCIP_RETCODE tightenCoefs( return SCIP_OKAY; } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following should work, but does not seem to be tested well. */ + /** try to reformulate constraint by replacing certain jobs */ static SCIP_RETCODE reformulateCons( @@ -11050,7 +11054,8 @@ SCIP_RETCODE presolveCons( assert(checkDemands(scip, cons) || *cutoff); -#if 0 +#ifdef SCIP_DISABLED_CODE + /* The following should work, but does not seem to be tested well. */ SCIP_CALL( reformulateCons(scip, cons, naggrvars) ); #endif @@ -12631,7 +12636,7 @@ SCIP_DECL_CONSEXITPRE(consExitpreCumulative) { SCIP_CALL( evaluateCumulativeness(scip, conss[c]) ); -#if 0 +#ifdef SCIP_DISABLED_CODE SCIP_CALL( SCIPvisualizeConsCumulative(scip, conss[c]) ); #endif } @@ -14193,7 +14198,8 @@ SCIP_RETCODE SCIPvisualizeConsCumulative( } } -#if 0 +#ifdef SCIP_DISABLED_CODE + /* uncomment to also output variable bounds */ vbdvars = SCIPvarGetVubVars(var); nvbdvars = SCIPvarGetNVubs(var); From 670ce5930a1691451a51e26d6353485423c3da5c Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:23:28 +0200 Subject: [PATCH 09/17] remove code that does not currently seem to be useful --- src/scip/cons_cumulative.c | 39 -------------------------------------- 1 file changed, 39 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index ad49d003d7..dfebc452cf 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -11162,30 +11162,6 @@ TCLIQUE_NEWSOL(tcliqueNewsolClique) SCIPdebugMessage("####### max clique %d\n", cliqueweight); } -/** print the tclique graph */ -#if 0 -static -void tcliquePrint( - SCIP* scip, /**< SCIP data structure */ - TCLIQUE_GRAPH* tcliquegraph /**< tclique graph */ - ) -{ - int nnodes; - int i; - int j; - - nnodes = tcliquegraph->nnodes; - - for( i = 0; i < nnodes; ++i ) - { - for( j = 0; j < nnodes; ++j ) - { - SCIPinfoMessage(scip, NULL, "(%d/%d) ", tcliquegraph->precedencematrix[i][j], tcliquegraph->demandmatrix[i][j]); - } - SCIPinfoMessage(scip, NULL, "\n"); - } -} -#endif /** @} */ @@ -11719,14 +11695,6 @@ SCIP_RETCODE findCumulativeConss( demandrow[c] = tcliquegraph->demandmatrix[v][c]; demandcol[c] = tcliquegraph->demandmatrix[c][v]; -#if 0 - if( precedencerow[c] || precedencecol[c] ) - { - tcliquegraph->demandmatrix[v][c] = FALSE; - tcliquegraph->demandmatrix[c][v] = FALSE; - } -#endif - tcliquegraph->precedencematrix[c][v] = FALSE; tcliquegraph->precedencematrix[v][c] = FALSE; } @@ -13050,13 +13018,6 @@ SCIP_DECL_CONSPROP(consPropCumulative) } } -#if 0 - if( !cutoff && conshdlrdata->dualpresolve && SCIPallowStrongDualReds(scip) && nconss > 1 ) - { - SCIP_CALL( propagateAllConss(scip, conss, nconss, TRUE, &nchgbds, &cutoff, NULL) ); - } -#endif - if( cutoff ) { SCIPdebugMsg(scip, "detected infeasible\n"); From 8fc3148d49c3e7ef2b6211c9259bb6892bf5d58b Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:24:09 +0200 Subject: [PATCH 10/17] remove possibility to aggregate (not useful currently) --- src/scip/cons_cumulative.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index dfebc452cf..773a6bbfa2 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -10984,9 +10984,6 @@ SCIP_RETCODE presolveCons( SCIP_CONSHDLRDATA* conshdlrdata, /**< constraint handler data */ SCIP_PRESOLTIMING presoltiming, /**< timing of presolving call */ int* nfixedvars, /**< pointer to store the number of fixed variables */ -#if 0 - int* naggrvars, /**< pointer to counter which is increased by the number of deduced variable aggregations */ -#endif int* nchgbds, /**< pointer to store the number of changed bounds */ int* ndelconss, /**< pointer to store the number of deleted constraints */ int* naddconss, /**< pointer to store the number of added constraints */ @@ -12963,9 +12960,6 @@ SCIP_DECL_CONSPROP(consPropCumulative) int nchgbds; int ndelconss; int c; -#if 0 - int naggrvars = 0; -#endif SCIPdebugMsg(scip, "propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss); @@ -12992,13 +12986,9 @@ SCIP_DECL_CONSPROP(consPropCumulative) if( SCIPgetDepth(scip) == 0 ) { -#if 0 - SCIP_CALL( presolveCons(scip, cons, conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, - &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) ); -#else SCIP_CALL( presolveCons(scip, cons, conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) ); -#endif + if( cutoff ) break; @@ -13085,13 +13075,8 @@ SCIP_DECL_CONSPRESOL(consPresolCumulative) if( presoltiming != SCIP_PRESOLTIMING_MEDIUM ) { -#if 0 - SCIP_CALL( presolveCons(scip, cons, conshdlrdata, presoltiming, - nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) ); -#else SCIP_CALL( presolveCons(scip, cons, conshdlrdata, presoltiming, nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) ); -#endif if( cutoff || unbounded ) break; From 5ec35725f92763e1fdcdbb9436b21f264d86e422 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Fri, 25 Oct 2024 14:29:29 +0200 Subject: [PATCH 11/17] remove old code --- .../Scheduler/src/cons_optcumulative.c | 76 ------------------- .../Scheduler/src/heur_optcumulative.c | 29 ------- 2 files changed, 105 deletions(-) diff --git a/applications/Scheduler/src/cons_optcumulative.c b/applications/Scheduler/src/cons_optcumulative.c index 3fe2555dc3..2be91f49fd 100644 --- a/applications/Scheduler/src/cons_optcumulative.c +++ b/applications/Scheduler/src/cons_optcumulative.c @@ -1146,13 +1146,6 @@ SCIP_RETCODE addRelaxation( consdata->relaxadded = TRUE; -#if 0 - if( !conshdlrdata->rowrelax ) - { - SCIP_CALL( SCIPrestartSolve(scip) ); - } -#endif - return SCIP_OKAY; } @@ -1877,75 +1870,6 @@ SCIP_RETCODE enfopsCons( return SCIP_OKAY; } -#if 0 -/** enforce the LP or pseudo solution */ -static -SCIP_RETCODE enfoCons( - SCIP* scip, /**< SCIP data structure */ - SCIP_CONS* cons, /**< constraint to be checked */ - SCIP_Bool* violated, /**< pointer to store if the constraint is violated */ - SCIP_Bool* rowadded /**< pointer to store if a row was added */ - ) -{ - SCIP_CONSDATA* consdata; - SCIP_VAR** binvars; - SCIP_VAR** vars; - int* demands; - int* durations; - SCIP_Bool auxiliary; - SCIP_Bool cutoff; - int nvars; - - assert(scip != NULL); - assert(cons != NULL); - assert(violated != NULL); - - SCIPdebugMessage("check optcumulative constraints <%s>\n", SCIPconsGetName(cons)); - - consdata = SCIPconsGetData(cons); - assert(consdata != NULL); - - SCIP_CALL( SCIPallocBufferArray(scip, &binvars, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &vars, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &durations, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &demands, consdata->nvars) ); - - /* collect information of all activities which are assigned to that machine in the given solution */ - collectSolActivities(scip, consdata, NULL, binvars, vars, durations, demands, &nvars, &auxiliary); - - if( nvars > 0 ) - { - /* check the cumulative condition */ - SCIP_CALL( SCIPcheckCumulativeCondition(scip, NULL, nvars, vars, - durations, demands, consdata->capacity, consdata->hmin, consdata->hmax, violated, cons, FALSE) ); - - if( *violated ) - { -#if 0 - /* create row */ - SCIP_CALL( createRow(scip, SCIPconsGetName(cons), binvars, vars, durations, demands, nvars, - consdata->capacity, TRUE, &cutoff) ); -#endif - /* reset constraint age since it successfully detected infeasibility */ - SCIP_CALL( SCIPresetConsAge(scip, cons) ); - } - else - { - /* increase constraint age since it did not detected infeasibility */ - SCIP_CALL( SCIPincConsAge(scip, cons) ); - } - } - - /* free all buffers */ - SCIPfreeBufferArray(scip, &demands); - SCIPfreeBufferArray(scip, &durations); - SCIPfreeBufferArray(scip, &vars); - SCIPfreeBufferArray(scip, &binvars); - - return SCIP_OKAY; -} -#endif - /** upgrade constraints to an cumulative constraint */ static SCIP_RETCODE upgradeCons( diff --git a/applications/Scheduler/src/heur_optcumulative.c b/applications/Scheduler/src/heur_optcumulative.c index 4e39e6ccb2..cbd495fcf8 100644 --- a/applications/Scheduler/src/heur_optcumulative.c +++ b/applications/Scheduler/src/heur_optcumulative.c @@ -253,9 +253,6 @@ SCIP_RETCODE applyOptcumulative( SCIP_Real upperbound; SCIP_Real pseudoobj; SCIP_Bool infeasible; -#if 0 - int depth; -#endif assert(heur != NULL); assert(heurdata != NULL); @@ -264,9 +261,6 @@ SCIP_RETCODE applyOptcumulative( infeasible = FALSE; *result = SCIP_DIDNOTFIND; -#if 0 - depth = SCIPgetDepth(scip); -#endif /* start probing */ SCIP_CALL( SCIPstartProbing(scip) ); @@ -545,29 +539,6 @@ SCIP_RETCODE applyOptcumulative( if( stored ) *result = SCIP_FOUNDSOL; } -#if 0 - else - { - /* check that code */ - int v; - - SCIP_CALL( SCIPinitConflictAnalysis(scip) ); - - for( v = 0; v < heurdata->machines[m]; ++v ) - { - SCIP_CALL( SCIPaddConflictBinvar(scip, heurdata->binvars[m][v]) ); - SCIP_CALL( SCIPaddConflictLb(scip, heurdata->vars[m][v], NULL) ); - SCIP_CALL( SCIPaddConflictUb(scip, heurdata->vars[m][v], NULL) ); - } - - /* analyze the conflict */ -#if 0 - SCIP_CALL( SCIPanalyzeConflict(scip, depth, NULL) ); -#endif - SCIP_CALL( SCIPanalyzeConflict(scip, 0, NULL) ); - SCIP_CALL( SCIPfreeSol(scip, &sol) ); - } -#endif } /* exit probing mode */ From 031103b790f27d94b9c89626e9d1f26de30bc605 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Sun, 27 Oct 2024 19:48:33 +0100 Subject: [PATCH 12/17] Apply 3 suggestion(s) to 3 file(s) Co-authored-by: Dominik Kamp --- src/scip/cons_cumulative.c | 4 ++-- src/scip/cons_linking.c | 1 - src/scip/heur_bound.c | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index 773a6bbfa2..861c07e63c 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -14144,8 +14144,8 @@ SCIP_RETCODE SCIPvisualizeConsCumulative( } } -#ifdef SCIP_DISABLED_CODE - /* uncomment to also output variable bounds */ +#ifdef SCIP_MORE_OUTPUT + /* define to also output variable bounds */ vbdvars = SCIPvarGetVubVars(var); nvbdvars = SCIPvarGetNVubs(var); diff --git a/src/scip/cons_linking.c b/src/scip/cons_linking.c index 1838c8acbb..1ca67366bb 100644 --- a/src/scip/cons_linking.c +++ b/src/scip/cons_linking.c @@ -2925,7 +2925,6 @@ SCIP_DECL_CONSPRESOL(consPresolLinking) /* The following should work, but does not seem to be tested well. */ /* transfer aggregated linking variables to the corresponding binary variables */ - assert(conshdlrdata->varmap != NULL); SCIP_CALL( aggregateVariables(scip, conshdlrdata->varmap, conss, nconss, naggrvars, &cutoff) ); #endif diff --git a/src/scip/heur_bound.c b/src/scip/heur_bound.c index 1ac44d25d6..e7686f5a5f 100644 --- a/src/scip/heur_bound.c +++ b/src/scip/heur_bound.c @@ -168,7 +168,8 @@ SCIP_RETCODE applyBoundHeur( SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, &infeasible, NULL) ); } - /* stop if infeasible (todo: could also try to backtrack) */ + /* todo: try to backtrack */ + /* stop if infeasible */ if( infeasible ) break; } From a3cd92203e44ea7c84a5b07d36c12d32658f1de9 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Sun, 27 Oct 2024 19:41:52 +0100 Subject: [PATCH 13/17] criteria -> criterion --- src/scip/prop_pseudoobj.c | 16 ++++++++-------- src/scip/prop_rootredcost.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/scip/prop_pseudoobj.c b/src/scip/prop_pseudoobj.c index 92f0bca77e..1c477c238e 100644 --- a/src/scip/prop_pseudoobj.c +++ b/src/scip/prop_pseudoobj.c @@ -282,13 +282,13 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) assert(SCIPvarGetObj(var1) != 0.0); assert(SCIPvarGetObj(var2) != 0.0); - /* first criteria is the absolute value of objective coefficient */ + /* first criterion is the absolute value of objective coefficient */ if( REALABS(SCIPvarGetObj(var1)) < REALABS(SCIPvarGetObj(var2)) ) return -1; else if( REALABS(SCIPvarGetObj(var1)) > REALABS(SCIPvarGetObj(var2)) ) return +1; - /* second criteria the locks which indicate most effect */ + /* second criterion the locks which indicate most effect */ if( SCIPvarGetObj(var1) > 0.0 ) locks1 = SCIPvarGetNLocksDownType(var1, SCIP_LOCKTYPE_MODEL); else @@ -304,7 +304,7 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) if( locks1 > locks2 ) return 1; - /* third criteria the other locks */ + /* third criterion the other locks */ if( SCIPvarGetObj(var1) > 0.0 ) locks1 = SCIPvarGetNLocksUpType(var1, SCIP_LOCKTYPE_MODEL); else @@ -320,7 +320,7 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) if( locks1 > locks2 ) return 1; - /* forth criteria use the problem index */ + /* forth criterion use the problem index */ return SCIPvarCompare(var1, var2); } @@ -2585,7 +2585,7 @@ SCIP_RETCODE propagateCutoffboundGlobally( #ifdef SCIP_DISABLED_CODE /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nminactvars; ++v ) { assert(cutoffbound - pseudoobjval >= propdata->minactimpls[v]->maxobjchg); @@ -2736,7 +2736,7 @@ SCIP_RETCODE propagateCutoffboundBinvars( #ifdef SCIP_DISABLED_CODE /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nminactvars; ++v ) { var = minactvars[v]; @@ -3338,7 +3338,7 @@ SCIP_RETCODE propagateLowerbound( nchgbds++; } - /* update globally fixed index if abort criteria was applied */ + /* update globally fixed index if abort criterion was applied */ propdata->maxactfirstnonfixed = v; /* check all binary variables which could potentially be fixed */ @@ -3368,7 +3368,7 @@ SCIP_RETCODE propagateLowerbound( #ifdef SCIP_DISABLED_CODE /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nmaxactvars && !cutoff; ++v ) { var = maxactvars[v]; diff --git a/src/scip/prop_rootredcost.c b/src/scip/prop_rootredcost.c index 8ae2a307ac..f010677721 100644 --- a/src/scip/prop_rootredcost.c +++ b/src/scip/prop_rootredcost.c @@ -153,7 +153,7 @@ SCIP_DECL_SORTPTRCOMP(varCompRedcost) else if( key1 > key2 ) return +1; - /* second criteria use the problem index + /* second criterion: use the problem index * * @note The problem index is unique. That means the resulting sorting is unique. */ @@ -391,7 +391,7 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( assert(!(*cutoff)); /* the binary variables are stored in the beginning of the variable array; these variables are sorted w.r.t. cutoff - * bound which would lead to a fixing; that give us an abort criteria (see below) + * bound which would lead to a fixing; that give us an abort criterion (see below) */ redcostvars = propdata->redcostvars; assert(redcostvars != NULL); @@ -486,12 +486,12 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( propdata->glbfirstnonfixed = v; #ifdef SCIP_DISABLED_CODE - /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may + /* due to numerics it might be that the abort criterion did not work correctly, because the sorting mechanism may * have evaluated variables with a really small difference in their reduced cost values but with really huge * lpobjval as the same */ #ifndef NDEBUG - /* check that the abort criteria works; that means none of the remaining binary variables can be fixed */ + /* check that the abort criterion works; that means none of the remaining binary variables can be fixed */ for( ; v < propdata->nredcostbinvars && !(*cutoff); ++v ) { SCIP_VAR* var; From 544d43bf777c338eb83d98fbc5caacaa939d2d8b Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Sun, 27 Oct 2024 19:43:46 +0100 Subject: [PATCH 14/17] add a bit more explanation why code is diabled --- src/scip/prop_rootredcost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scip/prop_rootredcost.c b/src/scip/prop_rootredcost.c index f010677721..ac6fe8210b 100644 --- a/src/scip/prop_rootredcost.c +++ b/src/scip/prop_rootredcost.c @@ -486,9 +486,9 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( propdata->glbfirstnonfixed = v; #ifdef SCIP_DISABLED_CODE - /* due to numerics it might be that the abort criterion did not work correctly, because the sorting mechanism may + /* Due to numerics it might be that the abort criterion did not work correctly, because the sorting mechanism may * have evaluated variables with a really small difference in their reduced cost values but with really huge - * lpobjval as the same + * lpobjval as the same. Thus, we disable the check below for now. */ #ifndef NDEBUG /* check that the abort criterion works; that means none of the remaining binary variables can be fixed */ From cb65eb18e581d5bf26f6f34795c8c1877cdf1437 Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Mon, 28 Oct 2024 10:50:36 +0100 Subject: [PATCH 15/17] Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Dominik Kamp --- src/scip/cons_xor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/scip/cons_xor.c b/src/scip/cons_xor.c index 9126116691..a9979f1512 100644 --- a/src/scip/cons_xor.c +++ b/src/scip/cons_xor.c @@ -4470,9 +4470,7 @@ SCIP_RETCODE preprocessConstraintPairs( assert(consdata0->sorted); #ifdef SCIP_DISABLED_CODE - /* if aggregation in the core of SCIP is not changed we do not need to call applyFixing, this would be the correct - * way - */ + /* TODO: consider running applyFixings() on the persistent constraint to detect a cutoff */ /* remove all variables that are fixed to zero and all pairs of variables fixed to one; * merge multiple entries of the same or negated variables */ From 2ac290c45d807815a30d2a93b7d147754804666b Mon Sep 17 00:00:00 2001 From: Marc Pfetsch Date: Mon, 28 Oct 2024 10:52:22 +0100 Subject: [PATCH 16/17] add todo --- src/scip/cons_linking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scip/cons_linking.c b/src/scip/cons_linking.c index 1ca67366bb..d870c01848 100644 --- a/src/scip/cons_linking.c +++ b/src/scip/cons_linking.c @@ -3182,7 +3182,7 @@ static SCIP_DECL_CONSENABLE(consEnableLinking) { /*lint --e{715}*/ #ifdef SCIP_DISABLED_CODE - /* The following might help, but it would need to be tested whether it speeds up the solution process. */ + /** @todo The following might help, but it would need to be tested whether it speeds up the solution process. */ SCIP_CONSHDLRDATA* conshdlrdata; SCIP_CONSDATA* consdata; From 81f04f963c4995ce10b600159895f6e4c64778a4 Mon Sep 17 00:00:00 2001 From: Stefan Vigerske Date: Wed, 30 Oct 2024 12:16:09 +0100 Subject: [PATCH 17/17] revise 9.1.2 changelog --- CHANGELOG | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a295c1ea83..6263b6feda 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,20 +6,14 @@ Fixed bugs ---------- -- skip constraint propagation if the residual activity bound cancels the side precision in tightenVarBounds() of cons_linear.c -- use indices of negation counterparts and accept fixings when ordering and-resultants of pseudoboolean constraints +- skip linear constraint propagation if the residual activity bound cancels the side precision - correct bound tracking to make the evaluation of primal-dual-integrals work -- update locks on model variables before removing pseudoboolean constraints in consPresolPseudoboolean() - skip aggregations on fixed variables in milp presolver to avoid errors for earlier versions of PaPILO +- use indices of negation counterparts and accept fixings when ordering and-resultants of pseudoboolean constraints +- update locks on model variables before removing pseudoboolean constraints in presolve - reformulate soft pseudoboolean constraints with linear constraints if the indicator decomposition is disabled -- in lpi_highs set the presolve option in lpiSolve() to not reset the model status directly after solving the LP -- update constraints and hashmap after each multi-aggregation to avoid key error in removeDoubleAndSingletonsAndPerformDualpresolve() of cons_setppc.c - -Unit tests ----------- - -Testing -------- +- add workaround for recent HiGHS versions resetting the model status when changing the presolve option after a solve +- avoid hashmap key error in removal of doubletons and singletons in dual presolve of setppc constraints by updating constraints and corresponding hashmaps after each multi-aggregation Build system ------------ @@ -28,16 +22,11 @@ Build system - attempted to fix detection of CPLEX library on macOS and Windows systems -### Makefile - Miscellaneous ------------- - adjusted Gurobi interface for Gurobi 12 -Known bugs ----------- - @section RN911 SCIP 9.1.1 *************************