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 )
1738 if ( timelim <= 0.0 )
1782 SCIPdebugMsg(scip,
"initial NLP infeasible or not solvable --> stop\n");
1786 heurdata->nfailcutoff++;
1788 heurdata->nfailnlperror++;
1804 assert(nnlpcands <= npseudocands);
1814 if( nnlpcands == 0 )
1831 SCIPdebugMsg(scip,
" -> solution of first NLP was integral, feasible, and good enough\n");
1843 if( heurdata->varselrule ==
'g' &&
SCIPgetNSols(scip) == 0 )
1853 assert(nlpcandsfrac != NULL);
1854 assert(nlpcands != NULL);
1855 assert(nlpcandssol != NULL);
1858 if( heurdata->nlpstart !=
'n' )
1867 if( heurdata->maxdiveubquotnosol > 0.0 )
1872 if( heurdata->maxdiveavgquotnosol > 0.0 )
1880 if( heurdata->maxdiveubquot > 0.0 )
1885 if( heurdata->maxdiveavgquot > 0.0 )
1891 searchbound = MIN(searchubbound, searchavgbound);
1893 searchbound =
SCIPceil(scip, searchbound);
1897 maxdivedepth = MIN(maxdivedepth, maxdepth);
1900 covercomputed =
FALSE;
1904 if( heurdata->prefercover || heurdata->solvesubmip )
1927 SCIP_CALL(
SCIPcomputeCoverUndercover(scip, &ncovervars, covervars, timelimit, memorylimit,
SCIPinfinity(scip),
FALSE,
FALSE,
FALSE,
'u', &covercomputed) );
1933 assert(ncovervars >= 0);
1939 for( c = 0; c < ncovervars; c++ )
1949 assert(heurdata->eventhdlr != NULL);
1971 SCIPdebugMsg(scip,
"(node %" SCIP_LONGINT_FORMAT
") executing nlpdiving heuristic: depth=%d, %d fractionals, dualbound=%g, searchbound=%g\n",
1975 if( heurdata->varselrule ==
'g' )
1984 if( heurdata->varselrule ==
'd' )
1998 lastnlpsolvedepth = 0;
1999 backtracked =
FALSE;
2000 fixquot = heurdata->fixquot;
2002 startnnlpcands = nnlpcands;
2003 solvesubmip = heurdata->solvesubmip;
2006 && (nfeasnlps < heurdata->maxfeasnlps
2007 || nnlpcands <= startnnlpcands - divedepth/2
2008 || (nfeasnlps < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound))
2024 bestcandmayround =
TRUE;
2025 bestcandroundup =
FALSE;
2027 updatepscost =
TRUE;
2031 switch( heurdata->varselrule )
2034 SCIP_CALL(
chooseCoefVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2035 &bestcand, &bestcandmayround, &bestcandroundup) );
2038 var = nlpcands[bestcand];
2039 bestboundval = nlpcandssol[bestcand];
2043 SCIP_CALL(
chooseVeclenVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2044 &bestcand, &bestcandmayround, &bestcandroundup) );
2047 var = nlpcands[bestcand];
2048 bestboundval = nlpcandssol[bestcand];
2052 SCIP_CALL(
choosePscostVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2053 &bestcand, &bestcandmayround, &bestcandroundup) );
2056 var = nlpcands[bestcand];
2057 bestboundval = nlpcandssol[bestcand];
2061 SCIP_CALL(
chooseGuidedVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, bestsol, varincover, covercomputed,
2062 &bestcand, &bestcandmayround, &bestcandroundup) );
2065 var = nlpcands[bestcand];
2066 bestboundval = nlpcandssol[bestcand];
2076 assert(backtrackdepth > 0 || nnlpcands <= npseudocands);
2081 varincover, covercomputed, &bestcand, &bestboundval, &bestcandmayround, &bestcandroundup) );
2083 var = pseudocands[bestcand];
2087 updatepscost =
FALSE;
2090 SCIP_CALL(
chooseFracVar(scip, heurdata, nlpcands, nlpcandssol, nlpcandsfrac, nnlpcands, varincover, covercomputed,
2091 &bestcand, &bestcandmayround, &bestcandroundup) );
2094 var = nlpcands[bestcand];
2095 bestboundval = nlpcandssol[bestcand];
2109 if( (var == NULL || bestcandmayround) && backtrackdepth == -1 )
2130 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2145 if( backtracked && backtrackdepth > 0 )
2147 assert(backtrackvar != NULL);
2154 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2161 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2163 assert(backtracked);
2168 if( backtrackroundup )
2170 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2171 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2178 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2179 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2186 backtrackdepth = -1;
2189 bestcandroundup = backtrackroundup;
2190 frac =
SCIPfrac(scip, backtrackvarval);
2195 assert(var != NULL);
2202 SCIPdebugMsg(scip,
"Selected variable <%s> already fixed to [%g,%g] (solval: %.9f), diving aborted \n",
2209 SCIPdebugMsg(scip,
"selected variable's <%s> solution value is outside the domain [%g,%g] (solval: %.9f), diving aborted\n",
2211 assert(backtracked);
2216 if( bestcandroundup == !backtracked )
2219 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2220 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2227 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2229 backtrackdepth = divedepth;
2231 backtrackvarval = bestboundval;
2232 backtrackroundup =
FALSE;
2238 SCIPdebugMsg(scip,
" dive %d/%d, NLP iter %d/%d: var <%s>, round=%u, sol=%g, oldbounds=[%g,%g], newbounds=[%g,%g]\n",
2239 divedepth, maxdivedepth, heurdata->nnlpiterations, maxnnlpiterations,
2246 if( backtrackdepth == -1 || (divedepth - lastnlpsolvedepth == (
int)(MIN(fixquot * nnlpcands, nlpbranchcands)/2.0)) )
2248 backtrackdepth = divedepth;
2250 backtrackvarval = bestboundval;
2251 backtrackroundup =
TRUE;
2258 if( heurdata->varselrule ==
'd' )
2260 assert(pseudocandsnlpsol != NULL);
2261 assert(0 <= bestcand && bestcand < npseudocands);
2262 frac =
SCIPfrac(scip, pseudocandsnlpsol[bestcand]);
2265 frac = nlpcandsfrac[bestcand];
2279 if( !cutoff && solvesubmip && covercomputed &&
2280 (heurdata->nfixedcovervars == ncovervars ||
2281 (heurdata->nfixedcovervars >= (ncovervars+1)/2 && !
SCIPhashmapExists(varincover, var))) )
2285 solvesubmip =
FALSE;
2287 assert(probingdepth >= 1);
2288 assert(covervars != NULL);
2290 if( heurdata->nfixedcovervars != ncovervars )
2293 for( c = 0; c < ncovervars && !cutoff ; c++ )
2305 nlpsolval = MIN(nlpsolval,ub);
2306 nlpsolval =
MAX(nlpsolval,lb);
2358 if( !cutoff && !lperror && (heurdata->lp || heurdata->varselrule ==
'd')
2377 if( updatepscost &&
SCIPisGT(scip, objval, oldobjval) )
2380 if( bestcandroundup )
2408 solvenlp = backtracked;
2409 if( !solvenlp && !cutoff )
2411 solvenlp = (lastnlpsolvedepth < divedepth - fixquot * nnlpcands);
2415 for( c = 0; c < nnlpcands; ++c )
2423 if( c == nnlpcands )
2431 if( !cutoff && solvenlp )
2446 if( heurdata->nlpstart !=
'n' && backtracked )
2448 assert(nlpstartsol != NULL);
2464 "Error while solving NLP in nlpdiving heuristic; NLP solve terminated with code <%d>\n", termstat);
2489 lastnlpsolvedepth = divedepth;
2491 backtrackdepth = -1;
2493 if( heurdata->nlpstart ==
'f' )
2495 assert(nlpstartsol != NULL);
2507 if( cutoff && !backtracked && heurdata->backtrack )
2509 if( backtrackdepth == -1 )
2530 divedepth = backtrackdepth;
2533 updatepscost =
FALSE;
2544 backtracked =
FALSE;
2546 while( backtracked );
2553 SCIPdebugMsg(scip,
" -> nlpsolstat=%d, objval=%g/%g, nfrac nlp=%d lp=%d\n", nlpsolstat, objval, searchbound, nnlpcands, nlpbranchcands);
2560 SCIPdebugMsgPrint(scip,
"NLP bad status - nlperror: %ud nlpsolstat: %d \n", nlperror, nlpsolstat);
2568 else if(! (divedepth < 10
2569 || nnlpcands <= startnnlpcands - divedepth/2
2570 || (divedepth < maxdivedepth && heurdata->nnlpiterations < maxnnlpiterations && objval < searchbound) ) )
2572 SCIPdebugMsgPrint(scip,
"TOO DEEP - divedepth: %4d cands halfed: %d ltmaxdepth: %d ltmaxiter: %d bound: %d\n", divedepth,
2573 (nnlpcands > startnnlpcands - divedepth/2), (divedepth >= maxdivedepth), (heurdata->nnlpiterations >= maxnnlpiterations),
2574 (objval >= searchbound));
2609 SCIPdebugMsg(scip,
" -> solution was feasible and good enough\n");
2624 assert(heurdata->eventhdlr != NULL);
2625 assert(heurdata->nfixedcovervars >= 0);
2626 assert(varincover != NULL);
2627 assert(covervars != NULL);
2632 for( c = 0; c < ncovervars; c++ )
2638 assert(varincover == NULL);
2641 if( heurdata->prefercover || heurdata->solvesubmip )
2643 assert(covervars != NULL || !covercomputed);
2644 if( covervars != NULL )
2648 assert(covervars == NULL);
2651 if( nlpstartsol != NULL )
2661 if( heurdata->varselrule ==
'g' )
2663 assert(bestsol != NULL);
2667 assert(bestsol == NULL);
2670 if( heurdata->varselrule ==
'd' )
2672 assert(pseudocandsnlpsol != NULL);
2673 assert(pseudocandsnlpsol != NULL);
2679 assert(pseudocandsnlpsol == NULL);
2680 assert(pseudocandsnlpsol == NULL);
2684 heurdata->nsuccess++;
2711 assert(heur != NULL);
2719 heurdata->eventhdlr = NULL;
2722 eventExecNlpdiving, NULL) );
2723 if ( heurdata->eventhdlr == NULL )
2732 "minimal relative depth to start diving",
2736 "maximal relative depth to start diving",
2739 "heuristics/" HEUR_NAME "/maxnlpiterabs",
2740 "minimial absolute number of allowed NLP iterations",
2743 "heuristics/" HEUR_NAME "/maxnlpiterrel",
2744 "additional allowed number of NLP iterations relative to successfully found solutions",
2747 "heuristics/" HEUR_NAME "/maxdiveubquot",
2748 "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)",
2751 "heuristics/" HEUR_NAME "/maxdiveavgquot",
2752 "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)",
2755 "heuristics/" HEUR_NAME "/maxdiveubquotnosol",
2756 "maximal UBQUOT when no solution was found yet (0.0: no limit)",
2759 "heuristics/" HEUR_NAME "/maxdiveavgquotnosol",
2760 "maximal AVGQUOT when no solution was found yet (0.0: no limit)",
2764 "maximal number of NLPs with feasible solution to solve during one dive",
2768 "use one level of backtracking if infeasibility is encountered?",
2772 "should the LP relaxation be solved before the NLP relaxation?",
2775 "heuristics/" HEUR_NAME "/preferlpfracs",
2776 "prefer variables that are also fractional in LP solution?",
2780 "heuristic will not run if less then this percentage of calls succeeded (0.0: no limit)",
2784 "percentage of fractional variables that should be fixed before the next NLP solve",
2788 "should variables in a minimal cover be preferred?",
2792 "should a sub-MIP be solved if all cover variables are fixed?",
2796 "should the NLP solver stop early if it converges slow?",
2800 "which point should be used as starting point for the NLP solver? ('n'one, last 'f'easible, from dive's'tart)",
2804 "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