Scippy

SCIP

Solving Constraint Integer Programs

reduce_util.c File Reference

Detailed Description

utility methods for Steiner tree reductions

Author
Daniel Rehfeldt

This file implements utility methods for Steiner tree problem reduction techniques.

A list of all interface methods can be found in reduce.h.

Definition in file reduce_util.c.

#include "reduce.h"
#include "portab.h"

Go to the source code of this file.

Data Structures

struct  complete_edge
 
struct  dynamic_complete_minimum_spanning_tree
 
struct  node_one_hop_star
 
struct  bottleneck_link_cut_node
 
struct  bottleneck_link_cut_tree
 

Typedefs

typedef struct complete_edge CEDGE
 
typedef struct bottleneck_link_cut_node BLCNODE
 

Functions

static SCIP_RETCODE blctreeBuildNodeMap (SCIP *scip, const GRAPH *graph, BLCTREE *RESTRICT blctree)
 
static SCIP_RETCODE blctreeInitPrimitives (SCIP *scip, const GRAPH *graph, BLCTREE **blctree)
 
static void blctreeResetNode (int i, BLCTREE *RESTRICT blctree)
 
static void blctreeEvert (const GRAPH *graph, int newroot, BLCTREE *blctree)
 
static SCIP_Real blctreeGetRootPathCost (int startnode, const BLCTREE *blctree)
 
static void blctreeUpdateRootPath (int startnode, SCIP_Real bottleneck, BLCTREE *blctree)
 
static void blctreeComputeBottlenecks (const GRAPH *graph, BLCTREE *blctree)
 
static void blctreeComputeEdgesState (const GRAPH *graph, BLCTREE *blctree)
 
static SCIP_RETCODE blctreeBuildMst (SCIP *scip, GRAPH *graph, BLCTREE *blctree)
 
static SCIP_RETCODE blctreeInitBottlenecks (SCIP *scip, GRAPH *graph, BLCTREE *blctree)
 
static void dcmstInsert (const CSR *org_mst, const SCIP_Real adjcosts[], int root, CEDGE new_mst[], SCIP_Bool new_nodemarked[], CEDGE *max_path_edge, int *new_nedges)
 
static void dcmstAddNode (const CSR *mst_in, const SCIP_Real *adjcosts, DCMST *dmst)
 
static void dcmstGetCSRfromStore (const DCMST *dmst, CSR *mst_out)
 
static SCIP_Real dcmstGetWeightFromStore (SCIP *scip, int mst_nedges, const DCMST *dmst)
 
static void starSelectedPositionsReset (STAR *star)
 
static void starSelectedEdgesUpdate (STAR *star)
 
static void starSelectedPositionsCopy (const STAR *star, int *posStorage)
 
static void starSelectedPositionsSetNext (STAR *star)
 
static SCIP_Bool starIsDeg2 (const STAR *star)
 
static void impliedNodesAddTerm (SCIP *scip, const GRAPH *graph, int term, STP_Vectype(int) *nodes_implications)
 
static void impliedNodesRemoveTerm (const GRAPH *graph, int neighbor, int term, STP_Vectype(int) *nodes_implications, SCIP_Bool *removed)
 
void reduce_impliedNodesGet (SCIP *scip, const GRAPH *graph, STP_Vectype(int) *nodes_implications)
 
void reduce_impliedNodesRepair (SCIP *scip, const GRAPH *graph, int tail, int head, STP_Vectype(int) *nodes_implications)
 
SCIP_Bool reduce_impliedNodesIsValid (const GRAPH *graph, const STP_Vectype(int) *nodes_implications)
 
SCIP_RETCODE reduce_applyPseudoDeletions (SCIP *scip, const SCIP_Bool *pseudoDelNodes, REDCOST *redcostdata, GRAPH *graph, SCIP_Real *offsetp, int *nelims)
 
SCIP_RETCODE reduce_blctreeInit (SCIP *scip, GRAPH *graph, BLCTREE **blctree)
 
SCIP_RETCODE reduce_blctreeRebuild (SCIP *scip, GRAPH *graph, BLCTREE *blctree)
 
void reduce_blctreeFree (SCIP *scip, BLCTREE **blctree)
 
int reduce_blctreeGetMstNedges (const BLCTREE *blctree)
 
void reduce_blctreeGetMstEdges (const GRAPH *graph, const BLCTREE *blctree, int *edgelist)
 
void reduce_blctreeGetMstEdgesToCutDist (const GRAPH *graph, const BLCTREE *blctree, SCIP_Real *RESTRICT tails2CutDist, SCIP_Real *RESTRICT heads2CutDist)
 
void reduce_blctreeGetMstEdgesState (const GRAPH *graph, const BLCTREE *blctree, SCIP_Bool *statelist)
 
void reduce_blctreeGetMstBottlenecks (const GRAPH *graph, const BLCTREE *blctree, SCIP_Real *costlist)
 
SCIP_RETCODE reduce_dcmstInit (SCIP *scip, int maxnnodes, DCMST **dcmst)
 
void reduce_dcmstAddNode (SCIP *scip, const CSR *mst_in, const SCIP_Real *adjcosts, DCMST *dmst, CSR *mst_out)
 
void reduce_dcmstAddNodeInplace (SCIP *scip, const SCIP_Real *adjcosts, DCMST *dmst, CSR *mst)
 
void reduce_dcmstGet0NodeMst (SCIP *scip, CSR *mst)
 
void reduce_dcmstGet1NodeMst (SCIP *scip, CSR *mst)
 
void reduce_dcmstGet2NodeMst (SCIP *scip, SCIP_Real edgecost, CSR *mst)
 
void reduce_dcmstGet3NodeMst (SCIP *scip, SCIP_Real edgecost01, SCIP_Real edgecost02, SCIP_Real edgecost12, CSR *mst)
 
SCIP_Real reduce_dcmstGetExtWeight (SCIP *scip, const CSR *mst, const SCIP_Real *adjcosts, DCMST *dmst)
 
SCIP_Real reduce_dcmstGetWeight (SCIP *scip, const CSR *mst_in)
 
int reduce_dcmstGetMaxnnodes (const DCMST *dmst)
 
SCIP_Realreduce_dcmstGetAdjcostBuffer (const DCMST *dmst)
 
void reduce_dcmstFree (SCIP *scip, DCMST **dcmst)
 
SCIP_Bool reduce_dcmstMstIsValid (SCIP *scip, const CSR *cmst)
 
SCIP_RETCODE reduce_starInit (SCIP *scip, int maxdegree, STAR **star)
 
void reduce_starFree (SCIP *scip, STAR **star)
 
void reduce_starReset (const GRAPH *g, int node, STAR *star)
 
void reduce_starResetWithEdges (const GRAPH *g, const STP_Vectype(int) staredges, STAR *star)
 
int reduce_starGetCenter (const STAR *star)
 
const int * reduce_starGetNext (STAR *star, int *nedges)
 
const int * reduce_starGetNextAndPosition (STAR *star, int *position, int *nedges)
 
const int * reduce_starGetRuledOutEdges (STAR *star, int *nedges)
 
void reduce_starCurrentSetRuledOut (STAR *star)
 
void reduce_starCurrentSetFailed (STAR *star)
 
SCIP_Bool reduce_starHasPromisingEdges (const STAR *star)
 
SCIP_Bool reduce_starAllAreChecked (const STAR *star)
 

Typedef Documentation

◆ CEDGE

typedef struct complete_edge CEDGE

storage for edge on complete graph

◆ BLCNODE

bottleneck link-cut tree node

Function Documentation

◆ blctreeBuildNodeMap()

static SCIP_RETCODE blctreeBuildNodeMap ( SCIP scip,
const GRAPH graph,
BLCTREE *RESTRICT  blctree 
)
inlinestatic

builds mapping

Parameters
scipSCIP
graphthe graph
blctreethe tree

Definition at line 103 of file reduce_util.c.

References GRAPH::grad, graph_pc_isPc(), GRAPH::knots, GRAPH::mark, SCIP_CALL, SCIP_OKAY, SCIPallocMemoryArray, and UNKNOWN.

Referenced by blctreeInitPrimitives().

◆ blctreeInitPrimitives()

static SCIP_RETCODE blctreeInitPrimitives ( SCIP scip,
const GRAPH graph,
BLCTREE **  blctree 
)
static

◆ blctreeResetNode()

static void blctreeResetNode ( int  i,
BLCTREE *RESTRICT  blctree 
)
inlinestatic

resets given node

Parameters
ithe node
blctreethe tree

Definition at line 183 of file reduce_util.c.

References FARAWAY, and UNKNOWN.

Referenced by blctreeBuildMst(), and blctreeEvert().

◆ blctreeEvert()

◆ blctreeGetRootPathCost()

static SCIP_Real blctreeGetRootPathCost ( int  startnode,
const BLCTREE blctree 
)
inlinestatic

gets cost of path

Parameters
startnodenode to start from
blctreetree

Definition at line 253 of file reduce_util.c.

References bottleneck_link_cut_node::edgecost, complete_edge::head, bottleneck_link_cut_node::head, bottleneck_link_cut_tree::mst, bottleneck_link_cut_tree::root, SCIP_Real, SCIPdebugMessage, and UNKNOWN.

Referenced by blctreeUpdateRootPath().

◆ blctreeUpdateRootPath()

static void blctreeUpdateRootPath ( int  startnode,
SCIP_Real  bottleneck,
BLCTREE blctree 
)
inlinestatic

updates path to root

Parameters
startnodenode to start from
bottleneckbottleneck
blctreetree

Definition at line 282 of file reduce_util.c.

References blctreeGetRootPathCost(), GE, complete_edge::head, bottleneck_link_cut_tree::mst, bottleneck_link_cut_tree::root, SCIP_Real, SCIPdebugMessage, and UNKNOWN.

Referenced by blctreeComputeBottlenecks().

◆ blctreeComputeBottlenecks()

◆ blctreeComputeEdgesState()

◆ blctreeBuildMst()

◆ blctreeInitBottlenecks()

static SCIP_RETCODE blctreeInitBottlenecks ( SCIP scip,
GRAPH graph,
BLCTREE blctree 
)
static

builds BLC tree

Parameters
scipSCIP
graphthe graph
blctreeto be built

Definition at line 516 of file reduce_util.c.

References blctreeBuildMst(), blctreeComputeBottlenecks(), blctreeComputeEdgesState(), SCIP_CALL, and SCIP_OKAY.

Referenced by reduce_blctreeInit(), and reduce_blctreeRebuild().

◆ dcmstInsert()

static void dcmstInsert ( const CSR org_mst,
const SCIP_Real  adjcosts[],
int  root,
CEDGE  new_mst[],
SCIP_Bool  new_nodemarked[],
CEDGE max_path_edge,
int *  new_nedges 
)
static

recursive method for adding node to MST

Parameters
org_mstthe base MST
adjcosts(undirected) adjacency costs for new node
rootthe current root
new_mstnew MST
new_nodemarkedarray
max_path_edgepointer to maximum edge on path to new node
new_nedgespointer to current number of edges

Definition at line 532 of file reduce_util.c.

References complete_edge::cost, csr_storage::cost, complete_edge::head, csr_storage::head, nnodes, csr_storage::nnodes, SCIP_Real, csr_storage::start, complete_edge::tail, TRUE, and w.

Referenced by dcmstAddNode().

◆ dcmstAddNode()

static void dcmstAddNode ( const CSR mst_in,
const SCIP_Real adjcosts,
DCMST dmst 
)
inlinestatic

add node to MST

Parameters
mst_insource
adjcosts(undirected) adjacency costs for new node
dmstunderlying structure

Definition at line 600 of file reduce_util.c.

References dcmstInsert(), dynamic_complete_minimum_spanning_tree::edgestore, FALSE, csr_storage::nnodes, dynamic_complete_minimum_spanning_tree::nodemark, SCIP_Bool, complete_edge::tail, and TRUE.

Referenced by reduce_dcmstAddNode(), reduce_dcmstAddNodeInplace(), and reduce_dcmstGetExtWeight().

◆ dcmstGetCSRfromStore()

static void dcmstGetCSRfromStore ( const DCMST dmst,
CSR mst_out 
)
inlinestatic

◆ dcmstGetWeightFromStore()

static SCIP_Real dcmstGetWeightFromStore ( SCIP scip,
int  mst_nedges,
const DCMST dmst 
)
inlinestatic

gets weight of MST from DCMST store

Parameters
scipSCIP
mst_nedgesnumber of edges
dmstunderlying structure

Definition at line 689 of file reduce_util.c.

References complete_edge::cost, dynamic_complete_minimum_spanning_tree::edgestore, FARAWAY, GE, complete_edge::head, LE, SCIP_Real, and complete_edge::tail.

Referenced by reduce_dcmstGetExtWeight().

◆ starSelectedPositionsReset()

static void starSelectedPositionsReset ( STAR star)
inlinestatic

sets star position array to initial setting for current star degree

Parameters
starthe star

Definition at line 721 of file reduce_util.c.

References node_one_hop_star::edgesSelectedPos, and node_one_hop_star::starDegree.

Referenced by reduce_starReset(), reduce_starResetWithEdges(), and starSelectedPositionsSetNext().

◆ starSelectedEdgesUpdate()

static void starSelectedEdgesUpdate ( STAR star)
inlinestatic

fills array star->edgesSelected by using the current positions

Parameters
starthe star (in/out)

Definition at line 737 of file reduce_util.c.

References node_one_hop_star::edgeId, node_one_hop_star::edgesSelected, node_one_hop_star::edgesSelectedPos, and node_one_hop_star::starDegree.

Referenced by reduce_starGetNext(), and reduce_starGetNextAndPosition().

◆ starSelectedPositionsCopy()

static void starSelectedPositionsCopy ( const STAR star,
int *  posStorage 
)
inlinestatic

copies selected positions into given array

Parameters
starthe star (in/out)
posStorageto copy into

Definition at line 757 of file reduce_util.c.

References node_one_hop_star::edgesSelectedPos, and node_one_hop_star::starDegree.

Referenced by reduce_starGetNextAndPosition().

◆ starSelectedPositionsSetNext()

static void starSelectedPositionsSetNext ( STAR star)
inlinestatic

◆ starIsDeg2()

static SCIP_Bool starIsDeg2 ( const STAR star)
inlinestatic

have we just move past the last star?

Parameters
starthe star (in/out)

Definition at line 834 of file reduce_util.c.

References FALSE, node_one_hop_star::starDegree, and TRUE.

Referenced by reduce_starGetNext(), and reduce_starGetNextAndPosition().

◆ impliedNodesAddTerm()

static void impliedNodesAddTerm ( SCIP scip,
const GRAPH graph,
int  term,
STP_Vectype(int) *  nodes_implications 
)
inlinestatic

adds implication for terminal

Parameters
scipSCIP data structure
graphgraph data structure
termterm
nodes_implicationsarray of size |V|; returned with implications per node or NULL

Definition at line 850 of file reduce_util.c.

References GRAPH::cost, EAT_LAST, EQ, FARAWAY, graph_pc_isPcMw(), graph_pc_knotIsDummyTerm(), GRAPH::ieat, GRAPH::inpbeg, Is_term, LE, LT, GRAPH::prize, SCIP_Bool, SCIP_Real, SCIPdebugMessage, STP_RPCSPG, GRAPH::stp_type, StpVecPushBack, GRAPH::tail, and GRAPH::term.

Referenced by reduce_impliedNodesGet(), and reduce_impliedNodesRepair().

◆ impliedNodesRemoveTerm()

static void impliedNodesRemoveTerm ( const GRAPH graph,
int  neighbor,
int  term,
STP_Vectype(int) *  nodes_implications,
SCIP_Bool removed 
)
inlinestatic

removes implication for terminal from neighbor (if implication exists)

Parameters
graphgraph data structure
neighborneighbor of term
termterm
nodes_implicationsarray of size |V|; returned with implications per node or NULL
removedwas removed?

Definition at line 902 of file reduce_util.c.

References FALSE, graph_knot_isInRange(), Is_term, STP_Vectype, StpVecGetSize, StpVecPopBack, GRAPH::term, and TRUE.

Referenced by reduce_impliedNodesRepair().

◆ reduce_impliedNodesGet()

void reduce_impliedNodesGet ( SCIP scip,
const GRAPH graph,
STP_Vectype(int) *  nodes_implications 
)

gets implied nodes for each node

Parameters
scipSCIP data structure
graphgraph data structure
nodes_implicationsarray of size |V|; returned with implications per node or NULL

Definition at line 937 of file reduce_util.c.

References GRAPH::extended, graph_get_nNodes(), graph_pc_isPcMw(), impliedNodesAddTerm(), Is_term, nnodes, NULL, and GRAPH::term.

Referenced by extreduce_extPermaInit().

◆ reduce_impliedNodesRepair()

void reduce_impliedNodesRepair ( SCIP scip,
const GRAPH graph,
int  tail,
int  head,
STP_Vectype(int) *  nodes_implications 
)

repairs implied nodes list AFTER edge elimination

Parameters
scipSCIP data structure
graphgraph data structure
tailtail of eliminated edge
headhead of eliminated edge
nodes_implicationsinitialized array of size |V|

Definition at line 962 of file reduce_util.c.

References GRAPH::extended, graph_knot_isInRange(), graph_pc_isPcMw(), impliedNodesAddTerm(), impliedNodesRemoveTerm(), Is_term, SCIP_Bool, and GRAPH::term.

Referenced by removeEdge(), and replaceEdgeByPath().

◆ reduce_impliedNodesIsValid()

SCIP_Bool reduce_impliedNodesIsValid ( const GRAPH graph,
const STP_Vectype(int) *  nodes_implications 
)

implied nodes list is valid

Parameters
graphgraph data structure
nodes_implicationsinitialized array of size |V|

Definition at line 996 of file reduce_util.c.

References EAT_LAST, FALSE, GRAPH::grad, graph_get_nNodes(), graph_knot_isInRange(), GRAPH::head, nnodes, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, STP_Vectype, StpVecGetSize, and TRUE.

Referenced by removeEdge(), and replaceEdgeByPath().

◆ reduce_applyPseudoDeletions()

SCIP_RETCODE reduce_applyPseudoDeletions ( SCIP scip,
const SCIP_Bool pseudoDelNodes,
REDCOST redcostdata,
GRAPH graph,
SCIP_Real offsetp,
int *  nelims 
)

◆ reduce_blctreeInit()

SCIP_RETCODE reduce_blctreeInit ( SCIP scip,
GRAPH graph,
BLCTREE **  blctree 
)

initializes BLC tree

Parameters
scipSCIP
graphthe graph
blctreeto be initialized

Definition at line 1168 of file reduce_util.c.

References blctreeInitBottlenecks(), blctreeInitPrimitives(), graph_mark(), SCIP_CALL, and SCIP_OKAY.

Referenced by reduce_sdInitBiasedBottleneck(), testBLCworksFor3Star(), testBLCworksFor3StarAfterReduction(), and testBLCworksFor5Tree().

◆ reduce_blctreeRebuild()

SCIP_RETCODE reduce_blctreeRebuild ( SCIP scip,
GRAPH graph,
BLCTREE blctree 
)

rebuilds BLC tree (needs to be initializes)

Parameters
scipSCIP
graphthe graph
blctreeto be initialized

Definition at line 1186 of file reduce_util.c.

References blctreeInitBottlenecks(), SCIP_CALL, and SCIP_OKAY.

◆ reduce_blctreeFree()

void reduce_blctreeFree ( SCIP scip,
BLCTREE **  blctree 
)

frees BLC tree

Parameters
scipSCIP
blctreeto be freed

Definition at line 1201 of file reduce_util.c.

References SCIPfreeMemory, and SCIPfreeMemoryArray.

Referenced by reduce_sdFree(), testBLCworksFor3Star(), testBLCworksFor3StarAfterReduction(), and testBLCworksFor5Tree().

◆ reduce_blctreeGetMstNedges()

int reduce_blctreeGetMstNedges ( const BLCTREE blctree)

gets number of BLC MST edges

Parameters
blctreeBLC tree

Definition at line 1218 of file reduce_util.c.

References bottleneck_link_cut_tree::nnodes_curr.

Referenced by nsvInitData(), and reduce_sdprofitUpdateFromBLC().

◆ reduce_blctreeGetMstEdges()

void reduce_blctreeGetMstEdges ( const GRAPH graph,
const BLCTREE blctree,
int *  edgelist 
)

◆ reduce_blctreeGetMstEdgesToCutDist()

void reduce_blctreeGetMstEdgesToCutDist ( const GRAPH graph,
const BLCTREE blctree,
SCIP_Real *RESTRICT  tails2CutDist,
SCIP_Real *RESTRICT  heads2CutDist 
)

gets BLC MST edges (maximum) distances from tail to cut

Parameters
graphgraph
blctreeBLC tree
tails2CutDistof size nodes - 1
heads2CutDistof size nodes - 1

Definition at line 1266 of file reduce_util.c.

References bottleneck_link_cut_node::dist_edgehead, bottleneck_link_cut_node::dist_edgetail, bottleneck_link_cut_node::edge, GE, graph_edge_printInfo(), graph_get_nNodes(), bottleneck_link_cut_tree::mst, bottleneck_link_cut_tree::nnodes_curr, bottleneck_link_cut_tree::nnodes_org, bottleneck_link_cut_tree::root, SCIP_Real, and UNKNOWN.

◆ reduce_blctreeGetMstEdgesState()

void reduce_blctreeGetMstEdgesState ( const GRAPH graph,
const BLCTREE blctree,
SCIP_Bool statelist 
)

returns BLC MST edges state. I.e. whether the ede is between two terminal or not

Parameters
graphgraph
blctreeBLC tree
statelistof size nodes - 1

Definition at line 1315 of file reduce_util.c.

References bottleneck_link_cut_node::edge, graph_get_nNodes(), bottleneck_link_cut_tree::mst, bottleneck_link_cut_tree::mstedges_isLink, bottleneck_link_cut_tree::nnodes_curr, bottleneck_link_cut_tree::nnodes_org, bottleneck_link_cut_tree::root, and UNKNOWN.

Referenced by nsvInitData().

◆ reduce_blctreeGetMstBottlenecks()

void reduce_blctreeGetMstBottlenecks ( const GRAPH graph,
const BLCTREE blctree,
SCIP_Real costlist 
)

◆ reduce_dcmstInit()

SCIP_RETCODE reduce_dcmstInit ( SCIP scip,
int  maxnnodes,
DCMST **  dcmst 
)

◆ reduce_dcmstAddNode()

void reduce_dcmstAddNode ( SCIP scip,
const CSR mst_in,
const SCIP_Real adjcosts,
DCMST dmst,
CSR mst_out 
)

adds node to CSR "mst_in" and saves result in "mst_out"

Parameters
scipSCIP
mst_insource
adjcosts(undirected) adjacency costs for new node
dmstunderlying structure
mst_outtarget

Definition at line 1411 of file reduce_util.c.

References dcmstAddNode(), dcmstGetCSRfromStore(), dynamic_complete_minimum_spanning_tree::maxnnodes, csr_storage::nedges_max, csr_storage::nnodes, and reduce_dcmstMstIsValid().

Referenced by dcmstTest1(), dcmstTest2(), dcmstTest2b(), dcmstTest3(), mstExtend(), and ruledOut().

◆ reduce_dcmstAddNodeInplace()

void reduce_dcmstAddNodeInplace ( SCIP scip,
const SCIP_Real adjcosts,
DCMST dmst,
CSR mst 
)

Adds node to CSR "mst". NOTE: There needs to be enough space in CSR arrays for one more node!

Parameters
scipSCIP
adjcosts(undirected) adjacency costs for new node
dmstunderlying structure
mstsource/target

Definition at line 1438 of file reduce_util.c.

References dcmstAddNode(), dcmstGetCSRfromStore(), dynamic_complete_minimum_spanning_tree::maxnnodes, csr_storage::nedges_max, csr_storage::nnodes, and reduce_dcmstMstIsValid().

Referenced by mstExtend().

◆ reduce_dcmstGet0NodeMst()

void reduce_dcmstGet0NodeMst ( SCIP scip,
CSR mst 
)

computes MST on 0 node

Parameters
scipSCIP
mstMST

Definition at line 1461 of file reduce_util.c.

References EQ, csr_storage::nedges_max, csr_storage::nnodes, reduce_dcmstGetWeight(), reduce_dcmstMstIsValid(), and csr_storage::start.

◆ reduce_dcmstGet1NodeMst()

void reduce_dcmstGet1NodeMst ( SCIP scip,
CSR mst 
)

computes MST on 1 node

Parameters
scipSCIP
mstMST

Definition at line 1479 of file reduce_util.c.

References EQ, csr_storage::nedges_max, csr_storage::nnodes, reduce_dcmstGetWeight(), reduce_dcmstMstIsValid(), and csr_storage::start.

Referenced by add1NodeMst(), and dcmstTest1().

◆ reduce_dcmstGet2NodeMst()

void reduce_dcmstGet2NodeMst ( SCIP scip,
SCIP_Real  edgecost,
CSR mst 
)

computes MST on 2 nodes

Parameters
scipSCIP
edgecostedge cost
mstMST

Definition at line 1498 of file reduce_util.c.

References complete_edge::cost, csr_storage::cost, EQ, csr_storage::head, csr_storage::nedges_max, csr_storage::nnodes, reduce_dcmstGetWeight(), reduce_dcmstMstIsValid(), SCIP_Real, and csr_storage::start.

Referenced by dcmstTest2(), dcmstTest2b(), and dcmstTest3().

◆ reduce_dcmstGet3NodeMst()

void reduce_dcmstGet3NodeMst ( SCIP scip,
SCIP_Real  edgecost01,
SCIP_Real  edgecost02,
SCIP_Real  edgecost12,
CSR mst 
)

computes MST on 3 nodes

Parameters
scipSCIP
edgecost01edge cost
edgecost02edge cost
edgecost12edge cost
mstMST

Definition at line 1528 of file reduce_util.c.

◆ reduce_dcmstGetExtWeight()

SCIP_Real reduce_dcmstGetExtWeight ( SCIP scip,
const CSR mst,
const SCIP_Real adjcosts,
DCMST dmst 
)

gets weight of MST extended along given vertex

Parameters
scipSCIP
mstMST for which to compute extended weight
adjcosts(undirected) adjacency costs for new node
dmstunderlying structure

Definition at line 1541 of file reduce_util.c.

References dcmstAddNode(), dcmstGetWeightFromStore(), FARAWAY, GE, GT, csr_storage::nedges_max, csr_storage::nnodes, reduce_dcmstMstIsValid(), and SCIP_Real.

Referenced by mstLevelLeafTryExtMst().

◆ reduce_dcmstGetWeight()

◆ reduce_dcmstGetMaxnnodes()

int reduce_dcmstGetMaxnnodes ( const DCMST dmst)

returns maximum number of nodes

Parameters
dmstunderlying structure

Definition at line 1604 of file reduce_util.c.

References dynamic_complete_minimum_spanning_tree::maxnnodes.

Referenced by mstCompAddLeaf().

◆ reduce_dcmstGetAdjcostBuffer()

SCIP_Real* reduce_dcmstGetAdjcostBuffer ( const DCMST dmst)

Returns buffer of size 'reduce_dcmstGetMaxnnodes'. NOTE: buffer is never used within any other function, apart from allocation and freeing. NOTE: in debug mode the array is initialized to -1.0

Parameters
dmstunderlying structure

Definition at line 1617 of file reduce_util.c.

References dynamic_complete_minimum_spanning_tree::adjcost_buffer, and dynamic_complete_minimum_spanning_tree::maxnnodes.

Referenced by baseMstBuildNew(), and mstCompAddLeaf().

◆ reduce_dcmstFree()

void reduce_dcmstFree ( SCIP scip,
DCMST **  dcmst 
)

frees dynamic MST structure

Parameters
scipSCIP
dcmstto be initialized

Definition at line 1634 of file reduce_util.c.

References SCIPfreeMemory, and SCIPfreeMemoryArray.

Referenced by dcmstTest1(), dcmstTest2(), dcmstTest2b(), dcmstTest3(), and extreduce_extPermaFree().

◆ reduce_dcmstMstIsValid()

◆ reduce_starInit()

◆ reduce_starFree()

◆ reduce_starReset()

◆ reduce_starResetWithEdges()

void reduce_starResetWithEdges ( const GRAPH g,
const STP_Vectype(int)  staredges,
STAR star 
)

◆ reduce_starGetCenter()

int reduce_starGetCenter ( const STAR star)

gets center

Parameters
starthe star (in/out)

Definition at line 1853 of file reduce_util.c.

References node_one_hop_star::starcenter.

◆ reduce_starGetNext()

const int* reduce_starGetNext ( STAR star,
int *  nedges 
)

◆ reduce_starGetNextAndPosition()

const int* reduce_starGetNextAndPosition ( STAR star,
int *  position,
int *  nedges 
)

gets next star

Parameters
starthe star (in/out)
positionarray to store the positions
nedgesnumber of edges of next star (out)

Definition at line 1886 of file reduce_util.c.

References node_one_hop_star::allStarsChecked, node_one_hop_star::edgesSelected, reduce_starAllAreChecked(), node_one_hop_star::starDegree, starIsDeg2(), starSelectedEdgesUpdate(), starSelectedPositionsCopy(), starSelectedPositionsSetNext(), and TRUE.

Referenced by bdkStarLoadNext().

◆ reduce_starGetRuledOutEdges()

const int* reduce_starGetRuledOutEdges ( STAR star,
int *  nedges 
)

gets ruled out edges after termination

Parameters
starthe star
nedgesnumber of ruled-out edges

Definition at line 1918 of file reduce_util.c.

References node_one_hop_star::edgeId, node_one_hop_star::edgeIsFailed, node_one_hop_star::edgesPromising, node_one_hop_star::nedgesPromising, node_one_hop_star::nodeDegree, and reduce_starAllAreChecked().

Referenced by bdkTryDegGe4(), and testStar4EdgeIsCorrect().

◆ reduce_starCurrentSetRuledOut()

void reduce_starCurrentSetRuledOut ( STAR star)

sets current star to ruled-out

Parameters
starthe star

Definition at line 1948 of file reduce_util.c.

References reduce_starAllAreChecked().

◆ reduce_starCurrentSetFailed()

void reduce_starCurrentSetFailed ( STAR star)

◆ reduce_starHasPromisingEdges()

SCIP_Bool reduce_starHasPromisingEdges ( const STAR star)

are there edge that might still be ruled out?

Parameters
starthe star

Definition at line 1990 of file reduce_util.c.

References node_one_hop_star::nedgesPromising.

Referenced by bdkTryDegGe4(), and testStar4EdgeIsCorrect().

◆ reduce_starAllAreChecked()