graph_trans.c
Go to the documentation of this file.
20 * This includes method for transformations (or reductions) between the different Steiner problem classes.
38 /** initializes cost_org_pc array (call right after transformation to extended has been performed) */
81 /** remove non-leaf terminals by edge weight shifting (call before graph transformation was performed,
174 /* for each proper terminal, except for the root, one node and three edges (i.e. six arcs) are to be added */
175 SCIP_CALL( graph_resize(scip, graph, (graph->ksize + graph->terms + 1), (graph->esize + graph->terms * 6) , -1) );
215 /* add one edge going from the root to the 'copied' terminal and one going from the former terminal to its copy */
298 SCIP_CALL( graph_resize(scip, graph, (graph->ksize + naddednodes), (graph->esize + naddedarcs) , -1) );
351 /* add one edge going from the root to the 'copied' terminal and one going from the former terminal to its copy */
431 /* for each terminal, except for the root, one node and two edges (i.e. four arcs) are to be added */
432 SCIP_CALL( graph_resize(scip, graph, (graph->ksize + npotterms), (graph->esize + npotterms * 4) , -1) );
465 /* add one edge going from the root to the 'copied' terminal and one going from the former terminal to its copy */
503 /** alters the graph from rooted prize collecting problems to SPG if there are not potential terminals.
504 * NOTE: deletes some PC data, but keeps history, in order to be able to reconstruct original optimal solution. */
530 /** changes the graph for rooted prize collecting problems such that no proper potential terminal are fixed */
585 /* for each terminal, except for the root, one node and two edges (i.e. four arcs) are to be added */
586 SCIP_CALL( graph_resize(scip, graph, (graph->ksize + npropterms), (graph->esize + npropterms * 4) , -1) );
609 /* add one edge going from the root to the 'copied' terminal and one going from the former terminal to its copy */
746 /* for each terminal, except for the root, one node and three edges (i.e. six arcs) are to be added */
747 SCIP_CALL( graph_resize(scip, graph, (graph->ksize + npterms), (graph->esize + npterms * 4) , -1) );
772 /* add one edge going from the root to the 'copied' terminal and one going from the former terminal to its copy */
908 printf("...transformed PC to RPC; fixed %d out of %d terminals \n", nfixedterms, orgnterms - 1);
910 printf("...transformed MW to RMW; fixed %d out of %d terminals \n", nfixedterms, orgnterms - 1);
963 SCIP_CALL( graph_resize(scip, (*newgraph), ((*newgraph)->ksize + 1), ((*newgraph)->esize + 2 * (nterms - 1)) , -1) );
975 if( Is_pseudoTerm(graph->term[k]) && (maxpvert == -1 || graph->prize[k] > graph->prize[maxpvert]) )
1014 (void) graph_edge_redirect(scip, (*newgraph), e, pseudoroot, head, graph->cost[e], TRUE, FALSE);
1379 * todo also compute a better big M than just the trivial one, e.g. by building an SAP and computing bound
Definition: graphdefs.h:274
Definition: graphdefs.h:184
Definition: struct_scip.h:59
void graph_edge_addBi(SCIP *, GRAPH *, int, int, double)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:490
SCIP_Bool graph_pc_term2edgeIsConsistent(SCIP *, const GRAPH *)
Definition: graph_pcbase.c:874
static SCIP_Bool isNonLeaf_pretransPc(SCIP *scip, const GRAPH *g, int vertex)
Definition: graph_trans.c:61
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
SCIP_RETCODE graph_transPcmw2rooted(SCIP *scip, GRAPH *graph, SCIP_Real fixprize, SCIP_Bool verbose)
Definition: graph_trans.c:809
SCIP_Real graph_pc_getNonLeafTermOffset(SCIP *, const GRAPH *)
Definition: graph_pcbase.c:2209
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:438
static void markNonLeafTerms_pretransPc(SCIP *scip, GRAPH *g)
Definition: graph_trans.c:84
SCIP_RETCODE graph_pc_initPrizes(SCIP *, GRAPH *, int)
Definition: graph_pcbase.c:741
SCIP_RETCODE graph_transRpc2SpgTrivial(SCIP *scip, GRAPH *g)
Definition: graph_trans.c:505
SCIP_RETCODE graph_pc_initTerm2Edge(SCIP *, GRAPH *, int)
Definition: graph_pcbase.c:721
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:451
void graph_pc_shiftNonLeafCosts(SCIP *, GRAPH *)
Definition: graph_pcbase.c:671
SCIP_RETCODE graph_transPc2Spg(SCIP *scip, PRESOL *presol, GRAPH *graph)
Definition: graph_trans.c:257
void graph_edge_add(SCIP *, GRAPH *, int, int, double, double)
SCIP_RETCODE graph_transPcGetSap(SCIP *scip, GRAPH *graph, GRAPH **newgraph, SCIP_Real *offset)
Definition: graph_trans.c:931
SCIP_RETCODE graph_transNw2pc(SCIP *scip, PRESOL *presol, GRAPH *g)
Definition: graph_trans.c:1420
void graph_pc_knotToFixedTermProperty(GRAPH *, int)
Definition: graph_pcbase.c:1062
void graph_pc_knotToNonTermProperty(GRAPH *, int)
Definition: graph_pcbase.c:1044
Definition: type_retcode.h:33
SCIP_RETCODE graph_transNw(SCIP *scip, PRESOL *presol, GRAPH *g)
Definition: graph_trans.c:1519
Definition: type_retcode.h:34
int graph_pc_nProperPotentialTerms(const GRAPH *)
Definition: graph_pcbase.c:2582
SCIP_RETCODE graph_transPcGetRsap(SCIP *scip, GRAPH *graph, GRAPH **newgraph, const int *rootcands, int nrootcands, int saproot)
Definition: graph_trans.c:1043
SCIP_Bool graph_pc_knotIsNonLeafTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1383
Portable definitions.
SCIP_RETCODE graph_transNw2sap(SCIP *scip, PRESOL *presol, GRAPH *g)
Definition: graph_trans.c:1487
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:477
void graph_transGstpClean(PRESOL *presol, GRAPH *graph)
Definition: graph_trans.c:1381
SCIP_Bool graph_pc_knotIsDummyTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1344
SCIP_Bool graph_pc_knotIsFixedTerm(const GRAPH *, int)
Definition: graph_pcbase.c:1257
SCIP_RETCODE graph_transRpc2FixedProper(SCIP *scip, PRESOL *presol, GRAPH *graph)
Definition: graph_trans.c:531
SCIP_RETCODE graph_transRpcGetSpg(SCIP *scip, const GRAPH *graph, SCIP_Real primalbound, SCIP_Real *offset, int **edgemap_new2org, GRAPH **newgraph)
Definition: graph_trans.c:1217
SCIP_Bool graph_transRpcToSpgIsStable(const GRAPH *graph, SCIP_Real primalbound)
Definition: graph_trans.c:1188
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip_numerics.c:464
Definition: objbenders.h:33