33 #include "scip/scip.h" 34 #include "scip/scipdefplugins.h" 35 #include "scip/cons_linear.h" 41 #include "scip/pub_misc.h" 44 #define HEUR_NAME "rec" 45 #define HEUR_DESC "LNS heuristic fixing all variables corresponding to edges used in at least one of several selected solutions" 46 #define HEUR_DISPCHAR 'R' 47 #define HEUR_PRIORITY 100 49 #define HEUR_FREQOFS 0 50 #define HEUR_MAXDEPTH -1 51 #define HEUR_TIMING (SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_AFTERLPLOOP | SCIP_HEURTIMING_AFTERNODE) 52 #define HEUR_USESSUBSCIP TRUE 54 #define DEFAULT_MAXFREQREC FALSE 55 #define DEFAULT_MAXNSOLS 50 56 #define DEFAULT_NUSEDSOLS 4 57 #define DEFAULT_RANDSEED 0 58 #define DEFAULT_NTMRUNS 75 59 #define DEFAULT_NWAITINGSOLS 4 97 SCIP_HEURDATA* heurdata;
100 newrandseed = SCIPparamGetInt(param);
102 heurdata = (SCIP_HEURDATA*)SCIPparamGetData(param);
103 assert(heurdata != NULL);
105 heurdata->randseed = (
unsigned int)newrandseed;
114 SCIP_HEURDATA* heurdata,
121 assert(SCIPisGE(scip, avg, 1.0));
124 if( SCIPisLT(scip, avg, 1.6) )
126 factor = SCIPgetRandomInt(1000, 1400, &(heurdata->randseed));
127 mult = (double) factor * (1.0 / avg);
129 else if( SCIPisLT(scip, avg, 2.6) )
131 factor = SCIPgetRandomInt(200, 1000, &(heurdata->randseed));
132 mult = (double) factor * (1.0 / avg);
134 else if( nusedsols == 3 && SCIPisLT(scip, avg, 3.6) )
136 factor = SCIPgetRandomInt(40, 100, &(heurdata->randseed));
137 mult = (double) factor * (1.0 / avg);
142 if( SCIPisLT(scip, avg, 1.6) )
144 factor = SCIPgetRandomInt(1400, 1800, &(heurdata->randseed));
146 else if( SCIPisLT(scip, avg, 2.6) )
148 factor = SCIPgetRandomInt(400, 1400, &(heurdata->randseed));
150 else if( SCIPisLT(scip, avg, 3.6) )
152 factor = SCIPgetRandomInt(150, 250, &(heurdata->randseed));
154 else if( SCIPisLT(scip, avg, 4.6) )
156 factor = SCIPgetRandomInt(60, 90, &(heurdata->randseed));
158 else if( nusedsols >= 5 && SCIPisLT(scip, avg, 5.6) )
160 factor = SCIPgetRandomInt(20, 40, &(heurdata->randseed));
162 mult = (double) factor * (1.0 / avg);
173 SCIP_HEURDATA* heurdata,
183 SCIP_Real varrevsolval;
199 assert(selection != NULL);
200 assert(graph != NULL);
201 assert(vars != NULL);
204 sols = SCIPgetSols(scip);
205 nsols = SCIPgetNSols(scip);
206 maxnsols = heurdata->maxnsols;
207 nusedsols = heurdata->nusedsols;
208 nedges = graph->
edges;
209 assert(nusedsols <= nsols);
212 assert(nusedsols > 1);
213 assert(nsols >= nusedsols);
216 SCIP_CALL( SCIPallocBufferArray(scip, &solselected, nsols) );
217 SCIP_CALL( SCIPallocBufferArray(scip, &soltimes, nsols) );
218 SCIP_CALL( SCIPallocBufferArray(scip, &perm, nsols) );
219 SCIP_CALL( SCIPallocBufferArray(scip, &soledges, nedges / 2) );
221 for( i = 0; i < nsols; i++ )
224 soltimes[i] = SCIPgetSolTime(scip, sols[i]);
225 solselected[i] =
FALSE;
228 if( *newsol == NULL )
230 SCIPsortRealInt(soltimes, perm, nsols);
233 if( heurdata->lastsolindex != SCIPsolGetIndex(sols[perm[i]]) )
235 *newsol = sols[perm[i]];
239 i = SCIPgetRandomInt(0, nsols - 1, &(heurdata->randseed));
241 *newsol = sols[perm[i]];
242 solselected[perm[i]] =
TRUE;
243 selection[nselectedsols++] = perm[i];
245 for( i = 0; i < nsols; i++ )
250 for( i = 0; i < nsols; i++ )
251 if( *newsol == sols[i] )
254 solselected[i] =
TRUE;
255 selection[nselectedsols++] = i;
258 for( e = 0; e < nedges; e += 2 )
260 varsolval = SCIPgetSolVal(scip, sols[selection[0]], vars[e]);
261 varrevsolval = SCIPgetSolVal(scip, sols[selection[0]], vars[e + 1]);
263 if( SCIPisEQ(scip, varsolval, 1.0) || SCIPisEQ(scip, varrevsolval, 1.0) )
265 soledges[e / 2] =
TRUE;
269 soledges[e / 2] =
FALSE;
272 maxnsols = MIN(nsols, maxnsols);
274 SCIPpermuteIntArray(perm, 0, maxnsols, &(heurdata->randseed));
277 if( solselected[perm[i]] ==
FALSE )
282 for( e = 0; e < nedges; e += 2 )
284 varsolval = SCIPgetSolVal(scip, sols[k], vars[e]);
285 varrevsolval = SCIPgetSolVal(scip, sols[k], vars[e + 1]);
287 if( SCIPisEQ(scip, varsolval, 1.0) || SCIPisEQ(scip, varrevsolval, 1.0) )
289 head = graph->
head[e];
290 tail = graph->
tail[e];
291 if( soledges[e / 2] ==
FALSE )
293 soledges[e / 2] =
TRUE;
305 if( diffnedges > 3 && eqnedges > 0 )
307 selection[nselectedsols++] = k;
308 solselected[k] =
TRUE;
310 if( nselectedsols >= nusedsols )
317 assert(nselectedsols <= nusedsols);
319 SCIPfreeBufferArray(scip, &soledges);
320 SCIPfreeBufferArray(scip, &perm);
321 SCIPfreeBufferArray(scip, &soltimes);
322 SCIPfreeBufferArray(scip, &solselected);
331 SCIP_HEURDATA* heurdata,
349 assert(selection != NULL);
352 sols = SCIPgetSols(scip);
353 nsols = SCIPgetNSols(scip);
354 maxnsols = heurdata->maxnsols;
355 nusedsols = heurdata->nusedsols;
356 assert(nusedsols <= nsols);
359 assert(nusedsols > 1);
360 assert(nsols >= nusedsols);
363 SCIP_CALL( SCIPallocBufferArray(scip, &solselected, nsols) );
364 SCIP_CALL( SCIPallocBufferArray(scip, &soltimes, nsols) );
365 SCIP_CALL( SCIPallocBufferArray(scip, &perm, nsols) );
367 for( i = 0; i < nsols; i++ )
370 soltimes[i] = SCIPgetSolTime(scip, sols[i]);
371 solselected[i] =
FALSE;
374 if( *newsol == NULL )
376 SCIPsortRealInt(soltimes, perm, nsols);
380 if( heurdata->lastsolindex != SCIPsolGetIndex(sols[perm[i]]) )
382 *newsol = sols[perm[i]];
386 i = SCIPgetRandomInt(0, nsols - 1, &(heurdata->randseed));
388 *newsol = sols[perm[i]];
389 solselected[perm[i]] =
TRUE;
390 selection[nselectedsols++] = perm[i];
392 for( i = 0; i < nsols; i++ )
397 for( i = 0; i < nsols; i++ )
398 if( *newsol == sols[i] )
403 solselected[i] =
TRUE;
404 selection[nselectedsols++] = i;
409 end = (int) ((SCIPgetRandomReal(1.0, (
double) nusedsols - 1, &(heurdata->randseed))) );
411 shift = SCIPgetRandomInt(end, 2 * nusedsols - 1, &(heurdata->randseed));
415 SCIPpermuteIntArray(perm, 0, shift, &(heurdata->randseed));
417 for( i = 0; i < end; i++ )
419 if( solselected[perm[i]] ==
FALSE )
421 selection[nselectedsols++] = perm[i];
422 solselected[perm[i]] =
TRUE;
426 maxnsols = MIN(nsols, maxnsols);
427 if( nselectedsols < nusedsols )
429 SCIPpermuteIntArray(perm, 0, maxnsols, &(heurdata->randseed));
432 if( solselected[perm[i]] ==
FALSE )
434 selection[nselectedsols++] = perm[i];
435 if( nselectedsols >= nusedsols )
440 assert(nselectedsols <= nusedsols);
442 SCIPfreeBufferArray(scip, &perm);
443 SCIPfreeBufferArray(scip, &soltimes);
444 SCIPfreeBufferArray(scip, &solselected);
453 SCIP_HEURDATA* heurdata,
467 SCIP_Real varrevsolval;
482 assert(scip != NULL);
483 assert(graph != NULL);
485 sols = SCIPgetSols(scip);
486 nedges = graph->
edges;
487 nnodes = graph->
knots;
492 *edgeancestor = NULL;
495 assert(sols != NULL);
500 SCIP_CALL( SCIPallocBufferArray(scip, &solselection, heurdata->nusedsols) );
501 SCIP_CALL( SCIPallocBufferArray(scip, &solnode, nnodes) );
502 SCIP_CALL( SCIPallocBufferArray(scip, &dnodemap, nnodes) );
503 SCIP_CALL( SCIPallocBufferArray(scip, &soledge, nedges / 2) );
505 for( i = 0; i < nedges / 2; i++ )
507 for( i = 0; i < nnodes; i++ )
515 SCIP_CALL(
selectdiffsols(scip, graph, heurdata, vars, newsol, solselection, success) );
517 SCIP_CALL(
selectsols(scip, heurdata, newsol, solselection, randomize) );
521 assert(heurdata->nselectedsols > 0);
524 for( i = 0; i < nedges; i += 2 )
526 for( j = 0; j < heurdata->nselectedsols; j++ )
528 varsolval = SCIPgetSolVal(scip, sols[solselection[j]], vars[i]);
529 varrevsolval = SCIPgetSolVal(scip, sols[solselection[j]], vars[i + 1]);
531 if( SCIPisEQ(scip, varsolval, 1.0) || SCIPisEQ(scip, varrevsolval, 1.0) )
534 soledge[i / 2] =
TRUE;
535 if( !solnode[graph->
tail[i]] )
540 if( !solnode[graph->
head[i]] )
556 soledge[i / 2] =
TRUE;
562 assert(solnode[graph->
head[i]]);
569 for( k = 0; k < nnodes; k++ )
576 if( solnode[graph->
head[i]] && !soledge[i / 2] )
578 soledge[i / 2] =
TRUE;
586 SCIP_CALL(
graph_init(scip, &newgraph, nsolnodes, 2 * nsoledges, 1, 0) );
594 SCIP_CALL( SCIPallocMemoryArray(scip, &(newgraph->
prize), nsolnodes) );
598 for( i = 0; i < nnodes; i++ )
607 newgraph->
prize[j] = 0.0;
619 assert(newgraph->
source[0] >= 0);
624 SCIP_CALL( SCIPallocMemoryArray(scip, &(newgraph->
maxdeg), nsolnodes) );
625 for( i = 0; i < nnodes; i++ )
630 SCIP_CALL( SCIPallocMemoryArray(scip, edgeancestor, 2 * nsoledges) );
631 SCIP_CALL( SCIPallocMemoryArray(scip, edgeweight, 2 * nsoledges) );
633 for( i = 0; i < 2 * nsoledges; i++ )
634 (*edgeweight)[i] = 1;
638 for( i = 0; i < nedges; i += 2 )
642 (*edgeancestor)[j++] = i;
643 (*edgeancestor)[j++] = i + 1;
647 for( k = 0; k < heurdata->nselectedsols; k++ )
649 varsolval = SCIPgetSolVal(scip, sols[solselection[k]], vars[i]);
650 varrevsolval = SCIPgetSolVal(scip, sols[solselection[k]], vars[i + 1]);
651 if( SCIPisEQ(scip, varsolval, 1.0) || SCIPisEQ(scip, varrevsolval, 1.0) )
653 (*edgeweight)[j - 2]++;
654 (*edgeweight)[j - 1]++;
659 for( i = 0; i < 2 * nsoledges; i++ )
660 assert((*edgeweight)[i] >= 1);
664 for( i = 0; i < graph->
knots; i++ )
668 printf(
"org neq: %d %f %f termi: %d termtail %d \n", i, graph->
prize[i], graph->
cost[e], graph->
term[i], graph->
term[graph->
tail[e]]);
670 for( i = 0; i < nsolnodes; i++ )
674 printf(
"neq: %d %f %f termi: %d termtail %d \n", i, newgraph->
prize[i], newgraph->
cost[e], newgraph->
term[i], newgraph->
term[newgraph->
tail[e]]);
676 for( i = 0; i < nsolnodes; i++ )
679 if( !SCIPisEQ(scip, 0.0, newgraph->
cost[e]) && !
Is_term(newgraph->
term[newgraph->
tail[e]]) )
680 printf(
"pterm neq: %d %f %f termi: %d termtail %d \n", i, newgraph->
prize[i], newgraph->
cost[e], newgraph->
term[i], newgraph->
term[newgraph->
tail[e]]);
683 assert(j == 2 * nsoledges);
687 SCIPfreeBufferArray(scip, &soledge);
688 SCIPfreeBufferArray(scip, &dnodemap);
689 SCIPfreeBufferArray(scip, &solnode);
690 SCIPfreeBufferArray(scip, &solselection);
691 *solgraph = newgraph;
704 assert(scip != NULL);
705 assert(heur != NULL);
706 assert(strcmp(SCIPheurGetName(heur),
HEUR_NAME) == 0);
718 SCIP_HEURDATA* heurdata;
720 assert(heur != NULL);
721 assert(scip != NULL);
724 heurdata = SCIPheurGetData(heur);
725 assert(heurdata != NULL);
728 SCIPfreeMemory(scip, &heurdata);
729 SCIPheurSetData(heur, NULL);
738 SCIP_HEURDATA* heurdata;
740 assert(heur != NULL);
741 assert(scip != NULL);
744 heurdata = SCIPheurGetData(heur);
745 assert(heurdata != NULL);
748 heurdata->nselectedsols = 0;
749 heurdata->ncalls = 0;
750 heurdata->ntmruns = 100;
751 heurdata->nlastsols = 0;
752 heurdata->lastsolindex = -1;
753 heurdata->bestsolindex = -1;
754 heurdata->nfailures = 0;
757 heurdata->randseed += getUgRank();
759 heurdata->randseed = 0;
769 SCIP_HEURDATA* heurdata;
770 SCIP_HEURDATA* tmheurdata;
771 SCIP_PROBDATA* probdata;
781 SCIP_Real* cost = NULL;
782 SCIP_Real* costrev = NULL;
783 SCIP_Real* nodepriority = NULL;
786 SCIP_Real maxcost = 0.0;
818 assert(heur != NULL);
819 assert(scip != NULL);
820 assert(strcmp(SCIPheurGetName(heur),
HEUR_NAME) == 0);
821 assert(result != NULL);
824 heurdata = SCIPheurGetData(heur);
825 assert(heurdata != NULL);
828 probdata = SCIPgetProbData(scip);
829 assert(probdata != NULL);
833 assert(graph != NULL);
836 *result = SCIP_DIDNOTRUN;
842 nsols = SCIPgetNSolsFound(scip);
851 if( heurdata->ncalls == 0 )
853 else if( heurdata->maxfreq )
856 i = MIN(heurdata->nwaitingsols, 2 * heurdata->nfailures);
858 i = MIN(heurdata->nwaitingsols, heurdata->nfailures);
865 if( heurdata->maxfreq )
868 i = MIN(heurdata->nwaitingsols, heurdata->nfailures);
870 if( nsols <= heurdata->
nlastsols + i && heurdata->bestsolindex == SCIPsolGetIndex(SCIPgetBestSol(scip)) )
876 assert(vars != NULL);
877 assert(vars[0] != NULL);
879 nedges = graph->
edges;
880 nnodes = graph->
knots;
881 bestsol = SCIPgetBestSol(scip);
893 SCIP_CALL( SCIPallocBufferArray(scip, &perm, runs) );
894 SCIP_CALL( SCIPallocBufferArray(scip, &nval, nedges) );
895 SCIP_CALL( SCIPallocBufferArray(scip, &orgresults, nedges) );
897 for( v = 0; v < runs; v++ )
902 newsol = (SCIPgetSols(scip))[0];
905 else if( heurdata->lastsolindex == -1 )
907 newsol = (SCIPgetSols(scip))[SCIPgetRandomInt(0, heurdata->nusedsols - 1, &(heurdata->randseed))];
916 nsols = SCIPgetNSols(scip);
918 sols = SCIPgetSols(scip);
919 for( i = 1; i < nsols; i++ )
920 if( SCIPisGT(scip, SCIPgetSolTime(scip, sols[i]), SCIPgetSolTime(scip, sols[solindex])) )
923 lastsolindex = SCIPsolGetIndex(sols[solindex]);
927 if( SCIPgetRandomInt(0, 10, &(heurdata->randseed)) == 1 )
933 for( v = 0; v < 5 * runs && !SCIPisStopped(scip); v++ )
947 if( perm[count] <= 1 )
949 heurdata->nusedsols = 2;
950 if( SCIPgetRandomInt(0, 1, &(heurdata->randseed)) == 1 )
955 else if( perm[count] <= 4 )
957 if( SCIPgetRandomInt(0, 1, &(heurdata->randseed)) == 1 )
963 else if( perm[count] <= 6 || pcmw )
967 else if( perm[count] <= 7 )
973 SCIP_CALL(
buildsolgraph(scip, heurdata, &newsol, graph, &solgraph, &edgeancestor, &edgeweight, &success, randomize) );
977 assert(newsol != NULL);
980 assert(SCIPfindHeur(scip,
"TM") != NULL);
981 tmheurdata = SCIPheurGetData(SCIPfindHeur(scip,
"TM"));
987 SCIP_CALL(
reduce(scip, &solgraph, &pobj, 0, 2) );
989 SCIP_CALL(
reduce(scip, &solgraph, &pobj, 1, 10) );
992 solgraph = psolgraph;
995 nsoledges = solgraph->
edges;
998 if( solgraph->
terms > 1 )
1004 SCIP_CALL( SCIPallocBufferArray(scip, &results, nsoledges) );
1005 SCIP_CALL( SCIPallocBufferArray(scip, &cost, nsoledges) );
1006 SCIP_CALL( SCIPallocBufferArray(scip, &costrev, nsoledges) );
1007 SCIP_CALL( SCIPallocBufferArray(scip, &nodepriority, solgraph->
knots) );
1009 for( i = 0; i < solgraph->
knots; i++ )
1010 nodepriority[i] = 0.0;
1013 BMScopyMemoryArray(cost, solgraph->
cost, nsoledges);
1016 for( e = 0; e < nsoledges; e++ )
1018 curr = ancestors[e];
1024 while( curr != NULL )
1027 avg += edgeweight[curr->
index];
1028 if( SCIPvarGetUbGlobal(vars[edgeancestor[curr->
index]] ) < 0.5 )
1033 avg = (double) avg / (
double) i;
1043 nodepriority[solgraph->
head[e]] += avg - 1.0;
1044 nodepriority[solgraph->
tail[e]] += avg - 1.0;
1048 cost[e] = cost[e] * mult;
1052 if( probtype ==
STP_HOP_CONS && SCIPisLT(scip, cost[e],
BLOCKED) && SCIPisGT(scip, cost[e], maxcost) )
1056 for( e = 0; e < nsoledges; e++ )
1067 solgraph->
source[0], cost, costrev, &hopfactor, nodepriority, maxcost, &success) );
1071 SCIPdebugMessage(
"failed to build tree\n");
1073 SCIPfreeBufferArrayNull(scip, &nodepriority);
1074 SCIPfreeBufferArrayNull(scip, &costrev);
1075 SCIPfreeBufferArrayNull(scip, &cost);
1076 SCIPfreeBufferArrayNull(scip, &results);
1077 SCIPfreeMemoryArray(scip, &edgeancestor);
1078 SCIPfreeMemoryArray(scip, &edgeweight);
1096 for( i = 0; i < nedges; i++ )
1100 SCIP_CALL( SCIPallocBufferArray(scip, &stnodes, nedges) );
1102 for( i = 0; i < nnodes; i++ )
1106 if( solgraph->
terms > 1 )
1108 assert(results != NULL);
1109 for( e = 0; e < nsoledges; e++ )
1114 curr = ancestors[e];
1115 while( curr != NULL )
1117 i = edgeancestor[curr->
index];
1120 head = graph->
head[i];
1121 tail = graph->
tail[i];
1122 stnodes[tail] =
TRUE;
1123 stnodes[head] =
TRUE;
1132 while( curr != NULL )
1134 i = edgeancestor[curr->
index];
1137 head = graph->
head[i];
1138 tail = graph->
tail[i];
1139 stnodes[tail] =
TRUE;
1140 stnodes[head] =
TRUE;
1151 SCIPfreeBufferArray(scip, &stnodes);
1154 for( e = 0; e < graph->
edges; e++ )
1156 if( orgresults[e] ==
CONNECT )
1159 pobj += graph->
cost[e];
1169 SCIPdebugMessage(
"better solution found ... ");
1175 SCIPdebugMessage(
"and added! \n");
1176 *result = SCIP_FOUNDSOL;
1178 nsols = SCIPgetNSols(scip);
1180 sols = SCIPgetSols(scip);
1182 for( i = 1; i < nsols; i++ )
1183 if( SCIPisGT(scip, SCIPgetSolTime(scip, sols[i]), SCIPgetSolTime(scip, sols[solindex])) )
1185 newsol = sols[solindex];
1189 heurdata->nfailures = 0;
1202 SCIPfreeBufferArrayNull(scip, &nodepriority);
1203 SCIPfreeBufferArrayNull(scip, &costrev);
1204 SCIPfreeBufferArrayNull(scip, &cost);
1205 SCIPfreeBufferArrayNull(scip, &results);
1207 SCIPfreeMemoryArray(scip, &edgeancestor);
1208 SCIPfreeMemoryArray(scip, &edgeweight);
1217 if( *result != SCIP_FOUNDSOL )
1218 heurdata->nfailures++;
1221 heurdata->bestsolindex = SCIPsolGetIndex(SCIPgetBestSol(scip));
1222 heurdata->nlastsols = SCIPgetNSolsFound(scip);
1223 SCIPfreeBufferArray(scip, &orgresults);
1224 SCIPfreeBufferArray(scip, &nval);
1225 SCIPfreeBufferArray(scip, &perm);
1240 SCIP_HEURDATA* heurdata;
1244 SCIP_CALL( SCIPallocMemory(scip, &heurdata) );
1247 SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
1251 assert(heur != NULL);
1254 SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyRec) );
1255 SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeRec) );
1256 SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitRec) );
1259 SCIP_CALL( SCIPaddIntParam(scip,
"heuristics/"HEUR_NAME"/nwaitingsols",
1260 "number of solution findings to be in abeyance",
1263 SCIP_CALL( SCIPaddIntParam(scip,
"heuristics/"HEUR_NAME"/randseed",
1264 "random seed for heuristic",
1267 SCIP_CALL( SCIPaddIntParam(scip,
"heuristics/"HEUR_NAME"/maxnsols",
1268 "max size of solution pool for heuristic",
1271 SCIP_CALL( SCIPaddIntParam(scip,
"heuristics/"HEUR_NAME"/ntmruns",
1272 "number of runs in TM",
1275 SCIP_CALL( SCIPaddBoolParam(scip,
"heuristics/"HEUR_NAME"/maxfreq",
1276 "should the heuristic be executed at maximum frequeny?",
SCIP_RETCODE graph_path_init(SCIP *, GRAPH *)
SCIP_RETCODE SCIPheurPruneSteinerTree(SCIP *scip, const GRAPH *g, SCIP_Real *cost, int layer, int *result, char *connected)
SCIP_RETCODE SCIPheurPrunePCSteinerTree(SCIP *scip, const GRAPH *g, SCIP_Real *cost, int *result, char *connected)
int graph_valid(const GRAPH *)
Constraint handler for Steiner problems.
static SCIP_RETCODE selectsols(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL **newsol, int *selection, SCIP_Bool randomize)
SCIP_VAR ** SCIPprobdataGetVars(SCIP *scip)
static SCIP_DECL_PARAMCHGD(paramChgdRandomseed)
SCIP_RETCODE SCIPheurPruneDegConsSteinerTree(SCIP *scip, const GRAPH *g, int *result, char *connected)
static SCIP_DECL_HEURCOPY(heurCopyRec)
Problem data for stp problem.
void graph_path_exit(SCIP *, GRAPH *)
void graph_free(SCIP *, GRAPH *, SCIP_Bool)
static SCIP_Real costMultiplier(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Real avg)
SCIP_RETCODE SCIPincludeHeurRec(SCIP *scip)
static SCIP_DECL_HEUREXEC(heurExecRec)
GRAPH * SCIPprobdataGetGraph(SCIP_PROBDATA *probdata)
#define STP_OBSTACLES_GRID
static SCIP_RETCODE buildsolgraph(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL **newsol, GRAPH *graph, GRAPH **solgraph, int **edgeancestor, int **edgeweight, SCIP_Bool *success, SCIP_Bool randomize)
SCIP_RETCODE graph_pack(SCIP *, GRAPH *, GRAPH **, SCIP_Bool)
SCIP_RETCODE SCIPprobdataAddNewSol(SCIP *scip, SCIP_Real *nval, SCIP_SOL *sol, SCIP_HEUR *heur, SCIP_Bool *success)
SCIP_Real SCIPprobdataGetOffset(SCIP *scip)
SCIP_RETCODE SCIPheurComputeSteinerTree(SCIP *scip, SCIP_HEURDATA *heurdata, const GRAPH *graph, int *starts, int *bestnewstart, int *best_result, int runs, int bestincstart, SCIP_Real *cost, SCIP_Real *costrev, SCIP_Real *hopfactor, SCIP_Real *nodepriority, SCIP_Real maxcost, SCIP_Bool *success)
SCIP_RETCODE reduce(SCIP *, GRAPH **, SCIP_Real *, int, int)
#define STP_MAX_NODE_WEIGHT
#define DEFAULT_NUSEDSOLS
SCIP_RETCODE SCIPheurImproveSteinerTree(SCIP *scip, GRAPH *graph, SCIP_Real *cost, SCIP_Real *costrev, int *best_result)
Improvement heuristic for Steiner problems.
static SCIP_DECL_HEURFREE(heurFreeRec)
static SCIP_DECL_HEURINIT(heurInitRec)
SCIP_Bool graph_sol_valid(SCIP *, const GRAPH *, int *)
#define DEFAULT_NWAITINGSOLS
SCIP_VAR ** SCIPprobdataGetEdgeVars(SCIP *scip)
#define DEFAULT_MAXFREQREC
static SCIP_RETCODE selectdiffsols(SCIP *scip, GRAPH *graph, SCIP_HEURDATA *heurdata, SCIP_VAR **vars, SCIP_SOL **newsol, int *selection, SCIP_Bool *success)
#define STP_PRIZE_COLLECTING
SCIP_RETCODE graph_init(SCIP *, GRAPH **, int, int, int, int)
includes various files containing graph methods used for Steiner problems
#define STP_ROOTED_PRIZE_COLLECTING
Primal recombination heuristic for Steiner problems.
shortest paths based primal heuristics for Steiner problems
void graph_knot_add(GRAPH *, int)
struct Int_List_Node * parent
void graph_edge_add(SCIP *, GRAPH *, int, int, double, double)