reduce_alt.c
Go to the documentation of this file.
21 * Most tests can be found in "Combining NP-Hard Reduction Techniques and Strong Heuristics in an Exact Algorithm for the
23 * or in "Reduction Techniques for the Prize-Collecting Steiner Tree Problem and the Maximum-Weight Connected Subgraph Problem"
32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
168 /* NOTE: terminals can be leafs in an optimal solution! Thus we need to be careful with terminals. */
436 graph_tpathsGet4CloseTermsLE(g, sd->terminalpaths, tail, upper_sdbound, neighbterms, firstedges,
469 graph_tpathsGet4CloseTermsLE(g, sd->terminalpaths, head, upper_sdbound, neighbterms, firstedges,
601 SCIPdebugMessage("%f + %f + %f <= %f ... ", dist_tail, edgecost, dist_head, candidate_bottlenecks[i]);
811 assert(GE(ttdist, 0.0) && LE(ttdist, vnoi[mintail].dist + g->cost[minedge] + vnoi[minhead].dist));
815 if( SCIPisGE(scip, mincost2, ttdist) && (edgestate == NULL || edgestate[minedge] != EDGE_BLOCKED) )
873 SCIP_CALL( graph_pc_contractEdge(scip, g, solnode, contractnode_in, contractnode_out, baseterm) );
884 SCIP_CALL( graph_knot_contractFixed(scip, g, solnode, minedge, contractnode_in, contractnode_out) );
1028 SCIP_CALL( graph_voronoiWithDist(scip, g, NULL, g->cost, distance, edgearrint, vbase, minedge1, distnode, vnoi) );
1228 SCIP_CALL( graph_voronoiWithDist(scip, g, nodes_isTerm, g->cost, distance, edgearrint, vbase, minedge1, distnode, vnoi) );
1355 if( contract && (!pc || (SCIPisLE(scip, g->cost[edge1], baseprize) && SCIPisLE(scip, ttdist, nextprize))) )
1731 && GT(g->prize[neighborNeighbor], maxSpecialNeighborPrize) && neighborNeighbor != specialNeigborRound0 )
1772 if( g->grad[neighbor] <= maxgrad && !Is_term(g->term[neighbor]) && marked[neighbor] != VERTEX_NEIGHBOR )
1886 /* vertex part of the current connected subset? Or terminal? Or belonging to the extension of the graph? */
2015 /* vertex part of the current connected subset? Or terminal? Or belonging to the extension of the graph? */
2150 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &sdist0, -prize, heap, statetail, statehead, memlbltail, memlblhead, adjverts[0], adjverts[1], limit, FALSE, TRUE) );
2151 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &sdist1, -prize, heap, statetail, statehead, memlbltail, memlblhead, adjverts[1], adjverts[2], limit, FALSE, TRUE) );
2152 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &sdist2, -prize, heap, statetail, statehead, memlbltail, memlblhead, adjverts[2], adjverts[0], limit, FALSE, TRUE) );
2235 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &(sdist0), -prize, heap, statetail, statehead, memlbltail, memlblhead, adjverts[k], adjverts[k2], limit, FALSE, TRUE) );
2338 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &(sdist0), -prize, heap, statetail, statehead, memlbltail, memlblhead, adjverts[k], adjverts[k2], limit, FALSE, TRUE) );
2510 SCIP_CALL( reduce_getSdByPaths(scip, g, pathtail, pathhead, &sdist, -(g->prize[i]), heap, statetail, statehead, memlbltail, memlblhead, i1, i2, limit, FALSE, TRUE) );
2645 SCIP_CALL( reduce_sdStarBiasedWithProfit(scip, edgelimit, sdistance->sdprofit, TRUE, g, &nelimsnew) );
2649 SCIP_CALL( reduce_sdprofitBuildFromBLC(scip, g, sdistance->blctree, FALSE, sdistance->sdprofit) );
2705 SCIP_CALL( graph_transRpcGetSpg(scip, g, primalbound, &fixednew, &edgemap_new2org, &graph_spg) );
2720 assert(Is_term(graph_spg->term[graph_spg->tail[i]]) || Is_term(graph_spg->term[graph_spg->head[i]]));
2737 SCIP_CALL( reduce_sdprofitBuildFromBLC(scip, graph_spg, sdistance->blctree, FALSE, sdistance->sdprofit) );
2738 SCIP_CALL( graph_tpathsRecomputeBiased(sdistance->sdprofit, graph_spg, sdistance->terminalpaths) );
2762 if( (graph_pc_knotIsFixedTerm(g, orgtail) || graph_pc_knotIsPropPotTerm(g, orgtail)) && g->source != orghead )
static SCIP_RETCODE nsvEdgeContract(SCIP *scip, int edge, int end_remain, int end_killed, GRAPH *g, NSV *nsv, int *nelims)
Definition: reduce_alt.c:497
SCIP_RETCODE graph_knot_contractFixed(SCIP *, GRAPH *, int *, int, int, int)
Definition: graph_node.c:521
Definition: graphdefs.h:184
Definition: struct_scip.h:59
void reduce_blctreeGetMstEdges(const GRAPH *, const BLCTREE *, int *)
Definition: reduce_util.c:1230
SCIP_RETCODE graph_voronoiWithDist(SCIP *, const GRAPH *, const SCIP_Bool *, const SCIP_Real *, double *, int *, int *, int *, int *, PATH *)
SCIP_RETCODE reduce_nsvImpliedRecord(SCIP *scip, const SD *sdistance, GRAPH *g, STP_Vectype(int) *edgerecord)
Definition: reduce_alt.c:643
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip_mem.h:117
void graph_getIsTermArray(const GRAPH *, SCIP_Bool *)
Definition: graph_base.c:540
SCIP_RETCODE reduce_sl(SCIP *scip, const int *edgestate, GRAPH *g, PATH *vnoi, SCIP_Real *fixed, int *vbase, int *vrnodes, STP_Bool *visited, int *solnode, int *nelims)
Definition: reduce_alt.c:665
void reduce_sollocalSetOffset(SCIP_Real, REDSOLLOCAL *)
Definition: reduce_sol.c:488
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
SCIP_RETCODE reduce_sdprofitBuildFromBLC(SCIP *, const GRAPH *, const BLCTREE *, SCIP_Bool, SDPROFIT *)
Definition: reduce_sdutil.c:1179
Problem data for stp problem.
includes various files containing graph methods used for Steiner tree problems
SCIP_RETCODE reduce_impliedProfitBased(SCIP *scip, int edgelimit, GRAPH *g, int *solnode, SCIP_Real *fixed, int *nelims)
Definition: reduce_alt.c:2609
Definition: graphdefs.h:284
SCIP_RETCODE reduce_cnsAdv(SCIP *scip, GRAPH *g, int *marked, int *count)
Definition: reduce_alt.c:1793
void reduce_blctreeGetMstEdgesState(const GRAPH *, const BLCTREE *, SCIP_Bool *)
Definition: reduce_util.c:1315
SCIP_RETCODE reduce_sollocalRebuildTry(SCIP *, GRAPH *, REDSOLLOCAL *)
Definition: reduce_sol.c:507
static void ansProcessCandidateWithBridge(SCIP *scip, GRAPH *g, int *RESTRICT marked, int *RESTRICT nelims, SCIP_Real maxprize, int candvertex, int bridgeedge)
Definition: reduce_alt.c:158
SCIP_Bool *RESTRICT candidates_isLink
Definition: reduce_alt.c:66
SCIP_RETCODE graph_tpathsRecomputeBiased(const SDPROFIT *, GRAPH *, TPATHS *)
Definition: graph_tpath.c:1776
int *RESTRICT nodes_isBlocked
Definition: reduce_alt.c:69
static SCIP_RETCODE nsvInitData(SCIP *scip, const SD *sdistance, const GRAPH *g, int *solnode, SCIP_Real *fixed, NSV *nsv)
Definition: reduce_alt.c:264
SCIP_RETCODE reduce_nv(SCIP *scip, GRAPH *g, PATH *vnoi, SCIP_Real *fixed, int *edgearrint, int *vbase, int *solnode, int *nelims)
Definition: reduce_alt.c:932
Definition: reducedefs.h:135
miscellaneous methods used for solving Steiner problems
SCIP_Bool graph_transRpcToSpgIsStable(const GRAPH *, SCIP_Real)
Definition: graph_trans.c:1188
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:451
int *RESTRICT candidates_tail
Definition: reduce_alt.c:67
SCIP_Real *RESTRICT candidates_headdist
Definition: reduce_alt.c:64
SCIP_RETCODE reduce_nsvImplied(SCIP *scip, const SD *sdistance, GRAPH *g, int *solnode, SCIP_Real *fixed, int *nelims)
Definition: reduce_alt.c:621
int *RESTRICT candidates_edge
Definition: reduce_alt.c:65
void graph_edge_add(SCIP *, GRAPH *, int, int, double, double)
SCIP_RETCODE reduce_ansAdv2(SCIP *scip, GRAPH *g, int *nelims)
Definition: reduce_alt.c:1656
Definition: type_retcode.h:33
SCIP_RETCODE reduce_sdBiased(SCIP *, SD *, GRAPH *, int *)
Definition: reduce_sd.c:1845
SCIP_RETCODE reduce_ansAdv(SCIP *scip, GRAPH *g, int *nelims, SCIP_Bool extneigbhood)
Definition: reduce_alt.c:1544
SCIP_RETCODE graph_pc_contractEdge(SCIP *, GRAPH *, int *, int, int, int)
Definition: graph_pcbase.c:2385
SCIP_Bool graph_pc_knotIsPropPotTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1288
SCIP_Real *RESTRICT candidates_taildist
Definition: reduce_alt.c:63
static SCIP_Real reduce_sdprofitGetProfit(const SDPROFIT *sdprofit, int node, int nonsource1, int nonsource2)
Definition: reducedefs.h:178
SCIP_RETCODE reduce_cutEdgeTryPrune(SCIP *, int, GRAPH *, SCIP_Bool *)
Definition: reduce_simple.c:1001
SCIP_RETCODE reduce_getSdByPaths(SCIP *, GRAPH *, PATH *, PATH *, SCIP_Real *, SCIP_Real, int *, int *, int *, int *, int *, int, int, int, SCIP_Bool, SCIP_Bool)
Definition: reduce_sd.c:2304
void graph_voronoiTerms(const GRAPH *, const SCIP_Bool *, int *RESTRICT, PATH *RESTRICT)
SCIP_RETCODE reduce_sdInitBiasedBottleneck(SCIP *, GRAPH *, SD **)
Definition: reduce_sdutil.c:779
int *RESTRICT candidates_head
Definition: reduce_alt.c:68
SCIP_Bool graph_pc_knotIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1383
static void ansDeleteVertex(SCIP *scip, GRAPH *g, int *RESTRICT marked, int *RESTRICT nelims, int vertex)
Definition: reduce_alt.c:85
SCIP_RETCODE reduce_chain2(SCIP *scip, GRAPH *g, PATH *pathtail, int *heap, int *statetail, int *statehead, int *nelims, int limit)
Definition: reduce_alt.c:2445
Portable definitions.
Definition: reducedefs.h:122
Definition: reduce_sol.c:44
SCIP_RETCODE reduce_npv(SCIP *scip, GRAPH *g, PATH *pathtail, int *heap, int *statetail, int *statehead, int *nelims, int limit)
Definition: reduce_alt.c:2067
Definition: reduce_util.c:84
struct nearest_special_distance_test_data NSV
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:477
static void nsvInitRecording(STP_Vectype(int) edgesrecord, NSV *nsv)
Definition: reduce_alt.c:337
SCIP_Bool graph_pc_knotIsDummyTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1344
static SCIP_RETCODE nsvExec(SCIP *scip, NSV *nsv, GRAPH *g, int *nelims)
Definition: reduce_alt.c:535
void reduce_blctreeGetMstEdgesToCutDist(const GRAPH *, const BLCTREE *, SCIP_Real *RESTRICT, SCIP_Real *RESTRICT)
SCIP_Bool graph_pc_knotIsFixedTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1257
SCIP_RETCODE reduce_unconnectedRpcRmw(SCIP *, GRAPH *, SCIP_Real *)
Definition: reduce_pcsimple.c:1524
SCIP_Bool graph_pc_isUnrootedPcMw(const GRAPH *)
Definition: graph_pcbase.c:2669
int reduce_blctreeGetMstNedges(const BLCTREE *)
Definition: reduce_util.c:1218
static void ansProcessCandidate(SCIP *scip, GRAPH *g, int *RESTRICT marked, int *RESTRICT nelims, SCIP_Real maxprize, int candvertex)
Definition: reduce_alt.c:219
static SCIP_Bool nsvEdgeIsValid(const GRAPH *g, const NSV *nsv, int edge)
Definition: reduce_alt.c:370
static void ansUnmark(const GRAPH *g, int basenode, const int *neighbarr, int nNeigbors, int *RESTRICT marked)
Definition: reduce_alt.c:111
SCIP_RETCODE reduce_sdStarBiasedWithProfit(SCIP *, int, const SDPROFIT *, SCIP_Bool, GRAPH *, int *)
Definition: reduce_sd.c:3353
void graph_pc_knotToFixedTerm(SCIP *, GRAPH *, int, SCIP_Real *)
Definition: graph_pcbase.c:1079
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:464
void graph_tpathsGet4CloseTermsLE(const GRAPH *, const TPATHS *, int, SCIP_Real, int *RESTRICT, int *RESTRICT, SCIP_Real *RESTRICT, int *RESTRICT)
SCIP_RETCODE graph_transRpcGetSpg(SCIP *, const GRAPH *, SCIP_Real, SCIP_Real *, int **, GRAPH **)
Definition: graph_trans.c:1217
SCIP_RETCODE reduce_impliedProfitBasedRpc(SCIP *scip, GRAPH *g, REDSOLLOCAL *redsollocal, SCIP_Real *fixed, int *nelims)
Definition: reduce_alt.c:2664
static void nsvEdgeGetTermDists(const GRAPH *g, const NSV *nsv, int edge, int candidate_id, SCIP_Real *dist_tail, SCIP_Real *dist_head)
Definition: reduce_alt.c:400
Definition: objbenders.h:33
SCIP_Real *RESTRICT candidates_bottleneck
Definition: reduce_alt.c:62
includes various reduction methods for Steiner tree problems
SCIP_Real reduce_sollocalGetUpperBound(const REDSOLLOCAL *)
Definition: reduce_sol.c:633
void reduce_blctreeGetMstBottlenecks(const GRAPH *, const BLCTREE *, SCIP_Real *)
Definition: reduce_util.c:1349
SCIP callable library.
SCIP_RETCODE reduce_nvAdv(SCIP *scip, const int *edgestate, GRAPH *g, PATH *vnoi, SCIP_Real *distance, SCIP_Real *fixed, int *edgearrint, int *vbase, int *distnode, int *solnode, int *nelims)
Definition: reduce_alt.c:1121