heur_local.c
Go to the documentation of this file.
20 * This file implements several local heuristics, including vertex insertion, key-path exchange and key-vertex elimination,
21 * ("Fast Local Search for Steiner Trees in Graphs" by Uchoa and Werneck). Other heuristics are for PCSTP and MWCSP.
27 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
39 /* @note if heuristic is running in root node timing is changed there to (SCIP_HEURTIMING_DURINGLPLOOP |
50 #define HEUR_TIMING (SCIP_HEURTIMING_BEFORENODE | SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_AFTERLPLOOP | SCIP_HEURTIMING_AFTERNODE)
67 #define GREEDY_MAXRESTARTS 3 /**< Max number of restarts for greedy PC/MW heuristic if improving solution has been found. */
68 #define GREEDY_EXTENSIONS_MW 6 /**< Number of extensions for greedy MW heuristic. MUST BE HIGHER THAN GREEDY_EXTENSIONS */
135 int* const solEdges; /**< array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) */
174 int* const solDegreeNonTerm; /**< degree of node [v] in current solution; (pseudo) terminals are marked as UNKNOWN */
346 = SCIPisLT(scip, newsol_obj, SCIPgetSolOrigObj(scip, initialsol) - SCIPprobdataGetOffset(scip));
375 if( heurdata->nbestsols < heurdata->maxnsols && SCIPisGT(scip, SCIPgetSolOrigObj(scip, bestsol) - SCIPprobdataGetOffset(scip), newsol_obj) )
380 SCIPdebugMessage("success in local: old: %f new: %f \n", (SCIPgetSolOrigObj(scip, bestsol) - SCIPprobdataGetOffset(scip)), newsol_obj);
406 if( stp_type != STP_SPG && stp_type != STP_RSMT && stp_type != STP_OARSMT && stp_type != STP_PCSPG
407 && stp_type != STP_RPCSPG && stp_type != STP_GSTP && stp_type != STP_MWCSP && stp_type != STP_RMWCSP )
540 /** computes lowest common ancestors for all pairs {vbase(v), vbase(u)} such that {u,w} is a boundary edge,
556 int* uboundpaths; /* boundary-paths (each one represented by its boundary edge) having node 'u' as an endpoint */
564 SCIP_CALL( lca(scip, graph, v, uf, nodesmark, steineredges, lcalists, boundpaths, heapsize, vbase) );
583 /* if the ancestor of 'u' and 'v' is one of the two, the boundary-edge is already in boundpaths[u] */
598 /** computes lowest common ancestors for all pairs {vbase(v), vbase(u)} such that {u,w} is a boundary edge */
623 SCIP_CALL( lca(scip, graph, graph->source, connectData->uf, nodesmark, solEdges, lvledges_start, boundpaths, pheapsize, vnoibase) );
673 if( graphmark[node] && !steinertree[node] && Is_pseudoTerm(graph->term[node]) && !prizemark[node] )
714 /** get prize not already counted that is associated to edge, not including solution nodes or forbidden ones */
861 /** checks whether node is crucial, i.e. a terminal or a vertex with degree at least 3 (w.r.t. the Steiner tree) */
985 assert(vnoiData->vnoi_base[graph->tail[boundaryedge]] != vnoiData->vnoi_base[graph->head[boundaryedge]]);
1002 for( int node = graph->tail[boundaryedge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1011 for( int node = graph->head[boundaryedge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1069 /* add vertical boundary-paths between the child components and the root-component (w.r.t. node 'crucnode') */
1080 SCIP_CALL( SCIPpairheapDeletemin(scip, &edge, &edgecost, &boundpaths[supernode], &pheapsize[supernode]) );
1082 node = (vnoibase[graph->head[edge]] == UNKNOWN)? UNKNOWN : SCIPStpunionfindFind(uf, vnoibase[graph->head[edge]]);
1084 /* check whether edge 'edge' represents a boundary-path having an endpoint in the kth-component and in the root-component respectively */
1242 SCIPpairheapMeldheaps(scip, &boundpaths[crucnode], &boundpaths[adjnode], &pheapsize[crucnode], &pheapsize[adjnode]);
1277 SCIPpairheapMeldheaps(scip, &boundpaths[crucnode], &boundpaths[adjnode], &pheapsize[crucnode], &pheapsize[adjnode]);
1292 /* traverse the (unique) key-path containing the parent of the current crucial node 'crucnode' */
1437 for( node = graph->tail[newedge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1445 for( node = graph->head[newedge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1457 /* flip all edges on the ST path between the endnode of the new key-path and the current crucial node */
1479 if( !Is_term(graph->term[node]) && scanned[node] && !pinned[node] && SCIPStpunionfindFind(uf, node) == node )
1486 if( solEdges[edge] == CONNECT && solNodes[adjnode] && graphmark[adjnode] && SCIPStpunionfindFind(uf, adjnode) != node )
1490 SCIPpairheapMeldheaps(scip, &boundpaths[node], &boundpaths[adjnode], &pheapsize[node], &pheapsize[adjnode]);
1519 SCIPpairheapMeldheaps(scip, &boundpaths[node], &boundpaths[adjnode], &pheapsize[node], &pheapsize[adjnode]);
1573 /* mark all Steiner tree nodes except for those belonging to the root-component as forbidden */
1593 const int edge = (mst[l].edge % 2 == 0)? boundedges[mst[l].edge / 2] : flipedge(boundedges[mst[l].edge / 2]);
1621 for( node = graph->tail[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1635 if( !Is_term(graph->term[node]) && scanned[node] && !pinned[node] && SCIPStpunionfindFind(uf, node) == node )
1644 if( solEdges[oedge] == CONNECT && graphmark[head] && solNodes[head] && SCIPStpunionfindFind(uf, head) != node )
1648 SCIPpairheapMeldheaps(scip, &boundpaths[node], &boundpaths[head], &pheapsize[node], &pheapsize[head]);
1676 SCIPpairheapMeldheaps(scip, &boundpaths[node], &boundpaths[head], &pheapsize[node], &pheapsize[head]);
1682 /* mark the start node (lying in the root-component of the Steiner tree) of the current boundary-path as pinned,
1686 for( node = graph->head[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1699 for( int node = graph->tail[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1702 if( solEdges[vnoipath[node].edge] != CONNECT && solEdges[flipedge(vnoipath[node].edge)] != CONNECT )
1708 for( int node = graph->head[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1754 edgecost_old = getBoundaryPathCostPrized(graph, vnoiData, soltreeData, boundedge_old, pcmwData);
1782 assert(SCIPisLT(scip, edgecost, FARAWAY) || (graph_pc_isPcMw(graph) && graph->source == graph->head[*boundedge_new] ) );
1857 /* create a supergraph, having the endpoints of the key-paths incident to the current crucial node as (super-) vertices */
1884 /* if node 'node' or 'adjnode' belongs to the root-component, take the (temporary) root-component identifier instead */
1892 graph_edge_add(scip, supergraph, supernodesid[node], supernodesid[adjnode], edgecost, edgecost);
1910 const int edge = (mst[l].edge % 2 == 0)? boundaryedges[mst[l].edge / 2] : flipedge(boundaryedges[mst[l].edge / 2]);
1918 if( pcmw ) printf("nodeweights: %f -> %f \n", graph->prize[graph->tail[edge]], graph->prize[graph->head[edge]]);
1929 for( int node = graph->tail[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1943 if( pcmw ) printf("nodeweights: %f -> %f \n", graph->prize[graph->tail[edge]], graph->prize[graph->head[edge]]);
1948 for( int node = graph->head[edge]; node != vnoibase[node]; node = graph->tail[vnoipath[node].edge] )
1964 if( pcmw ) printf("nodeweights: %f -> %f \n", graph->prize[graph->tail[edge]], graph->prize[graph->head[edge]]);
2017 assert(!pinned[keyvertex] && nodeIsCrucial(graph, solEdges, keyvertex) && !Is_term(graph->term[keyvertex]));
2282 /* restore data of all nodes having the current (internal) key-path node as their voronoi base */
2320 /* reset all nodes (referred to as 'C') whose bases are internal nodes of the current key-paths */
2760 /* finally, cut the edge added first (if it had been cut during the insertion process, it would have been restored above) */
2825 SCIPdebugMessage("remove chain %d->%d \n", graph->tail[chainfirst->edge], graph->head[chainlast->edge]);
2896 int* solEdges /**< array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) */
2927 if( stp_type != STP_SPG && stp_type != STP_RSMT && stp_type != STP_OARSMT && stp_type != STP_GSTP && !mwpc )
2964 INSERT insertData = { .chainStarts = chainStarts, .chainEnds = chainEnds, .edgecosts = edgecosts,
3020 insertionReplaceChain(graph, insertEdgeCurr, linkcutNodes, &insertData, v, insertHeadCurr, chainfirst, chainlast);
3025 const SCIP_Real chainweight = SCIPlinkcuttreeFindMaxChain(scip, linkcutNodes, edgecosts, pc ? graph->prize : NULL,
3036 insertionReplaceChain(graph, insertEdgeCurr, linkcutNodes, &insertData, v, insertHeadCurr, chainfirst, chainlast);
3137 int* solEdges, /**< array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) */
3249 VNOILOC vnoiData = { .vnoi_path = vnoipath, .vnoi_base = vnoibase, .memvdist = memvdist, .memvbase = memvbase,
3251 KPATHS keypathsData = { .kpnodes = kpnodes, .kpedges = kpedges, .kpcost = 0.0, .nkpnodes = 0, .nkpedges = 0,
3253 CONN connectivityData = { .blists_start = blists_start, .pheap_boundpaths = boundpaths, .lvledges_start = lvledges_start,
3256 SOLTREE soltreeData = { .solNodes = solNodes, .linkcutNodes = linkcutNodes, .solEdges = solEdges, .nodeIsPinned = pinned,
3260 PCMW pcmwData = { .prize_biased = prize_pc, .edgecost_biased = edgecostBiased_pc, .edgecost_org = edgecostOrg_pc,
3261 .prizemark = prizemark, .prizemarklist = prizemarklist, .nprizemarks = 0, .isActive = graph_pc_isPcMw(graph),
3290 graph_voronoi(graph, pcmwData.edgecost_biased, NULL, soltreeData.solNodes, vnoiData.vnoi_base, vnoiData.vnoi_path);
3294 graph_voronoi(graph, graph->cost, NULL, soltreeData.solNodes, vnoiData.vnoi_base, vnoiData.vnoi_path);
3297 SCIP_CALL( connectivityDataInit(scip, graph, &vnoiData, &soltreeData, &pcmwData, &connectivityData) );
3327 if( !pinned[crucnode] && !Is_term(graph->term[crucnode]) && nodeIsCrucial(graph, solEdges, crucnode) )
3331 getKeyPathsStar(crucnode, graph, &connectivityData, &soltreeData, &pcmwData, &keypathsData, &supergraphData, &allgood);
3342 assert(keypathsData.nkpnodes != 0); /* if there are no key-path nodes, something has gone wrong */
3344 /* reset all nodes (referred to as 'C' henceforth) whose bases are internal nodes of the current key-paths */
3347 SCIP_CALL( connectivityDataKeyElimUpdate(scip, graph, &vnoiData, &supergraphData, crucnode, &connectivityData) );
3349 /* try to connect the nodes of C (directly) to COMP(C), as a preprocessing for graph_voronoiRepairMult */
3350 vnoiDataRepairPreprocess(scip, graph, &keypathsData, &connectivityData, &pcmwData, &vnoiData, &nheapelems);
3352 graph_voronoiRepairMult(scip, graph, (pcmwData.isActive? pcmwData.edgecost_biased : graph->cost),
3353 supernodesmark, &nheapelems, vnoibase, connectivityData.boundaryedges, &(connectivityData.nboundaryedges), &uf, vnoipath);
3368 SCIPdebugMessage("found improving solution in KEY VERTEX ELIMINATION (round: %d) \n \n ", nruns);
3370 SCIP_CALL( soltreeElimKeyPathsStar(scip, graph, &connectivityData, &vnoiData, &keypathsData, &supergraphData,
3380 /* meld the heap pertaining to 'crucnode' and all heaps pertaining to descendant key-paths of node 'crucnode' */
3383 SCIPpairheapMeldheaps(scip, &boundpaths[crucnode], &boundpaths[kpnodes[k]], &pheapsize[crucnode], &pheapsize[kpnodes[k]]);
3387 SCIPpairheapMeldheaps(scip, &boundpaths[crucnode], &boundpaths[supernodes[k]], &pheapsize[crucnode], &pheapsize[supernodes[k]]);
3415 getKeyPathUpper(scip, crucnode, graph, &soltreeData, &pcmwData, &connectivityData, &keypathsData, &allgood);
3430 /* reset all nodes (henceforth referred to as 'C') whose bases are internal nodes of the current keypath */
3438 SCIP_CALL( SCIPpairheapDeletemin(scip, &e, &edgecost, &boundpaths[crucnode], &(pheapsize[crucnode])) );
3461 /* try to connect the nodes of C (directly) to COMP(C), as a preprocessing for Voronoi-repair */
3462 vnoiDataRepairPreprocess(scip, graph, &keypathsData, &connectivityData, &pcmwData, &vnoiData, &nheapelems);
3477 edgecost = getKeyPathReplaceCost(scip, graph, &vnoiData, &soltreeData, edgecost, oldedge, &pcmwData, &newedge);
3592 SCIPdebugMessage("key vertex heuristic obj before/after: %f/%f (improvement=%f)\n", initialobj, newobj, objimprovement);
3641 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
3667 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
3766 * and not among the elite solutions? (note that there can still be an improvement because heuristic is aborted early) */
3819 int* solEdges /**< array indicating whether an arc is part of the solution: CONNECTED/UNKNOWN (in/out) */
3870 SCIP_CALL( localKeyVertexHeuristics(scip, graph, useFast, solNodes, linkcutNodes, solEdges, &success) );
3902 int* solEdges /**< array indicating whether an arc is part of the solution: CONNECTED/UNKNOWN (in/out) */
3914 int* solEdges /**< array indicating whether an arc is part of the solution: CONNECTED/UNKNOWN (in/out) */
3926 int* result /**< array indicating whether an arc is part of the solution (CONNECTED/UNKNOWN) */
3996 STP_Bool* stvertex /**< uninitialized array to indicate whether a vertex is part of the Steiner tree */
4008 const int greedyextensions = (graph->stp_type == STP_MWCSP) ? GREEDY_EXTENSIONS_MW : GREEDY_EXTENSIONS;
4090 SCIP_CALL( addToCandidates(scip, graph, path, i, greedyextensions, &nextensions, candidates, pqueue) );
4094 for( int restartcount = 0; restartcount < GREEDY_MAXRESTARTS && !graph_pc_isRootedPcMw(graph); restartcount++ )
4186 SCIP_CALL( addToCandidates(scip, graph, path, j, greedyextensions, &nextensions, candidates, pqueue) );
4229 STP_Bool* stvertex /**< uninitialized array to indicate whether a vertex is part of the Steiner tree */
4260 if( graph->mark[k] && !stvertex[k] && Is_term(graph->term[k]) && !graph_pc_termIsNonLeafTerm(graph, k) )
4312 graph_path_st_pcmw_extendOut(scip, graph, cand, stvertex, dist, pred, stvertextmp, dheap, &success);
SCIP_Real SCIPlinkcuttreeFindMinChainMw(SCIP *scip, const LCNODE *tree, const SCIP_Real *nodeweight, const int *heads, const int *stdeg, const SCIP_Bool *nodeIsBlocked, int start, int *first, int *last)
Definition: misc_stp.c:381
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip_heur.c:233
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
Definition: scip_randnumgen.c:70
SCIP_Real SCIPlinkcuttreeFindMaxChain(SCIP *scip, const LCNODE *tree, const SCIP_Real *edgecosts, const SCIP_Real *prizes, const int *heads, const int *nonTermDeg, const SCIP_Bool *nodeIsBlocked, int start, int *first, int *last)
Definition: misc_stp.c:445
static SCIP_RETCODE solPrune(SCIP *scip, const GRAPH *graph, int *results)
Definition: heur_local.c:220
static SCIP_Bool probtypeIsValidForLocal(const GRAPH *graph)
Definition: heur_local.c:401
static SCIP_RETCODE solAddTry(SCIP *scip, SCIP_SOL **sols, SCIP_HEUR *heur, const GRAPH *graph, SCIP_Real initialsol_obj, SCIP_SOL *initialsol, int *results, SCIP_RESULT *result)
Definition: heur_local.c:312
Definition: type_result.h:33
Definition: type_result.h:47
SCIP_RETCODE SCIPStpunionfindInit(SCIP *scip, UF *uf, int length)
Definition: misc_stp.c:817
struct pcmw_data PCMW
void graph_pc_getBiased(const GRAPH *, SCIP_Real *RESTRICT, SCIP_Real *RESTRICT)
struct connectivity_data CONN
Definition: graphdefs.h:184
Definition: struct_scip.h:59
static void vnoiDataReset(const CONN *connectData, const KPATHS *keypathsData, const int *graphmark, VNOILOC *vnoiData)
Definition: heur_local.c:2302
static void vnoiDataRestore(const CONN *connectData, const KPATHS *keypathsData, VNOILOC *vnoiData)
Definition: heur_local.c:2264
static SCIP_Bool solDegIsValid(SCIP *scip, const GRAPH *graph, const int *solDegree, const LCNODE *linkcutNodes)
Definition: heur_local.c:2354
Constraint handler for Steiner problems.
Definition: struct_misc.h:69
Definition: heur_local.c:90
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:490
void graph_path_exec(SCIP *, const GRAPH *, int, int, const SCIP_Real *, PATH *)
Definition: graph_path.c:541
void SCIPpairheapMeldheaps(SCIP *scip, PHNODE **root1, PHNODE **root2, int *sizeroot1, int *sizeroot2)
Definition: misc_stp.c:708
includes methods for Steiner tree problem solutions
SCIP_RETCODE SCIPStpHeurLocalRunFast(SCIP *scip, GRAPH *graph, int *solEdges)
Definition: heur_local.c:3911
Definition: misc_stp.h:78
SCIP_RETCODE SCIPStpIncludeHeurLocal(SCIP *scip)
Definition: heur_local.c:4353
Definition: graphdefs.h:301
static SCIP_Real getEdgeCostUnbiased(const GRAPH *graph, const PCMW *pcmwData, int edge)
Definition: heur_local.c:897
static void supergraphDataRestore(const GRAPH *graph, SGRAPH *supergraphData)
Definition: heur_local.c:1791
static void vnoiDataRepairPreprocess(SCIP *scip, const GRAPH *graph, const KPATHS *keypathsData, const CONN *connectData, const PCMW *pcmwData, VNOILOC *vnoiData, int *nheapelems)
Definition: heur_local.c:2197
void graph_pathHeapAdd(const PATH *, int, int *RESTRICT, int *RESTRICT, int *)
static SCIP_Real getBoundaryPathCost(const GRAPH *graph, const VNOILOC *vnoiData, const PCMW *pcmwData, int boundaryedge)
Definition: heur_local.c:937
Problem data for stp problem.
SCIP_RETCODE SCIPStpHeurLocalExtendPcMwOut(SCIP *scip, GRAPH *graph, int *stedge, STP_Bool *stvertex)
Definition: heur_local.c:4225
static void markSolTreeNodes(SCIP *scip, const GRAPH *graph, const int *solEdges, LCNODE *linkcutNodes, STP_Bool *solNodes)
Definition: heur_local.c:455
static void initSolNumberBounds(SCIP *scip, SCIP_HEURDATA *heurdata)
Definition: heur_local.c:290
Definition: struct_misc.h:259
Definition: graphdefs.h:284
void graph_voronoiRepairMult(SCIP *, const GRAPH *, const SCIP_Real *, const STP_Bool *, int *RESTRICT, int *RESTRICT, int *RESTRICT, int *RESTRICT, UF *RESTRICT, PATH *RESTRICT)
static void insertionDecrementSolDegree(const GRAPH *graph, int node, INSERT *insertData)
Definition: heur_local.c:2460
static void insertionGetCandidateEdges(SCIP *scip, SCIP_HEURDATA *heurdata, const GRAPH *graph, const STP_Bool *solNodes, int vertex, int *insertcands, int *ncands)
Definition: heur_local.c:2841
Definition: misc_stp.h:70
SCIP_RETCODE SCIPpairheapDeletemin(SCIP *scip, int *element, SCIP_Real *key, PHNODE **root, int *size)
Definition: misc_stp.c:671
static void insertionResetBlockedNodes(INSERT *insertData)
Definition: heur_local.c:2652
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)
Definition: scip_heur.c:108
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
Definition: misc.c:10003
struct supergraph_data SGRAPH
Definition: heur_local.c:169
static SCIP_Bool pcmwDataIsClean(const GRAPH *graph, const PCMW *pcmwData)
Definition: heur_local.c:750
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:438
static void insertionFinalizeReplacement(const GRAPH *graph, int v_insert, LCNODE *linkcutNodes, INSERT *insertData)
Definition: heur_local.c:2601
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1362
void graph_voronoiRepair(SCIP *, const GRAPH *, const SCIP_Real *, const SCIP_Real *, int *, int *, PATH *, int *, int, UF *)
Definition: graph_vnoi.c:1100
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)
Definition: scip_param.c:74
header only, simple implementation of an STL like vector
GRAPH * SCIPprobdataGetGraph(SCIP_PROBDATA *probdata)
Definition: probdata_stp.c:2948
Definition: heur_local.c:143
SCIP_Bool graph_pc_termIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1431
static const SCIP_Real * getEdgeCosts(const GRAPH *graph, const PCMW *pcmwData)
Definition: heur_local.c:1033
void SCIPlinkcuttreeEvert(LCNODE *RESTRICT tree, int root_new)
Definition: misc_stp.c:559
static SCIP_RETCODE localKeyVertexHeuristics(SCIP *scip, GRAPH *graph, SCIP_Bool useFast, STP_Bool *solNodes, LCNODE *linkcutNodes, int *solEdges, SCIP_Bool *success)
Definition: heur_local.c:3131
Definition: struct_sol.h:64
static SCIP_RETCODE pcmwUpdate(SCIP *scip, GRAPH *graph, SOLTREE *soltreeData, PCMW *pcmwData)
Definition: heur_local.c:804
Definition: heur_local.c:118
Definition: heur_local.c:104
Definition: misc_stp.h:96
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip_heur.c:217
Definition: type_result.h:35
static SCIP_RETCODE getLowestCommonAncestors(SCIP *scip, const GRAPH *graph, const VNOILOC *vnoiData, const SOLTREE *soltreeData, CONN *connectData)
Definition: heur_local.c:600
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip_heur.c:169
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:451
static void insertionRestoreTree(const GRAPH *graph, const int *insertCands, int lcvertex_insert, LCNODE *linkcutNodes, INSERT *insertData)
Definition: heur_local.c:2711
static STP_Bool nodeIsCrucial(const GRAPH *graph, const int *steineredges, int node)
Definition: heur_local.c:863
SCIP_Bool SCIPprobdataProbIsAdversarial(SCIP *scip)
Definition: probdata_stp.c:3324
static void getKeyPathsStar(int keyvertex, const GRAPH *graph, const CONN *connectData, const SOLTREE *soltreeData, const PCMW *pcmwData, KPATHS *keypathsData, SGRAPH *supergraphData, SCIP_Bool *success)
Definition: heur_local.c:1992
static SCIP_Real getKeyPathReplaceCost(SCIP *scip, const GRAPH *graph, const VNOILOC *vnoiData, const SOLTREE *soltreeData, SCIP_Real edgecost_old_in, int boundedge_old, PCMW *pcmwData, int *boundedge_new)
Definition: heur_local.c:1732
SCIP_RETCODE SCIPprobdataAddNewSol(SCIP *scip, SCIP_Real *nval, SCIP_HEUR *heur, SCIP_Bool *success)
Definition: probdata_stp.c:3693
void graph_edge_add(SCIP *, GRAPH *, int, int, double, double)
SCIP_RETCODE SCIPpairheapInsert(SCIP *scip, PHNODE **root, PHNODE *pheapelems, int element, SCIP_Real key, int *size)
Definition: misc_stp.c:636
struct insertion_data INSERT
static SCIP_RETCODE localVertexInsertion(SCIP *scip, SCIP_HEURDATA *heurdata, const GRAPH *graph, STP_Bool *solNodes, LCNODE *linkcutNodes, int *solEdges)
Definition: heur_local.c:2890
void graph_path_st_pcmw_extend(SCIP *, const GRAPH *, const SCIP_Real *, SCIP_Bool, PATH *, STP_Bool *, SCIP_Bool *)
Definition: graph_path.c:1706
SCIP_RETCODE SCIPStpHeurLocalRun(SCIP *scip, GRAPH *graph, int *solEdges)
Definition: heur_local.c:3899
Definition: type_retcode.h:33
static SCIP_RETCODE soltreeExchangeKeyPath(SCIP *scip, GRAPH *graph, const CONN *connectData, const VNOILOC *vnoiData, const KPATHS *keypathsData, const int *dfstree, const STP_Bool *scanned, int dfstree_pos, int boundedge_new, SOLTREE *soltreeData)
Definition: heur_local.c:1385
void SCIPStpunionfindUnion(UF *uf, int p, int q, SCIP_Bool compress)
Definition: misc_stp.c:912
static SCIP_Real pcmwGetNewEdgePrize(const GRAPH *graph, const STP_Bool *steinertree, int edge, PCMW *pcmwData)
Definition: heur_local.c:716
static void pcmwDataClean(const GRAPH *graph, PCMW *pcmwData)
Definition: heur_local.c:780
Definition: struct_heur.h:88
Improvement heuristic for Steiner problems.
SCIP_RETCODE SCIPStpValidateSol(SCIP *, const GRAPH *, const double *, SCIP_Bool, SCIP_Bool *)
Definition: validate.c:202
int GNODECmpByDist(void *first_arg, void *second_arg)
SCIP_RETCODE solstp_pruneFromEdges(SCIP *scip, const GRAPH *g, int *result)
Definition: solstp.c:1432
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
Definition: scip_randnumgen.c:47
SCIP_Real solstp_getObjBounded(const GRAPH *g, const int *soledge, SCIP_Real offset, int nedges)
Definition: solstp.c:1833
void graph_heap_free(SCIP *, SCIP_Bool, SCIP_Bool, DHEAP **)
Definition: graph_util.c:1034
static void solGetStpSol(SCIP *scip, const GRAPH *graph, SCIP_SOL *initialsol, int *results)
Definition: heur_local.c:258
static void insertData(SCIP *scip, STP_Bitset termsmark, STP_Bitset rootsmark, int64_t nsubsets, int node_pos, int split_pos, int *subrootpos, DPSTREE *dpstree)
Definition: dpterms_util.c:172
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randnumgen, int *array, int begin, int end)
Definition: misc.c:10044
static SCIP_RETCODE localRun(SCIP *scip, GRAPH *graph, SCIP_Bool useFast, int *solEdges)
Definition: heur_local.c:3815
static void insertionInit(SCIP_HEURDATA *heurdata, const GRAPH *graph, const int *solEdges, int *solDegreeNonTerm, SCIP_Bool *nodeIsBlocked, int *vertices)
Definition: heur_local.c:2509
void SCIPlinkcuttreeLink(LCNODE *tree, int v, int w, int edge)
Definition: misc_stp.c:357
static void insertionIncrementSolDegree(const GRAPH *graph, int node, INSERT *insertData)
Definition: heur_local.c:2486
SCIP_Bool graph_pc_knotIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1383
void graph_path_st_pcmw_extendOut(SCIP *, const GRAPH *, int, STP_Bool *, SCIP_Real *, int *, STP_Bool *, DHEAP *, SCIP_Bool *)
Definition: graph_path.c:1051
static void soltreeUnmarkKpNodes(const GRAPH *graph, const KPATHS *keypathsData, SOLTREE *soltreeData)
Definition: heur_local.c:1337
SCIP_RETCODE graph_trail_costAware(SCIP *, const GRAPH *, int, SCIP_Bool *)
Definition: graph_util.c:353
struct Voronoi_data_structures VNOILOC
static SCIP_Real getBoundaryPathCostPrized(const GRAPH *graph, const VNOILOC *vnoiData, const SOLTREE *soltreeData, int boundaryedge, PCMW *pcmwData)
Definition: heur_local.c:974
static void getKeyPathUpper(SCIP *scip, int crucnode, const GRAPH *graph, const SOLTREE *soltreeData, const PCMW *pcmwData, CONN *connectData, KPATHS *keypathsData, SCIP_Bool *allGood)
Definition: heur_local.c:1201
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), SCIP_DECL_PQUEUEELEMCHGPOS((*elemchgpos)))
Definition: misc.c:1236
static void insertionBlockChain(const GRAPH *graph, const LCNODE *lctree, int chainfirst_index, int chainlast_index, INSERT *insertData)
Definition: heur_local.c:2678
static SCIP_Bool solIsTrivialPcMw(const GRAPH *graph, const int *solEdges)
Definition: heur_local.c:499
static SCIP_RETCODE connectivityDataInit(SCIP *scip, const GRAPH *graph, const VNOILOC *vnoiData, const SOLTREE *soltreeData, const PCMW *pcmwData, CONN *connectData)
Definition: heur_local.c:1122
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:477
static SCIP_Real getNewPrizeNode(const GRAPH *graph, const STP_Bool *steinertree, const SCIP_Real *prize_biased, const int *graphmark, int node, STP_Bool *prizemark, int *prizemarklist, int *prizemarkcount)
Definition: heur_local.c:659
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
Definition: misc.c:1335
static void insertionReplaceChain(const GRAPH *graph, int newedge, LCNODE *lctree, INSERT *insertData, int v_lc, int headCurr_lc, int chainfirst_index, int chainlast_index)
Definition: heur_local.c:2787
SCIP_Bool graph_pc_knotIsFixedTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1257
static void dfsorder(const GRAPH *graph, const int *edges, int node, int *counter, int *dfst)
Definition: heur_local.c:633
Definition: misc_stp.h:53
static int pcmwGetSolRoot(const GRAPH *graph, const int *solEdges)
Definition: heur_local.c:686
SCIP_RETCODE graph_heap_create(SCIP *, int, int *, DENTRY *, DHEAP **)
Definition: graph_util.c:992
struct solution_tree_data SOLTREE
struct keypaths_data_structures KPATHS
SCIP_RETCODE SCIPStpHeurLocalExtendPcMwImp(SCIP *scip, const GRAPH *graph, int *result)
Definition: heur_local.c:3923
Definition: heur_local.c:155
SCIP_RETCODE SCIPpairheapBuffarr(SCIP *scip, const PHNODE *root, int size, int **elements)
Definition: misc_stp.c:761
void graph_voronoi(const GRAPH *, const SCIP_Real *, const SCIP_Real *, const STP_Bool *, int *, PATH *)
Definition: graph_vnoi.c:333
SCIP_Real * SCIPprobdataGetXval(SCIP *scip, SCIP_SOL *sol)
Definition: probdata_stp.c:3190
shortest paths based primal heuristics for Steiner problems
static SCIP_Bool solNodeIsValid(SCIP *scip, const GRAPH *graph, const STP_Bool *solNodes, const LCNODE *linkcutNodes)
Definition: heur_local.c:2411
void graph_pc_getOrgCosts(SCIP *, const GRAPH *, SCIP_Real *)
Definition: graph_pcbase.c:1829
void solstp_setVertexFromEdge(const GRAPH *g, const int *result, STP_Bool *solnode)
Definition: solstp.c:2078
SCIP_RETCODE SCIPStpHeurLocalExtendPcMw(SCIP *scip, GRAPH *graph, const SCIP_Real *cost, int *stedge, STP_Bool *stvertex)
Definition: heur_local.c:3991
static void insertionInitInsert(SCIP *scip, const GRAPH *graph, int v_insert, int initialEdge, LCNODE *linkcutNodes, INSERT *insertData, SCIP_Real *diff)
Definition: heur_local.c:2548
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:464
static SCIP_RETCODE lca(SCIP *scip, const GRAPH *graph, int u, UF *uf, STP_Bool *nodesmark, const int *steineredges, STP_Vectype(int) *lcalists, PHNODE **boundpaths, const int *heapsize, const int *vbase)
Definition: heur_local.c:543
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip_heur.c:153
SCIP_Bool SCIPStpunionfindIsClear(SCIP *scip, const UF *uf)
Definition: misc_stp.c:861
SCIP_Bool solstp_isValid(SCIP *scip, const GRAPH *graph, const int *result)
Definition: solstp.c:1650
Definition: objbenders.h:33
SCIP_RETCODE solstp_prune(SCIP *scip, const GRAPH *g, int *result, STP_Bool *connected)
Definition: solstp.c:1366
void SCIPStpunionfindFreeMembers(SCIP *scip, UF *uf)
Definition: misc_stp.c:955
static SCIP_RETCODE supergraphComputeMst(SCIP *scip, const GRAPH *graph, const CONN *connectData, const VNOILOC *vnoiData, const KPATHS *keypathsData, int crucnode, SOLTREE *soltreeData, PCMW *pcmwData, SGRAPH *supergraphData)
Definition: heur_local.c:1813
Definition: heur_local.c:131
static SCIP_RETCODE addToCandidates(SCIP *scip, const GRAPH *graph, const PATH *path, int i, int greedyextensions, int *nextensions, GNODE *candidates, SCIP_PQUEUE *pqueue)
Definition: heur_local.c:415
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)
Definition: scip_param.c:48
static SCIP_RETCODE soltreeElimKeyPathsStar(SCIP *scip, const GRAPH *graph, const CONN *connectData, const VNOILOC *vnoiData, const KPATHS *keypathsData, const SGRAPH *supergraphData, const int *dfstree, const STP_Bool *scanned, int dfstree_pos, SOLTREE *soltreeData)
Definition: heur_local.c:1534
static void soltreeMarkKpNodes(const GRAPH *graph, const KPATHS *keypathsData, SOLTREE *soltreeData)
Definition: heur_local.c:1361
static SCIP_RETCODE connectivityDataKeyElimUpdate(SCIP *scip, const GRAPH *graph, const VNOILOC *vnoiData, const SGRAPH *supergraphData, int crucnode, CONN *connectData)
Definition: heur_local.c:1046