Scippy

SCIP

Solving Constraint Integer Programs

reduce_base.c File Reference

Detailed Description

Reduction tests for Steiner problems.

Author
Daniel Rehfeldt

This file includes several packages of reduction techniques for different Steiner problem variants.

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

Definition in file reduce_base.c.

#include "mincut.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "graph.h"
#include "reduce.h"
#include "heur_tm.h"
#include "misc_stp.h"
#include "scip/scip.h"
#include "probdata_stp.h"
#include "prop_stp.h"
#include "portab.h"
#include "dpterms.h"
#include "relax_stpenum.h"

Go to the source code of this file.

Macros

#define REDUCE_C
 
#define STP_RED_EXTENSIVE   FALSE
 
#define STP_REDBOUND_SDSP   200
 
#define STP_REDBOUND_SDSP2   800
 
#define STP_REDBOUND_PCBDK   80
 
#define STP_REDBOUND_PCBDK2   400
 
#define STP_REDBOUND_BDK   400
 
#define STP_REDBOUND_BDK2   600
 
#define STP_REDBOUND_SDSTAR   400
 
#define STP_REDBOUND_SDSTAR2   800
 
#define STP_RED_MWTERMBOUND   400
 
#define STP_RED_EXPENSIVEFACTOR   2
 
#define STP_RED_GLBFACTOR   3
 
#define STP_RED_EDGELIMIT   100000
 
#define STP_RED_EDGELIMIT_HUGE   1000000
 
#define STP_RED_MAXNINNROUNDS   15
 
#define STP_RED_MAXNOUTROUNDS_PC   4
 
#define STP_RED_MAXNOUTROUNDS_MW   4
 
#define STP_BND_THRESHOLD   0.03
 
#define USE_FULLSEPA
 

Enumerations

enum  PC_REDTYPE {
  pc_sdc,
  pc_sdstar,
  pc_sdstar2,
  pc_sdw1,
  pc_sdw2,
  pc_bd3
}
 
enum  STP_REDTYPE {
  stp_bdk,
  stp_sdstar,
  stp_sdstarbot
}
 

Functions

static int getWorkLimitsStp (const GRAPH *g, int roundnumber, SCIP_Bool fullreduce, enum STP_REDTYPE redtype)
 
static int getWorkLimitsPc (const GRAPH *g, int roundnumber, SCIP_Bool beFast, enum PC_REDTYPE redtype)
 
static void reduceStatsPrint (SCIP_Bool print, const char *method, int nelims)
 
static SCIP_RETCODE execNvSl (SCIP *scip, const int *edgestate, GRAPH *g, PATH *vnoi, SCIP_Real *nodearrreal, SCIP_Real *fixed, int *edgearrint, int *vbase, int *neighb, int *distnode, int *solnode, STP_Bool *visited, int *nelims, int minelims)
 
static SCIP_RETCODE execPc_SD (SCIP *scip, GRAPH *g, PATH *vnoi, int *heap, int *state, int *vbase, int *nodesid, int *nodesorg, int *nelims, int redbound, SCIP_Bool verbose, SCIP_Bool *rerun)
 
static SCIP_RETCODE execPc_BDk (SCIP *scip, GRAPH *g, PATH *pathtail, PATH *pathhead, int *heap, int *statetail, int *statehead, int *memlbltail, int *memlblhead, int *nelims, int limit, SCIP_Real *offset, int redbound, SCIP_Bool verbose, SCIP_Bool *rerun)
 
static SCIP_RETCODE execPc_NVSL (SCIP *scip, SCIP_Bool usestrongreds, GRAPH *g, PATH *vnoi, SCIP_Real *nodearrreal, SCIP_Real *fixed, int *edgearrint, int *vbase, int *neighb, int *distnode, int *solnode, STP_Bool *visited, int *nelims, int redbound, SCIP_Bool verbose, SCIP_Bool *rerun)
 
static SCIP_RETCODE execPc_BND (SCIP *scip, GRAPH *graph, PATH *vnoi, SCIP_Real *radius, SCIP_Real *offset, int *heap, int *state, int *vbase, int *nelims, int redbound, SCIP_Bool verbose, SCIP_Bool *rerun)
 
static SCIP_RealredbaseGetOffsetPointer (REDBASE *redbase)
 
static int * redbaseGetSolnode (REDSOLLOCAL *redsollocal, REDBASE *redbase)
 
static SCIP_RETCODE redLoopInnerStp (SCIP *scip, SCIP_RANDNUMGEN *randnumgen, GRAPH *g, REDSOLLOCAL *redsollocal, REDBASE *redbase, SCIP_Bool *wasDecomposed)
 
static SCIP_RETCODE redLoopInnerMw (SCIP *scip, GRAPH *g, REDSOLLOCAL *redsollocal, PATH *vnoi, SCIP_Real *nodearrreal, int *state, int *vbase, int *nodearrint, STP_Bool *nodearrchar, SCIP_Real *fixed, STP_Bool dualascent, STP_Bool bred, int redbound, SCIP_Bool userec, SCIP_Real prizesum)
 
static SCIP_RETCODE redLoopInnerPc (SCIP *scip, GRAPH *g, REDSOLLOCAL *redsollocal, DHEAP *dheap, PATH *vnoi, PATH *path, SCIP_Real *nodearrreal, int *heap, int *state, int *vbase, int *nodearrint, int *edgearrint, int *nodearrint2, STP_Bool *nodearrchar, SCIP_Real *fixed, SCIP_RANDNUMGEN *randnumgen, SCIP_Real prizesum, SCIP_Bool dualascent, SCIP_Bool bred, int reductbound, SCIP_Bool userec, SCIP_Bool nodereplacing, SCIP_Bool usestrongreds, SCIP_Bool beFast, int *ninnerelims)
 
int reduce_getMinNreductions (const GRAPH *g, int lowerbound)
 
SCIP_RETCODE reduce_baseInit (SCIP *scip, const GRAPH *g, REDBASE **redbase)
 
void reduce_baseFree (SCIP *scip, REDBASE **redbase)
 
SCIP_RETCODE reduce_stp (SCIP *scip, GRAPH *g, REDSOL *redsol, int minelims, SCIP_Bool dualascent, SCIP_Bool nodereplacing, SCIP_Bool userec, SCIP_Bool usestrongreds)
 
SCIP_RETCODE reduce_pc (SCIP *scip, REDSOL *redsol, GRAPH *g, int minelims, SCIP_Bool advanced, SCIP_Bool userec, SCIP_Bool nodereplacing, SCIP_Bool usestrongreds)
 
SCIP_RETCODE reduce_mw (SCIP *scip, REDSOL *redsol, GRAPH *g, int minelims, SCIP_Bool advanced, SCIP_Bool userec, SCIP_Bool usestrongreds)
 
SCIP_RETCODE reduce_hc (SCIP *scip, GRAPH *g, SCIP_Real *fixed, int minelims)
 
SCIP_RETCODE reduce_sap (SCIP *scip, GRAPH *g, SCIP_Bool dualascent, SCIP_Real *fixed, int minelims)
 
SCIP_RETCODE reduce_nw (SCIP *scip, GRAPH *g, SCIP_Real *fixed, int minelims)
 
SCIP_RETCODE reduce_dc (SCIP *scip, GRAPH *g, SCIP_Real *fixed, int minelims)
 
SCIP_RETCODE reduce_redLoopMw (SCIP *scip, REDSOL *redsol, GRAPH *g, PATH *vnoi, SCIP_Real *nodearrreal, int *state, int *vbase, int *nodearrint, STP_Bool *nodearrchar, STP_Bool advanced, STP_Bool bred, STP_Bool tryrmw, int redbound, SCIP_Bool userec, SCIP_Bool usestrongreds)
 
SCIP_RETCODE reduce_redLoopPc (SCIP *scip, REDSOL *redsol, GRAPH *g, PATH *vnoi, PATH *path, SCIP_Real *nodearrreal, int *heap, int *state, int *vbase, int *nodearrint, int *edgearrint, int *nodearrint2, STP_Bool *nodearrchar, SCIP_Bool dualascent, SCIP_Bool bred, SCIP_Bool tryrpc, int reductbound, SCIP_Bool userec, SCIP_Bool nodereplacing, SCIP_Bool usestrongreds)
 
SCIP_RETCODE reduce_redLoopStp (SCIP *scip, GRAPH *g, REDBASE *redbase)
 
SCIP_RETCODE reduce_exec (SCIP *scip, GRAPH *graph, REDSOL *redsol, int reductionlevel, int minelims, SCIP_Bool userec)
 

Macro Definition Documentation

◆ REDUCE_C

#define REDUCE_C

Definition at line 28 of file reduce_base.c.

◆ STP_RED_EXTENSIVE

#define STP_RED_EXTENSIVE   FALSE

just for testing

Definition at line 29 of file reduce_base.c.

Referenced by redLoopInnerMw(), redLoopInnerPc(), redLoopInnerStp(), and reduce_redLoopMw().

◆ STP_REDBOUND_SDSP

#define STP_REDBOUND_SDSP   200

visited edges bound for SDSP test

Definition at line 30 of file reduce_base.c.

Referenced by getWorkLimitsPc(), and redLoopInnerStp().

◆ STP_REDBOUND_SDSP2

#define STP_REDBOUND_SDSP2   800

visited edges bound for SDSP test

Definition at line 31 of file reduce_base.c.

Referenced by getWorkLimitsPc(), and redLoopInnerStp().

◆ STP_REDBOUND_PCBDK

#define STP_REDBOUND_PCBDK   80

visited edges bound for PC BDK test

Definition at line 32 of file reduce_base.c.

Referenced by getWorkLimitsPc().

◆ STP_REDBOUND_PCBDK2

#define STP_REDBOUND_PCBDK2   400

visited edges bound for PC BDK test

Definition at line 33 of file reduce_base.c.

Referenced by getWorkLimitsPc().

◆ STP_REDBOUND_BDK

#define STP_REDBOUND_BDK   400

visited edges bound for BDK test

Definition at line 35 of file reduce_base.c.

Referenced by getWorkLimitsStp().

◆ STP_REDBOUND_BDK2

#define STP_REDBOUND_BDK2   600

visited edges bound for BDK test

Definition at line 36 of file reduce_base.c.

Referenced by getWorkLimitsStp().

◆ STP_REDBOUND_SDSTAR

#define STP_REDBOUND_SDSTAR   400

visited edges bound for SD Star test

Definition at line 37 of file reduce_base.c.

Referenced by getWorkLimitsStp().

◆ STP_REDBOUND_SDSTAR2

#define STP_REDBOUND_SDSTAR2   800

visited edges bound for SD Star test

Definition at line 38 of file reduce_base.c.

Referenced by getWorkLimitsStp().

◆ STP_RED_MWTERMBOUND

#define STP_RED_MWTERMBOUND   400

Definition at line 39 of file reduce_base.c.

Referenced by reduce_redLoopMw().

◆ STP_RED_EXPENSIVEFACTOR

#define STP_RED_EXPENSIVEFACTOR   2

Definition at line 40 of file reduce_base.c.

Referenced by redLoopInnerStp(), and reduce_redLoopStp().

◆ STP_RED_GLBFACTOR

#define STP_RED_GLBFACTOR   3

Definition at line 41 of file reduce_base.c.

Referenced by redLoopInnerPc(), redLoopInnerStp(), and reduce_redLoopPc().

◆ STP_RED_EDGELIMIT

#define STP_RED_EDGELIMIT   100000

Definition at line 42 of file reduce_base.c.

◆ STP_RED_EDGELIMIT_HUGE

#define STP_RED_EDGELIMIT_HUGE   1000000

Definition at line 43 of file reduce_base.c.

Referenced by redLoopInnerPc().

◆ STP_RED_MAXNINNROUNDS

#define STP_RED_MAXNINNROUNDS   15

Definition at line 44 of file reduce_base.c.

Referenced by redLoopInnerMw(), and redLoopInnerPc().

◆ STP_RED_MAXNOUTROUNDS_PC

#define STP_RED_MAXNOUTROUNDS_PC   4

Definition at line 45 of file reduce_base.c.

Referenced by reduce_redLoopPc().

◆ STP_RED_MAXNOUTROUNDS_MW

#define STP_RED_MAXNOUTROUNDS_MW   4

Definition at line 46 of file reduce_base.c.

◆ STP_BND_THRESHOLD

#define STP_BND_THRESHOLD   0.03

Definition at line 48 of file reduce_base.c.

Referenced by reduce_pc(), and reduce_stp().

◆ USE_FULLSEPA

#define USE_FULLSEPA

Definition at line 49 of file reduce_base.c.

Enumeration Type Documentation

◆ PC_REDTYPE

enum PC_REDTYPE
Enumerator
pc_sdc 
pc_sdstar 
pc_sdstar2 
pc_sdw1 
pc_sdw2 
pc_bd3 

Definition at line 69 of file reduce_base.c.

◆ STP_REDTYPE

Enumerator
stp_bdk 
stp_sdstar 
stp_sdstarbot 

Definition at line 70 of file reduce_base.c.

Function Documentation

◆ getWorkLimitsStp()

static int getWorkLimitsStp ( const GRAPH g,
int  roundnumber,
SCIP_Bool  fullreduce,
enum STP_REDTYPE  redtype 
)
static

returns limit parameter for SPG method

Definition at line 75 of file reduce_base.c.

References stp_bdk, STP_REDBOUND_BDK, STP_REDBOUND_BDK2, STP_REDBOUND_SDSTAR, STP_REDBOUND_SDSTAR2, stp_sdstar, and stp_sdstarbot.

Referenced by redLoopInnerStp().

◆ getWorkLimitsPc()

static int getWorkLimitsPc ( const GRAPH g,
int  roundnumber,
SCIP_Bool  beFast,
enum PC_REDTYPE  redtype 
)
static

returns limit parameters for PCSTP method

Definition at line 118 of file reduce_base.c.

References GRAPH::edges, MAX, pc_bd3, pc_sdc, pc_sdstar, pc_sdstar2, pc_sdw1, pc_sdw2, STP_REDBOUND_PCBDK, STP_REDBOUND_PCBDK2, STP_REDBOUND_SDSP, and STP_REDBOUND_SDSP2.

Referenced by redLoopInnerPc().

◆ reduceStatsPrint()

static void reduceStatsPrint ( SCIP_Bool  print,
const char *  method,
int  nelims 
)
static

print reduction information

Definition at line 178 of file reduce_base.c.

Referenced by redLoopInnerStp(), and reduce_redLoopStp().

◆ execNvSl()

static SCIP_RETCODE execNvSl ( SCIP scip,
const int *  edgestate,
GRAPH g,
PATH vnoi,
SCIP_Real nodearrreal,
SCIP_Real fixed,
int *  edgearrint,
int *  vbase,
int *  neighb,
int *  distnode,
int *  solnode,
STP_Bool visited,
int *  nelims,
int  minelims 
)
static

iterate NV and SL test while at least minelims many contractions are being performed

Parameters
scipSCIP data structure
edgestatefor propagation or NULL
ggraph
vnoiVoronoi
nodearrrealarray
fixedoffset
edgearrintarray
vbasearray
neighbarray
distnodearray
solnodearray
visitedarray
nelimsnumber of eliminations
minelimsminimum number of eliminations

Definition at line 196 of file reduce_base.c.

References graph_valid(), NULL, reduce_nvAdv(), reduce_simple(), reduce_simple_pc(), reduce_sl(), SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, STP_PCSPG, STP_RPCSPG, and GRAPH::stp_type.

Referenced by execPc_NVSL(), and redLoopInnerStp().

◆ execPc_SD()

static SCIP_RETCODE execPc_SD ( SCIP scip,
GRAPH g,
PATH vnoi,
int *  heap,
int *  state,
int *  vbase,
int *  nodesid,
int *  nodesorg,
int *  nelims,
int  redbound,
SCIP_Bool  verbose,
SCIP_Bool rerun 
)
static
Parameters
scipSCIP data structure
ggraph data structure
vnoiVoronoi data structure
heapheap array
statearray to store state of a node during Voronoi computation
vbaseVoronoi base to each node
nodesidarray
nodesorgarray
nelimspointer to store number of eliminated edges
redboundreduction bound
verbosebe verbose?
rerunuse again?

Definition at line 274 of file reduce_base.c.

References FALSE, reduce_sdPc(), SCIP_CALL, and SCIP_OKAY.

Referenced by redLoopInnerPc().

◆ execPc_BDk()

static SCIP_RETCODE execPc_BDk ( SCIP scip,
GRAPH g,
PATH pathtail,
PATH pathhead,
int *  heap,
int *  statetail,
int *  statehead,
int *  memlbltail,
int *  memlblhead,
int *  nelims,
int  limit,
SCIP_Real offset,
int  redbound,
SCIP_Bool  verbose,
SCIP_Bool rerun 
)
static
Parameters
scipSCIP data structure
ggraph structure
pathtailarray for internal use
pathheadarray for internal use
heaparray for internal use
statetailarray for internal use
stateheadarray for internal use
memlbltailarray for internal use
memlblheadarray for internal use
nelimspoint to return number of eliminations
limitlimit for edges to consider for each vertex
offsetoffset
redboundreduction bound
verbosebe verbose?
rerunuse again?

Definition at line 307 of file reduce_base.c.

References FALSE, reduce_bd34(), SCIP_CALL, and SCIP_OKAY.

Referenced by redLoopInnerPc().

◆ execPc_NVSL()

static SCIP_RETCODE execPc_NVSL ( SCIP scip,
SCIP_Bool  usestrongreds,
GRAPH g,
PATH vnoi,
SCIP_Real nodearrreal,
SCIP_Real fixed,
int *  edgearrint,
int *  vbase,
int *  neighb,
int *  distnode,
int *  solnode,
STP_Bool visited,
int *  nelims,
int  redbound,
SCIP_Bool  verbose,
SCIP_Bool rerun 
)
static
Parameters
scipSCIP data structure
usestrongredsallow strong reductions?
ggraph
vnoiVoronoi data structure
nodearrrealarray
fixedoffset
edgearrintarray
vbasearray
neighbarray
distnodearray
solnodearray
visitedarray
nelimsnumber of eliminations
redboundreduction bound
verbosebe verbose?
rerunuse again?

Definition at line 338 of file reduce_base.c.

References execNvSl(), FALSE, NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by redLoopInnerPc().

◆ execPc_BND()

static SCIP_RETCODE execPc_BND ( SCIP scip,
GRAPH graph,
PATH vnoi,
SCIP_Real radius,
SCIP_Real offset,
int *  heap,
int *  state,
int *  vbase,
int *  nelims,
int  redbound,
SCIP_Bool  verbose,
SCIP_Bool rerun 
)
static
Parameters
scipSCIP data structure
graphgraph data structure
vnoiVoronoi data structure
radiusradius array
offsetpointer to the offset
heapheap array
statearray to store state of a node during Voronoi computation
vbaseVoronoi base to each node
nelimspointer to store number of eliminated edges
redboundreduction bound
verbosebe verbose?
rerunuse again?

Definition at line 371 of file reduce_base.c.

References FALSE, reduce_bound(), SCIP_CALL, SCIP_OKAY, and SCIP_Real.

Referenced by redLoopInnerPc().

◆ redbaseGetOffsetPointer()

static SCIP_Real* redbaseGetOffsetPointer ( REDBASE redbase)
static

returns pointer

Parameters
redbasebase

Definition at line 403 of file reduce_base.c.

References reduction_base::redsol, and reduce_solGetOffsetPointer().

Referenced by redLoopInnerStp(), and reduce_redLoopStp().

◆ redbaseGetSolnode()

static int* redbaseGetSolnode ( REDSOLLOCAL redsollocal,
REDBASE redbase 
)
static

returns pointer todo: remove once redsol is properly tested

Parameters
redsollocaldata structure for retaining primal solution
redbasebase

Definition at line 417 of file reduce_base.c.

References reduction_base::redsol, reduce_sollocalGetSolnode(), reduce_sollocalUsesNodesol(), reduce_solUsesNodesol(), and reduction_base::solnode.

Referenced by redLoopInnerStp(), and reduce_redLoopStp().

◆ redLoopInnerStp()

static SCIP_RETCODE redLoopInnerStp ( SCIP scip,
SCIP_RANDNUMGEN randnumgen,
GRAPH g,
REDSOLLOCAL redsollocal,
REDBASE redbase,
SCIP_Bool wasDecomposed 
)
static

inner STP reduction loop

Parameters
scipSCIP data structure
randnumgengenerator
ggraph data structure
redsollocaldata structure for retaining primal solution
redbaseparameters
wasDecomposedpointer to mark whether to exit early

Definition at line 441 of file reduce_base.c.

References reduction_base::bidecompparams, reduction_parameters::boundreduce, reduce_costs_reduction_parameters::damode, bidecomposition_reduction_parameters::depth, reduction_parameters::dualascent, reduction_base::edgearrint, execNvSl(), extred_none, FALSE, reduction_parameters::fullreduce, getWorkLimitsStp(), reduction_base::heap, bidecomposition_reduction_parameters::maxdepth, bidecomposition_reduction_parameters::newLevelStarted, reduction_base::nodearrchar, reduction_base::nodearrint, reduction_base::nodearrint2, reduction_base::nodearrreal, reduction_parameters::nodereplacing, NULL, redbaseGetOffsetPointer(), redbaseGetSolnode(), reduction_base::redparameters, reduce_bdk(), reduce_bidecomposition(), reduce_bound(), reduce_da(), reduce_impliedProfitBased(), reduce_pathreplace(), reduce_sd(), reduce_sdsp(), reduce_sdStarBiased(), reduce_simple(), reduce_sollocalGetUpperBound(), reduce_sollocalSetOffset(), reduce_unconnected(), reduceStatsPrint(), reduction_parameters::reductbound, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), reduction_base::state, stp_bdk, STP_DAMODE_FAST, STP_DAMODE_MEDIUM, STP_RED_EXPENSIVEFACTOR, STP_RED_EXTENSIVE, STP_RED_GLBFACTOR, STP_REDBOUND_SDSP, STP_REDBOUND_SDSP2, stp_sdstar, stp_sdstarbot, TRUE, reduction_parameters::userec, reduction_parameters::usestrongreds, reduction_base::vbase, and reduction_base::vnoi.

Referenced by reduce_redLoopStp().

◆ redLoopInnerMw()

static SCIP_RETCODE redLoopInnerMw ( SCIP scip,
GRAPH g,
REDSOLLOCAL redsollocal,
PATH vnoi,
SCIP_Real nodearrreal,
int *  state,
int *  vbase,
int *  nodearrint,
STP_Bool nodearrchar,
SCIP_Real fixed,
STP_Bool  dualascent,
STP_Bool  bred,
int  redbound,
SCIP_Bool  userec,
SCIP_Real  prizesum 
)
static

inner MWCS loop todo use REDBASE here instead of all the parameters and also allocate the memory locally!

Parameters
scipSCIP data structure
ggraph data structure
redsollocaldata structure for retaining primal solution
vnoiVoronoi data structure
nodearrrealnodes-sized array
stateshortest path array
vbasevoronoi base array
nodearrintnodes-sized array
nodearrcharnodes-sized array
fixedpointer to store the offset value
dualascentdo dual-ascent reduction?
breddo bound-based reduction?
redboundminimal number of edges to be eliminated in order to reiterate reductions
userecuse recombination heuristic?
prizesumprize sum

Definition at line 691 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_none, FALSE, graph_get_nVET(), graph_pc_isRootedPcMw(), NULL, reduce_ans(), reduce_ansAdv(), reduce_ansAdv2(), reduce_boundMw(), reduce_chain2(), reduce_da(), reduce_daPcMw(), reduce_nnp(), reduce_npv(), reduce_simple_mw(), reduce_sollocalGetSolnode(), reduce_sollocalRebuildTry(), reduce_sollocalSetOffset(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateRandom(), SCIPdebugMessage, SCIPfreeRandom(), SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, STP_RED_EXTENSIVE, STP_RED_MAXNINNROUNDS, and TRUE.

Referenced by reduce_redLoopMw().

◆ redLoopInnerPc()

static SCIP_RETCODE redLoopInnerPc ( SCIP scip,
GRAPH g,
REDSOLLOCAL redsollocal,
DHEAP dheap,
PATH vnoi,
PATH path,
SCIP_Real nodearrreal,
int *  heap,
int *  state,
int *  vbase,
int *  nodearrint,
int *  edgearrint,
int *  nodearrint2,
STP_Bool nodearrchar,
SCIP_Real fixed,
SCIP_RANDNUMGEN randnumgen,
SCIP_Real  prizesum,
SCIP_Bool  dualascent,
SCIP_Bool  bred,
int  reductbound,
SCIP_Bool  userec,
SCIP_Bool  nodereplacing,
SCIP_Bool  usestrongreds,
SCIP_Bool  beFast,
int *  ninnerelims 
)
static

inner (R)PC loop todo use REDBASE here instead of all the parameters and also allocate the memory locally!

Parameters
scipSCIP data structure
ggraph data structure
redsollocalsolution store
dheapheap data structure
vnoiVoronoi data structure
pathpath data structure
nodearrrealnodes-sized array
heapshortest path array
statevoronoi base array
vbasenodes-sized array
nodearrintnode-sized array
edgearrintedge-sized array
nodearrint2nodes-sized array
nodearrcharnodes-sized array
fixedoffset
randnumgenrandom number generator
prizesumprize sum
dualascentdo dual-ascent reduction?
breddo bound-based reduction?
reductboundminimal number of edges to be eliminated in order to reiterate reductions
userecuse recombination heuristic?
nodereplacingshould node replacement (by edges) be performed?
usestrongredsallow strong reductions?
beFastfast mode?
ninnerelimsnumber of eliminations

Definition at line 872 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, GRAPH::edges, execPc_BDk(), execPc_BND(), execPc_NVSL(), execPc_SD(), extred_none, FALSE, getWorkLimitsPc(), graph_pc_isRootedPcMw(), NULL, pc_bd3, pc_sdstar, pc_sdstar2, pc_sdw1, pc_sdw2, reduce_costs_reduction_parameters::pcmw_fastDa, reduce_costs_reduction_parameters::pcmw_solbasedda, reduce_da(), reduce_dapaths(), reduce_daPcMw(), reduce_pathreplace(), reduce_sdStarBiased(), reduce_sdStarPc2(), reduce_sdWalkExt(), reduce_sdWalkTriangle(), reduce_simple_pc(), reduce_sollocalGetSolnode(), reduce_sollocalRebuildTry(), reduce_sollocalSetOffset(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, STP_RED_EDGELIMIT_HUGE, STP_RED_EXTENSIVE, STP_RED_GLBFACTOR, STP_RED_MAXNINNROUNDS, STP_RPCSPG, GRAPH::stp_type, and TRUE.

Referenced by reduce_redLoopPc().

◆ reduce_getMinNreductions()

int reduce_getMinNreductions ( const GRAPH g,
int  lowerbound 
)

gets reduction bound

Parameters
ggraph data structure
lowerboundlower bound on number of reductions (>= 1)

Definition at line 1087 of file reduce_base.c.

References graph_get_nEdges(), graph_get_nNodes(), graph_pc_isMw(), graph_pc_isPc(), graph_typeIsSpgLike(), MAX, and nnodes.

Referenced by decomposeReduceSubDoIt(), reduce_mw(), reduce_pc(), and reduce_stp().

◆ reduce_baseInit()

◆ reduce_baseFree()

◆ reduce_stp()

SCIP_RETCODE reduce_stp ( SCIP scip,
GRAPH g,
REDSOL redsol,
int  minelims,
SCIP_Bool  dualascent,
SCIP_Bool  nodereplacing,
SCIP_Bool  userec,
SCIP_Bool  usestrongreds 
)

basic reduction package for the STP

Parameters
scipSCIP data structure
ggraph data structure
redsolprimal solution container
minelimsminimal number of edges to be eliminated in order to reiterate reductions
dualascentperform dual-ascent reductions?
nodereplacingshould node replacement (by edges) be performed?
userecuse recombination heuristic?
usestrongredsallow strong reductions? NOTE: needed for propagation, because arcs might have been fixed to 0

Definition at line 1181 of file reduce_base.c.

References bidecomposition_reduction_parameters::depth, reduction_parameters::dualascent, FALSE, graph_get_nEdges(), graph_get_nNodes(), graph_get_nTerms(), nnodes, nterms, NULL, reduction_base::redparameters, reduce_getMinNreductions(), reduce_redLoopStp(), reduce_solGetOffset(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMessage, SCIPfreeBufferArray, SCIPisLE(), STP_BND_THRESHOLD, and TRUE.

Referenced by fixVarsRedbased(), and reduce_exec().

◆ reduce_pc()

SCIP_RETCODE reduce_pc ( SCIP scip,
REDSOL redsol,
GRAPH g,
int  minelims,
SCIP_Bool  advanced,
SCIP_Bool  userec,
SCIP_Bool  nodereplacing,
SCIP_Bool  usestrongreds 
)

basic reduction package for the (R)PCSTP

Parameters
scipSCIP data structure
redsolsolution storage
ggraph data structure
minelimsminimal number of edges to be eliminated in order to reiterate reductions
advancedperform advanced (e.g. dual ascent) reductions?
userecuse recombination heuristic?
nodereplacingshould node replacement (by edges) be performed?
usestrongredsallow strong reductions? NOTE: needed for propagation, because arcs might have been fixed to 0

Definition at line 1260 of file reduce_base.c.

References GRAPH::edges, FALSE, graph_pc_nNonLeafTerms(), GRAPH::knots, nnodes, nterms, NULL, reduce_getMinNreductions(), reduce_redLoopPc(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetRealParam(), SCIPisGT(), SCIPisLE(), STP_BND_THRESHOLD, GRAPH::terms, and TRUE.

Referenced by fixVarsRedbased(), and reduce_exec().

◆ reduce_mw()

SCIP_RETCODE reduce_mw ( SCIP scip,
REDSOL redsol,
GRAPH g,
int  minelims,
SCIP_Bool  advanced,
SCIP_Bool  userec,
SCIP_Bool  usestrongreds 
)

reduction package for the MWCSP

Parameters
scipSCIP data structure
redsolsolution storage
ggraph data structure
minelimsminimal number of edges to be eliminated in order to reiterate reductions
advancedperform advanced reductions?
userecuse recombination heuristic?
usestrongredsallow strong reductions? NOTE: needed for propagation, because arcs might have been fixed to 0

Definition at line 1344 of file reduce_base.c.

References FALSE, graph_get_nNodes(), graph_get_nTerms(), nnodes, nterms, NULL, reduce_getMinNreductions(), reduce_redLoopMw(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPisLE(), and TRUE.

Referenced by fixVarsRedbased(), and reduce_exec().

◆ reduce_hc()

SCIP_RETCODE reduce_hc ( SCIP scip,
GRAPH g,
SCIP_Real fixed,
int  minelims 
)

basic reduction package for the HCDSTP

Parameters
scipSCIP data structure
ggraph data structure
fixedpointer to store the offset value
minelimsminimal number of edges to be eliminated in order to reiterate reductions

Definition at line 1403 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_none, FALSE, graph_get_nEdges(), graph_get_nNodes(), GRAPH::knots, MAX, nnodes, NULL, reduce_bound(), reduce_boundHop(), reduce_boundHopDa(), reduce_boundHopR(), reduce_boundHopRc(), reduce_da(), reduce_simple_hc(), reduce_sollocalFree(), reduce_sollocalInit(), reduce_unconnectedForDirected(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateRandom(), SCIPfreeBufferArray, SCIPfreeRandom(), SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, and TRUE.

Referenced by reduce_exec().

◆ reduce_sap()

SCIP_RETCODE reduce_sap ( SCIP scip,
GRAPH g,
SCIP_Bool  dualascent,
SCIP_Real fixed,
int  minelims 
)

basic reduction package for the SAP

Parameters
scipSCIP data structure
ggraph data structure
dualascentperform dual-ascent reductions?
fixedpointer to store the offset value
minelimsminimal number of edges to be eliminated in order to reiterate reductions

Definition at line 1557 of file reduce_base.c.

References GRAPH::cost, reduce_costs_reduction_parameters::damode, EQ, extred_none, FALSE, FARAWAY, graph_get_nEdges(), graph_get_nNodes(), graph_typeIsUndirected(), MAX, nnodes, NULL, reduce_da(), reduce_rpt(), reduce_sdspSap(), reduce_simple_sap(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateRandom(), SCIPfreeBufferArray, SCIPfreeRandom(), SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, STP_SAP, GRAPH::stp_type, and TRUE.

Referenced by reduce_exec().

◆ reduce_nw()

SCIP_RETCODE reduce_nw ( SCIP scip,
GRAPH g,
SCIP_Real fixed,
int  minelims 
)

reduce node-weighted Steiner tree problem

Parameters
scipSCIP data structure
ggraph data structure
fixedpointer to store the offset value
minelimsminimal number of edges to be eliminated in order to reiterate reductions

Definition at line 1669 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_none, FALSE, GRAPH::knots, MAX, nnodes, NULL, reduce_da(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateRandom(), SCIPfreeBufferArray, SCIPfreeRandom(), SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, and TRUE.

Referenced by reduce_exec().

◆ reduce_dc()

SCIP_RETCODE reduce_dc ( SCIP scip,
GRAPH g,
SCIP_Real fixed,
int  minelims 
)

reduce degree constrained Steiner tree problem

Parameters
scipSCIP data structure
ggraph data structure
fixedpointer to store the offset value
minelimsminimal number of edges to be eliminated in order to reiterate reductions

Definition at line 1729 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_none, FALSE, graph_get_nNodes(), MAX, nnodes, reduce_da(), reduce_simple_dc(), reduce_sollocalFree(), reduce_sollocalInit(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateRandom(), SCIPfreeRandom(), SCIPgetRealParam(), SCIPgetTotalTime(), SCIPisStopped(), STP_DAMODE_FAST, and TRUE.

Referenced by reduce_exec().

◆ reduce_redLoopMw()

SCIP_RETCODE reduce_redLoopMw ( SCIP scip,
REDSOL redsol,
GRAPH g,
PATH vnoi,
SCIP_Real nodearrreal,
int *  state,
int *  vbase,
int *  nodearrint,
STP_Bool nodearrchar,
STP_Bool  advanced,
STP_Bool  bred,
STP_Bool  tryrmw,
int  redbound,
SCIP_Bool  userec,
SCIP_Bool  usestrongreds 
)

MWCS loop

Parameters
scipSCIP data structure
redsolsolution contained
ggraph data structure
vnoiVoronoi data structure
nodearrrealnodes-sized array
stateshortest path array
vbasevoronoi base array
nodearrintnodes-sized array
nodearrcharnodes-sized array
advanceddo advanced reduction?
breddo bound-based reduction?
tryrmwtry to convert problem to RMWCSP? Only possible if advanced = TRUE and userec = TRUE
redboundminimal number of edges to be eliminated in order to reiterate reductions
userecuse recombination heuristic?
usestrongredsallow strong reductions?

Definition at line 1771 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_none, FALSE, graph_pc_2org(), graph_pc_2trans(), graph_pc_getPosPrizeSum(), graph_pc_isRootedPcMw(), graph_pc_term2edgeIsConsistent(), graph_transPcmw2rooted(), redLoopInnerMw(), reduce_da(), reduce_daPcMw(), reduce_simple_mw(), reduce_solFinalizeLocal(), reduce_solGetOffsetPointer(), reduce_solInitLocal(), reduce_sollocalGetSolnode(), reduce_sollocalRebuildTry(), reduce_sollocalSetOffset(), reduce_unconnected(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateRandom(), SCIPdebugMessage, SCIPfreeRandom(), SCIPgetRealParam(), SCIPisStopped(), STP_DAMODE_FAST, STP_RED_EXTENSIVE, STP_RED_MWTERMBOUND, GRAPH::terms, and TRUE.

Referenced by reduce_mw(), reduceExact(), and SCIPStpHeurPruneRun().

◆ reduce_redLoopPc()

SCIP_RETCODE reduce_redLoopPc ( SCIP scip,
REDSOL redsol,
GRAPH g,
PATH vnoi,
PATH path,
SCIP_Real nodearrreal,
int *  heap,
int *  state,
int *  vbase,
int *  nodearrint,
int *  edgearrint,
int *  nodearrint2,
STP_Bool nodearrchar,
SCIP_Bool  dualascent,
SCIP_Bool  bred,
SCIP_Bool  tryrpc,
int  reductbound,
SCIP_Bool  userec,
SCIP_Bool  nodereplacing,
SCIP_Bool  usestrongreds 
)

(R)PC loop

Parameters
scipSCIP data structure
redsolsolution contained
ggraph data structure
vnoiVoronoi data structure
pathpath data structure
nodearrrealnodes-sized array
heapshortest path array
statevoronoi base array
vbasenodes-sized array
nodearrintnode-sized array
edgearrintedge-sized array
nodearrint2nodes-sized array
nodearrcharnodes-sized array
dualascentdo dual-ascent reduction?
breddo bound-based reduction?
tryrpctry to transform to rpc?
reductboundminimal number of edges to be eliminated in order to reiterate reductions
userecuse recombination heuristic?
nodereplacingshould node replacement (by edges) be performed?
usestrongredsallow strong reductions?

Definition at line 1896 of file reduce_base.c.

References reduce_costs_reduction_parameters::damode, extred_fast, extred_full, FALSE, FARAWAY, graph_heap_create(), graph_heap_free(), graph_pc_2org(), graph_pc_2trans(), graph_pc_getPosPrizeSum(), graph_pc_nNonLeafTerms(), graph_pc_nProperPotentialTerms(), graph_pc_presolExit(), graph_pc_presolInit(), graph_pc_term2edgeIsConsistent(), graph_printInfo(), graph_transPcmw2rooted(), graph_transRpc2SpgTrivial(), GRAPH::knots, NULL, redLoopInnerPc(), reduce_da(), reduce_daPcMw(), reduce_deleteConflictEdges(), reduce_impliedProfitBasedRpc(), reduce_simple_pc(), reduce_solFinalizeLocal(), reduce_solGetOffsetPointer(), reduce_solInitLocal(), reduce_sollocalGetSolnode(), reduce_sollocalRebuildTry(), reduce_sollocalSetOffset(), reduce_unconnectedRpcRmw(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcreateRandom(), SCIPdebugMessage, SCIPfreeRandom(), SCIPgetRealParam(), STP_DAMODE_MEDIUM, STP_RED_GLBFACTOR, STP_RED_MAXNOUTROUNDS_PC, STP_RPCSPG, GRAPH::stp_type, GRAPH::terms, and TRUE.

Referenced by reduce_pc(), reduceExact(), and SCIPStpHeurPruneRun().

◆ reduce_redLoopStp()

◆ reduce_exec()

SCIP_RETCODE reduce_exec ( SCIP scip,
GRAPH graph,
REDSOL redsol,
int  reductionlevel,
int  minelims,
SCIP_Bool  userec 
)