37 #define HEUR_NAME "subnlp" 38 #define HEUR_DESC "primal heuristic that performs a local search in an NLP after fixing integer variables and presolving" 39 #define HEUR_DISPCHAR 'q' 40 #define HEUR_PRIORITY -2000000 42 #define HEUR_FREQOFS 0 43 #define HEUR_MAXDEPTH -1 44 #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE 45 #define HEUR_USESSUBSCIP FALSE 57 int nseriousnlpierror;
80 int maxpresolverounds;
103 assert(scip != NULL);
141 assert(heurdata != NULL);
142 assert(heurdata->subscip == NULL);
146 heurdata->triedsetupsubscip =
TRUE;
185 SCIPdebugMsg(scip,
"some NLPIs from main SCIP did not copy into sub-SCIP, give up heuristic.\n");
208 if( !heurdata->subscipisvalid )
211 SCIPdebugMsg(scip,
"In heur_subnlp: failed to copy some constraints to sub-SCIP, continue anyway\n");
226 heurdata->nvars = nvars;
268 for( i = 0; i < heurdata->nvars; ++i )
270 assert(heurdata->var_scip2subscip[i] != NULL);
273 for( i = 0; i < heurdata->nsubvars; ++i )
275 assert(heurdata->var_subscip2scip[i] != NULL);
312 if( !
SCIPisParamFixed(heurdata->subscip,
"constraints/components/maxprerounds") )
342 assert(scip != NULL);
343 assert(heurdata != NULL);
345 assert(heurdata->subscip != NULL);
348 if( heurdata->nlpstatistics != NULL )
350 assert(heurdata->nlpstatistics == NULL);
353 assert(nsubvars == heurdata->nsubvars);
358 for( i = 0; i < heurdata->nsubvars; ++i )
361 assert(subvar != NULL);
378 heurdata->nsubvars = 0;
396 assert(
scip != NULL);
397 assert(event != NULL);
398 assert(eventdata != NULL);
399 assert(eventhdlr != NULL);
402 assert(heurdata != NULL);
415 assert(idx < heurdata->nvars);
417 subvar = heurdata->var_scip2subscip[idx];
421 for( idx = 0; idx < heurdata->nsubvars; ++idx )
423 if( heurdata->var_subscip2scip[idx] == var )
426 assert(idx < heurdata->nsubvars);
429 assert(subvar != NULL);
462 assert(scip != NULL);
463 assert(conshdlr != NULL);
471 for( i = 0; i < nconss; ++i )
488 if( !addcombconss || !addcontconss )
490 iscombinatorial =
TRUE;
492 for( j = 0; j < nvars; ++j )
495 iscombinatorial =
FALSE;
500 if( (iscombinatorial && !addcombconss) || (!iscombinatorial && !addcontconss) )
506 0, NULL, 0, NULL, NULL,
534 assert(scip != NULL);
535 assert(conshdlr != NULL);
543 for( i = 0; i < nconss; ++i )
555 if( (iscombinatorial && !addcombconss) || (!iscombinatorial && !addcontconss) )
563 0, NULL, 0, NULL, NULL,
590 assert(scip != NULL);
591 assert(conshdlr != NULL);
602 for( i = 0; i < nconss; ++i )
610 if( coefssize < nvars )
620 for( j = coefssize; j < nvars; ++j )
629 0, NULL, 0, NULL, NULL,
660 assert(scip != NULL);
661 assert(conshdlr != NULL);
672 for( i = 0; i < nconss; ++i )
680 if( coefssize < nvars )
690 for( j = coefssize; j < nvars; ++j )
721 0, NULL, 0, NULL, NULL,
750 assert(scip != NULL);
751 assert(conshdlr != NULL);
758 assert(conss != NULL);
763 for( i = 0; i < nconss; ++i )
773 if( coefssize < nvars )
787 for( j = 0; j < nvars; ++j )
792 0, NULL, 0, NULL, NULL,
817 if( conshdlr != NULL )
824 if( conshdlr != NULL )
833 if( conshdlr != NULL )
840 if( conshdlr != NULL )
847 if( conshdlr != NULL )
870 assert(scip != NULL);
871 assert(heur != NULL);
875 assert(heurdata != NULL);
891 for( i = 0; i < heurdata->nsubvars; ++i )
893 var = heurdata->var_subscip2scip[i];
898 assert(subvar != NULL);
920 assert(scip != NULL);
921 assert(heur != NULL);
923 assert(subsol != NULL);
926 assert(heurdata != NULL);
938 for( i = 0; i < heurdata->nsubvars; ++i )
940 if( heurdata->var_subscip2scip[i] == NULL || !
SCIPvarIsActive(heurdata->var_subscip2scip[i]) )
971 assert(scip != NULL);
972 assert(heur != NULL);
973 assert(result != NULL);
976 assert(heurdata != NULL);
982 if( timelimit == 0.0 )
985 if( tighttolerances )
996 if( !
SCIPisParamFixed(heurdata->subscip,
"constraints/linear/aggregatevariables") )
1019 SCIPdebugMsg(scip,
"SCIP presolve interrupted by user\n");
1034 SCIPdebugMsg(scip,
"SCIP returned from presolve in stage presolving with status %d\n",
SCIPgetStatus(heurdata->subscip));
1072 SCIPwarningMessage(scip,
"Error while solving subproblem in subnlp heuristic; sub-SCIP terminated with code <%d>\n", retcode);
1089 if( resultsol == NULL )
1096 heurdata->lastsol = sol;
1100 if( heurdata->nlpverblevel >= 1 )
1104 SCIPdebugMsg(scip,
"SCIP stored solution from sub-SCIP root node\n");
1107 ++heurdata->nsolfound;
1112 if( heurdata->nlpverblevel >= 1 )
1116 SCIPdebugMsg(scip,
"SCIP did not store sub-SCIP optimal solution\n");
1124 heurdata->lastsol = resultsol;
1128 if( heurdata->nlpverblevel >= 1 )
1132 SCIPdebugMsg(scip,
"SCIP solution from sub-SCIP root node is feasible\n");
1135 ++heurdata->nsolfound;
1140 if( heurdata->nlpverblevel >= 1 )
1144 SCIPdebugMsg(scip,
"SCIP solution form sub-SCIP root node is not feasible\n");
1156 if( heurdata->nlpverblevel >= 1 )
1160 SCIPdebugMsg(scip,
"sub-SCIP detected infeasibility\n");
1208 if( heurdata->nlpverblevel >= 2 )
1222 if( subvar == NULL )
1224 startpoint[i] = constant;
1226 if( heurdata->nlpverblevel >= 2 && !
SCIPisZero(heurdata->subscip, startpoint[i]) )
1239 startpoint[i] = scalar *
SCIPgetSolVal(scip, refpoint, var) + constant;
1241 if( heurdata->nlpverblevel >= 2 && !
SCIPisZero(heurdata->subscip, startpoint[i]) )
1252 if( tighttolerances )
1265 if( heurdata->nlpoptfile != NULL && *heurdata->nlpoptfile !=
'\0' )
1271 if( itercontingent == -1 && heurdata->nlpiterlimit > 0 )
1272 itercontingent = heurdata->nlpiterlimit;
1273 if( itercontingent > 0 )
1286 SCIPdebugMsg(scip,
"start NLP solve with iteration limit %" SCIP_LONGINT_FORMAT
" and timelimit %g\n", itercontingent, timelimit);
1289 SCIPdebugMsg(scip,
"NLP solver returned with termination status %d and solution status %d, objective value is %g\n",
1295 if( heurdata->nlpverblevel >= 1 )
1299 ++(heurdata->nseriousnlpierror);
1301 "NLP solver in subNLP heuristic for problem <%s> returned with bad termination status %d. This was the %d%s successive time.\n",
1303 heurdata->nseriousnlpierror == 1 ?
"st" : heurdata->nseriousnlpierror == 2 ?
"nd" : heurdata->nseriousnlpierror == 3 ?
"rd" :
"th");
1304 if( heurdata->nseriousnlpierror >= 5 )
1311 heurdata->nseriousnlpierror = 0;
1315 if( iterused != NULL )
1317 SCIPdebugMsg(scip,
"NLP solver used %d iterations and %g seconds\n",
1326 if( resultsol == NULL )
1334 heurdata->lastsol = sol;
1335 if( heurdata->resolvefromscratch )
1356 if( heurdata->nlpverblevel >= 1 )
1364 ++heurdata->nsolfound;
1366 else if( !tighttolerances && heurdata->resolvetolfactor < 1.0 )
1369 if( heurdata->nlpverblevel >= 1 )
1374 SCIPdebugMsg(scip,
"solution reported by NLP solver not feasible for SCIP, resolve with feasibility tolerance %g and epsilon %g\n",
1381 SCIP_CALL(
solveSubNLP(scip, heur, result, heurdata->resolvefromscratch ? refpoint : sol, itercontingent, timelimit, iterused,
TRUE, resultsol) );
1385 if( heurdata->nlpverblevel >= 1 )
1389 SCIPdebugMsg(scip,
"solution reported by NLP solver not stored by SCIP\n");
1404 heurdata->lastsol = resultsol;
1414 if( heurdata->nlpverblevel >= 1 )
1418 SCIPdebugMsg(scip,
"solution reported by NLP solver feasible for SCIP\n");
1421 ++heurdata->nsolfound;
1423 else if( !tighttolerances && heurdata->resolvetolfactor < 1.0 )
1431 if( heurdata->nlpverblevel >= 1 )
1433 "solution reported by NLP solver not feasible for SCIP, resolve with feasibility tolerance %g and epsilon %g\n",
1437 SCIPdebugMsg(scip,
"solution reported by NLP solver not feasible for SCIP, resolve with feasibility tolerance %g and epsilon %g\n",
1441 SCIP_CALL(
solveSubNLP(scip, heur, result, heurdata->resolvefromscratch ? refpoint : resultsol, itercontingent, timelimit, iterused,
TRUE, resultsol) );
1445 if( heurdata->nlpverblevel >= 1 )
1449 SCIPdebugMsg(scip,
"solution reported by NLP solver not feasible for SCIP\n");
1454 else if( heurdata->nlpverblevel >= 1 )
1472 else if( heurdata->nlpverblevel >= 1
1481 if( heurdata->subscip != NULL )
1484 if( tighttolerances )
1498 if( iterused != NULL && *iterused == 0 )
1525 assert(scip != NULL);
1528 assert(nsubvars == heurdata->nsubvars);
1530 if( nsubbinvars == 0 && nsubintvars == 0 )
1533 SCIPwarningMessage(scip,
"heur_subnlp found subCIP infeasible after fixing no variables, something is strange here...\n");
1547 if( nsubintvars == 0 )
1556 for( i = nsubbinvars - 1; i >= 0; --i )
1558 subvar = subvars[i];
1561 var = heurdata->var_subscip2scip[i];
1568 assert(fixval == 0.0 || fixval == 1.0);
1573 consvars[nconsvars] = var;
1609 for( i = nsubbinvars + nsubintvars - 1; i >= 0; --i )
1611 subvar = subvars[i];
1614 var = heurdata->var_subscip2scip[i];
1622 assert((
int)fixval == fixval);
1627 assert(nconsvars < nsubbinvars + 2*nsubintvars);
1631 bounds[nconsvars] = fixval - 1.0;
1632 consvars[nconsvars] = var;
1638 assert(nconsvars < nsubbinvars + 2*nsubintvars);
1642 bounds[nconsvars] = fixval + 1.0;
1643 consvars[nconsvars] = var;
1660 SCIPdebugMsg(scip,
"adding constraint to forbid fixation in main problem\n");
1692 assert(scip != NULL);
1693 assert(heur != NULL);
1697 assert(heurdata != NULL);
1700 if( heurdata->subscip == NULL && !heurdata->triedsetupsubscip )
1708 if( heurdata->subscip == NULL )
1711 assert(heurdata->nsubvars > 0);
1712 assert(heurdata->var_subscip2scip != NULL);
1715 if( iterused != NULL )
1728 assert(nsubvars == heurdata->nsubvars);
1731 for( i = nsubbinvars + nsubintvars - 1; i >= 0; --i )
1733 subvar = subvars[i];
1736 var = heurdata->var_subscip2scip[i];
1737 assert(var != NULL);
1750 SCIPdebugMsg(scip,
"skip NLP heuristic because start candidate not integer feasible: var <%s> has value %g\n",
SCIPvarGetName(var), fixval);
1799 cutoff = MIN(upperbound, cutoff);
1801 SCIPdebugMsg(scip,
"set objective limit %g\n", cutoff);
1809 if( heurdata->subscip == NULL )
1841 heurdata->triedsetupsubscip =
FALSE;
1852 assert(nsubvars == heurdata->nsubvars);
1855 for( i = nsubbinvars + nsubintvars - 1; i >= 0; --i )
1857 subvar = subvars[i];
1860 var = heurdata->var_subscip2scip[i];
1861 assert(var != NULL);
1888 assert(scip != NULL);
1889 assert(heur != NULL);
1890 assert(sol != NULL);
1891 assert(success != NULL);
1895 assert(heurdata != NULL);
1898 if( heurdata->subscip == NULL && !heurdata->triedsetupsubscip )
1906 if( heurdata->subscip == NULL )
1909 assert(heurdata->nsubvars > 0);
1910 assert(heurdata->var_subscip2scip != NULL);
1925 assert(nsubvars == heurdata->nsubvars);
1928 for( i = nsubbinvars + nsubintvars - 1; i >= 0; --i )
1930 subvar = subvars[i];
1933 var = heurdata->var_subscip2scip[i];
1934 assert(var != NULL);
1945 SCIPdebugMsg(scip,
"skip NLP heuristic because start candidate not integer feasible: var <%s> has value %g\n",
SCIPvarGetName(var), fixval);
1969 cutoff += 0.01 *
REALABS(cutoff);
1973 cutoff -= 0.01 *
REALABS(cutoff);
1976 SCIPdebugMsg(scip,
"set objective limit %g\n", cutoff);
1982 if( heurdata->subscip == NULL )
1999 heurdata->triedsetupsubscip =
FALSE;
2010 assert(nsubvars == heurdata->nsubvars);
2013 for( i = nsubbinvars + nsubintvars - 1; i >= 0; --i )
2015 subvar = subvars[i];
2018 var = heurdata->var_subscip2scip[i];
2019 assert(var != NULL);
2037 assert(
scip != NULL);
2038 assert(heur != NULL);
2052 assert(
scip != NULL);
2053 assert(heur != NULL);
2056 assert(heurdata != NULL);
2057 assert(heurdata->subscip == NULL);
2058 assert(heurdata->var_subscip2scip == NULL);
2059 assert(heurdata->var_scip2subscip == NULL);
2060 assert(heurdata->startcand == NULL);
2073 assert(
scip != NULL);
2074 assert(heur != NULL);
2081 assert(heurdata != NULL);
2082 assert(heurdata->subscip == NULL);
2085 heurdata->nsolfound = 0;
2087 if( heurdata->keepcopy )
2093 if( heurdata->subscip == NULL )
2109 assert(
scip != NULL);
2110 assert(heur != NULL);
2114 assert(heurdata != NULL);
2116 if( heurdata->subscip != NULL )
2122 if( heurdata->startcand != NULL )
2130 heurdata->triedsetupsubscip =
FALSE;
2131 heurdata->comblinearconsadded =
FALSE;
2132 heurdata->contlinearconsadded =
FALSE;
2133 heurdata->nseriousnlpierror = 0;
2134 heurdata->iterused = 0;
2149 assert(
scip != NULL);
2150 assert(heur != NULL);
2157 assert(heurdata != NULL);
2166 if( heurdata->subscip == NULL && (heurdata->keepcopy || heurdata->triedsetupsubscip) )
2173 if( heurdata->startcand == NULL )
2178 if( nodeinfeasible )
2194 SCIPdebugMsg(
scip,
"LP is unbounded in root node, so we are quite desperate; run NLP heuristic and pray\n");
2201 SCIPdebugMsg(
scip,
"NLP heuristic delayed because no start candidate given and current LP solution is fractional\n");
2207 SCIPdebugMsg(
scip,
"NLP heuristic delayed because lower and upper bound coincide in current node\n");
2217 if( !heurdata->runalways )
2229 itercontingent += heurdata->iteroffset;
2231 itercontingent -= heurdata->iterused;
2233 if( itercontingent < heurdata->itermin )
2236 SCIPdebugMsg(
scip,
"skip NLP heuristic; contingent=%" SCIP_LONGINT_FORMAT
"; minimal number of iterations=%d; success ratio=%g\n",
2237 itercontingent, heurdata->itermin, (heurdata->nsolfound+1.0)/(
SCIPheurGetNCalls(heur) + 1.0));
2242 if( heurdata->nlpiterlimit > 0 )
2243 itercontingent = MIN(itercontingent, heurdata->nlpiterlimit);
2247 itercontingent = -1;
2255 if( timelimit <= 0.0 )
2262 if( heurdata->nlptimelimit > 0 )
2263 timelimit = MIN(heurdata->nlptimelimit, timelimit);
2268 if( heurdata->nlpverblevel >= 1 )
2272 heurdata->minimprove, &iterused, NULL) );
2273 heurdata->iterused += iterused;
2280 if( heurdata->startcand != NULL )
2310 heurdata->eventhdlr = NULL;
2312 processVarEvent, NULL) );
2313 assert(heurdata->eventhdlr != NULL);
2320 assert(heur != NULL);
2330 "verbosity level of NLP solver",
2331 &heurdata->nlpverblevel,
FALSE, 0, 0, INT_MAX, NULL, NULL) );
2334 "iteration limit of NLP solver; 0 to use solver default",
2335 &heurdata->nlpiterlimit,
FALSE, 0, 0, INT_MAX, NULL, NULL) );
2338 "time limit of NLP solver; 0 to use solver default",
2342 "name of an NLP solver specific options file",
2343 &heurdata->nlpoptfile,
TRUE,
"", NULL, NULL) );
2346 "if SCIP does not accept a NLP feasible solution, resolve NLP with feas. tolerance reduced by this factor (set to 1.0 to turn off resolve)",
2347 &heurdata->resolvetolfactor,
TRUE, 0.001, 0.0, 1.0, NULL, NULL) );
2350 "should the NLP resolve be started from the original starting point or the infeasible solution?",
2351 &heurdata->resolvefromscratch,
TRUE,
TRUE, NULL, NULL) );
2354 "number of iterations added to the contingent of the total number of iterations",
2355 &heurdata->iteroffset,
FALSE, 500, 0, INT_MAX, NULL, NULL) );
2358 "contingent of NLP iterations in relation to the number of nodes in SCIP",
2362 "contingent of NLP iterations in relation to the number of nodes in SCIP",
2363 &heurdata->itermin,
FALSE, 300, 0, INT_MAX, NULL, NULL) );
2366 "whether to run NLP heuristic always if starting point available (does not use iteroffset,iterquot,itermin)",
2367 &heurdata->runalways,
FALSE,
FALSE, NULL, NULL) );
2370 "factor by which NLP heuristic should at least improve the incumbent",
2371 &heurdata->minimprove,
TRUE, 0.01, 0.0, 1.0, NULL, NULL) );
2374 "limit on number of presolve rounds in sub-SCIP (-1 for unlimited, 0 for no presolve)",
2375 &heurdata->maxpresolverounds,
TRUE, -1, -1, INT_MAX, NULL, NULL) );
2378 "whether to add constraints that forbid specific fixings that turned out to be infeasible",
2379 &heurdata->forbidfixings,
FALSE,
TRUE, NULL, NULL) );
2382 "whether to keep SCIP copy or to create new copy each time heuristic is applied",
2383 &heurdata->keepcopy,
TRUE,
TRUE, NULL, NULL) );
2400 assert(scip != NULL);
2401 assert(heur != NULL);
2405 assert(heurdata != NULL);
2408 if( (!addcombconss || heurdata->comblinearconsadded) && (!addcontconss || heurdata->contlinearconsadded) )
2412 addcombconss && !heurdata->comblinearconsadded,
2413 addcontconss && !heurdata->contlinearconsadded) );
2415 heurdata->comblinearconsadded |= addcombconss;
2416 heurdata->contlinearconsadded |= addcontconss;
2434 assert(scip != NULL);
2435 assert(heur != NULL);
2437 assert(solcand != NULL);
2445 assert(heurdata != NULL);
2448 if( heurdata->subscip == NULL )
2454 if( heurdata->lastsol == solcand )
2457 SCIPdebugMsg(scip,
"consider solution candidate with violation %g and objective %g from %s\n",
2461 if( heurdata->startcand == NULL || violation < heurdata->startcandviol ||
2464 if( heurdata->startcand != NULL )
2470 heurdata->startcandviol = violation;
2487 assert(heur != NULL);
2491 assert(heurdata != NULL);
2493 return heurdata->subscip;
2504 assert(heur != NULL);
2508 assert(heurdata != NULL);
2510 return heurdata->var_scip2subscip;
2521 assert(heur != NULL);
2525 assert(heurdata != NULL);
2527 return heurdata->var_subscip2scip;
2538 assert(heur != NULL);
2542 assert(heurdata != NULL);
2544 return heurdata->startcand;
enum SCIP_Result SCIP_RESULT
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
enum SCIP_BoundType SCIP_BOUNDTYPE
int SCIPgetNIntVars(SCIP *scip)
#define SCIP_HEURTIMING_DURINGLPLOOP
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
static SCIP_RETCODE createSubSCIP(SCIP *scip, SCIP_HEURDATA *heurdata)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_VAR ** SCIPgetNLPVars(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
Constraint handler for variable bound constraints .
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarMappingScip2SubScipHeurSubNlp(SCIP *scip, SCIP_HEUR *heur)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPincludeHeurSubNlp(SCIP *scip)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPnlpStatisticsGetTotalTime(SCIP_NLPSTATISTICS *statistics)
int SCIPgetNOrigVars(SCIP *scip)
SCIP_RETCODE SCIPcreateConsSetcover(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
internal methods for NLPI solver interfaces
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_RETCODE SCIPcopyPlugins(SCIP *sourcescip, SCIP *targetscip, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copytables, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
static SCIP_RETCODE createSolFromNLP(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL **sol, SCIP_HEUR *authorheur)
static SCIP_RETCODE addLogicOrConstraints(SCIP *scip, SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void SCIPsetSubscipDepth(SCIP *scip, int newdepth)
SCIP_Bool SCIPhasNLPContinuousNonlinearity(SCIP *scip)
int SCIPgetSubscipDepth(SCIP *scip)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
int SCIPheurGetFreqofs(SCIP_HEUR *heur)
int SCIPvarGetProbindex(SCIP_VAR *var)
#define SCIP_EVENTTYPE_GLBCHANGED
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
struct SCIP_HeurData SCIP_HEURDATA
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
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)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetOrigVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPnlpStatisticsFree(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPcreate(SCIP **scip)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
int SCIPgetNLPBranchCands(SCIP *scip)
SCIP_Bool SCIPpressedCtrlC(SCIP *scip)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
static SCIP_RETCODE createSolFromSubScipSol(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL **sol, SCIP_SOL *subsol, SCIP_HEUR *authorheur)
static SCIP_DECL_HEUREXITSOL(heurExitsolSubNlp)
static SCIP_DECL_HEURINITSOL(heurInitsolSubNlp)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
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_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_SOL * SCIPgetStartCandidateHeurSubNlp(SCIP *scip, SCIP_HEUR *heur)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_HEUREXEC(heurExecSubNlp)
static SCIP_RETCODE addKnapsackConstraints(SCIP *scip, SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE addSetppcConstraints(SCIP *scip, SCIP_CONSHDLR *conshdlr)
const char * SCIPgetProbName(SCIP *scip)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Constraint handler for knapsack constraints of the form , x binary and .
int SCIPgetNNLPVars(SCIP *scip)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
static SCIP_RETCODE solveSubNLP(SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_SOL *refpoint, SCIP_Longint itercontingent, SCIP_Real timelimit, SCIP_Longint *iterused, SCIP_Bool tighttolerances, SCIP_SOL *resultsol)
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
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)
static SCIP_RETCODE addVarboundConstraints(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool addcombconss, SCIP_Bool addcontconss)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
static SCIP_RETCODE forbidFixation(SCIP *scip, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
#define SCIPfreeBufferArrayNull(scip, ptr)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_RETCODE SCIPpresolve(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE freeSubSCIP(SCIP *scip, SCIP_HEURDATA *heurdata)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
int SCIPgetNNlpis(SCIP *scip)
SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
int SCIPheurGetFreq(SCIP_HEUR *heur)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
static SCIP_RETCODE addLinearConstraintsToNlp(SCIP *scip, SCIP_Bool addcombconss, SCIP_Bool addcontconss)
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
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_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
static SCIP_DECL_HEURFREE(heurFreeSubNlp)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Real SCIPgetObjlimit(SCIP *scip)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
SCIP_Real SCIPvarGetNLPSol(SCIP_VAR *var)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPresolveSolHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Longint itercontingent, SCIP_Real timelimit)
SCIP_RETCODE SCIPcopyConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool *valid)
void SCIPsolSetHeur(SCIP_SOL *sol, SCIP_HEUR *heur)
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)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
int SCIPgetNSols(SCIP *scip)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPapplyHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_SOL *refpoint, SCIP_Longint itercontingent, SCIP_Real timelimit, SCIP_Real minimprove, SCIP_Longint *iterused, SCIP_SOL *resultsol)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define BMSclearMemory(ptr)
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_VAR ** SCIPgetVarMappingSubScip2ScipHeurSubNlp(SCIP *scip, SCIP_HEUR *heur)
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)
int SCIPgetNBinVars(SCIP *scip)
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE addLinearConstraints(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool addcombconss, SCIP_Bool addcontconss)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVars(SCIP *scip)
static SCIP_DECL_HEURCOPY(heurCopySubNlp)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
int SCIPgetNConss(SCIP *scip)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
NLP local search primal heuristic using sub-SCIPs.
SCIP_RETCODE SCIPnlpStatisticsCreate(BMS_BLKMEM *blkmem, SCIP_NLPSTATISTICS **statistics)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_HEUR * SCIPgetSolHeur(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPupdateStartpointHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *solcand, SCIP_Real violation)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
#define BMSclearMemoryArray(ptr, num)
static SCIP_DECL_EVENTEXEC(processVarEvent)
static SCIP_Bool runHeuristic(SCIP *scip)
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *expression, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
#define SCIP_EVENTTYPE_GUBCHANGED
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
constraint handler for bound disjunction constraints
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPresetParam(SCIP *scip, const char *name)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP * SCIPgetSubScipHeurSubNlp(SCIP *scip, SCIP_HEUR *heur)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
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_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
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)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
#define SCIPreallocBufferArray(scip, ptr, num)