49 #define HEUR_NAME "gins" 50 #define HEUR_DESC "gins works on k-neighborhood in a variable-constraint graph" 51 #define HEUR_DISPCHAR 'K' 52 #define HEUR_PRIORITY -1103000 54 #define HEUR_FREQOFS 8 55 #define HEUR_MAXDEPTH -1 56 #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE 57 #define HEUR_USESSUBSCIP TRUE 59 #define DEFAULT_NODESOFS 500 60 #define DEFAULT_MAXNODES 5000 61 #define DEFAULT_MINIMPROVE 0.01 62 #define DEFAULT_MINNODES 50 63 #define DEFAULT_MINFIXINGRATE 0.66 64 #define DEFAULT_NODESQUOT 0.15 65 #define DEFAULT_NWAITINGNODES 100 66 #define DEFAULT_USELPROWS FALSE 68 #define DEFAULT_COPYCUTS TRUE 70 #define DEFAULT_BESTSOLLIMIT 3 71 #define DEFAULT_FIXCONTVARS FALSE 72 #define DEFAULT_POTENTIAL 'r' 73 #define DEFAULT_MAXDISTANCE 3 75 #define DEFAULT_RANDSEED 71 76 #define DEFAULT_RELAXDENSECONSS FALSE 78 #define DEFAULT_USEROLLINGHORIZON TRUE 79 #define DEFAULT_ROLLHORIZONLIMFAC 0.4 82 #define NHISTOGRAMBINS 10 144 int sumneighborhoodvars;
145 int sumdiscneighborhoodvars;
156 #ifdef SCIP_STATISTIC 157 int consvarshist[NHISTOGRAMBINS];
158 int consdiscvarshist[NHISTOGRAMBINS];
159 int conscontvarshist[NHISTOGRAMBINS];
161 int nrelaxedconstraints;
179 #ifdef SCIP_STATISTIC 191 void addHistogramEntry(
199 assert(value <= basevalue);
202 index = (int)(ratio * NHISTOGRAMBINS);
225 assert(scip !=
NULL);
226 assert(vargraph !=
NULL);
234 #ifdef SCIP_STATISTIC 235 resetHistogram(heurdata->consvarshist);
236 resetHistogram(heurdata->consdiscvarshist);
237 resetHistogram(heurdata->conscontvarshist);
240 heurdata->nrelaxedconstraints = 0;
242 for( c = 0; c < nconss; ++c )
249 #ifdef SCIP_STATISTIC 265 if( heurdata->relaxdenseconss && nconsvars >= (1.0 - heurdata->minfixingrate) * nvars )
267 ++heurdata->nrelaxedconstraints;
277 #ifdef SCIP_STATISTIC 283 for( v = 0; v < nconsvars; ++v )
291 #ifdef SCIP_STATISTIC 324 #ifdef SCIP_STATISTIC 325 addHistogramEntry(heurdata->consvarshist, nconsvars,
SCIPgetNVars(scip));
327 addHistogramEntry(heurdata->conscontvarshist, nconscontvars, nconsvars);
348 assert(scip !=
NULL);
349 assert(vargraph !=
NULL);
360 SCIPhashKeyEqPtr, SCIPhashKeyValPtr,
NULL) );
382 assert(scip !=
NULL);
383 assert(vargraph !=
NULL);
387 for( v = nvars - 1; v >= 0; --v )
425 assert(scip !=
NULL);
426 assert(vargraph !=
NULL);
427 assert(startvar !=
NULL);
428 assert(distances !=
NULL);
429 assert(maxdistance >= 0);
440 for( i = 0; i < nvars; ++i )
451 nextlvlidx = nvars - 1;
460 currvar = vars[queue[currlvlidx]];
462 currentdistance = distances[varpos];
463 assert(currentdistance >= 0);
466 assert(currentdistance <= maxdistance);
469 if( currentdistance == maxdistance )
475 for( c = 0; c < vargraph->
nvarconss[varpos]; ++c )
499 for( v = 0; v < nconsvars; ++v )
503 assert(nextvar !=
NULL);
508 assert(nextvarpos >= 0);
511 if( distances[nextvarpos] == -1 )
513 distances[nextvarpos] = currentdistance + 1;
514 queue[nextlvlidx] = nextvarpos;
515 nextlvlidx -= increment;
524 queue[currlvlidx] = -1;
525 currlvlidx += increment;
528 if( currlvlidx == nvars || currlvlidx == 0 || queue[currlvlidx] == -1 || currlvlidx == nextlvlidx )
533 if( increment == +1 )
535 currlvlidx = nvars - 1;
542 nextlvlidx = nvars - 1;
547 while( queue[currlvlidx] != -1 && distances[queue[currlvlidx]] >= currentdistance );
563 assert(scip !=
NULL);
564 assert(rollinghorizon !=
NULL);
570 (*rollinghorizon)->distancessize = size;
571 (*rollinghorizon)->variablegraph =
NULL;
572 (*rollinghorizon)->lastdistance = -1;
573 (*rollinghorizon)->niterations = 0;
574 (*rollinghorizon)->nused = 0;
587 assert(scip !=
NULL);
588 assert(rollinghorizon !=
NULL);
589 assert(*rollinghorizon !=
NULL);
591 if( (*rollinghorizon)->variablegraph !=
NULL )
616 return (rollinghorizon->
nused < maxnused);
635 if( distances[i] == -1 )
655 assert(scip !=
NULL);
656 assert(vars !=
NULL);
664 for( i = 0; i < nvars; ++i )
679 switch( heurdata->potential )
691 SCIPerrorMessage(
"Unknown potential computation %c specified\n", heurdata->potential);
692 referencepoint = 0.0;
701 potential += objdelta;
716 assert(distances !=
NULL);
717 assert(maxdistance >= 0);
746 nvarstofix = heurdata->fixcontvars ? nvars : nbinvars + nintvars;
750 for( i = 0; i < nvarstofix; i++ )
753 if( distances[i] == -1 || distances[i] > maxdistance )
767 else if(
SCIPisGT(scip, solval, ub) )
773 fixedvars[*nfixings] = vars[i];
774 fixedvals[*nfixings] = solval;
778 else if( rollinghorizon !=
NULL && i < nbinvars + nintvars && ! rollinghorizon->used[i] )
780 ++rollinghorizon->
nused;
785 if( rollinghorizon !=
NULL )
802 int* choosevardistance
806 int nrelevantdistances;
815 nrelevantdistances = (heurdata->fixcontvars ? nvars : (nbinvars + nintvars));
828 assert(zeropos >= 0);
831 criticalidx = zeropos + (int)((1.0 - heurdata->minfixingrate) * nrelevantdistances);
832 criticalidx =
MIN(criticalidx, nrelevantdistances - 1);
835 *choosevardistance = distancescopy[criticalidx];
841 if( criticalidx != nrelevantdistances - 1 && distancescopy[criticalidx + 1] == *choosevardistance )
842 (*choosevardistance)--;
845 heurdata->maxseendistance =
MAX(heurdata->maxseendistance, distancescopy[nrelevantdistances - 1]);
858 return heurdata->sumdiscneighborhoodvars / (
MAX(1.0, (
SCIP_Real)heurdata->nneighborhoods));
869 int* selvarmaxdistance
879 int nintegralvarsleft;
880 int nintegralvarsbound;
886 assert(vargraph !=
NULL);
887 assert(scip !=
NULL);
888 assert(heurdata !=
NULL);
889 assert(selvar !=
NULL);
902 nintegralvarsbound = (int)((1.0 - heurdata->minfixingrate) * (nbinvars + nintvars));
907 maxdistance = (heurdata->maxdistance == - 1 ? INT_MAX : heurdata->maxdistance);
909 nintegralvarsleft = nbinvars + nintvars;
913 for( v = nintegralvarsleft - 1; v >= 0; --v )
917 varscopy[v] = varscopy[nintegralvarsleft - 1];
924 searchlimit =
MIN(searchlimit, 10);
927 while( nsearched < searchlimit && nintegralvarsleft > 0 )
931 int neighborhoodsize;
932 int ndiscvarsneighborhood;
933 int choosevardistance;
941 choosevar = varscopy[idx];
942 assert(choosevar !=
NULL);
946 varscopy[idx] = varscopy[nintegralvarsleft - 1];
955 SCIPdebugMsg(scip,
"No active variable left to perform breadth-first search\n");
968 if( heurdata->maxdistance != -1 )
970 choosevardistance = heurdata->maxdistance;
977 ndiscvarsneighborhood = 0;
978 neighborhoodsize = 0;
981 for( v = nvars - 1; v >= 0; --v )
989 neighborhood[neighborhoodsize++] = currvar;
993 ++ndiscvarsneighborhood;
998 if( ndiscvarsneighborhood >= nintegralvarsbound || ndiscvarsneighborhood <= 1 )
1000 SCIPdebugMsg(scip,
"Too many or too few discrete variables in neighboorhood: %d (%d)\n",
1001 ndiscvarsneighborhood, nbinvars + nintvars);
1009 if( potential > maxpotential )
1011 maxpotential = potential;
1012 *selvar = choosevar;
1013 *selvarmaxdistance = choosevardistance;
1018 for( v = nintegralvarsleft - 1; v >= 0; --v )
1025 varscopy[v] = varscopy[nintegralvarsleft - 1];
1026 --nintegralvarsleft;
1030 heurdata->sumdiscneighborhoodvars += ndiscvarsneighborhood;
1031 heurdata->sumneighborhoodvars += neighborhoodsize;
1032 ++heurdata->nneighborhoods;
1043 SCIPdebugMsg(scip,
"Stopping with maxpotential %15.9f and selected variable %s\n",
1059 int* selvarmaxdistance
1066 int minunuseddistance;
1068 assert(scip !=
NULL);
1069 assert(rollinghorizon !=
NULL);
1070 assert(distances !=
NULL);
1071 assert(selvar !=
NULL);
1072 assert(selvarmaxdistance !=
NULL);
1082 minunuseddistance = INT_MAX;
1085 for( i = 0; i < nbinvars + nintvars && minunuseddistance > rollinghorizon->
lastdistance; ++i )
1088 && rollinghorizon->
distances[i] < minunuseddistance && ! rollinghorizon->
used[i] )
1090 minunuseddistance = rollinghorizon->
distances[i];
1096 if( *selvar ==
NULL )
1098 *selvarmaxdistance = 0;
1108 if( *selvarmaxdistance == 0 )
1111 rollinghorizon->
nused++;
1120 assert(*selvarmaxdistance <= rollinghorizon->lastmaxdistance);
1150 int selvarmaxdistance;
1152 assert(fixedvars !=
NULL);
1153 assert(fixedvals !=
NULL);
1154 assert(nfixings !=
NULL);
1158 selvarmaxdistance = 0;
1160 assert(sol !=
NULL);
1166 SCIPdebugMsg(scip,
"Creating variable constraint graph\n");
1169 if( rollinghorizon !=
NULL )
1196 if( selvar !=
NULL && rollinghorizon !=
NULL )
1210 assert(selvar ==
NULL || selvarmaxdistance > 0);
1211 if( selvar ==
NULL )
1217 SCIPdebugMsg(scip,
"Selected variable <%s> as central variable for a <%d>-neighborhood\n",
1222 selvarmaxdistance, nfixings) );
1224 fixthreshold = (int)(heurdata->minfixingrate * (heurdata->fixcontvars ? nvars : (nbinvars + nintvars)));
1229 if( *nfixings < fixthreshold )
1231 SCIPdebugMsg(scip,
"Fixed %d < %d variables in gins heuristic, stopping", *nfixings, fixthreshold);
1237 if( rollinghorizon ==
NULL )
1259 assert(scip !=
NULL);
1260 assert(subscip !=
NULL);
1261 assert(subvars !=
NULL);
1262 assert(subsol !=
NULL);
1297 assert(solvelimits !=
NULL);
1393 cutoff =
MIN(upperbound, cutoff);
1414 assert(scip !=
NULL);
1415 assert(heur !=
NULL);
1416 assert(solvelimits !=
NULL);
1417 assert(runagain !=
NULL);
1443 maxnnodes = (
SCIP_Longint)(maxnnodesr - 100.0 * heurdata->nsubmips);
1444 maxnnodes += heurdata->nodesofs;
1447 solvelimits->
nodelimit = maxnnodes - heurdata->usednodes;
1451 if( solvelimits->
nodelimit < heurdata->minnodes )
1465 heurdata->nfailures++;
1466 heurdata->nextnodenumber = (heurdata->nfailures <= 25
1471 #ifdef SCIP_STATISTIC 1478 return heurdata->sumneighborhoodvars / (
MAX(1.0, (
SCIP_Real)heurdata->nneighborhoods));
1483 void printHistogram(
1494 for( i = 0; i < NHISTOGRAMBINS; ++i )
1508 assert(scip !=
NULL);
1509 assert(heur !=
NULL);
1524 assert(heur !=
NULL);
1529 assert(heurdata !=
NULL);
1544 assert(heur !=
NULL);
1549 assert(heurdata !=
NULL);
1550 assert(heurdata->randnumgen ==
NULL);
1553 heurdata->usednodes = 0;
1555 heurdata->sumdiscneighborhoodvars = heurdata->sumneighborhoodvars = 0;
1556 heurdata->nneighborhoods = 0;
1557 heurdata->maxseendistance = 0;
1558 heurdata->nsubmips = 0;
1559 heurdata->nfailures = 0;
1560 heurdata->nextnodenumber = 0;
1562 #ifdef SCIP_STATISTIC 1563 resetHistogram(heurdata->conscontvarshist);
1564 resetHistogram(heurdata->consdiscvarshist);
1565 resetHistogram(heurdata->conscontvarshist);
1577 assert(heur !=
NULL);
1582 assert(heurdata !=
NULL);
1588 printHistogram(scip, heurdata->consvarshist,
"Constraint density histogram");
1589 printHistogram(scip, heurdata->conscontvarshist,
"Constraint continuous density histogram");
1590 printHistogram(scip, heurdata->consdiscvarshist,
"Constraint discrete density histogram");
1594 heurdata->randnumgen =
NULL;
1621 assert(heur !=
NULL);
1622 assert(scip !=
NULL);
1623 assert(result !=
NULL);
1627 assert(heurdata !=
NULL);
1672 if( heurdata->userollinghorizon )
1675 rollinghorizon =
NULL;
1685 SCIPdebugMsg(scip,
"Could not create the subproblem -> skip call\n");
1698 ++heurdata->nsubmips;
1705 heurdata->uselprows, heurdata->copycuts, &success,
NULL) );
1707 for( i = 0; i < nvars; i++ )
1741 for( i = 0; i < nsubsols && !success; ++i )
1754 runagain = (*result ==
SCIP_FOUNDSOL) && heurdata->userollinghorizon;
1757 assert(rollinghorizon !=
NULL);
1762 }
while( runagain );
1771 if( heurdata->userollinghorizon )
1796 heurdata->randnumgen =
NULL;
1803 assert(heur !=
NULL);
1813 "number of nodes added to the contingent of the total nodes",
1817 "maximum number of nodes to regard in the subproblem",
1821 "minimum number of nodes required to start the subproblem",
1825 "number of nodes without incumbent change that heuristic should wait",
1829 "contingent of sub problem nodes in relation to the number of nodes of the original problem",
1833 "percentage of integer variables that have to be fixed",
1837 "factor by which " HEUR_NAME " should at least improve the incumbent",
1841 "should subproblem be created out of the rows in the LP rows?",
1845 "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
1849 "should continuous variables outside the neighborhoods be fixed?",
1853 "limit on number of improving incumbent solutions in sub-CIP",
1857 "maximum distance to selected variable to enter the subproblem, or -1 to select the distance " 1858 "that best approximates the minimum fixing rate from below",
1862 "the reference point to compute the neighborhood potential: (r)oot or (p)seudo solution",
1866 "should the heuristic solve a sequence of sub-MIP's around the first selected variable",
1870 "should dense constraints (at least as dense as 1 - minfixingrate) be ignored by connectivity graph?",
1874 "limiting percentage for variables already used in sub-SCIPs to terminate rolling horizon approach",
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
static SCIP_Real heurdataAvgDiscreteNeighborhoodSize(SCIP_HEURDATA *heurdata)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPgetNIntVars(SCIP *scip)
static SCIP_RETCODE rollingHorizonCreate(SCIP *scip, ROLLINGHORIZON **rollinghorizon)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPincludeHeurGins(SCIP *scip)
static void rollingHorizonStoreDistances(SCIP *scip, ROLLINGHORIZON *rollinghorizon, int *distances)
static SCIP_DECL_HEURCOPY(heurCopyGins)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
#define DEFAULT_MAXDISTANCE
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
#define SCIPallocClearBufferArray(scip, ptr, num)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_HASHTABLE * visitedconss
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
#define SCIPallocClearBlockMemoryArray(scip, ptr, num)
static SCIP_RETCODE fillVariableGraph(SCIP *scip, VARIABLEGRAPH *vargraph, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
int SCIPgetNOrigVars(SCIP *scip)
static SCIP_RETCODE selectNextVariable(SCIP *scip, SCIP_HEURDATA *heurdata, ROLLINGHORIZON *rollinghorizon, int *distances, SCIP_VAR **selvar, int *selvarmaxdistance)
SCIP_Real SCIPvarGetRootSol(SCIP_VAR *var)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
static SCIP_RETCODE determineVariableFixings(SCIP *scip, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int *nfixings, SCIP_HEURDATA *heurdata, ROLLINGHORIZON *rollinghorizon, SCIP_Bool *success)
static SCIP_RETCODE setLimits(SCIP *subscip, SOLVELIMITS *solvelimits)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
int SCIPvarGetProbindex(SCIP_VAR *var)
#define DEFAULT_MINFIXINGRATE
struct SCIP_HeurData SCIP_HEURDATA
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPcreate(SCIP **scip)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
#define SCIPallocBlockMemory(scip, ptr)
static SCIP_RETCODE determineMaxDistance(SCIP *scip, SCIP_HEURDATA *heurdata, int *distances, int *choosevardistance)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
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)
#define DEFAULT_ROLLHORIZONLIMFAC
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
SCIP_RETCODE SCIPsolve(SCIP *scip)
const char * SCIPheurGetName(SCIP_HEUR *heur)
#define DEFAULT_FIXCONTVARS
#define DEFAULT_USEROLLINGHORIZON
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
static void updateFailureStatistic(SCIP *scip, SCIP_HEURDATA *heurdata)
static void variableGraphFree(SCIP *scip, VARIABLEGRAPH **vargraph)
static SCIP_RETCODE variableGraphCreate(SCIP *scip, VARIABLEGRAPH **vargraph, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
LNS heuristic that tries to delimit the search region to a neighborhood in the constraint graph...
static SCIP_RETCODE setupSubScip(SCIP *scip, SCIP *subscip, SOLVELIMITS *solvelimits, SCIP_HEUR *heur)
#define DEFAULT_RELAXDENSECONSS
SCIP_Real SCIPgetLowerbound(SCIP *scip)
#define DEFAULT_POTENTIAL
static SCIP_DECL_HEURFREE(heurFreeGins)
#define DEFAULT_NODESQUOT
void SCIPhashtableRemoveAll(SCIP_HASHTABLE *hashtable)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
static SCIP_DECL_HEUREXEC(heurExecGins)
SCIP_Bool SCIPsortedvecFindInt(int *intarray, int val, int len, int *pos)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
#define DEFAULT_BESTSOLLIMIT
#define SCIPallocBufferArray(scip, ptr, num)
#define DEFAULT_USELPROWS
public data structures and miscellaneous methods
VARIABLEGRAPH * variablegraph
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
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)
static SCIP_Bool rollingHorizonRunAgain(SCIP *scip, ROLLINGHORIZON *rollinghorizon, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
int SCIPgetNSols(SCIP *scip)
#define BMScopyMemoryArray(ptr, source, num)
static SCIP_RETCODE variablegraphBreadthFirst(SCIP *scip, VARIABLEGRAPH *vargraph, SCIP_VAR *startvar, int *distances, int maxdistance)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
int SCIPgetNBinVars(SCIP *scip)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
int SCIPgetNVars(SCIP *scip)
static SCIP_DECL_HEURINIT(heurInitGins)
static SCIP_RETCODE determineLimits(SCIP *scip, SCIP_HEUR *heur, SOLVELIMITS *solvelimits, SCIP_Bool *runagain)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_Longint SCIPgetMemUsed(SCIP *scip)
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
#define DEFAULT_MINIMPROVE
int SCIPgetNConss(SCIP *scip)
static SCIP_RETCODE fixNonNeighborhoodVariables(SCIP *scip, SCIP_HEURDATA *heurdata, ROLLINGHORIZON *rollinghorizon, SCIP_SOL *sol, SCIP_VAR **vars, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int *distances, int maxdistance, int *nfixings)
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
SCIP_RETCODE SCIPcopyLargeNeighborhoodSearch(SCIP *sourcescip, SCIP *subscip, SCIP_HASHMAP *varmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool uselprows, SCIP_Bool copycuts, SCIP_Bool *success, SCIP_Bool *valid)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
void SCIPsortInt(int *intarray, int len)
static SCIP_DECL_HEUREXIT(heurExitGins)
static SCIP_Real getPotential(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *sol, SCIP_VAR **vars, int nvars)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE rollingHorizonFree(SCIP *scip, ROLLINGHORIZON **rollinghorizon)
static SCIP_RETCODE selectInitialVariable(SCIP *scip, SCIP_HEURDATA *heurdata, VARIABLEGRAPH *vargraph, int *distances, SCIP_VAR **selvar, int *selvarmaxdistance)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
#define BMSclearMemoryArray(ptr, num)
#define DEFAULT_NWAITINGNODES
#define SCIP_CALL_ABORT(x)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
static SCIP_Bool isVariableInNeighborhood(SCIP_VAR *var, int *distances, int maxdistance)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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)
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)