All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
heur_undercover.c
Go to the documentation of this file.
21 * The undercover heuristic is designed for mixed-integer nonlinear programs and tries to fix a subset of variables such
22 * as to make each constraint linear or convex. For this purpose it solves a binary program to automatically determine
23 * the minimum number of variable fixings necessary. As fixing values, we use values from the LP relaxation, the NLP
26 * @todo use the conflict analysis to analyze the infeasibility which arise after the probing of the cover worked and
27 * solve returned infeasible, instead of adding the Nogood/Conflict by hand; that has the advantage that the SCIP
30 * @todo do not use LP and NLP fixing values in the same run, e.g., fixingalts = "lni", but start a second dive if LP
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
55 #define DEFAULT_FIXINGALTS "li" /**< sequence of fixing values used: 'l'p relaxation, 'n'lp relaxation, 'i'ncumbent solution */
57 #define DEFAULT_MAXNODES (SCIP_Longint)500/**< maximum number of nodes to regard in the subproblem */
58 #define DEFAULT_MINNODES (SCIP_Longint)500/**< minimum number of nodes to regard in the subproblem */
59 #define DEFAULT_NODESOFS (SCIP_Longint)500/**< number of nodes added to the contingent of the total nodes */
64 #define DEFAULT_MAXCOVERSIZEVARS 1.0 /**< maximum coversize (as fraction of total number of variables) */
65 #define DEFAULT_MAXCOVERSIZECONSS SCIP_REAL_MAX /**< maximum coversize (as ratio to the percentage of non-affected constraints) */
66 #define DEFAULT_MINCOVEREDREL 0.15 /**< minimum percentage of nonlinear constraints in the original problem */
67 #define DEFAULT_MINCOVEREDABS 5 /**< minimum number of nonlinear constraints in the original problem */
68 #define DEFAULT_MINIMPROVE 0.0 /**< factor by which heuristic should at least improve the incumbent */
69 #define DEFAULT_NODESQUOT 0.1 /**< subproblem nodes in relation to nodes of the original problem */
70 #define DEFAULT_RECOVERDIV 0.9 /**< fraction of covering variables in the last cover which need to change their value when recovering */
79 #define DEFAULT_BEFORECUTS TRUE /**< should undercover called at root node before cut separation? */
81 #define DEFAULT_LOCKSROUNDING TRUE /**< shall LP values for integer vars be rounded according to locks? */
82 #define DEFAULT_ONLYCONVEXIFY FALSE /**< should we only fix/dom.red. variables creating nonconvexity? */
83 #define DEFAULT_POSTNLP TRUE /**< should the NLP heuristic be called to polish a feasible solution? */
84 #define DEFAULT_COVERBD FALSE /**< should bounddisjunction constraints be covered (or just copied)? */
85 #define DEFAULT_REUSECOVER FALSE /**< shall the cover be re-used if a conflict was added after an infeasible subproblem? */
86 #define DEFAULT_COPYCUTS TRUE /**< should all active cuts from the cutpool of the original scip be copied
93 #define MAXNLPFAILS 1 /**< maximum number of fails after which we give up solving the NLP relaxation */
94 #define MAXPOSTNLPFAILS 1 /**< maximum number of fails after which we give up calling NLP local search */
95 #define MINTIMELEFT 1.0 /**< don't start expensive parts of the heuristics if less than this amount of time left */
96 #define SUBMIPSETUPCOSTS 200 /**< number of nodes equivalent for the costs for setting up the sub-CIP */
108 char* fixingalts; /**< sequence of fixing values used: 'l'p relaxation, 'n'lp relaxation, 'i'ncumbent solution */
116 SCIP_Real maxcoversizevars; /**< maximum coversize (as fraction of total number of variables) */
117 SCIP_Real maxcoversizeconss; /**< maximum coversize maximum coversize (as ratio to the percentage of non-affected constraints) */
118 SCIP_Real mincoveredrel; /**< minimum percentage of nonlinear constraints in the original problem */
121 SCIP_Real recoverdiv; /**< fraction of covering variables in the last cover which need to change their value when recovering */
134 SCIP_Bool globalbounds; /**< should global bounds on variables be used instead of local bounds at focus node? */
135 SCIP_Bool locksrounding; /**< shall LP values for integer vars be rounded according to locks? */
141 SCIP_Bool reusecover; /**< shall the cover be re-used if a conflict was added after an infeasible subproblem? */
172 isfixed = SCIPisFeasEQ(scip, val, SCIPvarGetLbGlobal(var)) && SCIPisFeasEQ(scip, val, SCIPvarGetUbGlobal(var));
174 isfixed = SCIPisFeasEQ(scip, val, SCIPvarGetLbLocal(var)) && SCIPisFeasEQ(scip, val, SCIPvarGetUbLocal(var));
180 /** determines, whether a term is already constant, because the variable is fixed or the coefficient is zero */
255 SCIP_EXPRINT* exprint, /**< expression interpreter for computing sparsity pattern of the Hessian;
257 struct HessianData* hessiandata, /**< working memory for retrieving dense sparsity of Hessian matrices */
264 SCIP_Bool globalbounds, /**< should global bounds on variables be used instead of local bounds at focus node? */
307 /* is an expression interpreter available which can return the sparsity pattern of the Hessian? */
335 SCIP_CALL( SCIPgetSolVals(scip, hessiandata->evalsol, nexprtreevars, exprtreevars, hessiandata->varvals) );
338 SCIP_CALL( SCIPexprintHessianSparsityDense(exprint, exprtree, hessiandata->varvals, hessiandata->sparsity) );
342 /* if constraints with inactive variables are present, we will have difficulties creating the sub-CIP later */
346 SCIPdebugMessage("strange: inactive variables detected in nonlinear row <%s>\n", SCIPnlrowGetName(nlrow));
361 SCIPdebugMessage("fixing var <%s> in covering problem to 1\n", SCIPvarGetName(coveringvars[probidx1]));
374 if( !hessiandata->sparsity[idx1*nexprtreevars + idx2] && !hessiandata->sparsity[idx2*nexprtreevars + idx1] )
377 /* if diagonal has entry already, then covering constraint would always be satisfied, thus no need to add */
378 if( hessiandata->sparsity[idx2*nexprtreevars + idx2] && !termIsConstant(scip, exprtreevars[idx2], 1.0, globalbounds) )
381 /* if constraints with inactive variables are present, we will have difficulties creating the sub-CIP later */
385 SCIPdebugMessage("strange: inactive variables detected in nonlinear row <%s>\n", SCIPnlrowGetName(nlrow));
395 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_covering_%d_%d", SCIPnlrowGetName(nlrow), idx1, idx2);
411 SCIPdebugMessage("added covering constraint for vars <%s> and <%s> in covering problem\n", SCIPvarGetName(coveringvars[probidx1]), SCIPvarGetName(coveringvars[probidx2]));
426 /* if constraints with inactive variables are present, we will have difficulties creating the sub-CIP later */
447 SCIPdebugMessage("fixing var <%s> in covering problem to 1\n", SCIPvarGetName(coveringvars[probidx1]));
471 /* if constraints with inactive variables are present, we will have difficulties creating the sub-CIP later */
476 SCIPdebugMessage("inactive variables detected in nonlinear row <%s>\n", SCIPnlrowGetName(nlrow));
487 /* if we only convexify and term is convex considering the bounds of the nlrow, nothing to do */
488 if( onlyconvexify && termIsConvex(scip, SCIPnlrowGetLhs(nlrow), SCIPnlrowGetRhs(nlrow), quadelem->coef >= 0) )
499 SCIPdebugMessage("fixing var <%s> in covering problem to 1\n", SCIPvarGetName(coveringvars[probidx1]));
507 /* if the term is linear because one of the variables is fixed or the coefficient is zero, nothing to do */
547 SCIP_Bool globalbounds, /**< should global bounds on variables be used instead of local bounds at focus node? */
595 /* initialize empty hessiandata; memory will be allocated in method processNlRow() as required */
601 /* create covering variable for each variable in the original problem (fix it or not?) in the same order as in the
607 SCIP_CALL( SCIPcreateVar(coveringscip, &coveringvars[i], name, 0.0, 1.0, 1.0, SCIP_VARTYPE_BINARY,
613 /* first, go through some special constraint handlers which we do not want to treat by looking at their nlrow
614 * representation; we store these in a hash map and afterwards process all nlrows which are not found in the hash map
669 SCIP_CALL( SCIPallocBufferArray(coveringscip, &coveringconsvars, SCIPgetNVarsAnd(scip, andcons)+1) );
670 SCIP_CALL( SCIPallocBufferArray(coveringscip, &coveringconsvals, SCIPgetNVarsAnd(scip, andcons)+1) );
693 /* if constraints with inactive variables are present, we have to find the corresponding active variable */
731 SCIP_CALL( SCIPgetNegatedVar(coveringscip, coveringvars[probindex], &coveringconsvars[ntofix]) );
740 /* if constraints with inactive variables are present, we have to find the corresponding active variable */
745 /* if resultant is fixed this constraint can be either linearized or is redundant because all operands can be fixed */
760 SCIP_CALL( SCIPgetBinvarRepresentative(scip, SCIPgetResultantAnd(scip, andcons), &repvar, &negated) );
766 SCIPdebugMessage("strange: multiaggregated variable found <%s>\n", SCIPvarGetName(SCIPgetResultantAnd(scip, andcons)));
795 assert(!termIsConstant(scip, (negated ? SCIPvarGetNegatedVar(vars[probindex]) : vars[probindex]), 1.0, globalbounds));
797 /* if less than two variables are unfixed or the resultant variable is fixed, the entire constraint can be
807 SCIP_CALL( SCIPgetNegatedVar(coveringscip, coveringvars[probindex], &coveringconsvars[ntofix]) );
816 SCIP_CALL( SCIPcreateConsLinear(coveringscip, &coveringcons, name, ntofix, coveringconsvars, coveringconsvals,
835 incCounters(termcounter, conscounter, consmarker, SCIPvarGetProbindex(SCIPvarGetNegationVar(coveringconsvars[v])));
871 /* bounddisjunction constraints are not passed to the NLP, hence nothing to store in the hash map */
888 if( varIsFixed(scip, bdvars[v], globalbounds ? SCIPvarGetLbGlobal(bdvars[v]) : SCIPvarGetLbLocal(bdvars[v]),
894 /* if constraints with inactive variables are present, we have to find the corresponding active variable */
932 SCIP_CALL( SCIPgetNegatedVar(coveringscip, coveringvars[probindex], &coveringconsvars[ntofix]) );
947 SCIP_CALL( SCIPcreateConsLinear(coveringscip, &coveringcons, name, ntofix, coveringconsvars, coveringconsvals,
966 incCounters(termcounter, conscounter, consmarker, SCIPvarGetProbindex(SCIPvarGetNegationVar(coveringconsvars[v])));
998 if( varIsFixed(scip, binvar, globalbounds ? SCIPvarGetLbGlobal(binvar) : SCIPvarGetLbLocal(binvar), globalbounds) )
1003 /* if constraints with inactive variables are present, we have to find the corresponding active variable */
1019 SCIPdebugMessage("inactive variables detected in constraint <%s>\n", SCIPconsGetName(indcons));
1070 /* if we only want to convexify and curvature and bounds prove already convexity, nothing to do */
1072 && ((SCIPisInfinity(scip, -SCIPgetLhsQuadratic(scip, quadcons)) && SCIPisConvexQuadratic(scip, quadcons))
1073 || (SCIPisInfinity(scip, SCIPgetRhsQuadratic(scip, quadcons)) && SCIPisConcaveQuadratic(scip, quadcons))) )
1124 SCIP_CALL( SCIPallocBufferArray(coveringscip, &coveringconsvars, SCIPgetNLhsVarsSOC(scip, soccons)+1) );
1130 /* soc constraints should contain only active and multi-aggregated variables; the latter we do not handle */
1134 SCIPdebugMessage("inactive variables detected in constraint <%s>\n", SCIPconsGetName(soccons));
1142 SCIP_CALL( SCIPgetNegatedVar(coveringscip, coveringvars[probindex], &coveringconsvars[ntofix]) );
1151 /* soc constraints should contain only active and multi-aggregated variables; the latter we do not handle */
1155 SCIPdebugMessage("inactive variables detected in constraint <%s>\n", SCIPconsGetName(soccons));
1163 SCIP_CALL( SCIPgetNegatedVar(coveringscip, coveringvars[probindex], &coveringconsvars[ntofix]) );
1188 incCounters(termcounter, conscounter, consmarker, SCIPvarGetProbindex(SCIPvarGetNegatedVar(coveringconsvars[v])));
1218 SCIP_CALL( processNlRow(scip, nlrows[i], exprint, &hessiandata, coveringscip, nvars, coveringvars,
1239 (globalbounds ? SCIPvarGetUbGlobal(vars[i]) - SCIPvarGetLbGlobal(vars[i]) : SCIPvarGetUbLocal(vars[i]) - SCIPvarGetLbLocal(vars[i]))) );
1247 SCIP_CALL( SCIPchgVarObj(coveringscip, coveringvars[i], (SCIP_Real) (nlocksup+nlocksdown+1)) );
1255 SCIP_CALL( SCIPchgVarObj(coveringscip, coveringvars[i], (SCIP_Real) (MIN(nlocksup, nlocksdown)+1)) );
1340 SCIP_Bool* success, /**< pointer to store whether the cutoff constraint was created successfully */
1341 SCIP_Bool* infeas /**< pointer to store whether the cutoff proves (local or global) infeasibility */
1372 /* if all variables in the cover are binary and we require only one variable to change its value, then we create a
1399 /* if all variables in the cover are binary and we require more variables to change their value, then we create a
1440 /* if proven infeasible, we do not even add the constraint; otherwise we add and release the constraint if created
1464 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
1465 SCIP_Bool* success /**< pointer to store whether the cutoff constraint was created successfully */
1592 if( SCIPfindBranchrule(coveringscip, "inference") != NULL && !SCIPisParamFixed(coveringscip, "branching/inference/priority") )
1623 * hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
1630 SCIPwarningMessage(coveringscip, "Error while solving covering problem in Undercover heuristic; sub-SCIP terminated with code <%d>\n",retcode);
1640 SCIP_CALL( SCIPgetSolVals(coveringscip, SCIPgetBestSol(coveringscip), ncoveringvars, coveringvars, solvals) );
1657 *coversize, SCIPgetNOrigVars(coveringscip), SCIPgetSolOrigObj(coveringscip, SCIPgetBestSol(coveringscip))/(totalpenalty+SCIPsumepsilon(coveringscip)));
1658 SCIPdebug( SCIP_CALL( SCIPprintSol(coveringscip, SCIPgetBestSol(coveringscip), NULL, FALSE) ) );
1723 + heurdata->inferenceweight * SCIPgetVarAvgInferenceCutoffScore(scip, var, heurdata->cutoffweight);
1788 char fixalt, /**< source of the fixing value: 'l'p relaxation, 'n'lp relaxation, 'i'ncumbent solution */
1830 /* restore bounds at start of probing, since otherwise, if in backtrack mode, NLP solver becomes most likely
1881 *success = stat == SCIP_NLPSOLSTAT_GLOBOPT || stat == SCIP_NLPSOLSTAT_LOCOPT || stat == SCIP_NLPSOLSTAT_FEASIBLE;
1883 SCIPdebugMessage("solving NLP relaxation to obtain fixing values %s (stat=%d)\n", *success ? "successful" : "failed", stat);
1902 heurdata->nnlpfails, heurdata->nnlpfails > 1 ? "s" : "", heurdata->nnlpfails >= MAXNLPFAILS ? ", will not be called again" : "");
1923 * The alternatives are the two bounds of the variable, and the averages of the bounds and the fixing value.
1986 /* use the average of x' and lower bound as alternative value, if this is not equal to any of the other values */
1987 if( !SCIPisFeasEQ(scip, lb, fixval) && (!SCIPvarIsIntegral(var) || !SCIPisFeasEQ(scip, lb, fixval-1)) )
1993 /* use the average of x' and upper bound as alternative value, if this is not equal to any of the other values */
1994 if( !SCIPisFeasEQ(scip, ub, fixval) && (!SCIPvarIsIntegral(var) || !SCIPisFeasEQ(scip, ub, fixval+1)) )
2012 SCIP_Bool locksrounding /**< shall we round according to locks? (otherwise to nearest integer) */
2041 x = SCIPvarGetNLocksDown(var) < SCIPvarGetNLocksUp(var) ? SCIPfeasFloor(scip, x) : SCIPfeasCeil(scip, x);
2075 /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
2076 * since constraint copying may have required the copy of variables that are fixed in the main SCIP
2104 SCIP_Bool* validsolved, /**< was problem constructed from a valid copy and solved (proven optimal or infeasible)? */
2105 SCIP_SOL** sol, /**< best solution found in subproblem (if feasible); *sol must be NULL, solution will be created */
2149 SCIP_CALL( SCIPhashmapCreate(&varmap, SCIPblkmem(subscip), SCIPcalcHashtableSize(5 * nvars)) );
2152 SCIP_CALL( SCIPcopy(scip, subscip, varmap, NULL, "undercoversub", heurdata->globalbounds, FALSE, TRUE, validsolved) );
2186 /* deactivate expensive pre-root heuristics, since it may happen that the lp relaxation of the subproblem is already
2187 * infeasible; in this case, we do not want to waste time on heuristics before solving the root lp */
2196 SCIPwarningMessage(scip, "unfixing parameter heuristics/"HEUR_NAME"/freq in subscip of undercover heuristic to avoid recursive calls\n");
2201 SCIPdebugMessage("timelimit = %g, memlimit = %g, nodelimit = %"SCIP_LONGINT_FORMAT", nstallnodes = %"SCIP_LONGINT_FORMAT"\n", timelimit, memorylimit, nodelimit, nstallnodes);
2203 SCIPdebugMessage("timelimit = %g, memlimit = %g, nodelimit = %"SCIP_LONGINT_FORMAT", nstallnodes = %"SCIP_LONGINT_FORMAT"\n", timelimit, memorylimit, nodelimit, nstallnodes);
2222 /* if there is already a solution, add an objective cutoff; note: this does not affect the validity of the subproblem
2233 cutoff = (upperbound >= 0 ? 1.0 - heurdata->minimprove : 1.0 + heurdata->minimprove) * upperbound;
2235 cutoff = (1.0 - heurdata->minimprove) * upperbound + heurdata->minimprove * SCIPgetLowerbound(scip);
2240 SCIPdebugMessage("adding objective cutoff=%g (minimprove=%g)\n", cutoff, heurdata->minimprove);
2248 * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
2255 SCIPwarningMessage(scip, "Error while solving subproblem in Undercover heuristic; sub-SCIP terminated with code <%d>\n",retcode);
2262 /* store solving status; note: if we proved infeasibility in presence of an objective cutoff beyond the primal bound,
2265 || (SCIPgetStatus(subscip) == SCIP_STATUS_INFEASIBLE && (SCIPgetNSols(scip) == 0 || heurdata->minimprove <= 0.0)));
2268 /* if a solution was found for the subproblem, create corresponding solution in the original problem */
2269 if( SCIPgetNSols(subscip) > 0 && (SCIPgetStatus(subscip) != SCIP_STATUS_INFEASIBLE || heurdata->minimprove > 0.0) )
2279 * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted */
2297 SCIPdebugMessage("heuristic found %d solutions in subproblem; solution %d feasible in original problem\n", nsubsols, i);
2306 /* if the best subproblem solution was not accepted in the original problem, we do not trust the solving status */
2391 /* move fixing value into the new domain, since it may be outside due to numerical issues or previous propagation */
2499 for( nbacktracks = 0; nbacktracks <= heurdata->maxbacktracks+nfailedvals && *infeas; nbacktracks++ )
2514 * if the NLP relaxation is not constructed, we do not even try to retrieve the NLP solution value;
2515 * if there is no feasible solution yet, we do not even try to obtain the value in the incumbent */
2521 SCIP_CALL( getFixingValue(scip, heurdata, vars[idx], &val, heurdata->fixingalts[nbacktracks], &success, *bdlen, bdvars, bdtypes, oldbounds) );
2526 SCIPdebugMessage("retrieving fixing value '%c' for variable <%s> failed, trying next in the list\n",
2559 /* move value into the domain, since it may be outside due to numerical issues or previous propagation */
2584 SCIP_CALL( performFixing(scip, vars[idx], val, infeas, bdlen, bdvars, bdtypes, bdbounds, oldbounds) );
2651 SCIP_BOUNDTYPE* bdtypes; /* array of bound types in bound disjunction along the probing path */
2689 /* NLP relaxation has not been solved yet (only solve once, not again for each cover or dive, because it is expensive) */
2692 /* if solving the NLP relaxation has failed too often in previous runs, or NLP and NLP solver is not available, we do
2695 heurdata->nlpfailed = heurdata->nnlpfails >= MAXNLPFAILS || !SCIPisNLPConstructed(scip) || SCIPgetNNlpis(scip) == 0;
2708 if( nnlconss < (SCIP_Real) SCIPgetNConss(scip) * heurdata->mincoveredrel || nnlconss < heurdata->mincoveredabs )
2723 maxcoversizeconss = heurdata->maxcoversizeconss * nnlconss / ((SCIP_Real) SCIPgetNConss(scip));
2732 SCIP_CALL( createCoveringProblem(scip, coveringscip, coveringvars, heurdata->globalbounds, heurdata->onlyconvexify,
2802 timelimit, memorylimit + (SCIPgetMemExternEstim(coveringscip)+SCIPgetMemUsed(coveringscip))/1048576.0, maxcoversize, &success) );
2806 SCIPstatisticPrintf("UCstats coversize abs: %6d rel: %9.6f\n", coversize, 100.0*coversize /(SCIP_Real)nvars);
2831 if( heurdata->maxcoversizeconss < SCIP_REAL_MAX && coversize > heurdata->maxcoversizeconss * nnlconss / (SCIP_Real) SCIPgetNConss(scip) )
2852 SCIP_CALL( computeFixingOrder(scip, heurdata, nvars, vars, coversize, cover, lastfailed, &reordered) );
2854 SCIPdebugMessage("%sordering variables in cover %s\n", ndives == 0 ? "" : "re", reordered ? "" : "failed");
2861 SCIP_CALL( fixAndPropagate(scip, heurdata, cover, coversize, fixingvals, &bdlen, bdvars, bdtypes, bdbounds, oldbounds,
2868 SCIPdebugMessage("%d dive%s of fix-and-propagate for cover %d took %.1f seconds\n", ndives, ndives > 1 ? "s" : "", ncovers, SCIPgetClockTime(scip, clock));
2888 SCIPdebugMessage("heuristic successfully fixed %d variables (%d integral, %d continuous) during probing\n",
2903 /* if the subproblem was constructed from a valid copy and solved, try to forbid the assignment of fixing
2919 /* even if we had reset the global bounds at start of probing, the constraint might be only locally valid due to local constraints/cuts */
2920 SCIP_CALL( createConflict(scip, bdlen, bdvars, bdtypes, bdbounds, SCIPgetDepth(scip) > 0, TRUE, TRUE, &success) );
2924 SCIPdebugMessage("subproblem solved (%s), forbidding assignment in original problem %s, %sconflict length=%d\n",
2944 SCIPdebugMessage("subproblem solved to optimality while all covering variables are integral, hence skipping NLP local search\n");
2958 SCIP_CALL( SCIPapplyHeurSubNlp(scip, heurdata->nlpheur, &nlpresult, sol, -1LL, timelimit, heurdata->minimprove, NULL) );
2959 SCIPdebugMessage("NLP local search %s\n", nlpresult == SCIP_FOUNDSOL ? "successful" : "failed");
2973 /* heuristic failed but we have another recovering try, hence we forbid the current cover in the covering problem */
2979 /* compute minimal number of unfixed covering variables (in the cover) which have to change their value */
2984 SCIP_CALL( forbidCover(coveringscip, nvars, coveringvars, coversize, cover, diversification, &success, &infeas) );
2988 SCIPdebugMessage("recovering problem infeasible (diversification=%d), terminating\n", diversification);
2998 SCIPdebugMessage("added constraint to the covering problem in order to forbid current cover\n");
3016 /* we must remain in NLP diving mode until here to be able to retrieve NLP solution values easily */
3018 * (SCIPisNLPConstructed(scip) == TRUE && heurdata->nlpsolved == SCIPnlpIsDiving(SCIPgetNLP(scip))));
3089 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
3108 /* if the heuristic is called at the root node, we may want to be called directly after the initial root LP solve */
3161 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
3213 /* if we want to use NLP fixing values exclusively and no NLP solver is available, we cannot run */
3216 SCIPdebugMessage("skipping undercover heuristic: want to use NLP fixing values exclusively, but no NLP solver available\n");
3224 nstallnodes = (SCIP_Longint)(nstallnodes * 3.0 * (SCIPheurGetNBestSolsFound(heur) + 1.0)/(SCIPheurGetNCalls(heur) + 1.0));
3225 nstallnodes -= SUBMIPSETUPCOSTS * SCIPheurGetNCalls(heur); /* account for the setup costs of the sub-CIP */
3236 SCIPdebugMessage("skipping undercover heuristic: nstallnodes=%"SCIP_LONGINT_FORMAT", minnodes=%"SCIP_LONGINT_FORMAT"\n", nstallnodes, heurdata->minnodes);
3282 /* check for an nlrow with nontrivial expression tree or quadratic terms; start from 0 since we expect the linear
3287 run = SCIPnlrowGetExprtree(nlrows[i]) != NULL && SCIPexprtreeGetNVars(SCIPnlrowGetExprtree(nlrows[i])) > 0;
3308 SCIPdebugMessage("calling undercover heuristic for <%s> at depth %d\n", SCIPgetProbName(scip), SCIPgetDepth(scip));
3350 "prioritized sequence of fixing values used ('l'p relaxation, 'n'lp relaxation, 'i'ncumbent solution)",
3369 &heurdata->conflictweight, TRUE, DEFAULT_CONFLICTWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
3377 &heurdata->inferenceweight, TRUE, DEFAULT_INFERENCEWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
3384 "maximum coversize maximum coversize (as ratio to the percentage of non-affected constraints)",
3385 &heurdata->maxcoversizeconss, TRUE, DEFAULT_MAXCOVERSIZECONSS, 0.0, SCIP_REAL_MAX, NULL, NULL) );
3400 "fraction of covering variables in the last cover which need to change their value when recovering",
3422 "objective function of the covering problem (influenced nonlinear 'c'onstraints/'t'erms, 'd'omain size, 'l'ocks, 'm'in of up/down locks, 'u'nit penalties)",
3426 "order in which variables should be fixed (increasing 'C'onflict score, decreasing 'c'onflict score, increasing 'V'ariable index, decreasing 'v'ariable index",
3470 SCIP_VAR** cover, /**< pointer to store the variables (of the original SCIP) in the computed cover
3475 SCIP_Bool globalbounds, /**< should global bounds on variables be used instead of local bounds at focus node? */
3505 SCIP_CALL( createCoveringProblem(scip, coveringscip, coveringvars, globalbounds, onlyconvexify, coverbd, coveringobj, success) );
3513 timelimit, memorylimit + (SCIPgetMemExternEstim(coveringscip)+SCIPgetMemUsed(coveringscip))/1048576.0, objlimit, success) );
|