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");
1777 assert(nnlpcands <= npseudocands);
1787 if( nnlpcands == 0 )
1804 SCIPdebugMsg(scip,
" -> solution of first NLP was integral, feasible, and good enough\n");
1816 assert(nlpcandsfrac !=
NULL);
1817 assert(nlpcands !=
NULL);
1818 assert(nlpcandssol !=
NULL);
1821 if( heurdata->nlpstart !=
'n' )
1830 if( heurdata->maxdiveubquotnosol > 0.0 )
1835 if( heurdata->maxdiveavgquotnosol > 0.0 )
1843 if( heurdata->maxdiveubquot > 0.0 )
1848 if( heurdata->maxdiveavgquot > 0.0 )
1854 searchbound =
MIN(searchubbound, searchavgbound);
1856 searchbound =
SCIPceil(scip, searchbound);
1860 maxdivedepth =
MIN(maxdivedepth, maxdepth);
1863 covercomputed =
FALSE;
1867 if( heurdata->prefercover || heurdata->solvesubmip )
1890 SCIP_CALL(
SCIPcomputeCoverUndercover(scip, &ncovervars, covervars, timelimit, memorylimit,
SCIPinfinity(scip),
FALSE,
FALSE,
FALSE,
'u', &covercomputed) );
1896 assert(ncovervars >= 0);
1902 for( c = 0; c < ncovervars; c++ )
1912 assert(heurdata->eventhdlr !=
NULL);
1934 SCIPdebugMsg(scip,
"(node %" SCIP_LONGINT_FORMAT
") executing nlpdiving heuristic: depth=%d, %d fractionals, dualbound=%g, searchbound=%g\n",
1938 if( heurdata->varselrule ==
'g' )
1954 if( heurdata->varselrule ==
'd' )
1968 lastnlpsolvedepth = 0;
1969 backtracked =
FALSE;
1970 fixquot = heurdata->fixquot;
1972 startnnlpcands = nnlpcands;
1973 solvesubmip = heurdata->solvesubmip;
1976 && (nfeasnlps < heurdata->maxfeasnlps
1977 || nnlpcands <= startnnlpcands - divedepth/2
1978 || (nfeasnlps < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound))
1994 bestcandmayround =
TRUE;
1995 bestcandroundup =
FALSE;
1997 updatepscost =
TRUE;
2001 switch( heurdata->varselrule )
2004 SCIP_CALL(
chooseCoefVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2005 &bestcand, &bestcandmayround, &bestcandroundup) );
2008 var = nlpcands[bestcand];
2009 bestboundval = nlpcandssol[bestcand];
2013 SCIP_CALL(
chooseVeclenVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2014 &bestcand, &bestcandmayround, &bestcandroundup) );
2017 var = nlpcands[bestcand];
2018 bestboundval = nlpcandssol[bestcand];
2022 SCIP_CALL(
choosePscostVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2023 &bestcand, &bestcandmayround, &bestcandroundup) );
2026 var = nlpcands[bestcand];
2027 bestboundval = nlpcandssol[bestcand];
2031 SCIP_CALL(
chooseGuidedVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, bestsol, varincover, covercomputed,
2032 &bestcand, &bestcandmayround, &bestcandroundup) );
2035 var = nlpcands[bestcand];
2036 bestboundval = nlpcandssol[bestcand];
2046 assert(backtrackdepth > 0 || nnlpcands <= npseudocands);
2051 varincover, covercomputed, &bestcand, &bestboundval, &bestcandmayround, &bestcandroundup) );
2053 var = pseudocands[bestcand];
2057 updatepscost =
FALSE;
2060 SCIP_CALL(
chooseFracVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2061 &bestcand, &bestcandmayround, &bestcandroundup) );
2064 var = nlpcands[bestcand];
2065 bestboundval = nlpcandssol[bestcand];
2079 if( (var ==
NULL || bestcandmayround) && backtrackdepth == -1 )
2100 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2115 if( backtracked && backtrackdepth > 0 )
2117 assert(backtrackvar !=
NULL);
2124 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2131 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2133 assert(backtracked);
2138 if( backtrackroundup )
2140 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2141 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2148 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2149 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2156 backtrackdepth = -1;
2159 bestcandroundup = backtrackroundup;
2160 frac =
SCIPfrac(scip, backtrackvarval);
2165 assert(var !=
NULL);
2172 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2179 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2181 assert(backtracked);
2186 if( bestcandroundup == !backtracked )
2189 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2190 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2197 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(
MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2199 backtrackdepth = divedepth;
2201 backtrackvarval = bestboundval;
2202 backtrackroundup =
FALSE;
2208 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2209 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2216 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(
MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2218 backtrackdepth = divedepth;
2220 backtrackvarval = bestboundval;
2221 backtrackroundup =
TRUE;
2228 if( heurdata->varselrule ==
'd' )
2230 assert(pseudocandsnlpsol !=
NULL);
2231 assert(0 <= bestcand && bestcand < npseudocands);
2232 frac =
SCIPfrac(scip, pseudocandsnlpsol[bestcand]);
2235 frac = nlpcandsfrac[bestcand];
2249 if( !cutoff && solvesubmip && covercomputed &&
2250 (heurdata->nfixedcovervars == ncovervars ||
2251 (heurdata->nfixedcovervars >= (ncovervars+1)/2 && !
SCIPhashmapExists(varincover, var))) )
2255 solvesubmip =
FALSE;
2257 assert(probingdepth >= 1);
2258 assert(covervars !=
NULL);
2260 if( heurdata->nfixedcovervars != ncovervars )
2263 for( c = 0; c < ncovervars && !cutoff ; c++ )
2275 nlpsolval =
MIN(nlpsolval,ub);
2276 nlpsolval =
MAX(nlpsolval,lb);
2328 if( !cutoff && !lperror && (heurdata->lp || heurdata->varselrule ==
'd')
2347 if( updatepscost &&
SCIPisGT(scip, objval, oldobjval) )
2350 if( bestcandroundup )
2378 solvenlp = backtracked;
2379 if( !solvenlp && !cutoff )
2381 solvenlp = (lastnlpsolvedepth < divedepth - fixquot * nnlpcands);
2385 for( c = 0; c < nnlpcands; ++c )
2393 if( c == nnlpcands )
2401 if( !cutoff && solvenlp )
2410 if( heurdata->nlpstart !=
'n' && backtracked )
2412 assert(nlpstartsol !=
NULL);
2428 "Error while solving NLP in nlpdiving heuristic; NLP solve terminated with code <%d>\n", termstat);
2453 lastnlpsolvedepth = divedepth;
2455 backtrackdepth = -1;
2457 if( heurdata->nlpstart ==
'f' )
2459 assert(nlpstartsol !=
NULL);
2471 if( cutoff && !backtracked && heurdata->backtrack )
2473 if( backtrackdepth == -1 )
2494 divedepth = backtrackdepth;
2497 updatepscost =
FALSE;
2508 backtracked =
FALSE;
2510 while( backtracked );
2517 SCIPdebugMsg(scip,
" -> nlpsolstat=%d, objval=%g/%g, nfrac nlp=%d lp=%d\n", nlpsolstat, objval, searchbound, nnlpcands, nlpbranchcands);
2524 SCIPdebugMsgPrint(scip,
"NLP bad status - nlperror: %ud nlpsolstat: %d \n", nlperror, nlpsolstat);
2532 else if(! (divedepth < 10
2533 || nnlpcands <= startnnlpcands - divedepth/2
2534 || (divedepth < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound) ) )
2536 SCIPdebugMsgPrint(scip,
"TOO DEEP - divedepth: %4d cands halfed: %d ltmaxdepth: %d ltmaxiter: %d bound: %d\n", divedepth,
2537 (nnlpcands > startnnlpcands - divedepth/2), (divedepth >= maxdivedepth), (heurdata->nnlpiterations >= maxnnlpiterations),
2538 (objval >= searchbound));
2573 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2588 assert(heurdata->eventhdlr !=
NULL);
2589 assert(heurdata->nfixedcovervars >= 0);
2590 assert(varincover !=
NULL);
2591 assert(covervars !=
NULL);
2596 for( c = 0; c < ncovervars; c++ )
2602 assert(varincover ==
NULL);
2605 if( heurdata->prefercover || heurdata->solvesubmip )
2607 assert(covervars !=
NULL || !covercomputed);
2608 if( covervars !=
NULL )
2612 assert(covervars ==
NULL);
2615 if( nlpstartsol !=
NULL )
2625 if( heurdata->varselrule ==
'g' )
2627 assert(bestsol !=
NULL);
2631 assert(bestsol ==
NULL);
2634 if( heurdata->varselrule ==
'd' )
2636 assert(pseudocandsnlpsol !=
NULL);
2637 assert(pseudocandsnlpsol !=
NULL);
2643 assert(pseudocandsnlpsol ==
NULL);
2644 assert(pseudocandsnlpsol ==
NULL);
2648 heurdata->nsuccess++;
2675 assert(heur !=
NULL);
2683 heurdata->eventhdlr =
NULL;
2686 eventExecNlpdiving,
NULL) );
2687 if ( heurdata->eventhdlr ==
NULL )
2696 "minimal relative depth to start diving",
2700 "maximal relative depth to start diving",
2703 "heuristics/" HEUR_NAME "/maxnlpiterabs",
2704 "minimial absolute number of allowed NLP iterations",
2707 "heuristics/" HEUR_NAME "/maxnlpiterrel",
2708 "additional allowed number of NLP iterations relative to successfully found solutions",
2711 "heuristics/" HEUR_NAME "/maxdiveubquot",
2712 "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)",
2715 "heuristics/" HEUR_NAME "/maxdiveavgquot",
2716 "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)",
2719 "heuristics/" HEUR_NAME "/maxdiveubquotnosol",
2720 "maximal UBQUOT when no solution was found yet (0.0: no limit)",
2723 "heuristics/" HEUR_NAME "/maxdiveavgquotnosol",
2724 "maximal AVGQUOT when no solution was found yet (0.0: no limit)",
2728 "maximal number of NLPs with feasible solution to solve during one dive",
2732 "use one level of backtracking if infeasibility is encountered?",
2736 "should the LP relaxation be solved before the NLP relaxation?",
2739 "heuristics/" HEUR_NAME "/preferlpfracs",
2740 "prefer variables that are also fractional in LP solution?",
2744 "heuristic will not run if less then this percentage of calls succeeded (0.0: no limit)",
2748 "percentage of fractional variables that should be fixed before the next NLP solve",
2752 "should variables in a minimal cover be preferred?",
2756 "should a sub-MIP be solved if all cover variables are fixed?",
2760 "should the NLP solver stop early if it converges slow?",
2764 "which point should be used as starting point for the NLP solver? ('n'one, last 'f'easible, from dive's'tart)",
2768 "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