dpborder_core.c
Go to the documentation of this file.
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
101 SCIP_CALL( SCIPreallocMemoryArray(scip, &(dpborder->global_partitions), dpborder->global_partcap) );
242 assert(dpborder->borderlevels[iteration - 1]->nbordernodes == StpVecGetSize(dpborder->bordernodes));
348 partition.delimiter = dpborder_getDelimiter(dpborder, StpVecGetSize(dpborder->borderlevels) - 2);
364 SCIPdebugMessage("partition ncands=%d, isTerm=%d ...base partition: \n", ncands, toplevel->exnodeIsTerm);
610 dpborder->global_partcap = MAX(DPBORDER_GROWTH_FACTOR * maxnpartitions, BPBORDER_MAXBORDERSIZE);
611 SCIP_CALL( SCIPallocMemoryArray(scip, &(dpborder->global_partitions), dpborder->global_partcap) );
916 isBetter = (1.2 * (SCIP_Real) sequence_tmp->maxnpartitions < (SCIP_Real) sequence_base->maxnpartitions);
921 SCIPdebugMessage("---max n. partitions %ld->%ld \n", sequence_base->maxnpartitions, sequence_tmp->maxnpartitions);
922 SCIPdebugMessage("---max bordersize %d->%d \n", sequence_base->maxbordersize, sequence_tmp->maxbordersize);
978 printf("solved with partitions=%d, max. bordersize=%d \n", dpborder->global_npartitions, dpborder->dpbsequence->maxbordersize);
int dpborder_partGetIdxNew(SCIP *scip, const DPBPART *borderpartition, const int *candstarts_sub, int ncandstarts_sub, DPBORDER *dpborder)
Definition: dpborder_util.c:435
Definition: graphdefs.h:184
Definition: struct_scip.h:59
static SCIP_RETCODE initSolve(SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:592
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip_mem.h:117
static void hashmap_updateKeyarr(const char *keyarr, struct hashmap_s *out_hashmap) HASHMAP_USED
Definition: dpborder_hashmap.h:223
uint64_t maxnpartitions
Definition: dpborderinterns.h:45
DPB_Ptype * partchars
Definition: dpborderinterns.h:65
void dpborder_dpbsequenceFree(SCIP *scip, DPBSEQUENCE **dpbsequence)
Definition: dpborder_base.c:134
SCIP_RETCODE dpborder_coreSolve(SCIP *scip, const GRAPH *graph, DPBORDER *dpborder, SCIP_Bool *wasSolved)
Definition: dpborder_core.c:943
static int hashmap_remove(struct hashmap_s *const hashmap, int position, const unsigned len) HASHMAP_USED
Remove an element from the hashmap.
Definition: dpborder_hashmap.h:312
static SCIP_RETCODE computeOrderingFromNode(SCIP *scip, const GRAPH *graph, int root, DPBSEQUENCE *dpbsequence)
Definition: dpborder_core.c:674
static DPBLEVEL * dpborder_getTopLevel(const DPBORDER *dpborder)
Definition: dpborderinterns.h:137
static void borderBuildCharMap(int iteration, DPBORDER *dpborder)
Definition: dpborder_core.c:133
int maxbordersize
Definition: dpborderinterns.h:46
static int dpborder_getTopDelimiter(const DPBORDER *dpborder)
Definition: dpborderinterns.h:121
header only, simple implementation of an STL like vector
static SCIP_Bool allTermsAreVisited(const GRAPH *graph, const MST *mst)
Definition: relax_stpenum.c:72
DPB_Ptype * global_partitions
Definition: dpborderinterns.h:84
SCIP_RETCODE dpborder_coreUpdateOrdering(SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:876
SCIP_Real dpborder_partGetConnectionCost(const DPBORDER *dpborder, const DPBPART *borderpartition, const int *candstarts_sub, int ncandstarts_sub)
Definition: dpborder_util.c:389
miscellaneous methods used for solving Steiner problems
static void updateBorder(SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
Definition: dpborder_core.c:224
SCIP_RETCODE dpborder_dpblevelInit(SCIP *scip, DPBLEVEL **dpblevel)
Definition: dpborder_base.c:149
SCIP_RETCODE graph_getTermsRandom(SCIP *, const GRAPH *, int *)
Definition: graph_base.c:588
void dpborder_dpbsequenceCopy(const DPBSEQUENCE *dpbsequence_source, DPBSEQUENCE *dpbsequence_target)
Definition: dpborder_base.c:119
static SCIP_RETCODE addLevelFirst(SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:547
Definition: type_retcode.h:33
SCIP_RETCODE dpborder_coreComputeOrderingSimple(SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:863
static SCIP_RETCODE updateFromPartition(SCIP *scip, int globalposition, const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:325
void dpborder_partPrint(const DPBPART *borderpartition)
Definition: dpborder_util.c:286
int dpborder_partglobalGetCard(int globalindex, int delimiter, const DPBORDER *dpborder)
Definition: dpborder_util.c:363
Definition: dpborder_hashmap.h:86
Definition: type_retcode.h:34
static void borderBuildCharDists(const GRAPH *graph, DPBORDER *dpborder)
Definition: dpborder_core.c:175
SCIP_Bool * nodes_isBorder
Definition: dpborderinterns.h:78
static int dpborder_getDelimiter(const DPBORDER *dpborder, int iteration)
Definition: dpborderinterns.h:106
SCIP_RETCODE dpborder_dpbsequenceInit(SCIP *scip, const GRAPH *graph, DPBSEQUENCE **dpbsequence)
Definition: dpborder_base.c:97
Definition: graphdefs.h:138
SCIP_Real * borderchardists
Definition: dpborderinterns.h:81
Dynamic programming solver for Steiner tree (sub-) problems with small border.
static SCIP_Bool hashmap_isEmpty(const struct hashmap_s *const hashmap) HASHMAP_USED
Definition: dpborder_hashmap.h:377
static SCIP_RETCODE partitionTryRealloc(SCIP *scip, int newadds, DPBORDER *dpborder)
Definition: dpborder_core.c:85
SCIP_Bool exnodeIsTerm
Definition: dpborderinterns.h:58
Dynamic programming internals for Steiner tree (sub-) problems with small number of terminals...
int * nodessquence
Definition: dpborderinterns.h:44
int global_npartitions
Definition: dpborderinterns.h:90
static SCIP_RETCODE addPartitions(SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
Definition: dpborder_core.c:447
Definition: dpborderinterns.h:73
Definition: objbenders.h:33
static SCIP_RETCODE addLevel(SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
Definition: dpborder_core.c:476
static void partitionGetRangeGlobal(const DPBORDER *dpborder, int globalposition, int *start, int *end)
Definition: dpborder_core.c:112
int dpborder_partGetIdxNewExclusive(SCIP *scip, const DPBPART *borderpartition, DPBORDER *dpborder)
Definition: dpborder_util.c:633
int global_optposition
Definition: dpborderinterns.h:92