Scippy

SCIP

Solving Constraint Integer Programs

graph_delpseudo.c File Reference

Detailed Description

includes graph pseudo deletion methods for Steiner problems

Author
Daniel Rehfeldt

Graph node or edge pseudo-deletion methods (aka replacement methods) for Steiner problems

Definition in file graph_delpseudo.c.

#include "graph.h"
#include "portab.h"

Go to the source code of this file.

Data Structures

struct  pseudo_deletion
 

Macros

#define STP_DELPSEUDO_NOEDGE   -1
 
#define STP_DELPSEUDO_SKIPEDGE   -2
 

Typedefs

typedef struct pseudo_deletion DELPSEUDO
 

Functions

static SCIP_Bool isCutoffEdge (SCIP *scip, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, const SCIP_Real *ecost, const SCIP_Real *ecostrev, SCIP_Real prize, int edgeidx1, int edgeidx2, int cutoffidx)
 
static SCIP_Bool delPseudoIsEdgeDeletionMode (const DELPSEUDO *delpseudo)
 
static int delPseudoGetEdgePosition (const DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoInit (SCIP *scip, const SCIP_Real *edgecosts, const REDCOST *redcostdata, int vertex, GRAPH *g, DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoInitForCheck (SCIP *scip, const GRAPH *g, const SCIP_Real *edgecosts, int vertex, DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoDeleteVertex (SCIP *scip, int vertex, GRAPH *g, REDCOST *redcostdata, DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoGetReplaceEdges (SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
 
static SCIP_RETCODE delPseudoCheckReplacement (SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
 
static SCIP_RETCODE delPseudoEdgeInit (SCIP *scip, const SCIP_Real *edgecosts, const SCIP_Real *edgecosts_adapt, GRAPH *g, DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoEdgeGetReplaceEdges (SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, DELPSEUDO *delpseudo, SCIP_Bool *success)
 
static SCIP_RETCODE delPseudoEdgeDeleteEdge (SCIP *scip, GRAPH *g, SCIP_Real *edgecosts_adapt, DELPSEUDO *delpseudo)
 
static void delPseudoFreeData (SCIP *scip, DELPSEUDO *delpseudo)
 
static void delPseudoFreeDataForCheck (SCIP *scip, DELPSEUDO *delpseudo)
 
static SCIP_RETCODE delPseudoPathCreatePseudoAncestorTuple (SCIP *scip, GRAPH *g, int edge1, int edge2)
 
static SCIP_RETCODE delPseudoPath (SCIP *scip, GRAPH *g, int edge, int edge_pathtail, int edge_pathhead, SCIP_Real *edgecosts_adapt)
 
SCIP_RETCODE graph_knot_delPseudo (SCIP *scip, GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int vertex, REDCOST *redcostdata, SCIP_Bool *success)
 
SCIP_RETCODE graph_knot_delPseudoCheckIfPossible (SCIP *scip, const GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int vertex, SCIP_Bool *isPossible)
 
SCIP_RETCODE graph_edge_delPseudo (SCIP *scip, GRAPH *g, const SCIP_Real *cutoffcosts, const SCIP_Real *cutoffs, const SCIP_Real *cutoffsrev, int edge, SCIP_Real *edgecosts_adapt, SCIP_Bool *success)
 
SCIP_RETCODE graph_edge_delPseudoPath (SCIP *scip, GRAPH *g, int edge, int edge_pathtail, int edge_pathhead, SCIP_Real *edgecosts_adapt)
 

Macro Definition Documentation

◆ STP_DELPSEUDO_NOEDGE

#define STP_DELPSEUDO_NOEDGE   -1

◆ STP_DELPSEUDO_SKIPEDGE

#define STP_DELPSEUDO_SKIPEDGE   -2

Typedef Documentation

◆ DELPSEUDO

typedef struct pseudo_deletion DELPSEUDO

Internal data for pseudo-deletion. Is used for both pseudo-elimination of vertex and edge. In the latter case, the adjacency information is w.r.t. the head of the edge.

Function Documentation

◆ isCutoffEdge()

static SCIP_Bool isCutoffEdge ( SCIP scip,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
const SCIP_Real ecost,
const SCIP_Real ecostrev,
SCIP_Real  prize,
int  edgeidx1,
int  edgeidx2,
int  cutoffidx 
)
inlinestatic

can edge in pseudo-elimination method be cut off?

Parameters
scipSCIP data
cutoffscutoff values for each incident edge
cutoffsrevrevere cutoff values (or NULL if undirected)
ecostedge cost
ecostrevreverse edge cost
prizeprize if PcMw, 0.0 otherwise
edgeidx1index of first edge to be checked (wrt provided arrays)
edgeidx2index of second edge to be checked (wrt provided arrays)
cutoffidxindex for cutoff array

Definition at line 65 of file graph_delpseudo.c.

References FALSE, NULL, SCIP_Real, SCIPisGT(), and TRUE.

Referenced by delPseudoCheckReplacement(), delPseudoEdgeGetReplaceEdges(), and delPseudoGetReplaceEdges().

◆ delPseudoIsEdgeDeletionMode()

static SCIP_Bool delPseudoIsEdgeDeletionMode ( const DELPSEUDO delpseudo)
static

◆ delPseudoGetEdgePosition()

static int delPseudoGetEdgePosition ( const DELPSEUDO delpseudo)
inlinestatic

gets position of deletion edge in replacement arrays

Parameters
delpseudodata

Definition at line 118 of file graph_delpseudo.c.

References pseudo_deletion::degree, delPseudoIsEdgeDeletionMode(), pseudo_deletion::edge, flipedge, and pseudo_deletion::incedge.

Referenced by delPseudoEdgeDeleteEdge(), and delPseudoEdgeGetReplaceEdges().

◆ delPseudoInit()

◆ delPseudoInitForCheck()

◆ delPseudoDeleteVertex()

◆ delPseudoGetReplaceEdges()

static SCIP_RETCODE delPseudoGetReplaceEdges ( SCIP scip,
const GRAPH g,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
DELPSEUDO delpseudo,
SCIP_Bool success 
)
static

◆ delPseudoCheckReplacement()

static SCIP_RETCODE delPseudoCheckReplacement ( SCIP scip,
const GRAPH g,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
DELPSEUDO delpseudo,
SCIP_Bool success 
)
static

◆ delPseudoEdgeInit()

static SCIP_RETCODE delPseudoEdgeInit ( SCIP scip,
const SCIP_Real edgecosts,
const SCIP_Real edgecosts_adapt,
GRAPH g,
DELPSEUDO delpseudo 
)
static

initializes for edge elimination

Parameters
scipSCIP data
edgecostsedge costs for cutoff
edgecosts_adaptedge costs that should be adapted
ggraph
delpseudodata

Definition at line 639 of file graph_delpseudo.c.

References delPseudoInit(), delPseudoIsEdgeDeletionMode(), pseudo_deletion::edge, GRAPH::head, NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by graph_edge_delPseudo().

◆ delPseudoEdgeGetReplaceEdges()

static SCIP_RETCODE delPseudoEdgeGetReplaceEdges ( SCIP scip,
const GRAPH g,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
DELPSEUDO delpseudo,
SCIP_Bool success 
)
static

◆ delPseudoEdgeDeleteEdge()

◆ delPseudoFreeData()

◆ delPseudoFreeDataForCheck()

static void delPseudoFreeDataForCheck ( SCIP scip,
DELPSEUDO delpseudo 
)
static

◆ delPseudoPathCreatePseudoAncestorTuple()

static SCIP_RETCODE delPseudoPathCreatePseudoAncestorTuple ( SCIP scip,
GRAPH g,
int  edge1,
int  edge2 
)
inlinestatic

does the path replacement

Parameters
scipSCIP data structure
gthe graph
edge1first edge
edge2second edge

Definition at line 914 of file graph_delpseudo.c.

References graph_addPseudoAncestor(), graph_edge_isInRange(), graph_pseudoAncestors_addToEdge(), SCIP_CALL, and SCIP_OKAY.

Referenced by delPseudoPath().

◆ delPseudoPath()

static SCIP_RETCODE delPseudoPath ( SCIP scip,
GRAPH g,
int  edge,
int  edge_pathtail,
int  edge_pathhead,
SCIP_Real edgecosts_adapt 
)
static

does the path replacement

Parameters
scipSCIP data structure
gthe graph
edgethe edge to be replaced, mind the orientation!
edge_pathtailtail edge of path
edge_pathheadhead edge of path
edgecosts_adaptcosts to adapt or NULL

Definition at line 936 of file graph_delpseudo.c.

References GRAPH::ancestors, GRAPH::cost, delPseudoPathCreatePseudoAncestorTuple(), EAT_LAST, pseudo_deletion::edge, Edge_even, FALSE, flipedge, graph_edge_getAncestors(), graph_edge_printInfo(), graph_edge_redirect(), graph_pseudoAncestors_appendCopyEdge(), graph_typeIsUndirected(), GRAPH::head, NULL, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPintListNodeAppendCopy(), GRAPH::tail, and TRUE.

Referenced by graph_edge_delPseudoPath().

◆ graph_knot_delPseudo()

SCIP_RETCODE graph_knot_delPseudo ( SCIP scip,
GRAPH g,
const SCIP_Real cutoffcosts,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
int  vertex,
REDCOST redcostdata,
SCIP_Bool success 
)

pseudo delete node, i.e. reconnect neighbors; maximum degree of STP_DELPSEUDO_MAXGRAD!

Parameters
scipSCIP data structure
gthe graph
cutoffcostsedge costs for cutoff
cutoffscutoff values for each incident edge (or NULL)
cutoffsrevreverse edge cutoff values (or NULL if undirected or non-existent)
vertexthe vertex
redcostdatareduced cost data for adaptation or NULL
successhas node been pseudo-eliminated?

Definition at line 1015 of file graph_delpseudo.c.

References delPseudoDeleteVertex(), delPseudoFreeData(), delPseudoGetReplaceEdges(), delPseudoInit(), delPseudoIsEdgeDeletionMode(), GRAPH::grad, NULL, SCIP_CALL, SCIP_OKAY, STP_DELPSEUDO_MAXGRAD, STP_DELPSEUDO_MAXNEDGES, TRUE, and UNKNOWN.

Referenced by bdkTryDeg3(), bdkTryDegGe4(), boundPruneHeur(), pseudoDelDouble(), pseudodeleteDeleteNode(), pseudoDelSingle(), reduce_applyPseudoDeletions(), reduce_bd34(), reduce_bd34WithSd(), and reduce_bound().

◆ graph_knot_delPseudoCheckIfPossible()

SCIP_RETCODE graph_knot_delPseudoCheckIfPossible ( SCIP scip,
const GRAPH g,
const SCIP_Real cutoffcosts,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
int  vertex,
SCIP_Bool isPossible 
)

checks whether pseudo-deletion is possible; maximum degree of STP_DELPSEUDO_MAXGRAD!

Parameters
scipSCIP data structure
gthe graph
cutoffcostsedge costs for cutoff
cutoffscutoff values for each incident edge (or NULL)
cutoffsrevreverse edge cutoff values (or NULL if undirected or non-existent)
vertexthe vertex
isPossiblecan vertex pseudo-eliminated?

Definition at line 1063 of file graph_delpseudo.c.

References delPseudoCheckReplacement(), delPseudoFreeDataForCheck(), delPseudoInitForCheck(), delPseudoIsEdgeDeletionMode(), GRAPH::grad, NULL, SCIP_CALL, SCIP_OKAY, STP_DELPSEUDO_MAXGRAD, TRUE, and UNKNOWN.

Referenced by pseudodeleteDeleteComputeCutoffs().

◆ graph_edge_delPseudo()

SCIP_RETCODE graph_edge_delPseudo ( SCIP scip,
GRAPH g,
const SCIP_Real cutoffcosts,
const SCIP_Real cutoffs,
const SCIP_Real cutoffsrev,
int  edge,
SCIP_Real edgecosts_adapt,
SCIP_Bool success 
)

Pseudo deletes edge, i.e. reconnects tail of edge with neighbors of head; maximum degree of STP_DELPSEUDO_MAXGRAD! The orientation of the edge is important!

Parameters
scipSCIP data structure
gthe graph
cutoffcostsedge costs for cutoff
cutoffscutoff values for each incident edge (or NULL)
cutoffsrevreverse edge cutoff values (or NULL if undirected or non-existent)
edgethe edge, mind the orientation!
edgecosts_adaptcosts to adapt or NULL
successhas node been pseudo-eliminated?

Definition at line 1097 of file graph_delpseudo.c.

References delPseudoEdgeDeleteEdge(), delPseudoEdgeGetReplaceEdges(), delPseudoEdgeInit(), delPseudoFreeData(), delPseudoIsEdgeDeletionMode(), GRAPH::grad, graph_edge_isInRange(), GRAPH::head, NULL, SCIP_CALL, SCIP_OKAY, STP_DELPSEUDO_MAXGRAD, and TRUE.

Referenced by bdkTryDegGe4().

◆ graph_edge_delPseudoPath()

SCIP_RETCODE graph_edge_delPseudoPath ( SCIP scip,
GRAPH g,
int  edge,
int  edge_pathtail,
int  edge_pathhead,
SCIP_Real edgecosts_adapt 
)

Path replacement of edge; path is given by three oriented edges: edge_pathtail -> edge -> edge_pathhead. Middle edges is replaced.

Parameters
scipSCIP data structure
gthe graph
edgethe edge to be replaced, mind the orientation!
edge_pathtailtail edge of path
edge_pathheadhead edge of path
edgecosts_adaptcosts to adapt or NULL

Definition at line 1136 of file graph_delpseudo.c.

References delPseudoPath(), graph_edge_isInRange(), GRAPH::head, SCIP_CALL, SCIP_OKAY, and GRAPH::tail.

Referenced by replaceEdgeByPath().