graph_delpseudo.c
Go to the documentation of this file.
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
202 SCIP_CALL( SCIPallocBufferArray(scip, &(ecostadapt), redcost_nlevels * STP_DELPSEUDO_MAXGRAD) );
203 SCIP_CALL( SCIPallocBufferArray(scip, &(ecostadaptrev), redcost_nlevels * STP_DELPSEUDO_MAXGRAD) );
354 const int nspareedges = degree; /* todo we might want to allow additional edges to be inserted */
379 const int oldincedge = incedge[(replacecount == nspareedges) ? replacecount - 1 : replacecount];
414 // printf("...with costs %f, %f \n", edgecosts_adapt[newijedge], edgecosts_adapt[flipedge(newijedge)] );
462 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
484 SCIP_CALL( SCIPallocCleanBufferArray(scip, &hasharr, graph_pseudoAncestorsGetHashArraySize(g->pseudoancestors)) );
498 SCIP_Bool skipedge = isCutoffEdge(scip, cutoffs, cutoffsrev, ecost, ecostrev, vertexprize, i, j, edgecount);
556 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
579 SCIP_CALL( SCIPallocCleanBufferArray(scip, &hasharr, graph_pseudoAncestorsGetHashArraySize(g->pseudoancestors)) );
590 SCIP_Bool skipedge = isCutoffEdge(scip, cutoffs, cutoffsrev, ecost, ecostrev, vertexprize, i, j, edgecount);
666 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
692 SCIP_CALL( SCIPallocCleanBufferArray(scip, &hasharr, graph_pseudoAncestorsGetHashArraySize(g->pseudoancestors)) );
704 SCIP_Bool skipedge = isCutoffEdge(scip, cutoffs, cutoffsrev, ecost, ecostrev, vertexprize, i, edge_pos, i);
948 = edgecosts_adapt ? (edgecosts_adapt[edge] + edgecosts_adapt[edge_pathtail] + edgecosts_adapt[edge_pathhead]) : -1.0;
952 const int newedge = graph_edge_redirect(scip, g, edge, path_tail, path_head, path_cost, FALSE, TRUE);
973 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[edge_even]), graph_edge_getAncestors(g, edge_pathtail), NULL) );
974 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[edge_even]), graph_edge_getAncestors(g, edge_pathhead), NULL) );
979 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[newedge]), g->ancestors[edge_pathtail], NULL) );
980 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[newedge]), g->ancestors[edge_pathhead], NULL) );
981 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[flipedge(newedge)]), g->ancestors[flipedge(edge_pathtail)], NULL) );
982 SCIP_CALL( SCIPintListNodeAppendCopy(scip, &(g->ancestors[flipedge(newedge)]), g->ancestors[flipedge(edge_pathhead)], NULL) );
985 SCIP_CALL( graph_pseudoAncestors_appendCopyEdge(scip, newedge, edge_pathtail, FALSE, g, &conflict) );
988 SCIP_CALL( graph_pseudoAncestors_appendCopyEdge(scip, newedge, edge_pathhead, FALSE, g, &conflict) );
1020 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
1026 DELPSEUDO delpseudo = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1.0, -1, -1, UNKNOWN};
1068 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
1073 DELPSEUDO delpseudo = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1.0, -1, -1, UNKNOWN};
1095 /** Pseudo deletes edge, i.e. reconnects tail of edge with neighbors of head; maximum degree of STP_DELPSEUDO_MAXGRAD!
1102 const SCIP_Real* cutoffsrev, /**< reverse edge cutoff values (or NULL if undirected or non-existent) */
SCIP_RETCODE graph_singletonAncestors_init(SCIP *, const GRAPH *, int, SINGLETONANS *)
Definition: graph_history.c:684
void graph_pseudoAncestors_unhashEdge(const PSEUDOANS *, int, int *)
Definition: graph_history.c:854
int graph_pc_realDegree(const GRAPH *, int, SCIP_Bool)
Definition: graph_pcbase.c:2112
Definition: graphdefs.h:184
static SCIP_RETCODE delPseudoEdgeDeleteEdge(SCIP *scip, GRAPH *g, SCIP_Real *edgecosts_adapt, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:762
Definition: struct_scip.h:59
static SCIP_RETCODE delPseudoPathCreatePseudoAncestorTuple(SCIP *scip, GRAPH *g, int edge1, int edge2)
Definition: graph_delpseudo.c:914
static void delPseudoFreeData(SCIP *scip, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:874
int graph_pseudoAncestorsGetHashArraySize(const PSEUDOANS *)
Definition: graph_history.c:1321
static SCIP_RETCODE delPseudoEdgeInit(SCIP *scip, const SCIP_Real *edgecosts, const SCIP_Real *edgecosts_adapt, GRAPH *g, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:639
struct pseudo_deletion DELPSEUDO
SCIP_RETCODE graph_edge_delPseudoPath(SCIP *scip, GRAPH *g, int edge, int edge_pathtail, int edge_pathhead, SCIP_Real *edgecosts_adapt)
Definition: graph_delpseudo.c:1136
includes various files containing graph methods used for Steiner tree problems
int graph_edge_redirect(SCIP *, GRAPH *, int, int, int, SCIP_Real, SCIP_Bool, SCIP_Bool)
Definition: graph_edge.c:103
static SCIP_RETCODE delPseudoCheckReplacement(SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
Definition: graph_delpseudo.c:552
static void delPseudoFreeDataForCheck(SCIP *scip, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:897
void graph_pseudoAncestors_hashEdge(const PSEUDOANS *, int, int *)
Definition: graph_history.c:824
static SCIP_RETCODE delPseudoPath(SCIP *scip, GRAPH *g, int edge, int edge_pathtail, int edge_pathhead, SCIP_Real *edgecosts_adapt)
Definition: graph_delpseudo.c:936
SCIP_Bool graph_pc_knotHasMaxPrize(const GRAPH *, int)
Definition: graph_pcbase.c:1315
SCIP_RETCODE graph_edge_reinsert(SCIP *, GRAPH *, int, int, int, SCIP_Real, int, SINGLETONANS *, SINGLETONANS *, int *, SCIP_Bool *)
Definition: graph_edge.c:200
static SCIP_RETCODE delPseudoGetReplaceEdges(SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
Definition: graph_delpseudo.c:458
SCIP_Real * redcosts_getEdgeCosts(const REDCOST *redcostdata, int level)
Definition: redcosts.c:187
#define SCIPallocCleanBufferArray(scip, ptr, num)
Definition: scip_mem.h:133
SCIP_RETCODE SCIPintListNodeAppendCopy(SCIP *scip, IDX **node1, IDX *node2, SCIP_Bool *conflict)
Definition: misc_stp.c:197
SCIP_RETCODE graph_knot_delPseudoCheckIfPossible(SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int vertex, SCIP_Bool *isPossible)
Definition: graph_delpseudo.c:1063
void graph_pc_termToNonTerm(SCIP *, GRAPH *, int)
Definition: graph_pcbase.c:1158
Definition: graph_delpseudo.c:41
SCIP_RETCODE graph_pseudoAncestors_addToEdge(SCIP *, int, int, GRAPH *)
Definition: graph_history.c:1523
Definition: type_retcode.h:33
static SCIP_RETCODE delPseudoInitForCheck(SCIP *scip, const GRAPH *g, const SCIP_Real *edgecosts, int vertex, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:256
SCIP_RETCODE graph_knot_delPseudo(SCIP *scip, GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int vertex, REDCOST *redcostdata, SCIP_Bool *success)
Definition: graph_delpseudo.c:1015
static SCIP_Bool delPseudoIsEdgeDeletionMode(const DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:104
static int delPseudoGetEdgePosition(const DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:118
static SCIP_RETCODE delPseudoInit(SCIP *scip, const SCIP_Real *edgecosts, const REDCOST *redcostdata, int vertex, GRAPH *g, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:147
SCIP_RETCODE graph_pseudoAncestors_appendCopyEdge(SCIP *, int, int, SCIP_Bool, GRAPH *, SCIP_Bool *)
Definition: graph_history.c:1334
void graph_singletonAncestors_freeMembers(SCIP *, SINGLETONANS *)
Definition: graph_history.c:734
Definition: graphdefs.h:173
Portable definitions.
static SCIP_Bool isCutoffEdge(SCIP *scip, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, const SCIP_Real *ecost, const SCIP_Real *ecostrev, SCIP_Real prize, int edgeidx1, int edgeidx2, int cutoffidx)
Definition: graph_delpseudo.c:65
SCIP_RETCODE graph_edge_delPseudo(SCIP *scip, GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int edge, SCIP_Real *edgecosts_adapt, SCIP_Bool *success)
Definition: graph_delpseudo.c:1097
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:477
static SCIP_RETCODE delPseudoDeleteVertex(SCIP *scip, int vertex, GRAPH *g, REDCOST *redcostdata, DELPSEUDO *delpseudo)
Definition: graph_delpseudo.c:338
Definition: redcosts.c:34
Definition: objbenders.h:33
SCIP_Bool graph_pseudoAncestors_edgeIsHashed(const PSEUDOANS *, int, const int *)
Definition: graph_history.c:948
static SCIP_RETCODE delPseudoEdgeGetReplaceEdges(SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
Definition: graph_delpseudo.c:662
IDX * graph_edge_getAncestors(const GRAPH *, int)
Definition: graph_history.c:1202