Scippy

SCIP

Solving Constraint Integer Programs

extreduce_redcosts.c File Reference

Detailed Description

reduced cost routines for extended reduction techniques for Steiner tree problems

Author
Daniel Rehfeldt

This file implements methods for using reduced costs in extended reduction techniques.

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

Definition in file extreduce_redcosts.c.

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "graph.h"
#include "portab.h"
#include "extreduce.h"

Go to the source code of this file.

Functions

static SCIP_Real getTreeRedcosts_dbg (const GRAPH *graph, int redcostlevel, const EXTDATA *extdata, int root)
 
static void sortDescendingIntRealReal (int *RESTRICT keyArr, SCIP_Real *RESTRICT dataArr1, SCIP_Real *RESTRICT dataArr2, int nentries)
 
static SCIP_Real getMinDistCombination (const SCIP_Real *firstTermDist, const SCIP_Real *secondTermDist, int nentries)
 
static SCIP_Real extTreeGetDirectedRedcostProper (const GRAPH *graph, int redcostlevel, const EXTDATA *extdata, int root)
 
static SCIP_Real extTreeGetDirectedRedcost (const GRAPH *graph, int redcostlevel, const EXTDATA *extdata, const REDDATA *reddata, int root)
 
static SCIP_Bool extTreeRedcostCutoff (const GRAPH *graph, int redcostlevel, const EXTDATA *extdata, const REDDATA *reddata)
 
void extreduce_redcostTreeRecompute (SCIP *scip, const GRAPH *graph, EXTDATA *extdata)
 
void extreduce_redcostInitExpansion (const GRAPH *graph, EXTDATA *extdata)
 
void extreduce_redcostAddEdge (const GRAPH *graph, int edge, REDDATA *reddata, EXTDATA *extdata)
 
void extreduce_redcostRemoveEdge (int edge, const REDDATA *reddata, EXTDATA *extdata)
 
SCIP_Bool extreduce_redcostRuleOutPeriph (const GRAPH *graph, EXTDATA *extdata)
 

Function Documentation

◆ getTreeRedcosts_dbg()

static SCIP_Real getTreeRedcosts_dbg ( const GRAPH graph,
int  redcostlevel,
const EXTDATA extdata,
int  root 
)
static

◆ sortDescendingIntRealReal()

static void sortDescendingIntRealReal ( int *RESTRICT  keyArr,
SCIP_Real *RESTRICT  dataArr1,
SCIP_Real *RESTRICT  dataArr2,
int  nentries 
)
inlinestatic

insertion sort; keyArr has sentinel value at position -1 : do something special: maybe sort index array

Parameters
keyArrkey array of size 'nentries'
dataArr1array of size 'nentries'
dataArr2array of size 'nentries'
nentriesnumber of entries

Definition at line 105 of file extreduce_redcosts.c.

References SCIP_Real.

Referenced by extTreeGetDirectedRedcostProper().

◆ getMinDistCombination()

static SCIP_Real getMinDistCombination ( const SCIP_Real firstTermDist,
const SCIP_Real secondTermDist,
int  nentries 
)
inlinestatic

helper for rooted tree reduced cost computation

Parameters
firstTermDistarray of size 'nentries'
secondTermDistarray of size 'nentries'
nentriesnumber of entries to check

Definition at line 175 of file extreduce_redcosts.c.

References EQ, FARAWAY, LE, LT, and SCIP_Real.

Referenced by extTreeGetDirectedRedcostProper().

◆ extTreeGetDirectedRedcostProper()

static SCIP_Real extTreeGetDirectedRedcostProper ( const GRAPH graph,
int  redcostlevel,
const EXTDATA extdata,
int  root 
)
inlinestatic

◆ extTreeGetDirectedRedcost()

static SCIP_Real extTreeGetDirectedRedcost ( const GRAPH graph,
int  redcostlevel,
const EXTDATA extdata,
const REDDATA reddata,
int  root 
)
inlinestatic

gets reduced cost of current tree rooted at leave 'root'

Parameters
graphgraph data structure
redcostlevelthe reduced costs level
extdataextension data
reddatareduction data
rootthe root for the orientation

Definition at line 406 of file extreduce_redcosts.c.

References extTreeGetDirectedRedcostProper(), FARAWAY, graph_knot_isInRange(), GRAPH::knots, LT, reduction_data::redcost_treenodeswaps, SCIP_Real, SCIPdebugMessage, STP_EXTTREE_MAXNLEAVES_GUARD, extension_data::tree_leaves, extension_data::tree_nDelUpArcs, extension_data::tree_nleaves, and extension_data::tree_root.

Referenced by extTreeRedcostCutoff().

◆ extTreeRedcostCutoff()

static SCIP_Bool extTreeRedcostCutoff ( const GRAPH graph,
int  redcostlevel,
const EXTDATA extdata,
const REDDATA reddata 
)
inlinestatic

checks for reduced-cost cutoff of current tree

Parameters
graphgraph data structure
redcostlevellevel
extdataextension data
reddatareduction data

Definition at line 446 of file extreduce_redcosts.c.

References EPS_ZERO_HARD, extTreeGetDirectedRedcost(), FALSE, FARAWAY, GE_FEAS_EPS, getTreeRedcosts_dbg(), LE, LT, reduction_data::redcost_allowEquality, extension_data::redcostdata, redcosts_getCutoff(), SCIP_Bool, SCIP_Real, SCIPdebugMessage, extension_data::tree_leaves, extension_data::tree_nleaves, and TRUE.

Referenced by extreduce_redcostRuleOutPeriph().

◆ extreduce_redcostTreeRecompute()

◆ extreduce_redcostInitExpansion()

void extreduce_redcostInitExpansion ( const GRAPH graph,
EXTDATA extdata 
)

◆ extreduce_redcostAddEdge()

void extreduce_redcostAddEdge ( const GRAPH graph,
int  edge,
REDDATA reddata,
EXTDATA extdata 
)

◆ extreduce_redcostRemoveEdge()

void extreduce_redcostRemoveEdge ( int  edge,
const REDDATA reddata,
EXTDATA extdata 
)

update reduced cost for removed edge

Parameters
edgeedge to be added
reddatareduction data
extdataextension data

Definition at line 635 of file extreduce_redcosts.c.

References reduction_data::edgedeleted, FARAWAY, LT, reduction_data::redcost_nlevels, reduction_data::redcost_treecosts, extension_data::redcostdata, redcosts_getEdgeCosts(), redcosts_getNedges(), SCIP_Bool, SCIP_Real, and extension_data::tree_nDelUpArcs.

Referenced by extTreeStackTopRemove().

◆ extreduce_redcostRuleOutPeriph()

SCIP_Bool extreduce_redcostRuleOutPeriph ( const GRAPH graph,
EXTDATA extdata 
)

Can current tree be peripherally ruled out by using reduced costs arguments?

Parameters
graphgraph data structure
extdataextension data

Definition at line 665 of file extreduce_redcosts.c.

References extTreeRedcostCutoff(), FALSE, reduction_data::redcost_nlevels, extension_data::reddata, extension_data::tree_leaves, extension_data::tree_nleaves, extension_data::tree_root, and TRUE.

Referenced by extTreeRuleOutPeriph().