Scippy

SCIP

Solving Constraint Integer Programs

extreducedefs.h File Reference

Detailed Description

includes extended reductions definitions and inline methods used for Steiner tree problems

Author
Daniel Rehfeldt

Definition in file extreducedefs.h.

#include "scip/scip.h"
#include "reduce.h"
#include "graph.h"

Go to the source code of this file.

Data Structures

struct  pathroot_state
 
struct  distance_data
 
struct  extension_data_permanent
 
struct  reduction_data
 
struct  pcmw_specific_data
 
struct  initial_extension_component
 
struct  extension_data
 

Macros

#define STP_EXT_CLOSENODES_MAXN   50
 
#define STP_EXT_MAXSTACKSIZE   5000
 
#define STP_EXT_MAXNCOMPS   1000
 
#define STP_EXT_MAXDFSDEPTH   6
 
#define STP_EXT_MAXDFSDEPTH_GUARD   (STP_EXT_MAXDFSDEPTH + 2)
 
#define STP_EXT_MIDDFSDEPTH   5
 
#define STP_EXT_MINDFSDEPTH   4
 
#define STP_EXT_MAXGRAD   9
 
#define STP_EXT_MAXEDGES   500
 
#define STP_EXT_DEPTH_MIDNEDGES   50000
 
#define STP_EXT_DEPTH_MAXNEDGES   100000
 
#define STP_EXTTREE_MAXNEDGES   25
 
#define STP_EXTTREE_MAXNLEAVES   20
 
#define STP_EXTTREE_MAXNLEAVES_GUARD   (STP_EXTTREE_MAXNLEAVES + STP_EXT_MAXGRAD)
 
#define EXT_EDGE_WRAPPED   -10
 
#define EXT_STATE_NONE   0
 
#define EXT_STATE_EXPANDED   1
 
#define EXT_STATE_MARKED   2
 
#define STP_MLDISTS_ID_EMPTY   -2
 
#define STP_MLDISTS_ID_UNSET   -1
 
#define STP_MLDISTS_DIST_UNSET   -1.0
 

Typedefs

typedef struct multi_level_distances_storage MLDISTS
 
typedef struct extension_tree_contraction CONTRACT
 
typedef struct pathroot_state PRSTATE
 
typedef struct distance_data DISTDATA
 
typedef struct extension_data_permanent EXTPERMA
 
typedef struct reduction_data REDDATA
 
typedef struct pcmw_specific_data PCDATA
 
typedef struct initial_extension_component EXTCOMP
 
typedef struct extension_data EXTDATA
 

Functions

static SCIP_Bool extProbIsPc (const GRAPH *graph, const EXTDATA *extdata)
 
static SCIP_Bool extIsAtInitialComp (const EXTDATA *extdata)
 
static SCIP_Bool extInitialCompIsEdge (const EXTDATA *extdata)
 
static SCIP_Bool extInitialCompIsStar (const EXTDATA *extdata)
 
static SCIP_Bool extInitialCompIsGenStar (const EXTDATA *extdata)
 
static SCIP_Bool extIsAtInitialStar (const EXTDATA *extdata)
 
static SCIP_Bool extIsAtInitialGenStar (const EXTDATA *extdata)
 
static int extStackGetPosition (const EXTDATA *extdata)
 
static int extStackGetTopRoot (const GRAPH *graph, const EXTDATA *extdata)
 
static int extStackGetOutEdgesStart (const EXTDATA *extdata, int stackpos)
 
static int extStackGetOutEdgesEnd (const EXTDATA *extdata, int stackpos)
 
static int extStackGetTopOutEdgesStart (const EXTDATA *extdata, int stackpos)
 
static int extStackGetTopOutEdgesEnd (const EXTDATA *extdata, int stackpos)
 
static SCIP_Bool extStackTopIsWrapped (const EXTDATA *extdata)
 
static SCIP_Bool extStackTopIsSingleton (const EXTDATA *extdata)
 
static int extLeafFindPos (const EXTDATA *extdata, int leaf)
 
static SCIP_Bool extLeafIsExtendable (const GRAPH *graph, const SCIP_Bool *isterm, int leaf)
 
static SCIP_Real extSdGetProper (SCIP_Real sd_in)
 
static SCIP_Real extSdIsNonTrivial (SCIP_Real specialDist)
 
static SCIP_Bool extReddataHasBiasedSds (const REDDATA *reddata)
 

Macro Definition Documentation

◆ STP_EXT_CLOSENODES_MAXN

#define STP_EXT_CLOSENODES_MAXN   50

Definition at line 35 of file extreducedefs.h.

Referenced by extInit(), extreduce_init(), and extreduce_pseudoDeleteNodes().

◆ STP_EXT_MAXSTACKSIZE

#define STP_EXT_MAXSTACKSIZE   5000

Definition at line 36 of file extreducedefs.h.

Referenced by extreduce_getMaxStackSize().

◆ STP_EXT_MAXNCOMPS

#define STP_EXT_MAXNCOMPS   1000

Definition at line 37 of file extreducedefs.h.

Referenced by extreduce_getMaxStackNcomponents().

◆ STP_EXT_MAXDFSDEPTH

#define STP_EXT_MAXDFSDEPTH   6

Definition at line 38 of file extreducedefs.h.

Referenced by extreduce_extPermaInit(), and extreduce_getMaxTreeDepth().

◆ STP_EXT_MAXDFSDEPTH_GUARD

#define STP_EXT_MAXDFSDEPTH_GUARD   (STP_EXT_MAXDFSDEPTH + 2)

Definition at line 39 of file extreducedefs.h.

Referenced by extreduce_extPermaAddMLdistsbiased(), and extreduce_extPermaInit().

◆ STP_EXT_MIDDFSDEPTH

#define STP_EXT_MIDDFSDEPTH   5

Definition at line 40 of file extreducedefs.h.

Referenced by extreduce_getMaxTreeDepth().

◆ STP_EXT_MINDFSDEPTH

#define STP_EXT_MINDFSDEPTH   4

Definition at line 41 of file extreducedefs.h.

Referenced by extreduce_getMaxTreeDepth().

◆ STP_EXT_MAXGRAD

◆ STP_EXT_MAXEDGES

#define STP_EXT_MAXEDGES   500

Definition at line 43 of file extreducedefs.h.

◆ STP_EXT_DEPTH_MIDNEDGES

#define STP_EXT_DEPTH_MIDNEDGES   50000

Definition at line 44 of file extreducedefs.h.

Referenced by extreduce_getMaxTreeDepth().

◆ STP_EXT_DEPTH_MAXNEDGES

#define STP_EXT_DEPTH_MAXNEDGES   100000

Definition at line 45 of file extreducedefs.h.

Referenced by extreduce_getMaxTreeDepth().

◆ STP_EXTTREE_MAXNEDGES

#define STP_EXTTREE_MAXNEDGES   25

Definition at line 46 of file extreducedefs.h.

Referenced by extreduce_extPermaInit().

◆ STP_EXTTREE_MAXNLEAVES

#define STP_EXTTREE_MAXNLEAVES   20

Definition at line 47 of file extreducedefs.h.

Referenced by extreduce_extPermaInit().

◆ STP_EXTTREE_MAXNLEAVES_GUARD

◆ EXT_EDGE_WRAPPED

#define EXT_EDGE_WRAPPED   -10

◆ EXT_STATE_NONE

◆ EXT_STATE_EXPANDED

◆ EXT_STATE_MARKED

◆ STP_MLDISTS_ID_EMPTY

#define STP_MLDISTS_ID_EMPTY   -2

◆ STP_MLDISTS_ID_UNSET

◆ STP_MLDISTS_DIST_UNSET

Typedef Documentation

◆ MLDISTS

structure for storing distances in the extension tree

Definition at line 65 of file extreducedefs.h.

◆ CONTRACT

structure for storing data for algorithms based on contraction of extension tree

Definition at line 68 of file extreducedefs.h.

◆ PRSTATE

typedef struct pathroot_state PRSTATE

path root state

◆ DISTDATA

typedef struct distance_data DISTDATA

distance data

◆ EXTPERMA

permanent extension data

◆ REDDATA

typedef struct reduction_data REDDATA

Reduction data; just used internally. Stores information for SDs between tree vertices, reduced costs, and pseudo-ancestor conflicts.

◆ PCDATA

typedef struct pcmw_specific_data PCDATA

PC/MW data; just used internally.

◆ EXTCOMP

initial extension component NOTE: it is vital the the first edge of the star component comes from the root! (will thus be constantly asserted)

◆ EXTDATA

typedef struct extension_data EXTDATA

extension data; just used internally

Function Documentation

◆ extProbIsPc()

static SCIP_Bool extProbIsPc ( const GRAPH graph,
const EXTDATA extdata 
)
inlinestatic

prize-collecting problem?

Parameters
graphgraph data structure
extdataextension data

Definition at line 237 of file extreducedefs.h.

References graph_pc_isPc(), NULL, extension_data::pcdata, and pcmw_specific_data::pcSdToNode.

Referenced by addComponentUpdateTreeCosts(), extGetSdDouble(), extGetSdDoubleFromDistdata(), and mstLevelHorizontalAddSds().

◆ extIsAtInitialComp()

◆ extInitialCompIsEdge()

◆ extInitialCompIsStar()

◆ extInitialCompIsGenStar()

◆ extIsAtInitialStar()

static SCIP_Bool extIsAtInitialStar ( const EXTDATA extdata)
inlinestatic

currently at initial star?

Parameters
extdataextension data

Definition at line 305 of file extreducedefs.h.

References extInitialCompIsStar(), and extIsAtInitialComp().

Referenced by extreduce_redcostAddEdge(), extTreeFindExtensions(), and mstCompLeafGetSDsToSiblings().

◆ extIsAtInitialGenStar()

static SCIP_Bool extIsAtInitialGenStar ( const EXTDATA extdata)
inlinestatic

◆ extStackGetPosition()

◆ extStackGetTopRoot()

static int extStackGetTopRoot ( const GRAPH graph,
const EXTDATA extdata 
)
inlinestatic

returns root of top component on the stack

Parameters
graphgraph data structure
extdataextension data

Definition at line 338 of file extreducedefs.h.

References extension_data::extstack_data, extension_data::extstack_start, extStackGetPosition(), GRAPH::tail, extension_data::tree_deg, and extension_data::tree_root.

Referenced by compRootDistsUpdateLeavesDists(), extreduce_redcostInitExpansion(), extTreeStackTopRemove(), and extTreeStackTopRootRemove().

◆ extStackGetOutEdgesStart()

static int extStackGetOutEdgesStart ( const EXTDATA extdata,
int  stackpos 
)
inlinestatic

returns start of outgoing edges

Parameters
extdataextension data
stackposcurrent position

Definition at line 355 of file extreducedefs.h.

References extInitialCompIsGenStar(), extInitialCompIsStar(), extension_data::extstack_start, and extStackGetPosition().

Referenced by baseMstGetOrderedParentNodes(), extLeafRemoveTop(), and extStackGetTopOutEdgesStart().

◆ extStackGetOutEdgesEnd()

static int extStackGetOutEdgesEnd ( const EXTDATA extdata,
int  stackpos 
)
inlinestatic

returns end of outgoing edges

Parameters
extdataextension data
stackposcurrent position

Definition at line 384 of file extreducedefs.h.

References extension_data::extstack_start, and extStackGetPosition().

Referenced by baseMstGetOrderedParentNodes(), extLeafRemoveTop(), and extStackGetTopOutEdgesEnd().

◆ extStackGetTopOutEdgesStart()

static int extStackGetTopOutEdgesStart ( const EXTDATA extdata,
int  stackpos 
)
inlinestatic

◆ extStackGetTopOutEdgesEnd()

static int extStackGetTopOutEdgesEnd ( const EXTDATA extdata,
int  stackpos 
)
inlinestatic

◆ extStackTopIsWrapped()

static SCIP_Bool extStackTopIsWrapped ( const EXTDATA extdata)
inlinestatic

is component at top position wrapped?

Parameters
extdataextension data

Definition at line 426 of file extreducedefs.h.

References EXT_EDGE_WRAPPED, extension_data::extstack_data, extension_data::extstack_start, extStackGetPosition(), FALSE, and TRUE.

Referenced by extProcessComponent(), extStackTopExpand(), extStackTopExpandWrapped(), and extTreeSyncWithStack().

◆ extStackTopIsSingleton()

static SCIP_Bool extStackTopIsSingleton ( const EXTDATA extdata)
inlinestatic

is component at top position a singleton edge?

Parameters
extdataextension data

Definition at line 448 of file extreducedefs.h.

References extension_data::extstack_start, and extStackGetPosition().

Referenced by extTreeRuleOutPeriph().

◆ extLeafFindPos()

static int extLeafFindPos ( const EXTDATA extdata,
int  leaf 
)
inlinestatic

Finds position of given leaf in leaves data. Returns -1 if leaf could not be found.

Parameters
extdataextension data
leafleaf to find

Definition at line 462 of file extreducedefs.h.

References extension_data::tree_deg, extension_data::tree_leaves, and extension_data::tree_nleaves.

Referenced by baseMstGetOrderedParentNodes(), extLeafRemove(), extLeafRemoveTop(), and mstLevelLeafAdjustVerticalSDs().

◆ extLeafIsExtendable()

static SCIP_Bool extLeafIsExtendable ( const GRAPH graph,
const SCIP_Bool isterm,
int  leaf 
)
inlinestatic

can we extend the tree from given leaf?

Parameters
graphgraph data structure
istermmarks whether node is a terminal (or proper terminal for PC)
leafthe leaf

Definition at line 488 of file extreducedefs.h.

References GRAPH::grad, and STP_EXT_MAXGRAD.

Referenced by extreduce_checkArc(), extreduce_checkEdge(), extreduce_extCompFullIsPromising(), extreduce_extCompIsPromising(), extTreeFindExtensions(), and extTruncate().

◆ extSdGetProper()

static SCIP_Real extSdGetProper ( SCIP_Real  sd_in)
inlinestatic

Gets proper SD value. I.e., non-negative, but possible FARAWAY

Parameters
sd_inthe special distance

Definition at line 503 of file extreducedefs.h.

References EQ, FARAWAY, GE, and LE.

Referenced by extreduce_extGetSdProper(), extreduce_extGetSdProperDouble(), and mstLevelLeafSetVerticalSDsBoth().

◆ extSdIsNonTrivial()

static SCIP_Real extSdIsNonTrivial ( SCIP_Real  specialDist)
inlinestatic

◆ extReddataHasBiasedSds()