Scippy

SCIP

Solving Constraint Integer Programs

dpborder_core.c File Reference

Detailed Description

Core of dynamic programming solver for Steiner tree (sub-) problems with small border.

Author
Daniel Rehfeldt

Contains core methods.

Definition in file dpborder_core.c.

#include "dpborder.h"
#include "dpborderinterns.h"
#include "stpvector.h"
#include "misc_stp.h"

Go to the source code of this file.

Macros

#define DPB_ORDERMULT_PREVS   2
 
#define DPB_ORDERMULT_TERM   5
 
#define DPB_ORDERMULT_OUTDEG   1
 
#define DPB_ORDERMULT_OUTDELTA   1
 
#define DPB_ORDER_MAXNROOTS   100
 

Functions

static SCIP_RETCODE partitionTryRealloc (SCIP *scip, int newadds, DPBORDER *dpborder)
 
static void partitionGetRangeGlobal (const DPBORDER *dpborder, int globalposition, int *start, int *end)
 
static void borderBuildCharMap (int iteration, DPBORDER *dpborder)
 
static void borderBuildCharDists (const GRAPH *graph, DPBORDER *dpborder)
 
static void updateBorder (SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
 
static SCIP_RETCODE updateFromPartition (SCIP *scip, int globalposition, const GRAPH *graph, DPBORDER *dpborder)
 
static SCIP_RETCODE addPartitions (SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
 
static SCIP_RETCODE addLevel (SCIP *scip, const GRAPH *graph, int iteration, DPBORDER *dpborder)
 
static SCIP_RETCODE addLevelFirst (SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
 
static SCIP_RETCODE initSolve (SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
 
static SCIP_RETCODE computeOrderingFromNode (SCIP *scip, const GRAPH *graph, int root, DPBSEQUENCE *dpbsequence)
 
SCIP_RETCODE dpborder_coreComputeOrderingSimple (SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
 
SCIP_RETCODE dpborder_coreUpdateOrdering (SCIP *scip, const GRAPH *graph, DPBORDER *dpborder)
 
SCIP_RETCODE dpborder_coreSolve (SCIP *scip, const GRAPH *graph, DPBORDER *dpborder, SCIP_Bool *wasSolved)
 

Macro Definition Documentation

◆ DPB_ORDERMULT_PREVS

#define DPB_ORDERMULT_PREVS   2

Definition at line 32 of file dpborder_core.c.

Referenced by computeOrderingFromNode().

◆ DPB_ORDERMULT_TERM

#define DPB_ORDERMULT_TERM   5

Definition at line 33 of file dpborder_core.c.

Referenced by computeOrderingFromNode().

◆ DPB_ORDERMULT_OUTDEG

#define DPB_ORDERMULT_OUTDEG   1

Definition at line 34 of file dpborder_core.c.

Referenced by computeOrderingFromNode().

◆ DPB_ORDERMULT_OUTDELTA

#define DPB_ORDERMULT_OUTDELTA   1

Definition at line 35 of file dpborder_core.c.

Referenced by computeOrderingFromNode().

◆ DPB_ORDER_MAXNROOTS

#define DPB_ORDER_MAXNROOTS   100

Definition at line 37 of file dpborder_core.c.

Referenced by dpborder_coreUpdateOrdering().

Function Documentation

◆ partitionTryRealloc()

static SCIP_RETCODE partitionTryRealloc ( SCIP scip,
int  newadds,
DPBORDER dpborder 
)
inlinestatic

does reallocation of global array if necessary

Parameters
scipSCIP data structure
newaddsnumber of additions
dpborderborder

Definition at line 85 of file dpborder_core.c.

References DPBORDER_GROWTH_FACTOR, dynamic_programming_border::global_npartitions, dynamic_programming_border::global_partcap, dynamic_programming_border::global_partitions, dynamic_programming_border::hashmap, hashmap_updateKeyarr(), SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPreallocMemoryArray.

Referenced by updateFromPartition().

◆ partitionGetRangeGlobal()

static void partitionGetRangeGlobal ( const DPBORDER dpborder,
int  globalposition,
int *  start,
int *  end 
)
inlinestatic

gets partition range

Parameters
dpborderborder
globalpositionposition of partition
startpointer to range start (OUT)
endpointer to range end (OUT)

Definition at line 112 of file dpborder_core.c.

References dynamic_programming_border::global_npartitions.

Referenced by updateFromPartition().

◆ borderBuildCharMap()

static void borderBuildCharMap ( int  iteration,
DPBORDER dpborder 
)
static

◆ borderBuildCharDists()

static void borderBuildCharDists ( const GRAPH graph,
DPBORDER dpborder 
)
static

◆ updateBorder()

◆ updateFromPartition()

◆ addPartitions()

static SCIP_RETCODE addPartitions ( SCIP scip,
const GRAPH graph,
int  iteration,
DPBORDER dpborder 
)
static

adds partitions for new border

Parameters
scipSCIP data structure
graphgraph
iterationiteration number
dpborderborder

Definition at line 447 of file dpborder_core.c.

References dynamic_programming_border_level::globalstartidx, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and updateFromPartition().

Referenced by dpborder_coreSolve().

◆ addLevel()

◆ addLevelFirst()

◆ initSolve()

◆ computeOrderingFromNode()

◆ 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()