Scippy

SCIP

Solving Constraint Integer Programs

reduce_termsepa.c File Reference

Detailed Description

base class for terminal-separator reductions for Steiner tree problems

Author
Daniel Rehfeldt

This file implements base classes for terminal-separator reduction techniques Steiner tree problems. The actual algorithms can be found in reduce_termsepada.c and reduce_termsepafull.c

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

Definition in file reduce_termsepa.c.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "graph.h"
#include "reduce.h"
#include "extreduce.h"
#include "solstp.h"
#include "mincut.h"
#include "portab.h"
#include "stpvector.h"
#include "scip/scip.h"

Go to the source code of this file.

Data Structures

struct  tree_bottleneck_node
 
struct  terminal_separator_tree_bottleneck
 

Macros

#define MARK_NONACTIVE   0
 
#define MARK_SUBNODE   1
 
#define MARK_SEPARATOR   2
 

Typedefs

typedef struct tree_bottleneck_node TBNODE
 

Functions

static SCIP_RETCODE tbottleneckInit (SCIP *scip, const GRAPH *g, const int *soledges, TBOTTLENECK **tbottleneck)
 
static void tbottleneckGetMax (int node1, int node2, TBOTTLENECK *tbottleneck, SCIP_Real *maxlength)
 
static void tbottleneckFree (SCIP *scip, TBOTTLENECK **tbottleneck)
 
static void subgraphIdentify (SCIP *scip, GRAPH *g, TERMCOMP *termcomp)
 
static SCIP_RETCODE subgraphBuild (SCIP *scip, const GRAPH *orggraph, SCIP_Bool useSd, EXTPERMA *extperma, TERMCOMP *termcomp)
 
static SCIP_Real getExtBottleneckDist (const GRAPH *g, int term1, int term2, int term1_sub, int term2_sub, int mstsource, PATH *mst, TBOTTLENECK *subsolbottleneck, SCIP_Real *RESTRICT mstsdist)
 
SCIP_RETCODE reduce_compbuilderInit (SCIP *scip, const GRAPH *g, COMPBUILDER **compbuilder)
 
void reduce_compbuilderFree (SCIP *scip, COMPBUILDER **compbuilder)
 
SCIP_Real reduce_compbuilderGetSubNodesRatio (const COMPBUILDER *compbuilder)
 
void reduce_compbuilderPrintSeparators (const GRAPH *orggraph, const COMPBUILDER *compbuilder)
 
SCIP_RETCODE reduce_termcompBuildSubgraphWithSds (SCIP *scip, GRAPH *orggraph, EXTPERMA *extperma, TERMCOMP *termcomp)
 
SCIP_RETCODE reduce_termcompBuildSubgraph (SCIP *scip, GRAPH *orggraph, TERMCOMP *termcomp)
 
SCIP_RETCODE reduce_termcompChangeSubgraphToBottleneck (SCIP *scip, GRAPH *g, TERMCOMP *termcomp, SCIP_Bool *success)
 
void reduce_termcompChangeSubgraphToOrgCosts (const GRAPH *orggraph, TERMCOMP *termcomp)
 
SCIP_RETCODE reduce_termcompInit (SCIP *scip, const GRAPH *g, COMPBUILDER *builder, TERMCOMP **termcomp)
 
SCIP_RETCODE reduce_termcompInitTbottleneck (SCIP *scip, const int *subsoledges, TERMCOMP *termcomp)
 
void reduce_termcompFree (SCIP *scip, TERMCOMP **termcomp)
 
void reduce_termsepaGetNextComp (SCIP *scip, const GRAPH *g, TERMSEPAS *termsepas, COMPBUILDER *builder, SCIP_Bool *compWasFound)
 

Macro Definition Documentation

◆ MARK_NONACTIVE

#define MARK_NONACTIVE   0

Definition at line 45 of file reduce_termsepa.c.

Referenced by reduce_termcompChangeSubgraphToBottleneck().

◆ MARK_SUBNODE

#define MARK_SUBNODE   1

◆ MARK_SEPARATOR

#define MARK_SEPARATOR   2

Typedef Documentation

◆ TBNODE

typedef struct tree_bottleneck_node TBNODE

tree bottleneck node

Function Documentation

◆ tbottleneckInit()

◆ tbottleneckGetMax()

static void tbottleneckGetMax ( int  node1,
int  node2,
TBOTTLENECK tbottleneck,
SCIP_Real maxlength 
)
static

gets tree bottleneck cost

Parameters
node1first node
node2second node
tbottlenecktree bottleneck structure
maxlengthIN/OUT! user needs to provide a maximum that is to be surpassed

Definition at line 219 of file reduce_termsepa.c.

References tree_bottleneck_node::bottleneck, tree_bottleneck_node::degree, tree_bottleneck_node::edgecost, EQ, GE, GT, MAX, nnodes, tree_bottleneck_node::parent, SCIP_Real, SCIPdebugMessage, terminal_separator_tree_bottleneck::tree, and UNKNOWN.

Referenced by getExtBottleneckDist().

◆ tbottleneckFree()

static void tbottleneckFree ( SCIP scip,
TBOTTLENECK **  tbottleneck 
)
static

frees

Parameters
scipSCIP data structure
tbottleneckto initialize

Definition at line 310 of file reduce_termsepa.c.

References SCIPfreeMemory, SCIPfreeMemoryArray, and terminal_separator_tree_bottleneck::tree.

Referenced by reduce_termcompFree().

◆ subgraphIdentify()

◆ subgraphBuild()

◆ getExtBottleneckDist()

static SCIP_Real getExtBottleneckDist ( const GRAPH g,
int  term1,
int  term2,
int  term1_sub,
int  term2_sub,
int  mstsource,
PATH mst,
TBOTTLENECK subsolbottleneck,
SCIP_Real *RESTRICT  mstsdist 
)
static

gets extended bottleneck distances

Parameters
ggraph data structure
term1first terminal
term2second terminal
term1_subcorresponding terminal in subgraph
term2_subcorresponding terminal in subgraph
mstsourcesource node of minimum spanning tree
mstminimum spanning tree
subsolbottlenecktree bottleneck
mstsdistnode distance helper

Definition at line 613 of file reduce_termsepa.c.

References GRAPH::cost, shortest_path::edge, EQ, GRAPH::head, Is_term, GRAPH::knots, SCIP_Real, GRAPH::tail, tbottleneckGetMax(), and GRAPH::term.

Referenced by reduce_termcompChangeSubgraphToBottleneck().

◆ reduce_compbuilderInit()

◆ reduce_compbuilderFree()

void reduce_compbuilderFree ( SCIP scip,
COMPBUILDER **  compbuilder 
)

frees

Parameters
scipSCIP data structure
compbuilderto free

Definition at line 751 of file reduce_termsepa.c.

References terminial_component_initializer::nodes_bdist, SCIPfreeMemory, and SCIPfreeMemoryArray.

Referenced by freeHelpers().

◆ reduce_compbuilderGetSubNodesRatio()

SCIP_Real reduce_compbuilderGetSubNodesRatio ( const COMPBUILDER compbuilder)

◆ reduce_compbuilderPrintSeparators()

void reduce_compbuilderPrintSeparators ( const GRAPH orggraph,
const COMPBUILDER compbuilder 
)

prints

Parameters
orggraphgraph data structure
compbuilderbuilder

Definition at line 779 of file reduce_termsepa.c.

References graph_knot_isInRange(), graph_knot_printInfo(), terminial_component_initializer::nsepatterms, and terminial_component_initializer::sepaterms.

Referenced by processComponent().

◆ reduce_termcompBuildSubgraphWithSds()

SCIP_RETCODE reduce_termcompBuildSubgraphWithSds ( SCIP scip,
GRAPH orggraph,
EXTPERMA extperma,
TERMCOMP termcomp 
)

builds extended subgraph with SD weighted edges between terminal-separator nodes

Parameters
scipSCIP data structure
orggraphgraph data structure
extpermaextension data
termcompcomponent

Definition at line 799 of file reduce_termsepa.c.

References SCIP_Bool, SCIP_CALL, SCIP_OKAY, subgraphBuild(), subgraphIdentify(), and TRUE.

Referenced by processComponent().

◆ reduce_termcompBuildSubgraph()

SCIP_RETCODE reduce_termcompBuildSubgraph ( SCIP scip,
GRAPH orggraph,
TERMCOMP termcomp 
)

builds extended subgraph with BLOCKED weighted edges between terminal-separator nodes

Parameters
scipSCIP data structure
orggraphgraph data structure
termcompcomponent

Definition at line 818 of file reduce_termsepa.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, subgraphBuild(), and subgraphIdentify().

Referenced by processComponent().

◆ reduce_termcompChangeSubgraphToBottleneck()

◆ reduce_termcompChangeSubgraphToOrgCosts()

void reduce_termcompChangeSubgraphToOrgCosts ( const GRAPH orggraph,
TERMCOMP termcomp 
)

changes weights between terminal separator nodes to original costs (or BLOCKED)

Parameters
orggraphgraph data structure
termcompcomponent

Definition at line 930 of file reduce_termsepa.c.

References BLOCKED, terminal_separator_component::builder, GRAPH::cost, EAT_LAST, terminal_separator_component::edgemap_subToOrg, GRAPH::edges, EQ, GRAPH::head, Is_term, terminial_component_initializer::nsepatterms, GRAPH::oeat, GRAPH::outbeg, terminal_separator_component::subgraph, GRAPH::tail, and GRAPH::term.

Referenced by sepafullBuildSolcands().

◆ reduce_termcompInit()

◆ reduce_termcompInitTbottleneck()

SCIP_RETCODE reduce_termcompInitTbottleneck ( SCIP scip,
const int *  subsoledges,
TERMCOMP termcomp 
)

initializes tree bottleneck for terminal component

Parameters
scipSCIP data structure
subsoledgessolution tree to be represented
termcompto initialize for

Definition at line 1019 of file reduce_termsepa.c.

References SCIP_CALL, SCIP_OKAY, terminal_separator_component::subgraph, terminal_separator_component::subsolbottleneck, and tbottleneckInit().

Referenced by termcompComputeSubgraphSol().

◆ reduce_termcompFree()

◆ reduce_termsepaGetNextComp()