63#define HEUR_NAME "shiftandpropagate"
64#define HEUR_DESC "Pre-root heuristic to expand an auxiliary branch-and-bound tree and apply propagation techniques"
65#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_PROP
66#define HEUR_PRIORITY 1000
69#define HEUR_MAXDEPTH -1
70#define HEUR_TIMING SCIP_HEURTIMING_BEFORENODE
71#define HEUR_USESSUBSCIP FALSE
73#define DEFAULT_WEIGHT_INEQUALITY 1
74#define DEFAULT_WEIGHT_EQUALITY 3
75#define DEFAULT_RELAX TRUE
76#define DEFAULT_PROBING TRUE
77#define DEFAULT_ONLYWITHOUTSOL TRUE
78#define DEFAULT_NPROPROUNDS 10
79#define DEFAULT_PROPBREAKER 65000
80#define DEFAULT_CUTOFFBREAKER 15
81#define DEFAULT_RANDSEED 29
82#define DEFAULT_SORTKEY 'v'
83#define DEFAULT_SORTVARS TRUE
84#define DEFAULT_COLLECTSTATS TRUE
85#define DEFAULT_STOPAFTERFEASIBLE TRUE
86#define DEFAULT_PREFERBINARIES TRUE
87#define DEFAULT_SELECTBEST FALSE
88#define DEFAULT_MAXCUTOFFQUOT 0.0
89#define SORTKEYS "nrtuv"
91#define DEFAULT_NOZEROFIXING FALSE
92#define DEFAULT_FIXBINLOCKS TRUE
93#define DEFAULT_BINLOCKSFIRST FALSE
94#define DEFAULT_NORMALIZE TRUE
95#define DEFAULT_UPDATEWEIGHTS FALSE
96#define DEFAULT_IMPLISCONTINUOUS TRUE
97#define DEFAULT_MINFIXINGRATELP 0.0
99#define EVENTHDLR_NAME "eventhdlrshiftandpropagate"
100#define EVENTHDLR_DESC "event handler to catch bound changes"
101#define EVENTTYPE_SHIFTANDPROPAGATE (SCIP_EVENTTYPE_BOUNDCHANGED | SCIP_EVENTTYPE_GBDCHANGED)
159struct ConstraintMatrix
182struct SCIP_EventhdlrData
234 assert(0 <= rowindex && rowindex < matrix->nrows);
236 arrayposition = matrix->rowmatbegin[rowindex];
238 if ( nrowvals !=
NULL )
240 if( rowindex == matrix->nrows - 1 )
241 *nrowvals = matrix->nnonzs - arrayposition;
243 *nrowvals = matrix->rowmatbegin[rowindex + 1] - arrayposition;
246 if( valpointer !=
NULL )
247 *valpointer = &(matrix->rowmatvals[arrayposition]);
248 if( indexpointer !=
NULL )
249 *indexpointer = &(matrix->rowmatind[arrayposition]);
252 *lhs = matrix->lhs[rowindex];
255 *rhs = matrix->rhs[rowindex];
271 assert(0 <= colindex && colindex < matrix->ncols);
273 arrayposition = matrix->colmatbegin[colindex];
275 if( ncolvals !=
NULL )
277 if( colindex == matrix->ncols - 1 )
278 *ncolvals = matrix->nnonzs - arrayposition;
280 *ncolvals = matrix->colmatbegin[colindex + 1] - arrayposition;
282 if( valpointer !=
NULL )
283 *valpointer = &(matrix->colmatvals[arrayposition]);
285 if( indexpointer !=
NULL )
286 *indexpointer = &(matrix->colmatind[arrayposition]);
326 assert(matrix->normalized);
328 for(
r = 0;
r < ncolvals; ++
r )
347 assert(0 <= rowindex && rowindex < matrix->nrows);
367 matrix->lhs[rowindex] -= colval * lhsvarbound;
372 matrix->rhs[rowindex] -= colval * rhsvarbound;
376 SCIPdebugMsg(
scip,
"Row <%s> changed:Coefficient <%g>, LHS <%g> --> <%g>, RHS <%g> --> <%g>\n",
377 SCIProwGetName(colrow), colval, lhs, matrix->lhs[rowindex], rhs, matrix->rhs[rowindex]);
407 assert(0 <= colpos && colpos < heurdata->nlpcols);
418 negatecoeffs =
FALSE;
428 deltashift = matrix->transformshiftvals[colpos];
429 matrix->transformshiftvals[colpos] = 0.0;
438 matrix->transformshiftvals[colpos] = lb;
447 matrix->transformshiftvals[colpos] = ub;
473 for(
i = 0;
i < nrows; ++
i )
475 int rowpos = rows[
i];
477 assert(rowpos < matrix->nrows);
480 matrix->lhs[rowpos] -= (vals[
i]) * deltashift;
483 matrix->rhs[rowpos] -= (vals[
i]) * deltashift;
486 (vals[
i]) = -(vals[
i]);
491 SCIPdebugMsg(
scip,
"Variable <%s> at colpos %d transformed. Status %d LB <%g> --> <%g>, UB <%g> --> <%g>\n",
492 SCIPvarGetName(
var), colpos, matrix->transformstatus[colpos], lb, 0.0, ub, matrix->upperbounds[colpos]);
526 SCIPdebugMsg(
scip,
"entering Matrix Initialization method of SHIFTANDPROPAGATE heuristic!\n");
533 matrix->nrows = nrows;
535 matrix->normalized =
FALSE;
536 matrix->ndiscvars = 0;
538 impliscontinuous =
heurdata->impliscontinuous;
541 for( j = 0; j < ncols; ++j )
553 matrix->ncols = matrix->ndiscvars;
555 if( matrix->nnonzs == 0 )
557 SCIPdebugMsg(
scip,
"No matrix entries - Terminating initialization of matrix.\n");
559 *initialized =
FALSE;
580 for( j = 0; j < matrix->ndiscvars; ++j )
589 for(
i = 0;
i < nrows; ++
i )
607 matrix->rowmatbegin[
i] = currentpointer;
624 SCIPdebugMsg(
scip,
" Matrix initialization stopped because of row infeasibility! \n");
629 for( j = 0; j < nrowlpnonz; ++j )
634 assert(currentpointer < matrix->nnonzs);
636 matrix->rowmatvals[currentpointer] = rowvals[j];
643 matrix->normalized =
TRUE;
648 assert(currentpointer == matrix->nnonzs);
653 for( j = 0; j < matrix->ncols; ++j )
662 currentcol = lpcols[j];
668 matrix->colnorms[j] = ncolnonz;
670 *nmaxrows =
MAX(*nmaxrows, ncolnonz);
673 matrix->colmatbegin[j] = currentpointer;
675 for(
i = 0;
i < ncolnonz; ++
i )
682 assert(currentpointer < matrix->nnonzs);
683 matrix->colmatvals[currentpointer] = colvals[
i];
690 matrix->colnorms[j] +=
ABS(normval);
694 assert(currentpointer == matrix->nnonzs);
697 for( j = 0; j < (relax ? ncols : matrix->ndiscvars); ++j )
704 matrix->transformshiftvals[j] = 0.0;
717 SCIPdebugMsg(
scip,
"Matrix initialized for %d discrete variables with %d cols, %d rows and %d nonzero entries\n",
718 matrix->ndiscvars, matrix->ncols, matrix->nrows, matrix->nnonzs);
733 if( (*matrix)->nnonzs > 0 )
745 assert((*matrix)->transformshiftvals !=
NULL);
762 (*matrix)->nrows = 0;
763 (*matrix)->ncols = 0;
798 assert(*nviolatedrows < matrix->nrows);
800 violatedrows[*nviolatedrows] = rowindex;
801 violatedrowpos[rowindex] = *nviolatedrows;
804 ++rowweights[rowindex];
812 if( violatedrowpos[rowindex] != *nviolatedrows - 1 )
814 assert(*nviolatedrows - 1 >= 0);
815 violatedrows[violatedrowpos[rowindex]] = violatedrows[*nviolatedrows - 1];
816 violatedrowpos[violatedrows[*nviolatedrows - 1]] = violatedrowpos[rowindex];
820 violatedrowpos[rowindex] = -1;
826 for(
c = 0;
c < ncols; ++
c )
828 matrix->violrows[cols[
c]] += violadd;
829 assert(matrix->violrows[cols[
c]] >= 0);
856 assert(-1 <= colidx && colidx < matrix->ncols);
863 nrows = matrix->nrows;
868 for(
i = 0;
i < nrows; ++
i )
869 violatedrowpos[
i] = -1;
875 assert(colidx < 0 || *nviolatedrows >= 0);
878 for(
i = 0;
i < nrows; ++
i )
884 rowpos = rowindices[
i];
889 checkRowViolation(
scip, matrix, rowpos, violatedrows, violatedrowpos, nviolatedrows, rowweights, updateweights);
911 status = matrix->transformstatus[varindex];
919 return solvalue + matrix->transformshiftvals[varindex];
924 return matrix->transformshiftvals[varindex] - solvalue;
939 int* violationchange,
961 assert(direction == 1 || direction == -1);
963 upperbound = matrix->upperbounds[varindex];
973 for(
i = 0;
i < nrows; ++
i )
985 lhs = matrix->lhs[rowpos];
986 rhs = matrix->rhs[rowpos];
987 rowweight = rowweights[rowpos];
988 val = direction * vals[
i];
1013 slacksurplus -= val;
1020 slacksurplus += val;
1026 steps[
i] = maxfeasshift + 1.0;
1027 violationchange[
i] = rowweight;
1032 steps[
i] = upperbound;
1033 violationchange[
i] = 0;
1064 steps[
i] = minfeasshift;
1065 violationchange[
i] = -rowweight;
1070 steps[
i] = upperbound;
1071 violationchange[
i] = 0;
1082 *beststep = direction * upperbound;
1104 sum += violationchange[
i];
1109 if( (
i == nrows-1 || steps[
i+1] > steps[
i]) && sum < *rowviolations )
1111 *rowviolations = sum;
1112 *beststep = direction * steps[
i];
1115 assert(*rowviolations <= 0);
1134 int* violatedrowpos,
1144 assert(0 <= varindex && varindex < matrix->ndiscvars);
1148 status = matrix->transformstatus[varindex];
1150 SCIPdebugMsg(
scip,
" Variable <%d> [%g,%g], status %d(%g), ub %g \n", varindex, lb, ub, status,
1151 matrix->transformshiftvals[varindex], matrix->upperbounds[varindex]);
1153 checkviolations =
FALSE;
1161 checkviolations =
TRUE;
1165 deltashift = lb - (matrix->transformshiftvals[varindex]);
1166 matrix->transformshiftvals[varindex] = lb;
1168 matrix->upperbounds[varindex] = ub - lb;
1177 checkviolations =
TRUE;
1181 deltashift = (matrix->transformshiftvals[varindex]) - ub;
1182 matrix->transformshiftvals[varindex] = ub;
1198 checkviolations =
TRUE;
1207 SCIPerrorMessage(
"Error: Invalid variable status <%d> in shift and propagagate heuristic, aborting!\n", status);
1225 for(
i = 0;
i < nrows; ++
i )
1227 SCIPdebugMsg(
scip,
" update slacks of row<%d>: coefficient <%g>, %g <= 0 <= %g \n",
1228 rows[
i], vals[
i], matrix->lhs[rows[
i]], matrix->rhs[rows[
i]]);
1231 matrix->lhs[rows[
i]] -= (vals[
i]) * deltashift;
1234 matrix->rhs[rows[
i]] -= (vals[
i]) * deltashift;
1236 checkviolations =
TRUE;
1240 if( checkviolations )
1243 SCIPdebugMsg(
scip,
" Variable <%d> [%g,%g], status %d(%g), ub %g \n", varindex, lb, ub, status,
1244 matrix->transformshiftvals[varindex], matrix->upperbounds[varindex]);
1270 if( vartype1 < vartype2 )
1272 if( vartype1 > vartype2 )
1275 assert(vartype1 == vartype2);
1298 " DETAILS : %d violations left, %d probing status\n",
1394 int* violationchange;
1397 int* violatedrowpos;
1399 int* violatedvarrows;
1404 int lastindexofsusp;
1434 SCIPdebugMsg(
scip,
"entering execution method of shift and propagate heuristic\n");
1474 if(
nlprows == 0 || nlpcols == 0 )
1478 initialized =
FALSE;
1484 impliscontinuous =
heurdata->impliscontinuous;
1502 for(
c = 0;
c < nlpcols; ++
c )
1525 assert(nbinvars + nintvars <= ndiscvars);
1551 if( !initialized || infeasible )
1553 SCIPdebugMsg(
scip,
" MATRIX not initialized -> Execution of heuristic stopped! \n");
1560 if( matrix->ndiscvars < ndiscvars )
1562 SCIPdebugMsg(
scip,
"Not all discrete variables are in the current LP. Shiftandpropagate execution terminated.\n");
1568 eventhdlrdata->matrix = matrix;
1569 eventhdlrdata->heurdata =
heurdata;
1586 eventhdlrdata->violatedrows = violatedrows;
1587 eventhdlrdata->violatedrowpos = violatedrowpos;
1588 eventhdlrdata->nviolatedrows = &nviolatedrows;
1591 for(
i = 0;
i < ndiscvars; ++
i )
1595 for(
r = 0;
r < matrix->nrows; ++
r )
1602 colnorms = matrix->colnorms;
1617 violatedvarrows =
NULL;
1632 if( nbinvars < ndiscvars )
1639 SCIPdebugMsg(
scip,
"Variables sorted down w.r.t their normalized columns!\n");
1647 if( nbinvars < ndiscvars )
1648 SCIPsortRealInt(&colnorms[nbinvars], &permutation[nbinvars], ndiscvars - nbinvars);
1663 if( nbinvars < ndiscvars )
1664 SCIPsortDownIntInt(&violatedvarrows[nbinvars], &permutation[nbinvars], ndiscvars - nbinvars);
1671 SCIPdebugMsg(
scip,
"Variables sorted down w.r.t their number of currently infeasible rows!\n");
1680 if( nbinvars < ndiscvars )
1681 SCIPsortIntInt(&violatedvarrows[nbinvars], &permutation[nbinvars], ndiscvars - nbinvars);
1688 SCIPdebugMsg(
scip,
"Variables sorted (upwards) w.r.t their number of currently infeasible rows!\n");
1696 if( nbinvars < ndiscvars )
1698 ndiscvars - nbinvars - 1);
1716 int nbinwithoutlocks = 0;
1721 for(
c = 0;
c < nbinvars; ++
c )
1731 for(
c = 0;
c < ndiscvars; ++
c )
1743 if( nbinwithoutlocks > 0 )
1751 while(
c < nbinwithoutlocks &&
b < ndiscvars )
1764 if(
c >= nbinwithoutlocks )
1768 if(
c >= nbinwithoutlocks )
1786 tmp = permutation[
b];
1787 permutation[
b] = permutation[
c];
1788 permutation[
c] = tmp;
1797 for(
c = 0;
c < ndiscvars; ++
c )
1810 for(
c = 0;
c < matrix->ndiscvars; ++
c )
1821 eventdatas[
c]->colpos =
c;
1828 lastindexofsusp = -1;
1832 SCIPdebugMsg(
scip,
"SHIFT_AND_PROPAGATE heuristic starts main loop with %d violations and %d remaining variables!\n",
1833 nviolatedrows, ndiscvars);
1835 assert(matrix->ndiscvars == ndiscvars);
1838 for(
c = 0;
c < ndiscvars; ++
c )
1847 int permutedvarindex;
1854 while( j < ndiscvars )
1857 if( matrix->violrows[permutation[
c]] < matrix->violrows[permutation[j]] )
1860 tmp = permutation[
c];
1861 permutation[
c] = permutation[j];
1862 permutation[j] = tmp;
1867 permutedvarindex = permutation[
c];
1868 optimalshiftvalue = 0.0;
1892 SCIPdebugMsg(
scip,
"Variable %s with local bounds [%g,%g], status <%d>, matrix bound <%g>\n",
1893 SCIPvarGetName(
var), lb, ub, matrix->transformstatus[permutedvarindex], matrix->upperbounds[permutedvarindex]);
1906 marksuspicious =
FALSE;
1926 if( !
heurdata->stopafterfeasible || nviolatedrows > 0 )
1930 &optimalshiftvalue, &nviolations) );
1937 int ndownviolations;
1939 downshiftvalue = 0.0;
1940 ndownviolations = 0;
1942 &downshiftvalue, &ndownviolations) );
1947 if( ndownviolations < nviolations )
1949 optimalshiftvalue = downshiftvalue;
1954 optimalshiftvalue = 0.0;
1958 marksuspicious =
TRUE;
1975 if( !marksuspicious && probing )
1986 SCIPdebugMsg(
scip,
" Shift %g(%g originally) is optimal, propagate solution\n", optimalshiftvalue, origsolval);
2066 marksuspicious =
TRUE;
2070 if( marksuspicious )
2073 assert(permutedvarindex == permutation[
c]);
2076 assert(lastindexofsusp >= 0 && lastindexofsusp <=
c);
2078 permutation[
c] = permutation[lastindexofsusp];
2079 permutation[lastindexofsusp] = permutedvarindex;
2081 SCIPdebugMsg(
scip,
" Suspicious variable! Postponed from pos <%d> to position <%d>\n",
c, lastindexofsusp);
2085 SCIPdebugMsg(
scip,
"Variable <%d><%s> successfully shifted by value <%g>!\n", permutedvarindex,
2098 SCIPdebugMsg(
scip,
"Heuristic finished with %d remaining violations and %d remaining variables!\n",
2099 nviolatedrows, lastindexofsusp + 1);
2104 if( nviolatedrows == 0 && !
cutoff )
2110 for( v = 0; v <= lastindexofsusp; ++v )
2114 int permutedvarindex;
2117 permutedvarindex = permutation[v];
2139 if( nviolatedrows > 0 )
2145 if( nlpcols != matrix->ndiscvars )
2150 int nfixedvars = ndiscvars;
2155 for( v = ndiscvars; v <
nvars && nfixedvars < nminfixings; ++v )
2161 solvelp = (nfixedvars >= nminfixings);
2163 SCIPdebugMsg(
scip,
"Fixed %d of %d (%.1f %%) variables after probing -> %s\n",
2165 solvelp ?
"continue and solve LP for remaining variables" :
"terminate without LP");
2187 for( v = 0; v < ndiscvars; ++v )
2204 if( nunfixedcols > 0.5 * ncols )
2207 "Heuristic " HEUR_NAME " solving LP from scratch with %.1f %% unfixed columns (%d of %d) ...\n",
2208 100.0 * (nunfixedcols / (
SCIP_Real)ncols), nunfixedcols, ncols);
2228 SCIPwarningMessage(
scip,
"Error while solving LP in SHIFTANDPROPAGATE heuristic; LP solve terminated with code <%d>\n",
2262 printreason =
FALSE;
2285 SCIPdebugMsg(
scip,
"Solution constructed by heuristic is already known to be infeasible\n");
2292 for(
c = matrix->ndiscvars - 1;
c >= 0; --
c )
2305 if( violatedvarrows !=
NULL )
2319 eventhdlrdata->nviolatedrows =
NULL;
2320 eventhdlrdata->violatedrowpos =
NULL;
2321 eventhdlrdata->violatedrows =
NULL;
2335 eventhdlrdata->matrix =
NULL;
2361 matrix = eventhdlrdata->matrix;
2363 heurdata = eventhdlrdata->heurdata;
2366 colpos = eventdata->colpos;
2368 assert(0 <= colpos && colpos < matrix->ndiscvars);
2377 eventhdlrdata->violatedrowpos, eventhdlrdata->nviolatedrows) );
2397 eventhandlerdata->matrix =
NULL;
2401 eventExecShiftandpropagate, eventhandlerdata) );
2428 "The number of propagation rounds used for each propagation",
2435 "Should heuristic only be executed if no primal solution was found, yet?",
2440 "the key for variable sorting: (n)orms down, norms (u)p, (v)iolations down, viola(t)ions up, or (r)andom",
2447 "Should the heuristic stop calculating optimal shift values when no more rows are violated?",
2450 "Should binary variables be shifted first?",
2453 "should variables with a zero shifting value be delayed instead of being fixed?",
2456 "should binary variables with no locks in one direction be fixed to that direction?",
2459 "should binary variables with no locks be preferred in the ordering?",
2462 "should coefficients be normalized by max row coeff for col norm?",
2465 "should row weight be increased every time the row is violated?",
2468 "should implicit integer variables be treated as continuous variables?",
2471 "should the heuristic choose the best candidate in every round? (set to FALSE for static order)?",
2474 "maximum percentage of allowed cutoffs before stopping the heuristic",
2477 "minimum fixing rate over all variables (including continuous) to solve LP",
#define DEFAULT_NORMALIZE
#define SCIP_MAXTREEDEPTH
#define SCIP_LONGINT_FORMAT
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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)
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 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)
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randnumgen, int *array, int begin, int end)
SCIP_RETCODE SCIPincludeHeurShiftandpropagate(SCIP *scip)
SCIP_Bool SCIPisCertified(SCIP *scip)
int SCIPcolGetLPPos(SCIP_COL *col)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Bool SCIPcolIsIntegral(SCIP_COL *col)
SCIP_Bool SCIPcolIsImpliedIntegral(SCIP_COL *col)
SCIP_Real * SCIPcolGetVals(SCIP_COL *col)
SCIP_ROW ** SCIPcolGetRows(SCIP_COL *col)
int SCIPcolGetNLPNonz(SCIP_COL *col)
SCIP_Bool SCIPcolIsInLP(SCIP_COL *col)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur,)
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 SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur,)
void SCIPheurMarkExact(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur,)
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur,)
const char * SCIPheurGetName(SCIP_HEUR *heur)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPflushLP(SCIP *scip)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
int SCIPgetNLPRows(SCIP *scip)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
int SCIPgetNUnfixedLPCols(SCIP *scip)
int SCIPgetNLPCols(SCIP *scip)
SCIP_RETCODE SCIPwriteLP(SCIP *scip, const char *filename)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBuffer(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
int SCIPgetProbingDepth(SCIP *scip)
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
char * SCIPsnprintfProbingStats(SCIP *scip, char *strbuf, int len)
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
int SCIProwGetNLPNonz(SCIP_ROW *row)
int SCIProwGetLPPos(SCIP_ROW *row)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
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)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
void SCIPsolSetHeur(SCIP_SOL *sol, SCIP_HEUR *heur)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
void SCIPdisableVarHistory(SCIP *scip)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Bool SCIPvarIsImpliedIntegral(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
void SCIPenableVarHistory(SCIP *scip)
SCIP_Bool SCIPvarIsInLP(SCIP_VAR *var)
void SCIPsortDownIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortIntInt(int *intarray1, int *intarray2, int len)
void SCIPsortRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
SCIPfreeSol(scip, &heurdata->sol))
SCIPcreateSol(scip, &heurdata->sol, heur))
SCIPfreeRandom(scip, &heurdata->randnumgen)
#define DEFAULT_ONLYWITHOUTSOL
static SCIP_LPSOLSTAT lpsolstat
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
SCIPlinkLPSol(scip, sol))
#define DEFAULT_MINFIXINGRATELP
static void relaxVar(SCIP *scip, SCIP_VAR *var, CONSTRAINTMATRIX *matrix)
static void transformVariable(SCIP *scip, CONSTRAINTMATRIX *matrix, SCIP_HEURDATA *heurdata, int colpos)
static SCIP_RETCODE getOptimalShiftingValue(SCIP *scip, CONSTRAINTMATRIX *matrix, int varindex, int direction, int *rowweights, SCIP_Real *steps, int *violationchange, SCIP_Real *beststep, int *rowviolations)
static void getRowData(CONSTRAINTMATRIX *matrix, int rowindex, SCIP_Real **valpointer, SCIP_Real *lhs, SCIP_Real *rhs, int **indexpointer, int *nrowvals)
static void checkRowViolation(SCIP *scip, CONSTRAINTMATRIX *matrix, int rowindex, int *violatedrows, int *violatedrowpos, int *nviolatedrows, int *rowweights, SCIP_Bool updateweights)
static SCIP_Bool colIsDiscrete(SCIP_COL *col, SCIP_Bool impliscontinuous)
#define DEFAULT_PROPBREAKER
#define DEFAULT_IMPLISCONTINUOUS
#define DEFAULT_PREFERBINARIES
#define DEFAULT_NPROPROUNDS
#define DEFAULT_FIXBINLOCKS
static void freeMatrix(SCIP *scip, CONSTRAINTMATRIX **matrix)
#define DEFAULT_SELECTBEST
#define DEFAULT_BINLOCKSFIRST
static SCIP_RETCODE updateTransformation(SCIP *scip, CONSTRAINTMATRIX *matrix, SCIP_HEURDATA *heurdata, int varindex, SCIP_Real lb, SCIP_Real ub, int *violatedrows, int *violatedrowpos, int *nviolatedrows)
#define DEFAULT_MAXCUTOFFQUOT
#define DEFAULT_CUTOFFBREAKER
enum TransformStatus TRANSFORMSTATUS
#define DEFAULT_WEIGHT_INEQUALITY
#define DEFAULT_NOZEROFIXING
static void checkViolations(SCIP *scip, CONSTRAINTMATRIX *matrix, int colidx, int *violatedrows, int *violatedrowpos, int *nviolatedrows, int *rowweights, SCIP_Bool updateweights)
#define DEFAULT_UPDATEWEIGHTS
#define DEFAULT_COLLECTSTATS
static SCIP_Real retransformVariable(SCIP *scip, CONSTRAINTMATRIX *matrix, SCIP_VAR *var, int varindex, SCIP_Real solvalue)
static SCIP_Bool varIsDiscrete(SCIP_VAR *var, SCIP_Bool impliscontinuous)
struct ConstraintMatrix CONSTRAINTMATRIX
#define DEFAULT_WEIGHT_EQUALITY
static void getColumnData(CONSTRAINTMATRIX *matrix, int colindex, SCIP_Real **valpointer, int **indexpointer, int *ncolvals)
#define DEFAULT_STOPAFTERFEASIBLE
static SCIP_RETCODE initMatrix(SCIP *scip, CONSTRAINTMATRIX *matrix, SCIP_HEURDATA *heurdata, int *colposs, int *nmaxrows, SCIP_Bool relax, SCIP_Bool *initialized, SCIP_Bool *infeasible)
#define EVENTTYPE_SHIFTANDPROPAGATE
preroot heuristic that alternatingly fixes variables and propagates domains
memory allocation routines
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
public methods for managing events
public methods for primal heuristics
public methods for LP management
public methods for message output
#define SCIPstatisticMessage
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for primal CIP solutions
public methods for problem variables
public methods for certified solving
public methods for event handler plugins and event handlers
public methods for exact solving
public methods for primal heuristic plugins and divesets
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for the probing mode
public methods for random numbers
public methods for solutions
public methods for querying solving statistics
public methods for the branch-and-bound tree
public methods for SCIP variables
struct SCIP_Eventhdlr SCIP_EVENTHDLR
struct SCIP_EventData SCIP_EVENTDATA
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_DECL_HEURCOPY(x)
struct SCIP_HeurData SCIP_HEURDATA
struct SCIP_Heur SCIP_HEUR
#define SCIP_DECL_HEURINIT(x)
#define SCIP_DECL_HEUREXIT(x)
#define SCIP_DECL_HEURFREE(x)
#define SCIP_DECL_HEUREXEC(x)
enum SCIP_LPSolStat SCIP_LPSOLSTAT
@ SCIP_LPSOLSTAT_NOTSOLVED
#define SCIP_DECL_SORTPTRCOMP(x)
struct SCIP_RandNumGen SCIP_RANDNUMGEN
enum SCIP_Retcode SCIP_RETCODE
#define SCIP_DEPRECATED_VARTYPE_IMPLINT
enum SCIP_Vartype SCIP_VARTYPE