33 #define HEUR_NAME "nlpdiving" 34 #define HEUR_DESC "NLP diving heuristic that chooses fixings w.r.t. the fractionalities" 35 #define HEUR_DISPCHAR 'd' 36 #define HEUR_PRIORITY -1003000 38 #define HEUR_FREQOFS 3 39 #define HEUR_MAXDEPTH -1 40 #define HEUR_TIMING SCIP_HEURTIMING_AFTERLPPLUNGE 41 #define HEUR_USESSUBSCIP FALSE 44 #define EVENTHDLR_NAME "Nlpdiving" 45 #define EVENTHDLR_DESC "bound change event handler for " HEUR_NAME " heuristic" 52 #define DEFAULT_MINRELDEPTH 0.0 53 #define DEFAULT_MAXRELDEPTH 1.0 54 #define DEFAULT_MAXNLPITERABS 200 55 #define DEFAULT_MAXNLPITERREL 10 56 #define DEFAULT_MAXDIVEUBQUOT 0.8 58 #define DEFAULT_MAXDIVEAVGQUOT 0.0 60 #define DEFAULT_MAXDIVEUBQUOTNOSOL 0.1 61 #define DEFAULT_MAXDIVEAVGQUOTNOSOL 0.0 62 #define DEFAULT_MINSUCCQUOT 0.1 63 #define DEFAULT_MAXFEASNLPS 10 64 #define DEFAULT_FIXQUOT 0.2 65 #define DEFAULT_BACKTRACK TRUE 66 #define DEFAULT_LP FALSE 67 #define DEFAULT_PREFERLPFRACS FALSE 68 #define DEFAULT_PREFERCOVER TRUE 69 #define DEFAULT_SOLVESUBMIP FALSE 70 #define DEFAULT_NLPSTART 's' 71 #define DEFAULT_VARSELRULE 'd' 74 #define DEFAULT_NLPFASTFAIL TRUE 75 #define DEFAULT_RANDSEED 97 110 #ifdef SCIP_STATISTIC 146 assert(scip !=
NULL);
147 assert(heurdata !=
NULL);
148 assert(nlpcands !=
NULL);
149 assert(nlpcandssol !=
NULL);
150 assert(nlpcandsfrac !=
NULL);
151 assert(nnlpcands !=
NULL);
160 for( c = 0; c < *nnlpcands; ++c )
180 (*nlpcands)[c] = (*nlpcands)[*nnlpcands];
181 (*nlpcandssol)[c] = (*nlpcandssol)[*nnlpcands];
182 (*nlpcandsfrac)[c] = (*nlpcandsfrac)[*nnlpcands];
190 for( c = 0; c < *nnlpcands; ++c )
193 (*nlpcandsfrac)[c] *= 100.0;
231 assert(scip !=
NULL);
232 assert(heurdata !=
NULL);
233 assert(nlpcands !=
NULL);
234 assert(nlpcandssol !=
NULL);
235 assert(nlpcandsfrac !=
NULL);
236 assert(covercomputed == (varincover !=
NULL));
237 assert(bestcand !=
NULL);
238 assert(bestcandmayround !=
NULL);
239 assert(bestcandroundup !=
NULL);
241 bestcandmayrounddown =
TRUE;
242 bestcandmayroundup =
TRUE;
246 for( c = 0; c < nnlpcands; ++c )
260 frac = nlpcandsfrac[c];
267 if( mayrounddown || mayroundup )
270 if( bestcandmayrounddown || bestcandmayroundup )
277 if( mayrounddown && mayroundup )
282 roundup = (frac > 0.5);
285 roundup = mayrounddown;
304 else if( frac < 0.01 )
312 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
316 if(
SCIPisLT(scip, objgain, bestobjgain) || (
SCIPisEQ(scip, objgain, bestobjgain) && frac < bestfrac) )
319 bestobjgain = objgain;
321 bestcandmayrounddown = mayrounddown;
322 bestcandmayroundup = mayroundup;
323 *bestcandroundup = roundup;
332 else if( frac < 0.5 )
350 else if( frac < 0.01 )
358 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
362 if( bestcandmayrounddown || bestcandmayroundup || frac < bestfrac )
366 bestcandmayrounddown =
FALSE;
367 bestcandmayroundup =
FALSE;
368 *bestcandroundup = roundup;
374 *bestcandmayround = bestcandmayroundup || bestcandmayrounddown;
404 assert(scip !=
NULL);
405 assert(heurdata !=
NULL);
406 assert(nlpcands !=
NULL);
407 assert(nlpcandsfrac !=
NULL);
408 assert(nlpcandssol !=
NULL);
409 assert(bestcand !=
NULL);
410 assert(bestcandmayround !=
NULL);
411 assert(bestcandroundup !=
NULL);
413 *bestcandmayround =
TRUE;
417 for( c = 0; c < nnlpcands; ++c )
436 frac = nlpcandsfrac[c];
438 roundup = (obj >= 0.0);
439 objdelta = (roundup ? (1.0-frac)*obj : -frac * obj);
440 assert(objdelta >= 0.0);
454 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
458 if( score < bestscore )
462 *bestcandroundup = roundup;
501 assert(scip !=
NULL);
502 assert(heurdata !=
NULL);
503 assert(nlpcands !=
NULL);
504 assert(nlpcandsfrac !=
NULL);
505 assert(nlpcandssol !=
NULL);
506 assert(bestcand !=
NULL);
507 assert(bestcandmayround !=
NULL);
508 assert(bestcandroundup !=
NULL);
510 bestcandmayrounddown =
TRUE;
511 bestcandmayroundup =
TRUE;
512 bestnviolrows = INT_MAX;
516 for( c = 0; c < nnlpcands; ++c )
532 frac = nlpcandsfrac[c];
538 if( mayrounddown || mayroundup )
541 if( bestcandmayrounddown || bestcandmayroundup )
548 if( mayrounddown && mayroundup )
553 roundup = (frac > 0.5);
556 roundup = mayrounddown;
575 else if( frac < 0.01 )
583 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
588 if( nviolrows + frac < bestnviolrows + bestcandfrac )
591 bestnviolrows = nviolrows;
593 bestcandmayrounddown = mayrounddown;
594 bestcandmayroundup = mayroundup;
595 *bestcandroundup = roundup;
605 roundup = (nlocksdown > nlocksup);
608 roundup = (nlocksdown == nlocksup);
612 roundup = (roundup && frac > 0.5);
617 nviolrows = nlocksup;
621 nviolrows = nlocksdown;
632 else if( frac < 0.01 )
640 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
645 if( bestcandmayrounddown || bestcandmayroundup || nviolrows + frac < bestnviolrows + bestcandfrac )
648 bestnviolrows = nviolrows;
650 bestcandmayrounddown =
FALSE;
651 bestcandmayroundup =
FALSE;
652 *bestcandroundup = roundup;
658 *bestcandmayround = bestcandmayroundup || bestcandmayrounddown;
680 assert(heurdata !=
NULL);
681 assert(pscostquot !=
NULL);
682 assert(roundup !=
NULL);
686 frac =
MAX(frac, 0.1);
687 frac =
MIN(frac, 0.9);
692 assert(pscostdown >= 0.0 && pscostup >= 0.0);
701 else if( rounddir == +1 )
713 else if(
SCIPisLT(scip, pscostdown, pscostup)
721 *pscostquot =
sqrt(frac) * (1.0+pscostdown) / (1.0+pscostup);
723 *pscostquot =
sqrt(1.0-frac) * (1.0+pscostup) / (1.0+pscostdown);
727 (*pscostquot) *= 1000.0;
731 (*pscostquot) *= 1000.0;
765 assert(scip !=
NULL);
766 assert(heurdata !=
NULL);
767 assert(nlpcands !=
NULL);
768 assert(nlpcandsfrac !=
NULL);
769 assert(nlpcandssol !=
NULL);
770 assert(bestcand !=
NULL);
771 assert(bestcandmayround !=
NULL);
772 assert(bestcandroundup !=
NULL);
774 bestcandmayrounddown =
TRUE;
775 bestcandmayroundup =
TRUE;
776 bestpscostquot = -1.0;
778 for( c = 0; c < nnlpcands; ++c )
793 primsol = nlpcandssol[c];
794 frac = nlpcandsfrac[c];
795 prefvar = covercomputed && heurdata->prefercover &&
SCIPhashmapExists(varincover, var);
801 if( mayrounddown || mayroundup )
804 if( bestcandmayrounddown || bestcandmayroundup )
812 if( mayrounddown && mayroundup )
813 calcPscostQuot(scip, heurdata, var, primsol, frac, 0, &pscostquot, &roundup, prefvar);
814 else if( mayrounddown )
815 calcPscostQuot(scip, heurdata, var, primsol, frac, +1, &pscostquot, &roundup, prefvar);
817 calcPscostQuot(scip, heurdata, var, primsol, frac, -1, &pscostquot, &roundup, prefvar);
822 if( pscostquot > bestpscostquot )
825 bestpscostquot = pscostquot;
826 bestcandmayrounddown = mayrounddown;
827 bestcandmayroundup = mayroundup;
828 *bestcandroundup = roundup;
835 calcPscostQuot(scip, heurdata, var, primsol, frac, 0, &pscostquot, &roundup, prefvar);
839 if( bestcandmayrounddown || bestcandmayroundup || pscostquot > bestpscostquot )
842 bestpscostquot = pscostquot;
843 bestcandmayrounddown =
FALSE;
844 bestcandmayroundup =
FALSE;
845 *bestcandroundup = roundup;
850 *bestcandmayround = bestcandmayroundup || bestcandmayrounddown;
889 assert(scip !=
NULL);
890 assert(heurdata !=
NULL);
891 assert(nlpcands !=
NULL);
892 assert(nlpcandsfrac !=
NULL);
893 assert(nlpcandssol !=
NULL);
894 assert(bestcand !=
NULL);
895 assert(bestcandmayround !=
NULL);
896 assert(bestcandroundup !=
NULL);
898 bestcandmayrounddown =
TRUE;
899 bestcandmayroundup =
TRUE;
903 for( c = 0; c < nnlpcands; ++c )
919 solval = nlpcandssol[c];
920 frac = nlpcandsfrac[c];
931 if(
SCIPisEQ(scip, solval, bestsolval) )
934 roundup = (solval < bestsolval);
936 if( mayrounddown || mayroundup )
939 if( bestcandmayrounddown || bestcandmayroundup )
946 if( !mayrounddown || !mayroundup )
947 roundup = mayrounddown;
966 else if( frac < 0.01 )
974 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
978 if(
SCIPisLT(scip, objgain, bestobjgain) || (
SCIPisEQ(scip, objgain, bestobjgain) && frac < bestfrac) )
981 bestobjgain = objgain;
983 bestcandmayrounddown = mayrounddown;
984 bestcandmayroundup = mayroundup;
985 *bestcandroundup = roundup;
1004 else if( frac < 0.01 )
1012 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
1016 if( bestcandmayrounddown || bestcandmayroundup || frac < bestfrac )
1020 bestcandmayrounddown =
FALSE;
1021 bestcandmayroundup =
FALSE;
1022 *bestcandroundup = roundup;
1027 *bestcandmayround = bestcandmayroundup || bestcandmayrounddown;
1058 assert(scip !=
NULL);
1059 assert(heurdata !=
NULL);
1060 assert(pseudocands !=
NULL);
1061 assert(pseudocandsnlpsol !=
NULL);
1062 assert(pseudocandslpsol !=
NULL);
1063 assert(covercomputed == (varincover !=
NULL));
1064 assert(bestcand !=
NULL);
1065 assert(bestcandmayround !=
NULL);
1066 assert(bestcandroundup !=
NULL);
1070 for( c = 0; c < npseudocands; ++c )
1087 var = pseudocands[c];
1088 lpsol = pseudocandslpsol[c];
1089 nlpsol = pseudocandsnlpsol[c];
1101 if( mayround && !(*bestcandmayround) )
1111 floorval =
MIN(lpsolfloor,nlpsolfloor);
1112 ceilval =
MAX(lpsolceil,nlpsolceil);
1119 frac = 0.33*(lpsol-floorval) + 0.67*(nlpsol-floorval);
1123 boundval =
MIN(lpsolfloor,nlpsolfloor);
1129 boundval =
MAX(nlpsolceil,lpsolceil);
1136 midval = (nlpsol+lpsol)/2.0;
1137 roundup = nlpsol > lpsol;
1138 frac = ABS(nlpsol-lpsol);
1145 assert(roundup ==
SCIPisGT(scip, nlpsol, boundval));
1157 else if( frac < 0.01 )
1165 if( covercomputed && heurdata->prefercover && !
SCIPhashmapExists(varincover, var) )
1169 if( frac < bestfrac || (*bestcandmayround && !mayround) )
1173 *bestcandmayround =
FALSE;
1174 *bestcandroundup = roundup;
1175 *bestboundval = boundval;
1180 if( *bestcandroundup )
1181 *bestboundval -= 0.5;
1183 *bestboundval += 0.5;
1206 assert(scip !=
NULL);
1207 assert(subscip !=
NULL);
1208 assert(subsol !=
NULL);
1221 for( i = 0; i < nvars; i++ )
1273 SCIP_CALL(
SCIPcopyConsCompression(scip, subscip, varmap,
NULL,
"undercoversub",
NULL,
NULL, 0,
FALSE,
FALSE,
TRUE,
NULL) );
1276 for( c = 0; c < ncovervars; c++)
1356 cutoffbound =
MIN(upperbound, cutoffbound);
1370 SCIPwarningMessage(scip,
"Error while solving subproblem in " HEUR_NAME " heuristic; sub-SCIP terminated with code <%d>\n",retcode);
1378 for( c = 0; c < nsubsols && !(*success); ++c )
1407 assert(eventhdlr !=
NULL);
1408 assert(eventdata !=
NULL);
1410 assert(event !=
NULL);
1413 assert(heurdata !=
NULL);
1414 assert(0 <= heurdata->nfixedcovervars && heurdata->nfixedcovervars <=
SCIPgetNVars(scip));
1430 assert(!
SCIPisEQ(scip, oldbound, otherbound));
1431 ++(heurdata->nfixedcovervars);
1439 assert(!
SCIPisEQ(scip, newbound, otherbound));
1440 --(heurdata->nfixedcovervars);
1447 assert(0 <= heurdata->nfixedcovervars && heurdata->nfixedcovervars <=
SCIPgetNVars(scip));
1464 assert(scip !=
NULL);
1465 assert(heur !=
NULL);
1482 assert(scip !=
NULL);
1486 assert(heurdata !=
NULL);
1505 assert(heurdata !=
NULL);
1514 heurdata->nnlpiterations = 0;
1515 heurdata->nsuccess = 0;
1516 heurdata->nfixedcovervars = 0;
1518 heurdata->nnlpsolves = 0;
1519 heurdata->nfailcutoff = 0;
1520 heurdata->nfaildepth = 0;
1521 heurdata->nfailnlperror = 0;
1539 assert(heurdata !=
NULL);
1550 SCIPstatisticMessage(
"%-30s %5" SCIP_LONGINT_FORMAT
" sols in %5" SCIP_LONGINT_FORMAT
" runs, %6.1fs, %7d NLP iters in %5d NLP solves, %5.1f avg., %3d%% success %3d%% cutoff %3d%% depth %3d%% nlperror\n",
1552 heurdata->nnlpiterations, heurdata->nnlpsolves, heurdata->nnlpiterations/
MAX(1.0,(
SCIP_Real)heurdata->nnlpsolves),
1575 if( nlpheur !=
NULL )
1618 int avgnnlpiterations;
1619 int maxnnlpiterations;
1629 int lastnlpsolvedepth;
1640 backtrackdepth = -1;
1641 backtrackvar =
NULL;
1642 backtrackvarval = 0.0;
1643 backtrackroundup =
FALSE;
1645 pseudocandsnlpsol =
NULL;
1646 pseudocandslpsol =
NULL;
1649 assert(heur !=
NULL);
1651 assert(scip !=
NULL);
1652 assert(result !=
NULL);
1658 if( nodeinfeasible )
1671 assert(heurdata !=
NULL);
1688 maxdepth =
MAX(maxdepth, 30);
1689 if( depth < heurdata->minreldepth*maxdepth || depth > heurdata->maxreldepth*maxdepth )
1697 maxnnlpiterations = heurdata->maxnlpiterabs;
1698 maxnnlpiterations += (int)((1.0 + 10.0*(nsolsfound+1.0)/(ncalls+1.0)) * heurdata->maxnlpiterrel);
1701 if( heurdata->nnlpiterations >= maxnnlpiterations )
1705 avgnnlpiterations = (int)(heurdata->nnlpiterations /
MAX(ncalls, 1.0));
1706 maxnnlpiterations = (int)
MAX((
SCIP_Real) maxnnlpiterations, (
SCIP_Real) heurdata->nnlpiterations + 1.2*avgnnlpiterations);
1710 if( npseudocands == 0 )
1753 SCIPdebugMsg(scip,
"initial NLP infeasible or not solvable --> stop\n");
1757 heurdata->nfailcutoff++;
1759 heurdata->nfailnlperror++;
1775 assert(nnlpcands <= npseudocands);
1785 if( nnlpcands == 0 )
1802 SCIPdebugMsg(scip,
" -> solution of first NLP was integral, feasible, and good enough\n");
1814 assert(nlpcandsfrac !=
NULL);
1815 assert(nlpcands !=
NULL);
1816 assert(nlpcandssol !=
NULL);
1819 if( heurdata->nlpstart !=
'n' )
1828 if( heurdata->maxdiveubquotnosol > 0.0 )
1833 if( heurdata->maxdiveavgquotnosol > 0.0 )
1841 if( heurdata->maxdiveubquot > 0.0 )
1846 if( heurdata->maxdiveavgquot > 0.0 )
1852 searchbound =
MIN(searchubbound, searchavgbound);
1854 searchbound =
SCIPceil(scip, searchbound);
1858 maxdivedepth =
MIN(maxdivedepth, maxdepth);
1861 covercomputed =
FALSE;
1865 if( heurdata->prefercover || heurdata->solvesubmip )
1888 SCIP_CALL(
SCIPcomputeCoverUndercover(scip, &ncovervars, covervars, timelimit, memorylimit,
SCIPinfinity(scip),
FALSE,
FALSE,
FALSE,
'u', &covercomputed) );
1894 assert(ncovervars >= 0);
1900 for( c = 0; c < ncovervars; c++ )
1910 assert(heurdata->eventhdlr !=
NULL);
1932 SCIPdebugMsg(scip,
"(node %" SCIP_LONGINT_FORMAT
") executing nlpdiving heuristic: depth=%d, %d fractionals, dualbound=%g, searchbound=%g\n",
1936 if( heurdata->varselrule ==
'g' )
1952 if( heurdata->varselrule ==
'd' )
1966 lastnlpsolvedepth = 0;
1967 backtracked =
FALSE;
1968 fixquot = heurdata->fixquot;
1970 startnnlpcands = nnlpcands;
1971 solvesubmip = heurdata->solvesubmip;
1974 && (nfeasnlps < heurdata->maxfeasnlps
1975 || nnlpcands <= startnnlpcands - divedepth/2
1976 || (nfeasnlps < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound))
1992 bestcandmayround =
TRUE;
1993 bestcandroundup =
FALSE;
1995 updatepscost =
TRUE;
1999 switch( heurdata->varselrule )
2002 SCIP_CALL(
chooseCoefVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2003 &bestcand, &bestcandmayround, &bestcandroundup) );
2006 var = nlpcands[bestcand];
2007 bestboundval = nlpcandssol[bestcand];
2011 SCIP_CALL(
chooseVeclenVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2012 &bestcand, &bestcandmayround, &bestcandroundup) );
2015 var = nlpcands[bestcand];
2016 bestboundval = nlpcandssol[bestcand];
2020 SCIP_CALL(
choosePscostVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2021 &bestcand, &bestcandmayround, &bestcandroundup) );
2024 var = nlpcands[bestcand];
2025 bestboundval = nlpcandssol[bestcand];
2029 SCIP_CALL(
chooseGuidedVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, bestsol, varincover, covercomputed,
2030 &bestcand, &bestcandmayround, &bestcandroundup) );
2033 var = nlpcands[bestcand];
2034 bestboundval = nlpcandssol[bestcand];
2044 assert(backtrackdepth > 0 || nnlpcands <= npseudocands);
2049 varincover, covercomputed, &bestcand, &bestboundval, &bestcandmayround, &bestcandroundup) );
2051 var = pseudocands[bestcand];
2055 updatepscost =
FALSE;
2058 SCIP_CALL(
chooseFracVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2059 &bestcand, &bestcandmayround, &bestcandroundup) );
2062 var = nlpcands[bestcand];
2063 bestboundval = nlpcandssol[bestcand];
2077 if( (var ==
NULL || bestcandmayround) && backtrackdepth == -1 )
2098 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2113 if( backtracked && backtrackdepth > 0 )
2115 assert(backtrackvar !=
NULL);
2122 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2129 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2131 assert(backtracked);
2136 if( backtrackroundup )
2138 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2139 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2146 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2147 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2154 backtrackdepth = -1;
2157 bestcandroundup = backtrackroundup;
2158 frac =
SCIPfrac(scip, backtrackvarval);
2163 assert(var !=
NULL);
2170 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2177 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2179 assert(backtracked);
2184 if( bestcandroundup == !backtracked )
2187 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2188 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2195 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(
MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2197 backtrackdepth = divedepth;
2199 backtrackvarval = bestboundval;
2200 backtrackroundup =
FALSE;
2206 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2207 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2214 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(
MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2216 backtrackdepth = divedepth;
2218 backtrackvarval = bestboundval;
2219 backtrackroundup =
TRUE;
2226 if( heurdata->varselrule ==
'd' )
2228 assert(pseudocandsnlpsol !=
NULL);
2229 assert(0 <= bestcand && bestcand < npseudocands);
2230 frac =
SCIPfrac(scip, pseudocandsnlpsol[bestcand]);
2233 frac = nlpcandsfrac[bestcand];
2247 if( !cutoff && solvesubmip && covercomputed &&
2248 (heurdata->nfixedcovervars == ncovervars ||
2249 (heurdata->nfixedcovervars >= (ncovervars+1)/2 && !
SCIPhashmapExists(varincover, var))) )
2253 solvesubmip =
FALSE;
2255 assert(probingdepth >= 1);
2256 assert(covervars !=
NULL);
2258 if( heurdata->nfixedcovervars != ncovervars )
2261 for( c = 0; c < ncovervars && !cutoff ; c++ )
2273 nlpsolval =
MIN(nlpsolval,ub);
2274 nlpsolval =
MAX(nlpsolval,lb);
2326 if( !cutoff && !lperror && (heurdata->lp || heurdata->varselrule ==
'd')
2345 if( updatepscost &&
SCIPisGT(scip, objval, oldobjval) )
2348 if( bestcandroundup )
2376 solvenlp = backtracked;
2377 if( !solvenlp && !cutoff )
2379 solvenlp = (lastnlpsolvedepth < divedepth - fixquot * nnlpcands);
2383 for( c = 0; c < nnlpcands; ++c )
2391 if( c == nnlpcands )
2399 if( !cutoff && solvenlp )
2408 if( heurdata->nlpstart !=
'n' && backtracked )
2410 assert(nlpstartsol !=
NULL);
2426 "Error while solving NLP in nlpdiving heuristic; NLP solve terminated with code <%d>\n", termstat);
2451 lastnlpsolvedepth = divedepth;
2453 backtrackdepth = -1;
2455 if( heurdata->nlpstart ==
'f' )
2457 assert(nlpstartsol !=
NULL);
2469 if( cutoff && !backtracked && heurdata->backtrack )
2471 if( backtrackdepth == -1 )
2492 divedepth = backtrackdepth;
2495 updatepscost =
FALSE;
2506 backtracked =
FALSE;
2508 while( backtracked );
2515 SCIPdebugMsg(scip,
" -> nlpsolstat=%d, objval=%g/%g, nfrac nlp=%d lp=%d\n", nlpsolstat, objval, searchbound, nnlpcands, nlpbranchcands);
2522 SCIPdebugMsgPrint(scip,
"NLP bad status - nlperror: %ud nlpsolstat: %d \n", nlperror, nlpsolstat);
2530 else if(! (divedepth < 10
2531 || nnlpcands <= startnnlpcands - divedepth/2
2532 || (divedepth < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound) ) )
2534 SCIPdebugMsgPrint(scip,
"TOO DEEP - divedepth: %4d cands halfed: %d ltmaxdepth: %d ltmaxiter: %d bound: %d\n", divedepth,
2535 (nnlpcands > startnnlpcands - divedepth/2), (divedepth >= maxdivedepth), (heurdata->nnlpiterations >= maxnnlpiterations),
2536 (objval >= searchbound));
2571 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2586 assert(heurdata->eventhdlr !=
NULL);
2587 assert(heurdata->nfixedcovervars >= 0);
2588 assert(varincover !=
NULL);
2589 assert(covervars !=
NULL);
2594 for( c = 0; c < ncovervars; c++ )
2600 assert(varincover ==
NULL);
2603 if( heurdata->prefercover || heurdata->solvesubmip )
2605 assert(covervars !=
NULL || !covercomputed);
2606 if( covervars !=
NULL )
2610 assert(covervars ==
NULL);
2613 if( nlpstartsol !=
NULL )
2623 if( heurdata->varselrule ==
'g' )
2625 assert(bestsol !=
NULL);
2629 assert(bestsol ==
NULL);
2632 if( heurdata->varselrule ==
'd' )
2634 assert(pseudocandsnlpsol !=
NULL);
2635 assert(pseudocandsnlpsol !=
NULL);
2641 assert(pseudocandsnlpsol ==
NULL);
2642 assert(pseudocandsnlpsol ==
NULL);
2646 heurdata->nsuccess++;
2673 assert(heur !=
NULL);
2681 heurdata->eventhdlr =
NULL;
2684 eventExecNlpdiving,
NULL) );
2685 if ( heurdata->eventhdlr ==
NULL )
2694 "minimal relative depth to start diving",
2698 "maximal relative depth to start diving",
2701 "heuristics/" HEUR_NAME "/maxnlpiterabs",
2702 "minimial absolute number of allowed NLP iterations",
2705 "heuristics/" HEUR_NAME "/maxnlpiterrel",
2706 "additional allowed number of NLP iterations relative to successfully found solutions",
2709 "heuristics/" HEUR_NAME "/maxdiveubquot",
2710 "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)",
2713 "heuristics/" HEUR_NAME "/maxdiveavgquot",
2714 "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)",
2717 "heuristics/" HEUR_NAME "/maxdiveubquotnosol",
2718 "maximal UBQUOT when no solution was found yet (0.0: no limit)",
2721 "heuristics/" HEUR_NAME "/maxdiveavgquotnosol",
2722 "maximal AVGQUOT when no solution was found yet (0.0: no limit)",
2726 "maximal number of NLPs with feasible solution to solve during one dive",
2730 "use one level of backtracking if infeasibility is encountered?",
2734 "should the LP relaxation be solved before the NLP relaxation?",
2737 "heuristics/" HEUR_NAME "/preferlpfracs",
2738 "prefer variables that are also fractional in LP solution?",
2742 "heuristic will not run if less then this percentage of calls succeeded (0.0: no limit)",
2746 "percentage of fractional variables that should be fixed before the next NLP solve",
2750 "should variables in a minimal cover be preferred?",
2754 "should a sub-MIP be solved if all cover variables are fixed?",
2758 "should the NLP solver stop early if it converges slow?",
2762 "which point should be used as starting point for the NLP solver? ('n'one, last 'f'easible, from dive's'tart)",
2766 "which variable selection should be used? ('f'ractionality, 'c'oefficient, 'p'seudocost, 'g'uided, 'd'ouble, 'v'eclen)",
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
static SCIP_DECL_HEUREXIT(heurExitNlpdiving)
int SCIPgetNIntVars(SCIP *scip)
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_HASHMAP *varmap, SCIP_SOL *subsol, SCIP_Bool *success)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
SCIP_Real SCIPfeastol(SCIP *scip)
NLP diving heuristic that chooses fixings w.r.t. the fractionalities.
#define DEFAULT_BACKTRACK
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPnlpStatisticsCreate(SCIP_NLPSTATISTICS **statistics)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int *ival)
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_MAXFEASNLPS
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
int SCIPgetProbingDepth(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
SCIP_Longint SCIPgetNSolsFound(SCIP *scip)
static SCIP_RETCODE chooseVeclenVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
int SCIPgetNOrigVars(SCIP *scip)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
internal methods for NLPI solver interfaces
#define DEFAULT_MAXDIVEAVGQUOT
#define DEFAULT_MAXDIVEAVGQUOTNOSOL
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
static SCIP_RETCODE chooseFracVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
SCIP_Real SCIPvarGetRootSol(SCIP_VAR *var)
int SCIPgetMaxDepth(SCIP *scip)
static SCIP_RETCODE chooseGuidedVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_SOL *bestsol, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Undercover primal heuristic for MINLPs.
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
#define DEFAULT_MAXDIVEUBQUOT
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
SCIP_RETCODE SCIPcopyConsCompression(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
SCIP_Real SCIPinfinity(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
#define SCIPstatisticMessage
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_Real SCIPgetAvgLowerbound(SCIP *scip)
struct SCIP_HeurData SCIP_HEURDATA
#define DEFAULT_MINRELDEPTH
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
#define DEFAULT_MAXRELDEPTH
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
enum SCIP_LPSolStat SCIP_LPSOLSTAT
SCIP_RETCODE SCIPcreate(SCIP **scip)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
#define DEFAULT_VARSELRULE
#define DEFAULT_SOLVESUBMIP
#define SCIPallocBlockMemory(scip, ptr)
int SCIPgetNLPBranchCands(SCIP *scip)
#define SCIP_EVENTTYPE_BOUNDCHANGED
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
#define SCIPdebugMsgPrint
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)
void SCIPnlpStatisticsFree(SCIP_NLPSTATISTICS **statistics)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE chooseDoubleVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **pseudocands, SCIP_Real *pseudocandsnlpsol, SCIP_Real *pseudocandslpsol, int npseudocands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Real *bestboundval, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
#define SCIP_EVENTTYPE_LBCHANGED
const char * SCIPgetProbName(SCIP *scip)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
#define SCIP_EVENTTYPE_LBRELAXED
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
static SCIP_RETCODE getNLPFracVars(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR ***nlpcands, SCIP_Real **nlpcandssol, SCIP_Real **nlpcandsfrac, int *nnlpcands)
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_RETCODE SCIPaddLinearConsToNlpHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool addcombconss, SCIP_Bool addcontconss)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIPInterval sqrt(const SCIPInterval &x)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPendProbing(SCIP *scip)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPgetNNlpis(SCIP *scip)
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
static SCIP_RETCODE choosePscostVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
#define SCIP_EVENTTYPE_UBRELAXED
SCIP_Real SCIPgetLowerbound(SCIP *scip)
#define SCIP_EVENTTYPE_LBTIGHTENED
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPcomputeCoverUndercover(SCIP *scip, int *coversize, SCIP_VAR **cover, SCIP_Real timelimit, SCIP_Real memorylimit, SCIP_Real objlimit, SCIP_Bool globalbounds, SCIP_Bool onlyconvexify, SCIP_Bool coverbd, char coveringobj, SCIP_Bool *success)
#define DEFAULT_MAXNLPITERREL
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
#define SCIP_PROBINGSCORE_PENALTYRATIO
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
static SCIP_RETCODE solveSubMIP(SCIP *scip, SCIP_HEUR *heur, SCIP_VAR **covervars, int ncovervars, SCIP_Bool *success)
static SCIP_DECL_HEUREXEC(heurExecNlpdiving)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
SCIP_Real SCIPvarGetNLPSol(SCIP_VAR *var)
int SCIPgetDepth(SCIP *scip)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
static SCIP_DECL_HEURFREE(heurFreeNlpdiving)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
#define DEFAULT_MAXDIVEUBQUOTNOSOL
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
void SCIPenableVarHistory(SCIP *scip)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_DECL_EVENTEXEC(eventExecNlpdiving)
int SCIPgetNSols(SCIP *scip)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
#define SCIP_EVENTTYPE_UBTIGHTENED
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
static SCIP_DECL_HEURINIT(heurInitNlpdiving)
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
#define SCIP_MAXTREEDEPTH
int SCIPgetNBinVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
#define DEFAULT_PREFERLPFRACS
SCIP_RETCODE SCIPincludeHeurNlpdiving(SCIP *scip)
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE chooseCoefVar(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
static void calcPscostQuot(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR *var, SCIP_Real primsol, SCIP_Real frac, int rounddir, SCIP_Real *pscostquot, SCIP_Bool *roundup, SCIP_Bool prefvar)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
NLP local search primal heuristic using sub-SCIPs.
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
SCIP_Bool SCIPisStopped(SCIP *scip)
#define DEFAULT_PREFERCOVER
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
#define DEFAULT_MAXNLPITERABS
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
static SCIP_DECL_HEURCOPY(heurCopyNlpdiving)
SCIP_Real SCIPheurGetTime(SCIP_HEUR *heur)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
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 SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_Bool SCIPvarMayRoundUp(SCIP_VAR *var)
static SCIP_DECL_HEURINITSOL(heurInitsolNlpdiving)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
SCIP_Bool SCIPvarMayRoundDown(SCIP_VAR *var)
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)
#define DEFAULT_MINSUCCQUOT
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
#define DEFAULT_NLPFASTFAIL