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++ )
1256 assert(subscip != NULL);
1257 assert(scip != NULL);
1258 assert(heur != NULL);
1266 SCIP_CALL(
SCIPcopyConsCompression(scip, subscip, varmap, NULL,
"undercoversub", NULL, NULL, 0,
FALSE,
FALSE,
TRUE, NULL) );
1269 for( c = 0; c < ncovervars; c++)
1353 cutoffbound = MIN(upperbound, cutoffbound);
1364 for( c = 0; c < nsubsols && !(*success); ++c )
1399 retcode =
doSolveSubMIP(scip, subscip, heur, covervars, ncovervars, success);
1426 assert(eventhdlr != NULL);
1427 assert(eventdata != NULL);
1429 assert(event != NULL);
1432 assert(heurdata != NULL);
1433 assert(0 <= heurdata->nfixedcovervars && heurdata->nfixedcovervars <=
SCIPgetNVars(scip));
1449 assert(!
SCIPisEQ(scip, oldbound, otherbound));
1450 ++(heurdata->nfixedcovervars);
1458 assert(!
SCIPisEQ(scip, newbound, otherbound));
1459 --(heurdata->nfixedcovervars);
1466 assert(0 <= heurdata->nfixedcovervars && heurdata->nfixedcovervars <=
SCIPgetNVars(scip));
1483 assert(scip != NULL);
1484 assert(heur != NULL);
1499 assert(heur != NULL);
1501 assert(scip != NULL);
1505 assert(heurdata != NULL);
1519 assert(heur != NULL);
1524 assert(heurdata != NULL);
1533 heurdata->nnlpiterations = 0;
1534 heurdata->nsuccess = 0;
1535 heurdata->nfixedcovervars = 0;
1537 heurdata->nnlpsolves = 0;
1538 heurdata->nfailcutoff = 0;
1539 heurdata->nfaildepth = 0;
1540 heurdata->nfailnlperror = 0;
1553 assert(heur != NULL);
1558 assert(heurdata != NULL);
1569 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",
1571 heurdata->nnlpiterations, heurdata->nnlpsolves, heurdata->nnlpiterations/
MAX(1.0,(
SCIP_Real)heurdata->nnlpsolves),
1594 if( nlpheur != NULL )
1638 int avgnnlpiterations;
1639 int maxnnlpiterations;
1649 int lastnlpsolvedepth;
1660 backtrackdepth = -1;
1661 backtrackvar = NULL;
1662 backtrackvarval = 0.0;
1663 backtrackroundup =
FALSE;
1665 pseudocandsnlpsol = NULL;
1666 pseudocandslpsol = NULL;
1669 assert(heur != NULL);
1671 assert(scip != NULL);
1672 assert(result != NULL);
1678 if( nodeinfeasible )
1691 assert(heurdata != NULL);
1708 maxdepth =
MAX(maxdepth, 30);
1709 if( depth < heurdata->minreldepth*maxdepth || depth > heurdata->maxreldepth*maxdepth )
1717 maxnnlpiterations = heurdata->maxnlpiterabs;
1718 maxnnlpiterations += (int)((1.0 + 10.0*(nsolsfound+1.0)/(ncalls+1.0)) * heurdata->maxnlpiterrel);
1721 if( heurdata->nnlpiterations >= maxnnlpiterations )
1725 avgnnlpiterations = (int)(heurdata->nnlpiterations /
MAX(ncalls, 1.0));
1726 maxnnlpiterations = (int)
MAX((
SCIP_Real) maxnnlpiterations, (
SCIP_Real) heurdata->nnlpiterations + 1.2*avgnnlpiterations);
1730 if( npseudocands == 0 )
1779 SCIPdebugMsg(scip,
"initial NLP infeasible or not solvable --> stop\n");
1783 heurdata->nfailcutoff++;
1785 heurdata->nfailnlperror++;
1801 assert(nnlpcands <= npseudocands);
1811 if( nnlpcands == 0 )
1828 SCIPdebugMsg(scip,
" -> solution of first NLP was integral, feasible, and good enough\n");
1840 if( heurdata->varselrule ==
'g' &&
SCIPgetNSols(scip) == 0 )
1850 assert(nlpcandsfrac != NULL);
1851 assert(nlpcands != NULL);
1852 assert(nlpcandssol != NULL);
1855 if( heurdata->nlpstart !=
'n' )
1864 if( heurdata->maxdiveubquotnosol > 0.0 )
1869 if( heurdata->maxdiveavgquotnosol > 0.0 )
1877 if( heurdata->maxdiveubquot > 0.0 )
1882 if( heurdata->maxdiveavgquot > 0.0 )
1888 searchbound = MIN(searchubbound, searchavgbound);
1890 searchbound =
SCIPceil(scip, searchbound);
1894 maxdivedepth = MIN(maxdivedepth, maxdepth);
1897 covercomputed =
FALSE;
1901 if( heurdata->prefercover || heurdata->solvesubmip )
1924 SCIP_CALL(
SCIPcomputeCoverUndercover(scip, &ncovervars, covervars, timelimit, memorylimit,
SCIPinfinity(scip),
FALSE,
FALSE,
FALSE,
'u', &covercomputed) );
1930 assert(ncovervars >= 0);
1936 for( c = 0; c < ncovervars; c++ )
1946 assert(heurdata->eventhdlr != NULL);
1968 SCIPdebugMsg(scip,
"(node %" SCIP_LONGINT_FORMAT
") executing nlpdiving heuristic: depth=%d, %d fractionals, dualbound=%g, searchbound=%g\n",
1972 if( heurdata->varselrule ==
'g' )
1981 if( heurdata->varselrule ==
'd' )
1995 lastnlpsolvedepth = 0;
1996 backtracked =
FALSE;
1997 fixquot = heurdata->fixquot;
1999 startnnlpcands = nnlpcands;
2000 solvesubmip = heurdata->solvesubmip;
2003 && (nfeasnlps < heurdata->maxfeasnlps
2004 || nnlpcands <= startnnlpcands - divedepth/2
2005 || (nfeasnlps < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound))
2021 bestcandmayround =
TRUE;
2022 bestcandroundup =
FALSE;
2024 updatepscost =
TRUE;
2028 switch( heurdata->varselrule )
2031 SCIP_CALL(
chooseCoefVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2032 &bestcand, &bestcandmayround, &bestcandroundup) );
2035 var = nlpcands[bestcand];
2036 bestboundval = nlpcandssol[bestcand];
2040 SCIP_CALL(
chooseVeclenVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2041 &bestcand, &bestcandmayround, &bestcandroundup) );
2044 var = nlpcands[bestcand];
2045 bestboundval = nlpcandssol[bestcand];
2049 SCIP_CALL(
choosePscostVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2050 &bestcand, &bestcandmayround, &bestcandroundup) );
2053 var = nlpcands[bestcand];
2054 bestboundval = nlpcandssol[bestcand];
2058 SCIP_CALL(
chooseGuidedVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, bestsol, varincover, covercomputed,
2059 &bestcand, &bestcandmayround, &bestcandroundup) );
2062 var = nlpcands[bestcand];
2063 bestboundval = nlpcandssol[bestcand];
2073 assert(backtrackdepth > 0 || nnlpcands <= npseudocands);
2078 varincover, covercomputed, &bestcand, &bestboundval, &bestcandmayround, &bestcandroundup) );
2080 var = pseudocands[bestcand];
2084 updatepscost =
FALSE;
2087 SCIP_CALL(
chooseFracVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2088 &bestcand, &bestcandmayround, &bestcandroundup) );
2091 var = nlpcands[bestcand];
2092 bestboundval = nlpcandssol[bestcand];
2106 if( (var == NULL || bestcandmayround) && backtrackdepth == -1 )
2127 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2142 if( backtracked && backtrackdepth > 0 )
2144 assert(backtrackvar != NULL);
2151 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2158 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2160 assert(backtracked);
2165 if( backtrackroundup )
2167 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2168 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2175 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2176 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2183 backtrackdepth = -1;
2186 bestcandroundup = backtrackroundup;
2187 frac =
SCIPfrac(scip, backtrackvarval);
2192 assert(var != NULL);
2199 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2206 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2208 assert(backtracked);
2213 if( bestcandroundup == !backtracked )
2216 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2217 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2224 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2226 backtrackdepth = divedepth;
2228 backtrackvarval = bestboundval;
2229 backtrackroundup =
FALSE;
2235 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2236 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2243 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2245 backtrackdepth = divedepth;
2247 backtrackvarval = bestboundval;
2248 backtrackroundup =
TRUE;
2255 if( heurdata->varselrule ==
'd' )
2257 assert(pseudocandsnlpsol != NULL);
2258 assert(0 <= bestcand && bestcand < npseudocands);
2259 frac =
SCIPfrac(scip, pseudocandsnlpsol[bestcand]);
2262 frac = nlpcandsfrac[bestcand];
2276 if( !cutoff && solvesubmip && covercomputed &&
2277 (heurdata->nfixedcovervars == ncovervars ||
2278 (heurdata->nfixedcovervars >= (ncovervars+1)/2 && !
SCIPhashmapExists(varincover, var))) )
2282 solvesubmip =
FALSE;
2284 assert(probingdepth >= 1);
2285 assert(covervars != NULL);
2287 if( heurdata->nfixedcovervars != ncovervars )
2290 for( c = 0; c < ncovervars && !cutoff ; c++ )
2302 nlpsolval = MIN(nlpsolval,ub);
2303 nlpsolval =
MAX(nlpsolval,lb);
2355 if( !cutoff && !lperror && (heurdata->lp || heurdata->varselrule ==
'd')
2374 if( updatepscost &&
SCIPisGT(scip, objval, oldobjval) )
2377 if( bestcandroundup )
2405 solvenlp = backtracked;
2406 if( !solvenlp && !cutoff )
2408 solvenlp = (lastnlpsolvedepth < divedepth - fixquot * nnlpcands);
2412 for( c = 0; c < nnlpcands; ++c )
2420 if( c == nnlpcands )
2428 if( !cutoff && solvenlp )
2443 if( heurdata->nlpstart !=
'n' && backtracked )
2445 assert(nlpstartsol != NULL);
2461 "Error while solving NLP in nlpdiving heuristic; NLP solve terminated with code <%d>\n", termstat);
2486 lastnlpsolvedepth = divedepth;
2488 backtrackdepth = -1;
2490 if( heurdata->nlpstart ==
'f' )
2492 assert(nlpstartsol != NULL);
2504 if( cutoff && !backtracked && heurdata->backtrack )
2506 if( backtrackdepth == -1 )
2527 divedepth = backtrackdepth;
2530 updatepscost =
FALSE;
2541 backtracked =
FALSE;
2543 while( backtracked );
2550 SCIPdebugMsg(scip,
" -> nlpsolstat=%d, objval=%g/%g, nfrac nlp=%d lp=%d\n", nlpsolstat, objval, searchbound, nnlpcands, nlpbranchcands);
2557 SCIPdebugMsgPrint(scip,
"NLP bad status - nlperror: %ud nlpsolstat: %d \n", nlperror, nlpsolstat);
2565 else if(! (divedepth < 10
2566 || nnlpcands <= startnnlpcands - divedepth/2
2567 || (divedepth < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound) ) )
2569 SCIPdebugMsgPrint(scip,
"TOO DEEP - divedepth: %4d cands halfed: %d ltmaxdepth: %d ltmaxiter: %d bound: %d\n", divedepth,
2570 (nnlpcands > startnnlpcands - divedepth/2), (divedepth >= maxdivedepth), (heurdata->nnlpiterations >= maxnnlpiterations),
2571 (objval >= searchbound));
2606 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2621 assert(heurdata->eventhdlr != NULL);
2622 assert(heurdata->nfixedcovervars >= 0);
2623 assert(varincover != NULL);
2624 assert(covervars != NULL);
2629 for( c = 0; c < ncovervars; c++ )
2635 assert(varincover == NULL);
2638 if( heurdata->prefercover || heurdata->solvesubmip )
2640 assert(covervars != NULL || !covercomputed);
2641 if( covervars != NULL )
2645 assert(covervars == NULL);
2648 if( nlpstartsol != NULL )
2658 if( heurdata->varselrule ==
'g' )
2660 assert(bestsol != NULL);
2664 assert(bestsol == NULL);
2667 if( heurdata->varselrule ==
'd' )
2669 assert(pseudocandsnlpsol != NULL);
2670 assert(pseudocandsnlpsol != NULL);
2676 assert(pseudocandsnlpsol == NULL);
2677 assert(pseudocandsnlpsol == NULL);
2681 heurdata->nsuccess++;
2708 assert(heur != NULL);
2716 heurdata->eventhdlr = NULL;
2719 eventExecNlpdiving, NULL) );
2720 if ( heurdata->eventhdlr == NULL )
2729 "minimal relative depth to start diving",
2733 "maximal relative depth to start diving",
2736 "heuristics/" HEUR_NAME "/maxnlpiterabs",
2737 "minimial absolute number of allowed NLP iterations",
2740 "heuristics/" HEUR_NAME "/maxnlpiterrel",
2741 "additional allowed number of NLP iterations relative to successfully found solutions",
2744 "heuristics/" HEUR_NAME "/maxdiveubquot",
2745 "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)",
2748 "heuristics/" HEUR_NAME "/maxdiveavgquot",
2749 "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)",
2752 "heuristics/" HEUR_NAME "/maxdiveubquotnosol",
2753 "maximal UBQUOT when no solution was found yet (0.0: no limit)",
2756 "heuristics/" HEUR_NAME "/maxdiveavgquotnosol",
2757 "maximal AVGQUOT when no solution was found yet (0.0: no limit)",
2761 "maximal number of NLPs with feasible solution to solve during one dive",
2765 "use one level of backtracking if infeasibility is encountered?",
2769 "should the LP relaxation be solved before the NLP relaxation?",
2772 "heuristics/" HEUR_NAME "/preferlpfracs",
2773 "prefer variables that are also fractional in LP solution?",
2777 "heuristic will not run if less then this percentage of calls succeeded (0.0: no limit)",
2781 "percentage of fractional variables that should be fixed before the next NLP solve",
2785 "should variables in a minimal cover be preferred?",
2789 "should a sub-MIP be solved if all cover variables are fixed?",
2793 "should the NLP solver stop early if it converges slow?",
2797 "which point should be used as starting point for the NLP solver? ('n'one, last 'f'easible, from dive's'tart)",
2801 "which variable selection should be used? ('f'ractionality, 'c'oefficient, 'p'seudocost, 'g'uided, 'd'ouble, 'v'eclen)",
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
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_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_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)
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed)
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)
void SCIPnlpStatisticsFree(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
#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
#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)
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)
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)
SCIP_RETCODE SCIPsetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real dval)
#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
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)
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
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 SCIPnlpStatisticsCreate(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
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)
#define SCIP_CALL_ABORT(x)
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)
static SCIP_RETCODE doSolveSubMIP(SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_VAR **covervars, int ncovervars, SCIP_Bool *success)
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