Scippy

SCIP

Solving Constraint Integer Programs

extreduce_bottleneck.c File Reference

Detailed Description

extended-reduction specific tree bottleneck algorithms for Steiner tree problems

Author
Daniel Rehfeldt

This file implements tree bottleneck algorithms for extended reduction techniques for Steiner problems.

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

Definition in file extreduce_bottleneck.c.

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

Go to the source code of this file.

Functions

Local methods
static SCIP_Real bottleneckGetDist (const GRAPH *graph, const EXTDATA *extdata, int vertex_pathmarked, int vertex_unmarked)
 
static void bottleneckMarkEqualityPath (SCIP *scip, const GRAPH *graph, int path_start, int path_end, EXTDATA *extdata)
 
static void bottleneckMarkEqualityEdges (SCIP *scip, const GRAPH *graph, SCIP_Real dist_eq, int vertex_pathmarked, int vertex_unmarked, EXTDATA *extdata)
 
static void bottleneckMarkEqualityEdge (SCIP *scip, const GRAPH *g, int edge, EXTDATA *extdata)
 
static SCIP_Bool bottleneckIsEqualityDominated (SCIP *scip, const GRAPH *g, SCIP_Real dist_eq, int edge_forbidden, int vertex1, int vertex2, EXTDATA *extdata)
 
Interface methods
void extreduce_bottleneckMarkRootPath (const GRAPH *graph, int vertex, EXTDATA *extdata)
 
void extreduce_bottleneckUnmarkRootPath (const GRAPH *graph, int vertex, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckIsDominated (SCIP *scip, const GRAPH *graph, int vertex_pathmarked, int vertex_unmarked, SCIP_Real specialDist, int edge_forbidden, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckIsDominatedBiased (SCIP *scip, const GRAPH *graph, int vertex_pathmarked, int vertex_unmarked, SCIP_Real specialDistBiased, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckWithExtedgeIsDominated (SCIP *scip, const GRAPH *graph, int extedge, int vertex_pathmarked, int vertex_unmarked, SCIP_Real specialDist, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckWithExtedgeIsDominatedBiased (SCIP *scip, const GRAPH *graph, int extedge, int vertex_pathmarked, int vertex_unmarked, SCIP_Real specialDistBiased, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckToSiblingIsDominated (SCIP *scip, const GRAPH *graph, int extedge, int edge2sibling, SCIP_Real specialDist, EXTDATA *extdata)
 
SCIP_Bool extreduce_bottleneckToSiblingIsDominatedBiased (SCIP *scip, const GRAPH *graph, int extedge, int edge2sibling, SCIP_Real specialDistBiased, EXTDATA *extdata)
 
void extreduce_bottleneckCheckNonLeaves_pc (SCIP *scip, const GRAPH *graph, int edge2neighbor, EXTDATA *extdata, SCIP_Bool *ruledOut)
 
void extreduce_bottleneckCheckNonLeaves (SCIP *scip, const GRAPH *graph, int edge2neighbor, EXTDATA *extdata, SCIP_Bool *ruledOut)
 

Function Documentation

◆ bottleneckGetDist()

static SCIP_Real bottleneckGetDist ( const GRAPH graph,
const EXTDATA extdata,
int  vertex_pathmarked,
int  vertex_unmarked 
)
static

computes the tree bottleneck between vertices in the current tree, for which vertex_pathmarked root path has been marked already

Parameters
graphgraph data structure
extdataextension data
vertex_pathmarkedvertex with marked rootpath
vertex_unmarkedsecond vertex

Definition at line 48 of file extreduce_bottleneck.c.

References graph_pc_isPc(), graph_pc_termIsNonLeafTerm(), Is_term, MAX, GRAPH::prize, SCIP_Bool, SCIP_Real, GRAPH::term, extension_data::tree_bottleneckDistNode, extension_data::tree_deg, extension_data::tree_parentEdgeCost, extension_data::tree_parentNode, and extension_data::tree_root.

Referenced by extreduce_bottleneckIsDominated(), extreduce_bottleneckIsDominatedBiased(), extreduce_bottleneckWithExtedgeIsDominated(), and extreduce_bottleneckWithExtedgeIsDominatedBiased().

◆ bottleneckMarkEqualityPath()

static void bottleneckMarkEqualityPath ( SCIP scip,
const GRAPH graph,
int  path_start,
int  path_end,
EXTDATA extdata 
)
inlinestatic

◆ bottleneckMarkEqualityEdges()

static void bottleneckMarkEqualityEdges ( SCIP scip,
const GRAPH graph,
SCIP_Real  dist_eq,
int  vertex_pathmarked,
int  vertex_unmarked,
EXTDATA extdata 
)
inlinestatic

markes bottleneck edges used for equality rule-out

Parameters
scipSCIP
graphgraph data structure
dist_eqdistance that was used for equality rule-out
vertex_pathmarkedvertex with marked rootpath
vertex_unmarkedsecond vertex
extdataextension data

Definition at line 167 of file extreduce_bottleneck.c.

References bottleneckMarkEqualityPath(), EQ, extIsAtInitialGenStar(), GE, graph_pc_isPc(), graph_pc_termIsNonLeafTerm(), Is_term, GRAPH::prize, SCIP_Bool, SCIP_Real, GRAPH::term, extension_data::tree_bottleneckDistNode, extension_data::tree_deg, extension_data::tree_parentEdgeCost, extension_data::tree_parentNode, extension_data::tree_root, and UNKNOWN.

Referenced by extreduce_bottleneckIsDominated(), and extreduce_bottleneckWithExtedgeIsDominated().

◆ bottleneckMarkEqualityEdge()

static void bottleneckMarkEqualityEdge ( SCIP scip,
const GRAPH g,
int  edge,
EXTDATA extdata 
)
inlinestatic

markes single bottleneck edge used for equality rule-out

Parameters
scipSCIP
ggraph data structure
edgethe edge to mark
extdataextension data

Definition at line 293 of file extreduce_bottleneck.c.

References graph_edge_isInRange(), SCIP_Bool, extension_data::sdeq_edgesIsForbidden, extension_data::sdeq_hasForbiddenEdges, StpVecPushBack, and TRUE.

Referenced by extreduce_bottleneckToSiblingIsDominated(), and extreduce_bottleneckWithExtedgeIsDominated().

◆ bottleneckIsEqualityDominated()

static SCIP_Bool bottleneckIsEqualityDominated ( SCIP scip,
const GRAPH g,
SCIP_Real  dist_eq,
int  edge_forbidden,
int  vertex1,
int  vertex2,
EXTDATA extdata 
)
inlinestatic

helper to check the case of quality

Parameters
scipSCIP
ggraph data structure
dist_eqcritical distance
edge_forbiddenforbidden edge
vertex1first vertex
vertex2second vertex
extdataextension data

Definition at line 316 of file extreduce_bottleneck.c.

References EQ, extreduce_distDataGetSdDoubleForbiddenEq(), FALSE, GE, LE, SCIP_Real, and TRUE.

Referenced by extreduce_bottleneckIsDominated(), extreduce_bottleneckToSiblingIsDominated(), and extreduce_bottleneckWithExtedgeIsDominated().

◆ extreduce_bottleneckMarkRootPath()

◆ extreduce_bottleneckUnmarkRootPath()

void extreduce_bottleneckUnmarkRootPath ( const GRAPH graph,
int  vertex,
EXTDATA extdata 
)

unmarks bottleneck array on path to tree root

Parameters
graphgraph data structure
vertexvertex to start from
extdataextension data

Definition at line 422 of file extreduce_bottleneck.c.

References SCIP_Real, extension_data::tree_bottleneckDistNode, extension_data::tree_deg, extension_data::tree_parentNode, and extension_data::tree_root.

Referenced by dbgBottleneckFromLeafIsDominated(), mstCompLeafGetSDsToAncestors(), mstCompLeafGetSDsToSiblings(), mstCompLeafToAncestorsBiasedRuleOut(), and mstLevelLeafExit().

◆ extreduce_bottleneckIsDominated()

SCIP_Bool extreduce_bottleneckIsDominated ( SCIP scip,
const GRAPH graph,
int  vertex_pathmarked,
int  vertex_unmarked,
SCIP_Real  specialDist,
int  edge_forbidden,
EXTDATA extdata 
)

Does a special distance approximation dominate the tree bottleneck distance between vertex_pathmarked and vertex_unmarked in the current tree. NOTE: makes additional checks in case of equality

Parameters
scipSCIP
graphgraph data structure
vertex_pathmarkedvertex for which bottleneck path to root has been marked
vertex_unmarkedsecond vertex
specialDistbest computed special distance approximation (-1.0 if unknown)
edge_forbiddenforbidden edge
extdataextension data

Definition at line 464 of file extreduce_bottleneck.c.

References bottleneckGetDist(), bottleneckIsEqualityDominated(), bottleneckMarkEqualityEdges(), EQ, extreduce_extGetSdDouble(), extSdIsNonTrivial(), FALSE, graph_knot_isInRange(), LE, LT, SCIP_Bool, SCIP_Real, SCIPdebugMessage, and TRUE.

Referenced by dbgBottleneckFromLeafIsDominated(), mstCompLeafGetSDsToAncestors(), and mstCompLeafGetSDsToSiblings().

◆ extreduce_bottleneckIsDominatedBiased()

SCIP_Bool extreduce_bottleneckIsDominatedBiased ( SCIP scip,
const GRAPH graph,
int  vertex_pathmarked,
int  vertex_unmarked,
SCIP_Real  specialDistBiased,
EXTDATA extdata 
)

As above, but for biased special distance

Parameters
scipSCIP
graphgraph data structure
vertex_pathmarkedvertex for which bottleneck path to root has been marked
vertex_unmarkedsecond vertex
specialDistBiasedbest computed special distance approximation (-1.0 if unknown)
extdataextension data

Definition at line 520 of file extreduce_bottleneck.c.

References bottleneckGetDist(), extSdIsNonTrivial(), FALSE, graph_knot_isInRange(), LT, SCIP_Bool, SCIP_Real, SCIPdebugMessage, and TRUE.

Referenced by mstCompLeafToAncestorsBiasedRuleOut().

◆ extreduce_bottleneckWithExtedgeIsDominated()

SCIP_Bool extreduce_bottleneckWithExtedgeIsDominated ( SCIP scip,
const GRAPH graph,
int  extedge,
int  vertex_pathmarked,
int  vertex_unmarked,
SCIP_Real  specialDist,
EXTDATA extdata 
)

Does a special distance approximation dominate the tree bottleneck distance of extension edge (i.e. its edge cost) or bottleneck distance between vertex_pathmarked and vertex_unmarked in the current tree. NOTE: makes additional checks in case of equality

Parameters
scipSCIP
graphgraph data structure
extedgeedge along which we want to extend the tree
vertex_pathmarkedvertex for which bottleneck path to root has been marked
vertex_unmarkedsecond vertex
specialDistbest computed special distance approximation (-1.0 if unknown)
extdataextension data

Definition at line 561 of file extreduce_bottleneck.c.

References bottleneckGetDist(), bottleneckIsEqualityDominated(), bottleneckMarkEqualityEdge(), bottleneckMarkEqualityEdges(), GRAPH::cost, EQ, extreduce_extGetSdDouble(), extSdIsNonTrivial(), FALSE, graph_edge_isInRange(), GRAPH::head, LE, LT, SCIP_Bool, SCIP_Real, SCIPdebugMessage, GRAPH::tail, and TRUE.

Referenced by extreduce_bottleneckCheckNonLeaves(), extreduce_bottleneckCheckNonLeaves_pc(), and mstLevelLeafSetVerticalSDsBoth().

◆ extreduce_bottleneckWithExtedgeIsDominatedBiased()

SCIP_Bool extreduce_bottleneckWithExtedgeIsDominatedBiased ( SCIP scip,
const GRAPH graph,
int  extedge,
int  vertex_pathmarked,
int  vertex_unmarked,
SCIP_Real  specialDistBiased,
EXTDATA extdata 
)

as above, but for biased special distance

Parameters
scipSCIP
graphgraph data structure
extedgeedge along which we want to extend the tree
vertex_pathmarkedvertex for which bottleneck path to root has been marked
vertex_unmarkedsecond vertex
specialDistBiasedbest computed biased special distance approximation (-1.0 if unknown)
extdataextension data

Definition at line 640 of file extreduce_bottleneck.c.

References bottleneckGetDist(), GRAPH::cost, extSdIsNonTrivial(), FALSE, graph_edge_isInRange(), LT, SCIP_Bool, SCIP_Real, SCIPdebugMessage, GRAPH::tail, and TRUE.

Referenced by mstLevelLeafSetVerticalSDsBoth().

◆ extreduce_bottleneckToSiblingIsDominated()

SCIP_Bool extreduce_bottleneckToSiblingIsDominated ( SCIP scip,
const GRAPH graph,
int  extedge,
int  edge2sibling,
SCIP_Real  specialDist,
EXTDATA extdata 
)

Does a special distance approximation dominate the tree bottleneck distance between vertex_pathmarked and vertex_unmarked in the current tree? NOTE: makes additional checks in case of equality

Parameters
scipSCIP
graphgraph data structure
extedgeedge for extension
edge2siblingedge to sibling of extedge head
specialDistbest computed special distance approximation (FARAWAY if unknown)
extdataextension data

Definition at line 683 of file extreduce_bottleneck.c.

References bottleneckIsEqualityDominated(), bottleneckMarkEqualityEdge(), GRAPH::cost, FALSE, FARAWAY, GE, GRAPH::head, LE, LT, SCIP_Bool, SCIP_Real, SCIPdebugMessage, GRAPH::tail, and TRUE.

Referenced by mstCompLeafGetSDsToSiblings().

◆ extreduce_bottleneckToSiblingIsDominatedBiased()

SCIP_Bool extreduce_bottleneckToSiblingIsDominatedBiased ( SCIP scip,
const GRAPH graph,
int  extedge,
int  edge2sibling,
SCIP_Real  specialDistBiased,
EXTDATA extdata 
)

as above, but for biased special distance

Parameters
scipSCIP
graphgraph data structure
extedgeedge for extension
edge2siblingedge to sibling of extedge head
specialDistBiasedbest computed special distance approximation (FARAWAY if unknown)
extdataextension data

Definition at line 751 of file extreduce_bottleneck.c.

References GRAPH::cost, FALSE, FARAWAY, GE, LT, SCIP_Bool, SCIP_Real, GRAPH::tail, and TRUE.

Referenced by mstCompLeafToSiblingsBiasedRuleOut().

◆ extreduce_bottleneckCheckNonLeaves_pc()

void extreduce_bottleneckCheckNonLeaves_pc ( SCIP scip,
const GRAPH graph,
int  edge2neighbor,
EXTDATA extdata,
SCIP_Bool ruledOut 
)

checks tree bottleneck distances to non-leaves of the tree that were marked before

Parameters
scipSCIP
graphgraph data structure
edge2neighborthe edge from the tree to the neighbor
extdataextension data
ruledOutcould the extension be ruled out

Definition at line 787 of file extreduce_bottleneck.c.

References extreduce_bottleneckWithExtedgeIsDominated(), extreduce_extGetSd(), GRAPH::head, pcmw_specific_data::nPcSdCands, extension_data::pcdata, pcmw_specific_data::pcSdCands, SCIP_Real, SCIPdebugMessage, GRAPH::tail, extension_data::tree_deg, and TRUE.

Referenced by extreduce_mstLevelVerticalAddLeaf().

◆ extreduce_bottleneckCheckNonLeaves()

void extreduce_bottleneckCheckNonLeaves ( SCIP scip,
const GRAPH graph,
int  edge2neighbor,
EXTDATA extdata,
SCIP_Bool ruledOut 
)

checks tree bottleneck distances to non-leaves of the tree

Parameters
scipSCIP
graphgraph data structure
edge2neighborthe edge from the tree to the neighbor
extdataextension data
ruledOutcould the extension be ruled out

Definition at line 833 of file extreduce_bottleneck.c.

References extreduce_bottleneckWithExtedgeIsDominated(), extreduce_extGetSd(), graph_knot_isInRange(), GRAPH::head, SCIP_Real, SCIPdebugMessage, GRAPH::tail, extension_data::tree_deg, extension_data::tree_innerNodes, extension_data::tree_ninnerNodes, and TRUE.

Referenced by extreduce_mstLevelVerticalAddLeaf().