61#define HEUR_NAME "shiftandpropagate"
62#define HEUR_DESC "Pre-root heuristic to expand an auxiliary branch-and-bound tree and apply propagation techniques"
63#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_PROP
64#define HEUR_PRIORITY 1000
67#define HEUR_MAXDEPTH -1
68#define HEUR_TIMING SCIP_HEURTIMING_BEFORENODE
69#define HEUR_USESSUBSCIP FALSE
71#define DEFAULT_WEIGHT_INEQUALITY 1
72#define DEFAULT_WEIGHT_EQUALITY 3
73#define DEFAULT_RELAX TRUE
74#define DEFAULT_PROBING TRUE
75#define DEFAULT_ONLYWITHOUTSOL TRUE
76#define DEFAULT_NPROPROUNDS 10
77#define DEFAULT_PROPBREAKER 65000
78#define DEFAULT_CUTOFFBREAKER 15
79#define DEFAULT_RANDSEED 29
80#define DEFAULT_SORTKEY 'v'
81#define DEFAULT_SORTVARS TRUE
82#define DEFAULT_COLLECTSTATS TRUE
83#define DEFAULT_STOPAFTERFEASIBLE TRUE
84#define DEFAULT_PREFERBINARIES TRUE
85#define DEFAULT_SELECTBEST FALSE
86#define DEFAULT_MAXCUTOFFQUOT 0.0
87#define SORTKEYS "nrtuv"
89#define DEFAULT_NOZEROFIXING FALSE
90#define DEFAULT_FIXBINLOCKS TRUE
91#define DEFAULT_BINLOCKSFIRST FALSE
92#define DEFAULT_NORMALIZE TRUE
93#define DEFAULT_UPDATEWEIGHTS FALSE
94#define DEFAULT_IMPLISCONTINUOUS TRUE
95#define DEFAULT_MINFIXINGRATELP 0.0
97#define EVENTHDLR_NAME "eventhdlrshiftandpropagate"
98#define EVENTHDLR_DESC "event handler to catch bound changes"
99#define EVENTTYPE_SHIFTANDPROPAGATE (SCIP_EVENTTYPE_BOUNDCHANGED | SCIP_EVENTTYPE_GBDCHANGED)
157struct ConstraintMatrix
180struct SCIP_EventhdlrData
232 assert(0 <= rowindex && rowindex < matrix->nrows);
234 arrayposition = matrix->rowmatbegin[rowindex];
236 if ( nrowvals !=
NULL )
238 if( rowindex == matrix->nrows - 1 )
239 *nrowvals = matrix->nnonzs - arrayposition;
241 *nrowvals = matrix->rowmatbegin[rowindex + 1] - arrayposition;
244 if( valpointer !=
NULL )
245 *valpointer = &(matrix->rowmatvals[arrayposition]);
246 if( indexpointer !=
NULL )
247 *indexpointer = &(matrix->rowmatind[arrayposition]);
250 *lhs = matrix->lhs[rowindex];
253 *rhs = matrix->rhs[rowindex];
269 assert(0 <= colindex && colindex < matrix->ncols);
271 arrayposition = matrix->colmatbegin[colindex];
273 if( ncolvals !=
NULL )
275 if( colindex == matrix->ncols - 1 )
276 *ncolvals = matrix->nnonzs - arrayposition;
278 *ncolvals = matrix->colmatbegin[colindex + 1] - arrayposition;
280 if( valpointer !=
NULL )
281 *valpointer = &(matrix->colmatvals[arrayposition]);
283 if( indexpointer !=
NULL )
284 *indexpointer = &(matrix->colmatind[arrayposition]);
324 assert(matrix->normalized);
326 for(
r = 0;
r < ncolvals; ++
r )
345 assert(0 <= rowindex && rowindex < matrix->nrows);
365 matrix->lhs[rowindex] -= colval * lhsvarbound;
370 matrix->rhs[rowindex] -= colval * rhsvarbound;
374 SCIPdebugMsg(
scip,
"Row <%s> changed:Coefficient <%g>, LHS <%g> --> <%g>, RHS <%g> --> <%g>\n",
375 SCIProwGetName(colrow), colval, lhs, matrix->lhs[rowindex], rhs, matrix->rhs[rowindex]);
405 assert(0 <= colpos && colpos < heurdata->nlpcols);
416 negatecoeffs =
FALSE;
426 deltashift = matrix->transformshiftvals[colpos];
427 matrix->transformshiftvals[colpos] = 0.0;
436 matrix->transformshiftvals[colpos] = lb;
445 matrix->transformshiftvals[colpos] = ub;
471 for(
i = 0;
i < nrows; ++
i )
473 int rowpos = rows[
i];
475 assert(rowpos < matrix->nrows);
478 matrix->lhs[rowpos] -= (vals[
i]) * deltashift;
481 matrix->rhs[rowpos] -= (vals[
i]) * deltashift;
484 (vals[
i]) = -(vals[
i]);
489 SCIPdebugMsg(
scip,
"Variable <%s> at colpos %d transformed. Status %d LB <%g> --> <%g>, UB <%g> --> <%g>\n",
490 SCIPvarGetName(
var), colpos, matrix->transformstatus[colpos], lb, 0.0, ub, matrix->upperbounds[colpos]);
524 SCIPdebugMsg(
scip,
"entering Matrix Initialization method of SHIFTANDPROPAGATE heuristic!\n");
531 matrix->nrows = nrows;
533 matrix->normalized =
FALSE;
534 matrix->ndiscvars = 0;
536 impliscontinuous =
heurdata->impliscontinuous;
539 for( j = 0; j < ncols; ++j )
551 matrix->ncols = matrix->ndiscvars;
553 if( matrix->nnonzs == 0 )
555 SCIPdebugMsg(
scip,
"No matrix entries - Terminating initialization of matrix.\n");
557 *initialized =
FALSE;
578 for( j = 0; j < matrix->ndiscvars; ++j )
587 for(
i = 0;
i < nrows; ++
i )
605 matrix->rowmatbegin[
i] = currentpointer;
622 SCIPdebugMsg(
scip,
" Matrix initialization stopped because of row infeasibility! \n");
627 for( j = 0; j < nrowlpnonz; ++j )
632 assert(currentpointer < matrix->nnonzs);
634 matrix->rowmatvals[currentpointer] = rowvals[j];
641 matrix->normalized =
TRUE;
646 assert(currentpointer == matrix->nnonzs);
651 for( j = 0; j < matrix->ncols; ++j )
660 currentcol = lpcols[j];
666 matrix->colnorms[j] = ncolnonz;
668 *nmaxrows =
MAX(*nmaxrows, ncolnonz);
671 matrix->colmatbegin[j] = currentpointer;
673 for(
i = 0;
i < ncolnonz; ++
i )
680 assert(currentpointer < matrix->nnonzs);
681 matrix->colmatvals[currentpointer] = colvals[
i];
688 matrix->colnorms[j] +=
ABS(normval);
692 assert(currentpointer == matrix->nnonzs);
695 for( j = 0; j < (relax ? ncols : matrix->ndiscvars); ++j )
702 matrix->transformshiftvals[j] = 0.0;
715 SCIPdebugMsg(
scip,
"Matrix initialized for %d discrete variables with %d cols, %d rows and %d nonzero entries\n",
716 matrix->ndiscvars, matrix->ncols, matrix->nrows, matrix->nnonzs);
731 if( (*matrix)->nnonzs > 0 )
743 assert((*matrix)->transformshiftvals !=
NULL);
760 (*matrix)->nrows = 0;
761 (*matrix)->ncols = 0;
796 assert(*nviolatedrows < matrix->nrows);
798 violatedrows[*nviolatedrows] = rowindex;
799 violatedrowpos[rowindex] = *nviolatedrows;
802 ++rowweights[rowindex];
810 if( violatedrowpos[rowindex] != *nviolatedrows - 1 )
812 assert(*nviolatedrows - 1 >= 0);
813 violatedrows[violatedrowpos[rowindex]] = violatedrows[*nviolatedrows - 1];
814 violatedrowpos[violatedrows[*nviolatedrows - 1]] = violatedrowpos[rowindex];
818 violatedrowpos[rowindex] = -1;
824 for(
c = 0;
c < ncols; ++
c )
826 matrix->violrows[cols[
c]] += violadd;
827 assert(matrix->violrows[cols[
c]] >= 0);
854 assert(-1 <= colidx && colidx < matrix->ncols);
861 nrows = matrix->nrows;
866 for(
i = 0;
i < nrows; ++
i )
867 violatedrowpos[
i] = -1;
873 assert(colidx < 0 || *nviolatedrows >= 0);
876 for(
i = 0;
i < nrows; ++
i )
882 rowpos = rowindices[
i];
887 checkRowViolation(
scip, matrix, rowpos, violatedrows, violatedrowpos, nviolatedrows, rowweights, updateweights);
909 status = matrix->transformstatus[varindex];
917 return solvalue + matrix->transformshiftvals[varindex];
922 return matrix->transformshiftvals[varindex] - solvalue;
937 int* violationchange,
959 assert(direction == 1 || direction == -1);
961 upperbound = matrix->upperbounds[varindex];
971 for(
i = 0;
i < nrows; ++
i )
983 lhs = matrix->lhs[rowpos];
984 rhs = matrix->rhs[rowpos];
985 rowweight = rowweights[rowpos];
986 val = direction * vals[
i];
1011 slacksurplus -= val;
1018 slacksurplus += val;
1024 steps[
i] = maxfeasshift + 1.0;
1025 violationchange[
i] = rowweight;
1030 steps[
i] = upperbound;
1031 violationchange[
i] = 0;
1062 steps[
i] = minfeasshift;
1063 violationchange[
i] = -rowweight;
1068 steps[
i] = upperbound;
1069 violationchange[
i] = 0;
1080 *beststep = direction * upperbound;
1102 sum += violationchange[
i];
1107 if( (
i == nrows-1 || steps[
i+1] > steps[
i]) && sum < *rowviolations )
1109 *rowviolations = sum;
1110 *beststep = direction * steps[
i];
1113 assert(*rowviolations <= 0);
1132 int* violatedrowpos,
1142 assert(0 <= varindex && varindex < matrix->ndiscvars);
1146 status = matrix->transformstatus[varindex];
1148 SCIPdebugMsg(
scip,
" Variable <%d> [%g,%g], status %d(%g), ub %g \n", varindex, lb, ub, status,
1149 matrix->transformshiftvals[varindex], matrix->upperbounds[varindex]);
1151 checkviolations =
FALSE;
1159 checkviolations =
TRUE;
1163 deltashift = lb - (matrix->transformshiftvals[varindex]);
1164 matrix->transformshiftvals[varindex] = lb;
1166 matrix->upperbounds[varindex] = ub - lb;
1175 checkviolations =
TRUE;
1179 deltashift = (matrix->transformshiftvals[varindex]) - ub;
1180 matrix->transformshiftvals[varindex] = ub;
1196 checkviolations =
TRUE;
1205 SCIPerrorMessage(
"Error: Invalid variable status <%d> in shift and propagagate heuristic, aborting!\n", status);
1223 for(
i = 0;
i < nrows; ++
i )
1225 SCIPdebugMsg(
scip,
" update slacks of row<%d>: coefficient <%g>, %g <= 0 <= %g \n",
1226 rows[
i], vals[
i], matrix->lhs[rows[
i]], matrix->rhs[rows[
i]]);
1229 matrix->lhs[rows[
i]] -= (vals[
i]) * deltashift;
1232 matrix->rhs[rows[
i]] -= (vals[
i]) * deltashift;
1234 checkviolations =
TRUE;
1238 if( checkviolations )
1241 SCIPdebugMsg(
scip,
" Variable <%d> [%g,%g], status %d(%g), ub %g \n", varindex, lb, ub, status,
1242 matrix->transformshiftvals[varindex], matrix->upperbounds[varindex]);
1331 " DETAILS : %d violations left, %d probing status\n",
1427 int* violationchange;
1430 int* violatedrowpos;
1432 int* violatedvarrows;
1437 int lastindexofsusp;
1467 SCIPdebugMsg(
scip,
"entering execution method of shift and propagate heuristic\n");
1504 if(
nlprows == 0 || nlpcols == 0 )
1508 initialized =
FALSE;
1514 impliscontinuous =
heurdata->impliscontinuous;
1532 for(
c = 0;
c < nlpcols; ++
c )
1581 if( !initialized || infeasible )
1583 SCIPdebugMsg(
scip,
" MATRIX not initialized -> Execution of heuristic stopped! \n");
1590 if( matrix->ndiscvars < ndiscvars )
1592 SCIPdebugMsg(
scip,
"Not all discrete variables are in the current LP. Shiftandpropagate execution terminated.\n");
1598 eventhdlrdata->matrix = matrix;
1599 eventhdlrdata->heurdata =
heurdata;
1616 eventhdlrdata->violatedrows = violatedrows;
1617 eventhdlrdata->violatedrowpos = violatedrowpos;
1618 eventhdlrdata->nviolatedrows = &nviolatedrows;
1621 for(
i = 0;
i < ndiscvars; ++
i )
1625 for(
r = 0;
r < matrix->nrows; ++
r )
1632 colnorms = matrix->colnorms;
1647 violatedvarrows =
NULL;
1669 SCIPdebugMsg(
scip,
"Variables sorted down w.r.t their normalized columns!\n");
1701 SCIPdebugMsg(
scip,
"Variables sorted down w.r.t their number of currently infeasible rows!\n");
1718 SCIPdebugMsg(
scip,
"Variables sorted (upwards) w.r.t their number of currently infeasible rows!\n");
1746 int nbinwithoutlocks = 0;
1761 for(
c = 0;
c < ndiscvars; ++
c )
1773 if( nbinwithoutlocks > 0 )
1781 while(
c < nbinwithoutlocks &&
b < ndiscvars )
1794 if(
c >= nbinwithoutlocks )
1798 if(
c >= nbinwithoutlocks )
1816 tmp = permutation[
b];
1817 permutation[
b] = permutation[
c];
1818 permutation[
c] = tmp;
1827 for(
c = 0;
c < ndiscvars; ++
c )
1840 for(
c = 0;
c < matrix->ndiscvars; ++
c )
1851 eventdatas[
c]->colpos =
c;
1858 lastindexofsusp = -1;
1862 SCIPdebugMsg(
scip,
"SHIFT_AND_PROPAGATE heuristic starts main loop with %d violations and %d remaining variables!\n",
1863 nviolatedrows, ndiscvars);
1865 assert(matrix->ndiscvars == ndiscvars);
1868 for(
c = 0;
c < ndiscvars; ++
c )
1877 int permutedvarindex;
1884 while( j < ndiscvars )
1887 if( matrix->violrows[permutation[
c]] < matrix->violrows[permutation[j]] )
1890 tmp = permutation[
c];
1891 permutation[
c] = permutation[j];
1892 permutation[j] = tmp;
1897 permutedvarindex = permutation[
c];
1898 optimalshiftvalue = 0.0;
1922 SCIPdebugMsg(
scip,
"Variable %s with local bounds [%g,%g], status <%d>, matrix bound <%g>\n",
1923 SCIPvarGetName(
var), lb, ub, matrix->transformstatus[permutedvarindex], matrix->upperbounds[permutedvarindex]);
1936 marksuspicious =
FALSE;
1956 if( !
heurdata->stopafterfeasible || nviolatedrows > 0 )
1960 &optimalshiftvalue, &nviolations) );
1967 int ndownviolations;
1969 downshiftvalue = 0.0;
1970 ndownviolations = 0;
1972 &downshiftvalue, &ndownviolations) );
1977 if( ndownviolations < nviolations )
1979 optimalshiftvalue = downshiftvalue;
1984 optimalshiftvalue = 0.0;
1988 marksuspicious =
TRUE;
2005 if( !marksuspicious && probing )
2016 SCIPdebugMsg(
scip,
" Shift %g(%g originally) is optimal, propagate solution\n", optimalshiftvalue, origsolval);
2096 marksuspicious =
TRUE;
2100 if( marksuspicious )
2103 assert(permutedvarindex == permutation[
c]);
2106 assert(lastindexofsusp >= 0 && lastindexofsusp <=
c);
2108 permutation[
c] = permutation[lastindexofsusp];
2109 permutation[lastindexofsusp] = permutedvarindex;
2111 SCIPdebugMsg(
scip,
" Suspicious variable! Postponed from pos <%d> to position <%d>\n",
c, lastindexofsusp);
2115 SCIPdebugMsg(
scip,
"Variable <%d><%s> successfully shifted by value <%g>!\n", permutedvarindex,
2128 SCIPdebugMsg(
scip,
"Heuristic finished with %d remaining violations and %d remaining variables!\n",
2129 nviolatedrows, lastindexofsusp + 1);
2134 if( nviolatedrows == 0 && !
cutoff )
2140 for( v = 0; v <= lastindexofsusp; ++v )
2144 int permutedvarindex;
2147 permutedvarindex = permutation[v];
2169 if( nviolatedrows > 0 )
2175 if( nlpcols != matrix->ndiscvars )
2180 int nfixedvars = ndiscvars;
2185 for( v = ndiscvars; v <
nvars && nfixedvars < nminfixings; ++v )
2191 solvelp = (nfixedvars >= nminfixings);
2193 SCIPdebugMsg(
scip,
"Fixed %d of %d (%.1f %%) variables after probing -> %s\n",
2195 solvelp ?
"continue and solve LP for remaining variables" :
"terminate without LP");
2217 for( v = 0; v < ndiscvars; ++v )
2234 if( nunfixedcols > 0.5 * ncols )
2237 "Heuristic " HEUR_NAME " solving LP from scratch with %.1f %% unfixed columns (%d of %d) ...\n",
2238 100.0 * (nunfixedcols / (
SCIP_Real)ncols), nunfixedcols, ncols);
2258 SCIPwarningMessage(
scip,
"Error while solving LP in SHIFTANDPROPAGATE heuristic; LP solve terminated with code <%d>\n",
2292 printreason =
FALSE;
2315 SCIPdebugMsg(
scip,
"Solution constructed by heuristic is already known to be infeasible\n");
2322 for(
c = matrix->ndiscvars - 1;
c >= 0; --
c )
2335 if( violatedvarrows !=
NULL )
2349 eventhdlrdata->nviolatedrows =
NULL;
2350 eventhdlrdata->violatedrowpos =
NULL;
2351 eventhdlrdata->violatedrows =
NULL;
2365 eventhdlrdata->matrix =
NULL;
2391 matrix = eventhdlrdata->matrix;
2393 heurdata = eventhdlrdata->heurdata;
2396 colpos = eventdata->colpos;
2398 assert(0 <= colpos && colpos < matrix->ndiscvars);
2407 eventhdlrdata->violatedrowpos, eventhdlrdata->nviolatedrows) );
2427 eventhandlerdata->matrix =
NULL;
2431 eventExecShiftandpropagate, eventhandlerdata) );
2455 "The number of propagation rounds used for each propagation",
2462 "Should heuristic only be executed if no primal solution was found, yet?",
2467 "the key for variable sorting: (n)orms down, norms (u)p, (v)iolations down, viola(t)ions up, or (r)andom",
2474 "Should the heuristic stop calculating optimal shift values when no more rows are violated?",
2477 "Should binary variables be shifted first?",
2480 "should variables with a zero shifting value be delayed instead of being fixed?",
2483 "should binary variables with no locks in one direction be fixed to that direction?",
2486 "should binary variables with no locks be preferred in the ordering?",
2489 "should coefficients be normalized by max row coeff for col norm?",
2492 "should row weight be increased every time the row is violated?",
2495 "should implicit integer variables be treated as continuous variables?",
2498 "should the heuristic choose the best candidate in every round? (set to FALSE for static order)?",
2501 "maximum percentage of allowed cutoffs before stopping the heuristic",
2504 "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)
int SCIPcolGetLPPos(SCIP_COL *col)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Bool SCIPcolIsIntegral(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,)
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_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 event handler plugins and event handlers
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
@ SCIP_VARTYPE_CONTINUOUS
enum SCIP_Vartype SCIP_VARTYPE