Scippy

SCIP

Solving Constraint Integer Programs

extreduce_contract.c File Reference

Detailed Description

extended-reduction tree contraction algorithms for Steiner tree problems

Author
Daniel Rehfeldt

This file implements rule-out algorithms for extended reduction techniques for Steiner problems. Allows to compute and store special distance (SD) MSTs / SPGs between the leaves of extension tree, after the contraction of certain parts of the tree.

Similarly to the extmst methods, we keep two distance storages: One from all component vertices to the lower leaves. One from the component root to the lower leafs and to the siblings.

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

Definition in file extreduce_contract.c.

#include "extreduce.h"
#include "extreducedefs.h"

Go to the source code of this file.

Data Structures

struct  extension_tree_contraction
 

Functions

Local methods
static int compDistGetPosition (int leaf_id, int level, const CONTRACT *contraction)
 
static void compUpDistAddLeaf (int leaf_id, SCIP_Real dist, SCIP_Bool override, EXTDATA *extdata, CONTRACT *contraction)
 
static void compUpDistUpdateLeavesDists (const GRAPH *graph, EXTDATA *extdata, CONTRACT *contraction)
 
static void compRootDistAddLeaf (int leaf_id, SCIP_Real dist, EXTDATA *extdata, CONTRACT *contraction)
 
static void compRootDistsUpdateLeavesDists (const GRAPH *graph, EXTDATA *extdata, CONTRACT *contraction)
 
static void compUpDistInitMindists (int level, EXTDATA *extdata, CONTRACT *contraction)
 
static void compUpDistUpdateMindists (int level, EXTDATA *extdata, CONTRACT *contraction)
 
static void compRootDistUpdateMindists (int level, EXTDATA *extdata, CONTRACT *contraction)
 
static void addComponentUpdateTreeCosts (const GRAPH *graph, EXTDATA *extdata, CONTRACT *contraction)
 
static void addComponentUpdateLeavesStarts (const GRAPH *graph, EXTDATA *extdata, CONTRACT *contraction)
 
static void addComponentUpdateLeavesToCompDists (const GRAPH *graph, EXTDATA *extdata, CONTRACT *contraction)
 
static void addComponent (SCIP *scip, const GRAPH *graph, EXTDATA *extdata)
 
static SCIP_Bool ruledOut (SCIP *scip, const GRAPH *graph, EXTDATA *extdata)
 
Interface methods
SCIP_RETCODE extreduce_contractionInit (SCIP *scip, int maxnlevels, int maxnleaves, CONTRACT **contraction)
 
void extreduce_contractionFree (SCIP *scip, CONTRACT **contraction)
 
SCIP_Bool extreduce_contractionRuleOutPeriph (SCIP *scip, const GRAPH *graph, EXTDATA *extdata)
 

Function Documentation

◆ compDistGetPosition()

static int compDistGetPosition ( int  leaf_id,
int  level,
const CONTRACT contraction 
)
inlinestatic

gets position of distance value

Parameters
leaf_idid
levellevel
contractioncontraction data

Definition at line 68 of file extreduce_contract.c.

References extension_tree_contraction::leaves_maxn, and extension_tree_contraction::level_maxn.

Referenced by compRootDistAddLeaf(), compRootDistUpdateMindists(), compUpDistAddLeaf(), compUpDistInitMindists(), and compUpDistUpdateMindists().

◆ compUpDistAddLeaf()

static void compUpDistAddLeaf ( int  leaf_id,
SCIP_Real  dist,
SCIP_Bool  override,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

adds distance

Parameters
leaf_idid
distdistance
overrideoverride distance? (take in otherwise)
extdataextension data
contractioncontraction data

Definition at line 88 of file extreduce_contract.c.

References compDistGetPosition(), GE, extension_tree_contraction::leafToCompLeaves, extension_tree_contraction::leafToCompUpDists, extension_tree_contraction::level_n, LT, and extension_data::tree_leaves.

Referenced by compUpDistUpdateLeavesDists().

◆ compUpDistUpdateLeavesDists()

static void compUpDistUpdateLeavesDists ( const GRAPH graph,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

◆ compRootDistAddLeaf()

static void compRootDistAddLeaf ( int  leaf_id,
SCIP_Real  dist,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

adds distance

Parameters
leaf_idid
distdistance
extdataextension data
contractioncontraction data

Definition at line 161 of file extreduce_contract.c.

References compDistGetPosition(), GE, extension_tree_contraction::leafToCompLeaves, extension_tree_contraction::leafToCompRootDists, extension_tree_contraction::level_n, and extension_data::tree_leaves.

Referenced by compRootDistsUpdateLeavesDists().

◆ compRootDistsUpdateLeavesDists()

static void compRootDistsUpdateLeavesDists ( const GRAPH graph,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

◆ compUpDistInitMindists()

static void compUpDistInitMindists ( int  level,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

initializes distances from component to lower leaves

Parameters
levellevel from which to initialize
extdataextension data
contractioncontraction data

Definition at line 248 of file extreduce_contract.c.

References compDistGetPosition(), FARAWAY, extension_tree_contraction::leafToCompUpDists, extension_tree_contraction::leaves_maxn, extension_tree_contraction::leaves_mindists, extension_tree_contraction::leaves_start, extension_tree_contraction::level_n, and SCIP_Real.

Referenced by ruledOut().

◆ compUpDistUpdateMindists()

static void compUpDistUpdateMindists ( int  level,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

updates distances from component to lower leaves

Parameters
levellevel from which to initialize
extdataextension data
contractioncontraction data

Definition at line 276 of file extreduce_contract.c.

References compDistGetPosition(), GE, extension_tree_contraction::leafToCompUpDists, extension_tree_contraction::leaves_mindists, extension_tree_contraction::leaves_start, extension_tree_contraction::level_n, LT, and SCIP_Real.

Referenced by ruledOut().

◆ compRootDistUpdateMindists()

static void compRootDistUpdateMindists ( int  level,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

updates leaf distances from component root to lower leaves

Parameters
levellevel from which to initialize
extdataextension data
contractioncontraction data

Definition at line 303 of file extreduce_contract.c.

References compDistGetPosition(), GE, extension_tree_contraction::leafToCompRootDists, extension_tree_contraction::leaves_mindists, extension_tree_contraction::leaves_start, extension_tree_contraction::level_n, LT, and SCIP_Real.

Referenced by ruledOut().

◆ addComponentUpdateTreeCosts()

static void addComponentUpdateTreeCosts ( const GRAPH graph,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

◆ addComponentUpdateLeavesStarts()

static void addComponentUpdateLeavesStarts ( const GRAPH graph,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

◆ addComponentUpdateLeavesToCompDists()

static void addComponentUpdateLeavesToCompDists ( const GRAPH graph,
EXTDATA extdata,
CONTRACT contraction 
)
inlinestatic

helper

Parameters
graphgraph data structure
extdataextension data
contractioncontraction data

Definition at line 406 of file extreduce_contract.c.

References compRootDistsUpdateLeavesDists(), compUpDistUpdateLeavesDists(), and extension_tree_contraction::level_n.

Referenced by addComponent().

◆ addComponent()

static void addComponent ( SCIP scip,
const GRAPH graph,
EXTDATA extdata 
)
static

◆ ruledOut()

◆ extreduce_contractionInit()

SCIP_RETCODE extreduce_contractionInit ( SCIP scip,
int  maxnlevels,
int  maxnleaves,
CONTRACT **  contraction 
)

◆ extreduce_contractionFree()

◆ extreduce_contractionRuleOutPeriph()

SCIP_Bool extreduce_contractionRuleOutPeriph ( SCIP scip,
const GRAPH graph,
EXTDATA extdata 
)

can current tree be peripherally ruled out by using contraction based arguments?

Parameters
scipSCIP
graphgraph data structure
extdataextension data

Definition at line 609 of file extreduce_contract.c.

References addComponent(), reduction_data::contration, FALSE, extension_data::reddata, ruledOut(), SCIPdebugMessage, extension_data::tree_nleaves, and TRUE.

Referenced by extTreeRuleOutPeriph().