extreduce_base.c
Go to the documentation of this file.
20 * This file implements interface methods for extended reduction techniques for several Steiner problems.
26 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
159 SCIP_CALL( graph_edge_delPseudoPath(scip, graph, edge, path_edgein, path_edgeout, redcosts_getEdgeCostsTop(redcostdata)) );
169 assert(reduce_impliedNodesIsValid(graph, (const STP_Vectype(int)*) extpermanent->nodes_implications));
225 SCIP_CALL_ABORT( reduce_sdRepair(scip, edge, distdata->hasPathReplacement, graph, distdata->sdistdata) );
243 assert(reduce_impliedNodesIsValid(graph, (const STP_Vectype(int)*) extpermanent->nodes_implications));
289 SCIP_CALL( extreduce_distDataInit(scip, graph, STP_EXT_CLOSENODES_MAXN, useSd, FALSE, distdata) );
588 extpermanent->redcostEqualAllow = (extpermanent->solIsValid && result[edge] != CONNECT && result[flipedge(edge)] != CONNECT);
604 SCIP_CALL( extreduce_checkComponent(scip, graph, redcostdata, &extcomp, extpermanent, isDeletable) );
647 if( (graph->grad[tail] + graph->grad[head]) <= (STP_GENSTAR_MAXDEG + 2) && !Is_term(graph->term[tail]) && !Is_term(graph->term[head]) )
652 const STP_Bool* halfedges_isInSdMst = reduce_sdgraphGetMstHalfMark(distdata->sdistdata->sdgraph);
727 const SCIP_Real sd = extreduce_distDataGetSdDoubleForbiddenSingle(scip, graph, edge, node_j, node_k, distdata);
1063 SCIPdebugMessage("biased SD for extension not promising: %f < %f \n", profitsratio, EXT_PROFIT_MINRATIO);
1123 hasProfit = GT(reduce_sdprofitGetProfit(extperma->distdata_biased->sdistdata->sdprofit, node, -1, -1), 0.0);
1197 if( SCIPisEQ(scip, newedgecost, cutoffs[edgecount]) && nodestouches[node] == 0 && nodestouches[vert] == 0 && nodestouches[vert2] == 0 )
1223 SCIP_CALL( graph_knot_delPseudoCheckIfPossible(scip, graph, graph->cost, cutoffs, NULL, node, &(extpseudo->cutoffIsPromising)) );
1253 SCIP_CALL( pseudodeleteDeleteComputeCutoffs(scip, FALSE, FALSE, distdata, node, graph, extpseudo) );
1266 SCIP_CALL( graph_knot_delPseudo(scip, graph, graph->cost, cutoffs, NULL, node, redcostdata, success) );
1327 SCIP_CALL( pseudodeleteDeleteComputeCutoffs(scip, FALSE, FALSE, distdata, k, graph, extpseudo) );
1328 SCIP_CALL( pseudodeleteDeleteNode(scip, k, redcostdata, distdata, graph, extpseudo, &success) );
1363 SCIP_CALL( pseudodeleteDeleteMarkedNodes(scip, pseudoDelNodes, redcostdata, distdata_default, graph, extpseudo) );
1364 SCIPdebugMessage("number of eliminations by simple pseudo-elimination %d \n", extpseudo->nelims_simple);
1391 SCIP_CALL( pseudodeleteDeleteComputeCutoffs(scip, TRUE, TRUE, distdata_default, i, graph, extpseudo) );
1398 SCIP_CALL( extreduce_mstbiasedCheck3NodeSimple(scip, graph, i, distdata_default, extperma->distdata_biased, &nodeisDeletable) );
1401 SCIP_CALL( extreduce_checkNode(scip, graph, redcostdata, i, stardata, extperma, &nodeisDeletable) );
1444 SCIP_CALL( extreduce_distDataInit(scip, graph, STP_EXT_CLOSENODES_MAXN, useSd, FALSE, &(extperma->distdata_default)) );
1475 * This method will also set edgedeletable[a] to TRUE if arc 'a' can be deleted, but its anti-parallel arc not. */
1515 extpermanent->redcostEqualAllow = (withSol && result[e] != CONNECT && result[erev] != CONNECT);
1586 assert(redcosts_getRootTop(redcostdata) >= 0 && redcosts_getRootTop(redcostdata) < graph->knots);
1658 SCIP_CALL( generalStarDeleteEdges(scip, redcostdata, extperma, graph, distdata, &ngenstarelims) );
1712 SCIP_CALL( extreduce_distDataInit(scip, graph, STP_EXT_CLOSENODES_MAXN, TRUE, TRUE, &(extperma->distdata_biased)) );
1713 extperma->distdata_biased->hasPathReplacement = extperma->distdata_default->hasPathReplacement;
1720 SCIPdebugMessage("number of eliminations after extended pseudo-elimination %d \n", extpseudo.nelims_extended);
1730 SCIPdebugMessage("number of eliminations after extended pseudo-elimination on profits %d \n", extpseudo.nelims_extended);
1738 /* todo otherwise (I015) we get isolated vertices...not sure whether this is a bug or normal behavior */
1755 STP_Bool* edgedeletable, /**< edge array to mark which (directed) edge can be removed (in/out) */
1764 assert(redcosts_getRootTop(redcostdata) >= 0 && redcosts_getRootTop(redcostdata) < graph->knots);
1822 if( SCIPisGT(scip, edgebound, cutoff) || (extpermanent->redcostEqualAllow && SCIPisEQ(scip, edgebound, cutoff)) || head == root )
1843 SCIP_CALL( extreduce_checkComponent(scip, graph, redcostdata, &extcomp, extpermanent, edgeIsDeletable) );
1874 if( extLeafIsExtendable(graph, isterm, graph->tail[edge]) || extLeafIsExtendable(graph, isterm, graph->head[edge]) )
1882 SCIP_CALL( extreduce_checkComponent(scip, graph, redcostdata, &extcomp, extpermanent, edgeIsDeletable) );
1923 SCIP_CALL( extreduce_checkComponent(scip, graph, redcostdata, &extcomp, extpermanent, isPseudoDeletable) );
1988 if( EQ(0.0, redcosts_getEdgeCostsTop(redcostdata)[e]) && EQ(0.0, redcosts_getEdgeCostsTop(redcostdata)[flipedge(e)]) )
void reduce_removeDeg0NonLeafTerms(SCIP *, GRAPH *, SCIP_Real *)
Definition: reduce_pcsimple.c:1380
SCIP_RETCODE reduce_sdprofitInit1stOnly(SCIP *, const GRAPH *, const SCIP_Real *, SDPROFIT **)
Definition: reduce_sdutil.c:1048
void graph_pseudoAncestors_unhashEdge(const PSEUDOANS *, int, int *)
Definition: graph_history.c:854
SCIP_RETCODE graph_edge_delPseudoPath(SCIP *, GRAPH *, int, int, int, SCIP_Real *)
Definition: graph_delpseudo.c:1136
int graph_pc_realDegree(const GRAPH *, int, SCIP_Bool)
Definition: graph_pcbase.c:2112
Definition: reducedefs.h:71
static void pseudodeleteFreeStar(SCIP *scip, int **compedges, int **extleaves)
Definition: extreduce_base.c:971
SCIP_RETCODE extreduce_extPermaAddMLdistsbiased(SCIP *, EXTPERMA *)
Definition: extreduce_data.c:279
Definition: extreduce_base.c:49
Definition: graphdefs.h:184
SCIP_RETCODE extreduce_pseudoDeleteNodes(SCIP *scip, const SCIP_Bool *pseudoDelNodes, EXTPERMA *extperma, GRAPH *graph, SCIP_Real *offsetp, int *nelims)
Definition: extreduce_base.c:1668
Definition: extreducedefs.h:187
Definition: struct_scip.h:59
SCIP_Bool extreduce_treeIsFlawed(SCIP *, const GRAPH *, const EXTDATA *)
Definition: extreduce_dbg.c:939
void extreduce_exit(SCIP *scip, GRAPH *graph, EXTPERMA **extpermanent)
Definition: extreduce_base.c:1452
SCIP_Real extreduce_distDataGetSdDouble(SCIP *, const GRAPH *, int, int, DISTDATA *)
Definition: extreduce_dist.c:1463
static SCIP_RETCODE generalStarInit(SCIP *scip, const GRAPH *graph, GENSTAR *genstar)
Definition: extreduce_base.c:768
Definition: extreduce_base.c:49
static SCIP_Bool isPseudoDeletable(SCIP *scip, const GRAPH *g, const GRAPH *auxg, const SCIP_Real *ecost, const int *edges, int degree)
Definition: reduce_sd.c:1028
SCIP_Bool reduce_starAllAreChecked(const STAR *)
Definition: reduce_util.c:2002
void extreduce_distDataFree(SCIP *, const GRAPH *, DISTDATA **)
Definition: extreduce_dist.c:1784
SCIP_Real redcosts_getCutoffTop(const REDCOST *redcostdata)
Definition: redcosts.c:300
includes methods for Steiner tree problem solutions
int graph_pseudoAncestorsGetHashArraySize(const PSEUDOANS *)
Definition: graph_history.c:1321
Definition: extreducedefs.h:101
SCIP_RETCODE extreduce_deleteGeneralStars(SCIP *scip, REDCOST *redcostdata, const int *result, GRAPH *graph, STP_Bool *edgedeletable, int *nelims)
Definition: extreduce_base.c:1750
Definition: reducedefs.h:71
void graph_dcsr_deleteEdgeBi(SCIP *, DCSR *, int)
Definition: graph_util.c:1894
void extreduce_distDataRecomputeDirtyPaths(SCIP *, const GRAPH *, DISTDATA *)
Definition: extreduce_dist.c:1370
DISTDATA * distdata_default
Definition: extreducedefs.h:106
SCIP_Bool solstp_isUnreduced(SCIP *scip, const GRAPH *graph, const int *result)
Definition: solstp.c:1596
includes various files containing graph methods used for Steiner tree problems
static void generalStarCheckInit(SCIP *scip, const GRAPH *g, GENSTAR *genstar)
Definition: extreduce_base.c:313
Definition: graphdefs.h:284
static SCIP_RETCODE pseudodeleteDeleteMarkedNodes(SCIP *scip, const SCIP_Bool *pseudoDelNodes, REDCOST *redcostdata, DISTDATA *distdata, GRAPH *graph, EXTPSEUDO *extpseudo)
Definition: extreduce_base.c:1304
SCIP_RETCODE extreduce_deleteEdges(SCIP *scip, EXTPERMA *extperma, GRAPH *graph, int *nelims)
Definition: extreduce_base.c:1569
SCIP_RETCODE extreduce_checkArc(SCIP *scip, const GRAPH *graph, REDCOST *redcostdata, int edge, EXTPERMA *extpermanent, SCIP_Bool *edgeIsDeletable)
Definition: extreduce_base.c:1794
void graph_pseudoAncestors_hashEdge(const PSEUDOANS *, int, int *)
Definition: graph_history.c:824
static SCIP_RETCODE pseudodeleteInit(SCIP *scip, const int *result, const GRAPH *g, SCIP_Real *offsetp, EXTPSEUDO *extpseudo)
Definition: extreduce_base.c:875
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:438
SCIP_RETCODE extreduce_checkEdge(SCIP *scip, const GRAPH *graph, const REDCOST *redcostdata, int edge, EXTPERMA *extpermanent, SCIP_Bool *edgeIsDeletable)
Definition: extreduce_base.c:1854
int extreduce_getMaxTreeDepth(const GRAPH *graph, const EXTPERMA *extpermanent)
Definition: extreduce_base.c:2080
SCIP_Bool graph_pc_termIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1431
SCIP_RETCODE extreduce_spgCheck3ComponentSimple(SCIP *, const GRAPH *, int, const EXTCOMP *, SCIP_Bool, DISTDATA *, SCIP_Bool *)
Definition: extreduce_extspg.c:252
void reduce_impliedNodesRepair(SCIP *, const GRAPH *, int, int, STP_Vectype(int) *)
Definition: reduce_util.c:962
#define SCIPallocCleanBufferArray(scip, ptr, num)
Definition: scip_mem.h:133
SCIP_RETCODE extreduce_init(SCIP *scip, SCIP_Bool useSd, enum EXTRED_MODE mode, GRAPH *graph, REDCOST *redcostdata, EXTPERMA **extpermanent)
Definition: extreduce_base.c:1425
This file implements extended reduction techniques for several Steiner problems.
SCIP_RETCODE extreduce_checkComponent(SCIP *, const GRAPH *, const REDCOST *, EXTCOMP *, EXTPERMA *, SCIP_Bool *)
Definition: extreduce_core.c:2081
SCIP_RETCODE extreduce_deleteArcs(SCIP *scip, REDCOST *redcostdata, const int *result, GRAPH *graph, STP_Bool *edgedeletable, int *nelims)
Definition: extreduce_base.c:1476
SCIP_Bool cutoffIsPromising
Definition: extreduce_base.c:79
static SCIP_RETCODE generalStarCheck(SCIP *scip, const GRAPH *graph, const REDCOST *redcostdata, GENSTAR *genstar, EXTPERMA *extpermanent, SCIP_Bool *isDeletable)
Definition: extreduce_base.c:544
Definition: reducedefs.h:135
SCIP_Real extreduce_distDataGetSdDoubleForbiddenLast(SCIP *, const GRAPH *, int, int, int, int, DISTDATA *)
Definition: extreduce_dist.c:1727
SCIP_RETCODE extreduce_extPermaInit(SCIP *, enum EXTRED_MODE, const GRAPH *, STP_Bool *, EXTPERMA **)
Definition: extreduce_data.c:162
SCIP_Bool extreduce_edgeIsValid(const GRAPH *graph, const REDCOST *redcostdata, int e)
Definition: extreduce_base.c:1959
SCIP_Real * redcosts_getEdgeCostsTop(const REDCOST *redcostdata)
Definition: redcosts.c:202
static SCIP_RETCODE pseudodeleteDeleteComputeCutoffs(SCIP *scip, SCIP_Bool checkpromising, SCIP_Bool abortDeg3, DISTDATA *distdata, int node, GRAPH *graph, EXTPSEUDO *extpseudo)
Definition: extreduce_base.c:1139
enum EXTPSEUDO_MODE deletionMode
Definition: extreduce_base.c:82
SCIP_RETCODE graph_knot_delPseudo(SCIP *, GRAPH *, const SCIP_Real *, const SCIP_Real *, const SCIP_Real *, int, REDCOST *, SCIP_Bool *)
Definition: graph_delpseudo.c:1015
Definition: type_retcode.h:33
static void generalStarSetUp(SCIP *scip, const GRAPH *graph, int edge, GENSTAR *genstar, SCIP_Bool *isPromising, DISTDATA *distdata)
Definition: extreduce_base.c:624
SCIP_RETCODE graph_knot_delPseudoCheckIfPossible(SCIP *, const GRAPH *, const SCIP_Real *, const SCIP_Real *, const SCIP_Real *, int, SCIP_Bool *)
Definition: graph_delpseudo.c:1063
static SCIP_RETCODE pseudodeleteDeleteNode(SCIP *scip, int node, REDCOST *redcostdata, DISTDATA *distdata, GRAPH *graph, EXTPSEUDO *extpseudo, SCIP_Bool *success)
Definition: extreduce_base.c:1232
SCIP_Bool redcostEqualAllow
Definition: extreducedefs.h:128
void extreduce_treeRecompCosts(SCIP *scip, const GRAPH *graph, EXTDATA *extdata)
Definition: extreduce_base.c:1998
static void generalStarCheckGetNextStar(const GRAPH *g, GENSTAR *genstar, EXTCOMP *extcomp, SCIP_Bool *allVisited)
Definition: extreduce_base.c:399
void graph_edge_delFull(SCIP *, GRAPH *, int, SCIP_Bool)
Definition: graph_edge.c:418
SCIP_Real reduce_sdgraphGetMaxCost(const SDGRAPH *)
Definition: reduce_sdgraph.c:1867
void reduce_starResetWithEdges(const GRAPH *, const STP_Vectype(int), STAR *)
static void removeEdge(SCIP *scip, int edge, GRAPH *graph, DISTDATA *distdata, EXTPERMA *extpermanent)
Definition: extreduce_base.c:205
static SCIP_Real reduce_sdprofitGetProfit(const SDPROFIT *sdprofit, int node, int nonsource1, int nonsource2)
Definition: reducedefs.h:178
void extreduce_extPermaFree(SCIP *, EXTPERMA **)
Definition: extreduce_data.c:386
SCIP_Bool graph_valid_dcsr(const GRAPH *, SCIP_Bool verbose)
Definition: graph_util.c:1919
SCIP_RETCODE reduce_termsepaDaWithExperma(SCIP *, GRAPH *, EXTPERMA *, SCIP_Bool *, int *)
Definition: reduce_termsepada.c:441
void extreduce_distDataDeleteEdge(SCIP *, const GRAPH *, int, DISTDATA *)
Definition: extreduce_dist.c:1315
SCIP_RETCODE reduce_sdRepair(SCIP *, int, SCIP_Bool, GRAPH *, SD *)
Definition: reduce_sdutil.c:811
static SCIP_RETCODE pseudodeleteExecute(SCIP *scip, const int *result, const SCIP_Bool *pseudoDelNodes, EXTPERMA *extperma, EXTPSEUDO *extpseudo, GRAPH *graph)
Definition: extreduce_base.c:1343
Definition: extreducedefs.h:174
static SCIP_RETCODE generalStarDeleteEdges(SCIP *scip, REDCOST *redcostdata, EXTPERMA *extpermanent, GRAPH *graph, DISTDATA *distdata, int *nelims)
Definition: extreduce_base.c:810
Definition: extreduce_base.c:54
static SCIP_RETCODE pseudodeleteInitStar(SCIP *scip, const GRAPH *g, int node, STAR *stardata, int **compedges, int **extleaves)
Definition: extreduce_base.c:949
SCIP_Bool extreduce_distCloseNodesAreValid(SCIP *, const GRAPH *, const DISTDATA *)
Definition: extreduce_dbg.c:1125
PATH * redcosts_getNodeToTermsPathsTop(const REDCOST *redcostdata)
Definition: redcosts.c:253
SCIP_RETCODE extreduce_checkNode(SCIP *scip, const GRAPH *graph, const REDCOST *redcostdata, int node, STAR *stardata, EXTPERMA *extpermanent, SCIP_Bool *isPseudoDeletable)
Definition: extreduce_base.c:1890
Definition: extreducedefs.h:79
static void extFree(SCIP *scip, GRAPH *graph, DISTDATA **distdata, EXTPERMA **extpermanent)
Definition: extreduce_base.c:298
static SCIP_RETCODE extInit(SCIP *scip, SCIP_Bool useSd, GRAPH *graph, STP_Bool *edgedeletable, DISTDATA **distdata, EXTPERMA **extpermanent)
Definition: extreduce_base.c:275
SCIP_Bool extreduce_extPermaIsClean(const GRAPH *, const EXTPERMA *)
Definition: extreduce_data.c:305
SCIP_Bool graph_pc_knotIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1383
void extreduce_edgeRemove(SCIP *scip, int edge, GRAPH *graph, DISTDATA *distdata, EXTPERMA *extpermanent)
Definition: extreduce_base.c:1946
SCIP_Bool reduce_sdgraphEdgeIsInMst(const SDGRAPH *, int)
Definition: reduce_sdgraph.c:1909
void extreduce_redcostTreeRecompute(SCIP *, const GRAPH *, EXTDATA *)
Definition: extreduce_redcosts.c:495
SCIP_Real extreduce_distDataGetSdDoubleForbiddenSingle(SCIP *, const GRAPH *, int, int, int, DISTDATA *)
Definition: extreduce_dist.c:1669
Definition: reducedefs.h:122
Definition: extreducedefs.h:138
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:477
SCIP_RETCODE extreduce_distDataInit(SCIP *, GRAPH *, int, SCIP_Bool, SCIP_Bool, DISTDATA **)
Definition: extreduce_dist.c:1218
SCIP_Bool graph_pc_knotIsDummyTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1344
SCIP_Real *RESTRICT nodes_bias
Definition: reducedefs.h:137
SCIP_Bool graph_pc_knotIsFixedTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1257
static SCIP_Bool pseudodeleteBiasedIsPromising(SCIP *scip, const EXTPERMA *extperma, const GRAPH *g)
Definition: extreduce_base.c:1025
SCIP_RETCODE reduce_pathreplaceExt(SCIP *, GRAPH *, EXTPERMA *, int *)
Definition: reduce_path.c:1080
static SCIP_Bool graphmarkIsClean(const REDCOST *redcostdata, const GRAPH *graph)
Definition: extreduce_base.c:89
void graph_pseudoAncestors_hashEdgeDirty(const PSEUDOANS *, int, SCIP_Bool, SCIP_Bool *, int *)
Definition: graph_history.c:884
SCIP_Real * redcosts_getRootToNodeDistTop(const REDCOST *redcostdata)
Definition: redcosts.c:228
SCIP_Bool cutoffIsComputed
Definition: extreduce_base.c:80
static SCIP_RETCODE replaceEdgeByPath(SCIP *scip, int edge, const GENSTAR *genstar, GRAPH *graph, REDCOST *redcostdata, DISTDATA *distdata, EXTPERMA *extpermanent)
Definition: extreduce_base.c:118
static void generalStarExit(SCIP *scip, const GRAPH *graph, GENSTAR *genstar)
Definition: extreduce_base.c:788
static void pseudodeleteExit(SCIP *scip, EXTPSEUDO *extpseudo, int *nelimsp)
Definition: extreduce_base.c:928
Definition: graph_history.c:52
void solstp_setVertexFromEdge(const GRAPH *g, const int *result, STP_Bool *solnode)
Definition: solstp.c:2078
static void generalStarCheckExit(SCIP *scip, const GRAPH *g, GENSTAR *genstar)
Definition: extreduce_base.c:375
SCIP_RETCODE extreduce_mstbiasedCheck3NodeSimple(SCIP *, const GRAPH *, int, DISTDATA *, DISTDATA *, SCIP_Bool *)
Definition: extreduce_extmstbiased.c:226
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:464
static void pseudodeleteGetNextStar(const GRAPH *g, STAR *stardata, EXTCOMP *extcomp)
Definition: extreduce_base.c:984
struct extension_pseudo_deletion EXTPSEUDO
Definition: redcosts.c:34
Definition: extreduce_base.c:49
SCIP_Bool solstp_isValid(SCIP *scip, const GRAPH *graph, const int *result)
Definition: solstp.c:1650
Definition: reduce_util.c:53
static SCIP_Bool pseudodeleteAllStarsChecked(const STAR *stardata)
Definition: extreduce_base.c:1014
Definition: objbenders.h:33
SCIP_RETCODE reduce_sdRepairSetUp(SCIP *, const GRAPH *, SD *)
Definition: reduce_sdutil.c:853
const STP_Bool * reduce_sdgraphGetMstHalfMark(const SDGRAPH *)
Definition: reduce_sdgraph.c:1879
int extreduce_getMaxStackNcomponents(const GRAPH *graph)
Definition: extreduce_base.c:2069
static SCIP_Bool pseudodeleteNodeIsPromising(const GRAPH *g, const EXTPERMA *extperma, const EXTPSEUDO *extpseudo, int node)
Definition: extreduce_base.c:1074
Definition: extreduce_base.c:70
struct general_star GENSTAR
SCIP_Bool reduce_impliedNodesIsValid(const GRAPH *, const STP_Vectype(int) *)
Definition: reduce_util.c:996
static SCIP_Bool extLeafIsExtendable(const GRAPH *graph, const SCIP_Bool *isterm, int leaf)
Definition: extreducedefs.h:488