Scippy

SCIP

Solving Constraint Integer Programs

dpborderinterns.h File Reference

Detailed Description

Dynamic programming internals for Steiner tree (sub-) problems with small number of terminals.

Author
Daniel Rehfeldt

Internal methods and data structures for DP.

Definition in file dpborderinterns.h.

#include "scip/scip.h"
#include "graph.h"
#include "stpvector.h"
#include "dpborder_hashmap.h"

Go to the source code of this file.

Data Structures

struct  dynamic_programming_border_nodes_sequence
 
struct  dynamic_programming_border_level
 
struct  dynamic_programming_border_partition
 
struct  dynamic_programming_border
 

Macros

#define BPBORDER_MAXNPARTITIONS   50000000
 
#define BPBORDER_MAXBORDERSIZE   16
 
#define DPB_Ptype   char
 
#define DPBORDER_GROWTH_FACTOR   4
 

Typedefs

typedef struct dynamic_programming_border_nodes_sequence DPBSEQUENCE
 
typedef struct dynamic_programming_border_level DPBLEVEL
 
typedef struct dynamic_programming_border_partition DPBPART
 

Functions

static int dpborder_getDelimiter (const DPBORDER *dpborder, int iteration)
 
static int dpborder_getTopDelimiter (const DPBORDER *dpborder)
 
static DPBLEVELdpborder_getTopLevel (const DPBORDER *dpborder)
 
static DPBLEVELdpborder_getPredLevel (const DPBORDER *dpborder)
 
SCIP_Real dpborder_partGetConnectionCost (const DPBORDER *, const DPBPART *, const int *, int)
 
int dpborder_partglobalGetCard (int, int, const DPBORDER *)
 
int dpborder_partGetIdxNew (SCIP *, const DPBPART *, const int *, int, DPBORDER *)
 
int dpborder_partGetIdxNewExclusive (SCIP *, const DPBPART *, DPBORDER *)
 
 STP_Vectype (int) dpborder_partGetCandstarts(SCIP *
 
const DPBPART const DPBORDER *SCIP_Bool dpborder_partIsValid (const DPBPART *)
 
void dpborder_partPrint (const DPBPART *)
 
void dpborder_markSolNodes (const DPBORDER *, STP_Bool *RESTRICT)
 
SCIP_RETCODE dpborder_dpbsequenceInit (SCIP *, const GRAPH *, DPBSEQUENCE **)
 
void dpborder_dpbsequenceFree (SCIP *, DPBSEQUENCE **)
 
void dpborder_dpbsequenceCopy (const DPBSEQUENCE *, DPBSEQUENCE *)
 
SCIP_RETCODE dpborder_dpblevelInit (SCIP *, DPBLEVEL **)
 
void dpborder_dpblevelFree (SCIP *, DPBLEVEL **)
 
SCIP_RETCODE dpborder_coreComputeOrderingSimple (SCIP *, const GRAPH *, DPBORDER *)
 
SCIP_RETCODE dpborder_coreUpdateOrdering (SCIP *, const GRAPH *, DPBORDER *)
 
SCIP_RETCODE dpborder_coreSolve (SCIP *, const GRAPH *, DPBORDER *, SCIP_Bool *)
 

Macro Definition Documentation

◆ BPBORDER_MAXNPARTITIONS

#define BPBORDER_MAXNPARTITIONS   50000000

◆ BPBORDER_MAXBORDERSIZE

◆ DPB_Ptype

◆ DPBORDER_GROWTH_FACTOR

#define DPBORDER_GROWTH_FACTOR   4

Definition at line 38 of file dpborderinterns.h.

Referenced by dpborder_solve(), initSolve(), and partitionTryRealloc().

Typedef Documentation

◆ DPBSEQUENCE

nodes sequence structure

◆ DPBLEVEL

nodes sequence structure

◆ DPBPART

single partition

Function Documentation

◆ dpborder_getDelimiter()

static int dpborder_getDelimiter ( const DPBORDER dpborder,
int  iteration 
)
inlinestatic

gets border delimiter for given iteration

Parameters
dpborderborder
iterationiteration number

Definition at line 106 of file dpborderinterns.h.

References BPBORDER_MAXBORDERSIZE.

Referenced by dpborder_markSolNodes(), and updateFromPartition().

◆ dpborder_getTopDelimiter()

static int dpborder_getTopDelimiter ( const DPBORDER dpborder)
inlinestatic

gets border delimiter

Parameters
dpborderborder

Definition at line 121 of file dpborderinterns.h.

References BPBORDER_MAXBORDERSIZE, and StpVecGetSize.

Referenced by dpborder_partGetIdxNew(), dpborder_partGetIdxNewExclusive(), and updateFromPartition().

◆ dpborder_getTopLevel()

static DPBLEVEL* dpborder_getTopLevel ( const DPBORDER dpborder)
inlinestatic

◆ dpborder_getPredLevel()

◆ dpborder_partGetConnectionCost()

SCIP_Real dpborder_partGetConnectionCost ( const DPBORDER dpborder,
const DPBPART borderpartition,
const int *  candstarts_sub,
int  ncandstarts_sub 
)

gets minimum connection cost of connection selected sets of partition to extension vertex

Parameters
dpborderborder
borderpartitionbase partition
candstarts_subcandidate starts from which to construct new partition
ncandstarts_subnumber of candidate starts

Definition at line 389 of file dpborder_util.c.

References dynamic_programming_border::borderchardists, dynamic_programming_border_partition::delimiter, DPB_Ptype, dpborder_partIsValid(), FARAWAY, GE, LT, dynamic_programming_border_partition::partchars, dynamic_programming_border_partition::partsize, and SCIP_Real.

Referenced by dpborder_getPredLevel(), and updateFromPartition().

◆ dpborder_partglobalGetCard()

int dpborder_partglobalGetCard ( int  globalindex,
int  delimiter,
const DPBORDER dpborder 
)

gets cardinality from global index of new global partition.

Parameters
globalindexglobal index
delimiterdelimiter
dpborderborder

Definition at line 363 of file dpborder_util.c.

References DPB_Ptype, and dynamic_programming_border::global_partitions.

Referenced by dpborder_getPredLevel(), and updateFromPartition().

◆ dpborder_partGetIdxNew()

int dpborder_partGetIdxNew ( SCIP scip,
const DPBPART borderpartition,
const int *  candstarts_sub,
int  ncandstarts_sub,
DPBORDER dpborder 
)

◆ dpborder_partGetIdxNewExclusive()

int dpborder_partGetIdxNewExclusive ( SCIP scip,
const DPBPART borderpartition,
DPBORDER dpborder 
)

◆ STP_Vectype()

STP_Vectype ( int  )

Referenced by dpborder_getPredLevel().

◆ dpborder_partIsValid()

◆ dpborder_partPrint()

◆ dpborder_markSolNodes()

void dpborder_markSolNodes ( const DPBORDER ,
STP_Bool RESTRICT 
)

Referenced by dpborder_getPredLevel().

◆ dpborder_dpbsequenceInit()

◆ dpborder_dpbsequenceFree()

void dpborder_dpbsequenceFree ( SCIP scip,
DPBSEQUENCE **  dpbsequence 
)

◆ dpborder_dpbsequenceCopy()

void dpborder_dpbsequenceCopy ( const DPBSEQUENCE dpbsequence_source,
DPBSEQUENCE dpbsequence_target 
)

◆ dpborder_dpblevelInit()

SCIP_RETCODE dpborder_dpblevelInit ( SCIP scip,
DPBLEVEL **  dpblevel 
)

◆ dpborder_dpblevelFree()

void dpborder_dpblevelFree ( SCIP scip,
DPBLEVEL **  dpblevel 
)

frees

Parameters
scipSCIP data structure
dpblevelto be freed

Definition at line 170 of file dpborder_base.c.

References SCIPfreeMemory, and StpVecFree.

Referenced by dpborder_free(), and dpborder_getPredLevel().

◆ dpborder_coreComputeOrderingSimple()

SCIP_RETCODE dpborder_coreComputeOrderingSimple ( SCIP scip,
const GRAPH graph,
DPBORDER dpborder 
)

computes node ordering

Parameters
scipSCIP data structure
graphgraph
dpborderborder

Definition at line 863 of file dpborder_core.c.

References computeOrderingFromNode(), dynamic_programming_border::dpbsequence, SCIP_CALL, SCIP_OKAY, and GRAPH::source.

Referenced by dpborder_getPredLevel(), and dpborder_probePotential().

◆ dpborder_coreUpdateOrdering()

◆ dpborder_coreSolve()