assert(heurdata !=
NULL);
124assert(heurdata->nlpi !=
NULL);
127 if( heurdata->nlpiprob !=
NULL)
149cutoff =
MIN(upperbound, cutoff);
168assert(heurdata !=
NULL);
171 if( heurdata->nlpiprob ==
NULL)
174assert(heurdata->nlpi !=
NULL);
175assert(heurdata->var2idx !=
NULL);
178 SCIP_CALL( SCIPfreeNlpiProblem(
scip, heurdata->nlpi, &heurdata->nlpiprob) );
199assert(binvars !=
NULL);
200assert(nbinvars > 0);
209 for( i = 0; i < nbinvars; ++i )
226 SCIP_CALL(
SCIPcreateNlRow(
scip, &nlrows[i], name, 0.0, 1, &binvars[i], &one, sumexpr, -
SCIPinfinity(
scip), theta,
SCIP_EXPRCURV_CONCAVE) );
235 for( i = nbinvars-1; i >= 0; --i )
253 for( i = 0; i < nbinvars; ++i )
257indices[i] = startidx + i;
260 SCIP_CALL( SCIPchgNlpiConsSides(
scip, heurdata->nlpi, heurdata->nlpiprob, nbinvars, indices, lhss, rhss) );
279assert(expr !=
NULL);
305 int* indices =
NULL;
308 SCIP_Realnlpcostleft = heurdata->maxnlpcost;
315assert(heurdata->nlpiprob !=
NULL);
316assert(heurdata->var2idx !=
NULL);
317assert(heurdata->nlpi !=
NULL);
318assert(result !=
NULL);
329binvars[nbinvars++] = var;
346assert(nlrow !=
NULL);
366nlpparam.
iterlimit= heurdata->maxnlpiter;
383 SCIP_CALL( SCIPsolveNlpiParam(
scip, heurdata->nlpi, heurdata->nlpiprob, nlpparam) );
384solstat = SCIPgetNlpiSolstat(
scip, heurdata->nlpi, heurdata->nlpiprob);
394 SCIP_CALL( SCIPgetNlpiStatistics(
scip, heurdata->nlpi, heurdata->nlpiprob, &nlpstatistics) );
395nlpcostleft -= nlpstatistics.
niterations* nlpcostperiter * nbinvars;
399assert(primal !=
NULL);
402binaryfeasible =
TRUE;
403regularfeasible =
TRUE;
404 for( j = 0; j < nbinvars; ++j )
408regularfeasible = regularfeasible &&
SCIPisLE(
scip, primal[idx] -
SQR(primal[idx]), theta);
410maxviolreg =
MAX(maxviolreg, primal[idx] -
SQR(primal[idx]) - theta);
411maxviolbin =
MAX(maxviolbin,
MIN(primal[idx], 1.0-primal[idx]));
413 SCIPdebugMsg(
scip,
"maxviol-regularization %g maxviol-integrality %g\n", maxviolreg, maxviolbin);
418 if( !subnlpcalled && heurdata->subnlp !=
NULL 419&& (
SCIPisLE(
scip, maxviolbin, heurdata->subnlptrigger) || nlpcostleft <= 0.0)
425 SCIPdebugMsg(
scip,
"call sub-NLP heuristic because binary infeasibility is small enough\n");
446subnlpcalled =
TRUE;
481 SCIPdebugMsg(
scip,
"update theta from %g -> %g\n", theta, theta*heurdata->sigma);
489theta *= heurdata->sigma;
495 for( j = 0; j < nbinvars; ++j )
501 SCIP_CALL( SCIPchgNlpiVarBounds(
scip, heurdata->nlpi, heurdata->nlpiprob, nbinvars, indices, lbs, ubs) );
509 SCIPdebugMsg(
scip,
"NLP is infeasible but regularization constraints are satisfied -> stop!\n");
518 SCIPdebugMsg(
scip,
"NLP solution is not feasible for the NLP and the binary variables\n");
523 SCIPdebugMsg(
scip,
"fixing variables did not resolve infeasibility -> stop!\n");
533 for( j = 0; j < nbinvars; ++j )
545lbs[j] = primal[idx] >= 0.5 ? 0.0 : 1.0;
546ubs[j] = primal[idx] >= 0.5 ? 0.0 : 1.0;
552 SCIP_CALL( SCIPchgNlpiVarBounds(
scip, heurdata->nlpi, heurdata->nlpiprob, nbinvars, indices, lbs, ubs) );
560 for( j = 0; j < nbinvars; ++j )
563initguess[idx] = primal[idx] >= 0.5 ? 0.0 : 1.0;
604assert(heurdata !=
NULL);
618assert(heurdata !=
NULL);
619assert(heurdata->nlpi ==
NULL);
637assert(heurdata !=
NULL);
638heurdata->nlpi =
NULL;
651assert(heurdata !=
NULL);
658|| heurdata->nunsucc > heurdata->maxnunsucc )
676heurdata->nunsucc = (*result ==
SCIP_FOUNDSOL) ? 0 : heurdata->nunsucc + 1;
703assert(heur !=
NULL);
713 "initial regularization right-hand side value",
717 "regularization update factor",
721 "maximum number of NLP iterations per solve",
725 "maximum cost available for solving NLPs per call of the heuristic",
729 "factor by which heuristic should at least improve the incumbent",
733 "minimum amount of gap left in order to call the heuristic",
737 "maximum number of iterations of the MPEC loop",
741 "maximum number of NLP iterations per solve",
745 "maximum number of consecutive calls for which the heuristic did not find an improving solution",
power and signed power expression handlers
variable expression handler
SCIP_RETCODE SCIPcreateExprVar(SCIP *scip, SCIP_EXPR **expr, SCIP_VAR *var, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprSum(SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefficients, SCIP_Real constant, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprPow(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPgetNIntVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPapplyHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_SOL *refpoint, SCIP_SOL *resultsol)
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 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 SCIPincludeHeurMpec(SCIP *scip)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
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 SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
const char * SCIPheurGetName(SCIP_HEUR *heur)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPaddNlpiProblemNlRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_NLROW **nlrows, int nnlrows)
SCIP_RETCODE SCIPcreateNlpiProblemFromNlRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **nlpiprob, const char *name, SCIP_NLROW **nlrows, int nnlrows, SCIP_HASHMAP *var2idx, SCIP_HASHMAP *nlrow2idx, SCIP_Real *nlscore, SCIP_Real cutoffbound, SCIP_Bool setobj, SCIP_Bool onlyconvex)
int SCIPgetNNlpis(SCIP *scip)
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
int SCIPgetNNLPNlRows(SCIP *scip)
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
SCIP_EXPR * SCIPnlrowGetExpr(SCIP_NLROW *nlrow)
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPR *expr, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
int SCIPgetNSols(SCIP *scip)
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 SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_Real SCIPgetGap(SCIP *scip)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
int SCIPsnprintf(char *t, int len, const char *s,...)
#define DEFAULT_SUBNLPTRIGGER
#define DEFAULT_MAXNUNSUCC
#define DEFAULT_MAXNLPITER
static SCIP_DECL_HEUREXITSOL(heurExitsolMpec)
#define DEFAULT_MINGAPLEFT
static SCIP_RETCODE createNLP(SCIP *scip, SCIP_HEURDATA *heurdata)
#define DEFAULT_MAXNLPCOST
#define DEFAULT_MINIMPROVE
static SCIP_DECL_HEURFREE(heurFreeMpec)
static SCIP_DECL_HEURINITSOL(heurInitsolMpec)
static SCIP_RETCODE heurExec(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RESULT *result)
static SCIP_DECL_HEUREXEC(heurExecMpec)
static SCIP_DECL_HEURCOPY(heurCopyMpec)
static SCIP_RETCODE freeNLP(SCIP *scip, SCIP_HEURDATA *heurdata)
static SCIP_RETCODE addRegularScholtes(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **binvars, int nbinvars, SCIP_Real theta, SCIP_Bool update)
#define DEFAULT_INITTHETA
static int getExprSize(SCIP_EXPR *expr)
NLP local search primal heuristic using sub-SCIPs.
memory allocation routines
#define BMSclearMemory(ptr)
#define BMScopyMemoryArray(ptr, source, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
public functions to work with algebraic expressions
public methods for primal heuristics
public methods for message output
public data structures and miscellaneous methods
public methods for NLP management
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for primal heuristic plugins and divesets
public methods for memory management
public methods for message handling
public methods for nonlinear relaxation
public methods for NLPI solver interfaces
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for solutions
public methods for querying solving statistics
public methods for timing
struct SCIP_HeurData SCIP_HEURDATA
#define SCIP_NLPPARAM_DEFAULT(scip)
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
@ SCIP_NLPSOLSTAT_LOCINFEASIBLE
@ SCIP_NLPSOLSTAT_FEASIBLE
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4