Scippy

SCIP

Solving Constraint Integer Programs

graph_tpath.c File Reference

Detailed Description

Graph algorithms for Steiner problems related to shortest paths to terminals.

Author
Thorsten Koch
Daniel Rehfeldt

This file encompasses various algorithms that are used to compute shortest paths from non-terminals to terminals.

Definition in file graph_tpath.c.

#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <assert.h>
#include "graph.h"
#include "graphdefs.h"
#include "stpvector.h"
#include "reduce.h"

Go to the source code of this file.

Data Structures

struct  nodes_to_terminal_paths
 
struct  tpaths_repair
 

Macros

#define STP_TPATHS_NTERMBASES   4
 
#define STP_TPATHS_RESERVESIZE   16
 
#define pathResetSingle(entry)
 
#define tpathsRepairResetNode(scip, node, resetnodes, stack, nodes_isvisited)
 

Typedefs

typedef struct tpaths_repair TREPAIR
 

Functions

static int pathheapGetNearest (int *RESTRICT heap, int *RESTRICT state, int *RESTRICT count, const PATH *path)
 
static void pathheapCorrectDist (int *RESTRICT heap, int *RESTRICT state, int *RESTRICT count, PATH *RESTRICT path, int l, int k, int edge, SCIP_Real newdist)
 
static void utdist (SCIP *scip, const GRAPH *g, PATH *path, SCIP_Real ecost, int *vbase, int k, int l, int k2, int shift, int nnodes)
 
static void tpathsPrintPath (const GRAPH *g, const SDPROFIT *sdprofit, const TPATHS *tpaths, int node, int level)
 
static SCIP_RETCODE tpathsAlloc (SCIP *scip, const GRAPH *g, TPATHS **tpaths)
 
static void tpathsResetMembers (const GRAPH *g, int level, TPATHS *tpaths)
 
static void tpathsGetKCloseTerms (const GRAPH *g, const TPATHS *tpaths, int maxnumber, int node, SCIP_Real maxdist, SCIP_Bool distIsStrict, int *RESTRICT closeterms, int *RESTRICT firstedges, SCIP_Real *RESTRICT closeterms_dist, int *RESTRICT ncloseterms)
 
static SCIP_Real tpathsGetDistNew (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const int *vbase, int node, int nextnode, int edge, const SDPROFIT *sdprofit, const PATH *path)
 
static void tpathsBuild (SCIP *scip, GRAPH *g, TPATHS *tpaths)
 
static void tpathsBuildBiased (const SDPROFIT *sdprofit, GRAPH *g, TPATHS *tpaths)
 
static void tpathsScan1st (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, const SDPROFIT *sdprofit, int heapsize, TPATHS *tpaths, TREPAIR *repair)
 
static void tpathsScan2nd (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, int heapsize, TPATHS *tpaths, TREPAIR *repair)
 
static void tpathsScan3rd (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, int heapsize, TPATHS *tpaths, TREPAIR *repair)
 
static void tpathsScan4th (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, int heapsize, TPATHS *tpaths, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepairInitLevel (SCIP *scip, int level, const GRAPH *g, TREPAIR *repair)
 
static void tpathsRepairExitLevel (SCIP *scip, int level, const GRAPH *g, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepairTraverse1st (SCIP *scip, int start, int pred, const GRAPH *g, TREPAIR *repair)
 
static void tpathsRepairTraverseLevelWithStack (SCIP *scip, const GRAPH *g, int level, TREPAIR *repair)
 
static void tpathsRepairTraverseStackAddEdge (SCIP *scip, const GRAPH *g, int level, TREPAIR *repair)
 
static void tpathsRepairTraverseStackAddBelow (SCIP *scip, const GRAPH *g, int level, TREPAIR *repair)
 
static void tpathsRepairTraverseLevel (SCIP *scip, const GRAPH *g, int level, TREPAIR *repair)
 
static void tpathsRepairUpdate1st (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static void tpathsRepairUpdateLevel (SCIP *scip, const GRAPH *g, int level, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepair1st (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepair2nd (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepair3rd (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static SCIP_RETCODE tpathsRepair4th (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static void tpathsRepairInit (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
static void tpathsRepairExit (SCIP *scip, const GRAPH *g, TREPAIR *repair)
 
void graph_add1stTermPaths (const GRAPH *g, const SCIP_Real *cost, PATH *path, int *vbase, int *state)
 
void graph_add2ndTermPaths (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path2, int *vbase2, int *state2)
 
void graph_add3rdTermPaths (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path3, int *vbase3, int *state3)
 
void graph_add4thTermPaths (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path4, int *vbase4, int *state4)
 
void graph_get2nextTermPaths (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path2, int *vbase2, int *state2)
 
void graph_get3nextTermPaths (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path3, int *vbase3, int *state3)
 
void graph_get4nextTermPaths (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, PATH *path4, int *vbase4, int *state4)
 
SCIP_RETCODE graph_get4nextTTerms (SCIP *scip, GRAPH *g, const SCIP_Real *cost, PATH *path, int *vbase, int *heap, int *state)
 
SCIP_RETCODE graph_tpathsInit (SCIP *scip, GRAPH *g, TPATHS **tpaths)
 
SCIP_RETCODE graph_tpathsInitBiased (SCIP *scip, const SDPROFIT *sdprofit, GRAPH *g, TPATHS **tpaths)
 
SCIP_RETCODE graph_tpathsRepairSetUp (const GRAPH *g, TPATHS *tpaths)
 
SCIP_RETCODE graph_tpathsRepair (SCIP *scip, int edge, SCIP_Bool withEdgeReplacement, const GRAPH *g, TPATHS *tpaths)
 
SCIP_RETCODE graph_tpathsRecomputeBiased (const SDPROFIT *sdprofit, GRAPH *g, TPATHS *tpaths)
 
void graph_tpathsPrintForNode (const GRAPH *g, const SDPROFIT *sdprofit, const TPATHS *tpaths, int node)
 
void graph_tpathsGetProfitNodes (SCIP *scip, const GRAPH *g, const TPATHS *tpaths, const SDPROFIT *sdprofit, int start, int base, STP_Vectype(int) profitnodes)
 
void graph_tpathsAdd1st (const GRAPH *g, const SCIP_Real *cost, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsAdd2nd (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsAdd3rd (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsAdd4th (const GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsSetAll2 (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsSetAll3 (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsSetAll4 (GRAPH *g, const SCIP_Real *cost, const SCIP_Real *costrev, const SDPROFIT *sdprofit, TPATHS *tpaths)
 
void graph_tpathsFree (SCIP *scip, TPATHS **tpaths)
 
void graph_tpathsGetClosestTerm (const GRAPH *g, const TPATHS *tpaths, int node, int *RESTRICT closeterm, int *RESTRICT firstedge, SCIP_Real *RESTRICT closeterm_dist)
 
void graph_tpathsGet3CloseTerms (const GRAPH *g, const TPATHS *tpaths, int node, SCIP_Real maxdist_strict, int *RESTRICT closeterms, int *RESTRICT firstedges, SCIP_Real *RESTRICT closeterms_dist, int *RESTRICT ncloseterms)
 
void graph_tpathsGet4CloseTerms (const GRAPH *g, const TPATHS *tpaths, int node, SCIP_Real maxdist_strict, int *RESTRICT closeterms, int *RESTRICT firstedges, SCIP_Real *RESTRICT closeterms_dist, int *RESTRICT ncloseterms)
 
void graph_tpathsGet4CloseTermsLE (const GRAPH *g, const TPATHS *tpaths, int node, SCIP_Real maxdist_nonstrict, int *RESTRICT closeterms, int *RESTRICT firstedges, SCIP_Real *RESTRICT closeterms_dist, int *RESTRICT ncloseterms)
 

Macro Definition Documentation

◆ STP_TPATHS_NTERMBASES

◆ STP_TPATHS_RESERVESIZE

#define STP_TPATHS_RESERVESIZE   16

Definition at line 36 of file graph_tpath.c.

Referenced by tpathsRepairInit().

◆ pathResetSingle

#define pathResetSingle (   entry)
Value:
do \
{ \
entry.dist = FARAWAY; \
entry.edge = UNKNOWN; \
} while( 0 )
#define FARAWAY
Definition: graphdefs.h:89
#define UNKNOWN
Definition: sepa_mcf.c:4095

reset single path struct

Definition at line 39 of file graph_tpath.c.

Referenced by tpathsRepairUpdate1st(), tpathsRepairUpdateLevel(), and tpathsResetMembers().

◆ tpathsRepairResetNode

#define tpathsRepairResetNode (   scip,
  node,
  resetnodes,
  stack,
  nodes_isvisited 
)
Value:
do \
{ \
assert(scip && resetnodes && stack && nodes_isvisited); \
assert(!nodes_isvisited[node]); \
StpVecPushBack(scip, resetnodes, node); \
StpVecPushBack(scip, stack, node); \
nodes_isvisited[node] = TRUE; \
} while( 0 )
#define TRUE
Definition: def.h:86

resets node

Definition at line 48 of file graph_tpath.c.

Referenced by tpathsRepairTraverse1st(), tpathsRepairTraverseLevelWithStack(), tpathsRepairTraverseStackAddBelow(), and tpathsRepairTraverseStackAddEdge().

Typedef Documentation

◆ TREPAIR

typedef struct tpaths_repair TREPAIR

data needed to repair node to terminal paths for edge-deletion

Function Documentation

◆ pathheapGetNearest()

static int pathheapGetNearest ( int *RESTRICT  heap,
int *RESTRICT  state,
int *RESTRICT  count,
const PATH path 
)
inlinestatic

Definition at line 100 of file graph_tpath.c.

References GT, and LT.

Referenced by tpathsScan1st(), tpathsScan2nd(), tpathsScan3rd(), and tpathsScan4th().

◆ pathheapCorrectDist()

static void pathheapCorrectDist ( int *RESTRICT  heap,
int *RESTRICT  state,
int *RESTRICT  count,
PATH *RESTRICT  path,
int  l,
int  k,
int  edge,
SCIP_Real  newdist 
)
inlinestatic

set new distance and predeccesor

Definition at line 145 of file graph_tpath.c.

References UNKNOWN.

Referenced by graph_tpathsAdd2nd(), graph_tpathsAdd3rd(), graph_tpathsAdd4th(), tpathsScan1st(), tpathsScan2nd(), tpathsScan3rd(), and tpathsScan4th().

◆ utdist()

static void utdist ( SCIP scip,
const GRAPH g,
PATH path,
SCIP_Real  ecost,
int *  vbase,
int  k,
int  l,
int  k2,
int  shift,
int  nnodes 
)
inlinestatic

terminal to terminal distance

Definition at line 188 of file graph_tpath.c.

References shortest_path::dist, Is_term, nodes_to_terminal_paths::nnodes, r, SCIP_Real, SCIPisLT(), and GRAPH::term.

Referenced by graph_get4nextTTerms().

◆ tpathsPrintPath()

static void tpathsPrintPath ( const GRAPH g,
const SDPROFIT sdprofit,
const TPATHS tpaths,
int  node,
int  level 
)
static

prints terminal path from given node

Parameters
ggraph data structure
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths
nodenode to start from
levelbetween 1 and 4

Definition at line 285 of file graph_tpath.c.

References shortest_path::edge, graph_edge_isDeleted(), graph_edge_isInRange(), graph_edge_printInfo(), graph_get_nNodes(), graph_knot_isInRange(), nodes_to_terminal_paths::nnodes, reduce_sdprofitGetProfit(), SCIP_Real, STP_TPATHS_NTERMBASES, GRAPH::tail, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and UNKNOWN.

Referenced by graph_tpathsPrintForNode().

◆ tpathsAlloc()

static SCIP_RETCODE tpathsAlloc ( SCIP scip,
const GRAPH g,
TPATHS **  tpaths 
)
static

◆ tpathsResetMembers()

static void tpathsResetMembers ( const GRAPH g,
int  level,
TPATHS tpaths 
)
static

resets TPATHS members

Parameters
ggraph
levellevel between 2 and 4
tpathsthe terminal paths

Definition at line 371 of file graph_tpath.c.

References CONNECT, graph_get_nNodes(), nodes_to_terminal_paths::nnodes, pathResetSingle, nodes_to_terminal_paths::state, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and UNKNOWN.

Referenced by graph_tpathsAdd2nd(), graph_tpathsAdd3rd(), and graph_tpathsAdd4th().

◆ tpathsGetKCloseTerms()

static void tpathsGetKCloseTerms ( const GRAPH g,
const TPATHS tpaths,
int  maxnumber,
int  node,
SCIP_Real  maxdist,
SCIP_Bool  distIsStrict,
int *RESTRICT  closeterms,
int *RESTRICT  firstedges,
SCIP_Real *RESTRICT  closeterms_dist,
int *RESTRICT  ncloseterms 
)
inlinestatic

gets (up to) four close terminals to given node i

Parameters
ggraph
tpathsthe terminal paths
maxnumbernumber of close terms
nodenode
maxdistmaximum valid distance
distIsStrictis 'maxdist' strict?
closetermsfour close terminals
firstedgescorresponding first edge (can be NULL)
closeterms_distfour close terminal distance
nclosetermsnumber of close terminals found

Definition at line 405 of file graph_tpath.c.

References shortest_path::dist, shortest_path::edge, GE, GRAPH::grad, graph_knot_isInRange(), Is_term, GRAPH::knots, LE, LT, nodes_to_terminal_paths::nnodes, NULL, SCIP_Bool, STP_TPATHS_NTERMBASES, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and UNKNOWN.

Referenced by graph_tpathsGet3CloseTerms(), graph_tpathsGet4CloseTerms(), and graph_tpathsGet4CloseTermsLE().

◆ tpathsGetDistNew()

static SCIP_Real tpathsGetDistNew ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const int *  vbase,
int  node,
int  nextnode,
int  edge,
const SDPROFIT sdprofit,
const PATH path 
)
inlinestatic

gets new distance for extension

Parameters
ggraph
costedge costs
costrevreversed edge costs
vbasebases
nodenode to extend from
nextnodenode to extend to
edgethe edge
sdprofitSD bias for nodes or NULL
paththe actual terminal paths

Definition at line 484 of file graph_tpath.c.

References shortest_path::dist, shortest_path::edge, GE, graph_get_nNodes(), graph_pc_isMw(), GRAPH::head, Is_term, GRAPH::knots, LE, nodes_to_terminal_paths::nnodes, reduce_sdprofitGetBiasedDist(), SCIP_Real, GRAPH::source, GRAPH::tail, and GRAPH::term.

Referenced by graph_tpathsAdd2nd(), graph_tpathsAdd3rd(), graph_tpathsAdd4th(), tpathsScan2nd(), tpathsScan3rd(), and tpathsScan4th().

◆ tpathsBuild()

static void tpathsBuild ( SCIP scip,
GRAPH g,
TPATHS tpaths 
)
inlinestatic

allocates TPATHS data

Parameters
scipSCIP
ggraph
tpathsthe terminal paths

Definition at line 535 of file graph_tpath.c.

References GRAPH::cost, graph_tpathsSetAll4(), NULL, and STP_TPATHS_NTERMBASES.

Referenced by graph_tpathsInit().

◆ tpathsBuildBiased()

static void tpathsBuildBiased ( const SDPROFIT sdprofit,
GRAPH g,
TPATHS tpaths 
)
inlinestatic

allocates TPATHS data

Parameters
sdprofitSD profit
ggraph
tpathsthe terminal paths

Definition at line 548 of file graph_tpath.c.

References GRAPH::cost, graph_tpathsSetAll4(), and STP_TPATHS_NTERMBASES.

Referenced by graph_tpathsInitBiased(), and graph_tpathsRecomputeBiased().

◆ tpathsScan1st()

static void tpathsScan1st ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
const SDPROFIT sdprofit,
int  heapsize,
TPATHS tpaths,
TREPAIR repair 
)
static

sub-method to find closest terminal to each non terminal (Voronoi diagram)

Parameters
scipSCIP or NULL
ggraph data structure
costedge costs
sdprofitSD bias for nodes or NULL
heapsizesize of heap
tpathsstorage for terminal paths
repairdata for repairing or NULL

Definition at line 562 of file graph_tpath.c.

References CONNECT, EAT_LAST, GE, GT, GRAPH::head, Is_term, LE, GRAPH::mark, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), pathheapGetNearest(), reduce_sdprofitGetBiasedDist(), SCIP_Bool, SCIP_Real, nodes_to_terminal_paths::state, StpVecPushBack, GRAPH::tail, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and TRUE.

Referenced by graph_tpathsAdd1st(), and tpathsRepair1st().

◆ tpathsScan2nd()

static void tpathsScan2nd ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
int  heapsize,
TPATHS tpaths,
TREPAIR repair 
)
static

sub-method to find 2nd closest terminal to each non terminal

Parameters
scipSCIP or NULL
ggraph data structure
costedge costs
costrevreverse edge costs
sdprofitSD bias for nodes or NULL
heapsizesize of heap
tpathsstorage for terminal paths
repairdata for repairing or NULL

Definition at line 637 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), graph_knot_isInRange(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), pathheapGetNearest(), SCIP_Bool, SCIP_Real, nodes_to_terminal_paths::state, StpVecPushBack, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), TRUE, and UNKNOWN.

Referenced by graph_tpathsAdd2nd(), and tpathsRepair2nd().

◆ tpathsScan3rd()

static void tpathsScan3rd ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
int  heapsize,
TPATHS tpaths,
TREPAIR repair 
)
static

sub-method to find 3rd closest terminal to each non terminal

Parameters
scipSCIP or NULL
ggraph data structure
costedge costs
costrevreverse edge costs
sdprofitSD bias for nodes or NULL
heapsizesize of heap
tpathsstorage for terminal paths
repairdata for repairing or NULL

Definition at line 700 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), pathheapGetNearest(), SCIP_Bool, SCIP_Real, nodes_to_terminal_paths::state, StpVecPushBack, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), TRUE, and UNKNOWN.

Referenced by graph_tpathsAdd3rd(), and tpathsRepair3rd().

◆ tpathsScan4th()

static void tpathsScan4th ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
int  heapsize,
TPATHS tpaths,
TREPAIR repair 
)
static

sub-method to find 4th closest terminal to each non terminal

Parameters
scipSCIP or NULL
ggraph data structure
costedge costs
costrevreverse edge costs
sdprofitSD bias for nodes or NULL
heapsizesize of heap
tpathsstorage for terminal paths
repairdata for repairing or NULL

Definition at line 764 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), pathheapGetNearest(), SCIP_Bool, SCIP_Real, nodes_to_terminal_paths::state, StpVecPushBack, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), TRUE, and UNKNOWN.

Referenced by graph_tpathsAdd4th(), and tpathsRepair4th().

◆ tpathsRepairInitLevel()

static SCIP_RETCODE tpathsRepairInitLevel ( SCIP scip,
int  level,
const GRAPH g,
TREPAIR repair 
)
inlinestatic

initializes

Parameters
scipSCIP
level0 - 3
ggraph
repairdata for repairing

Definition at line 831 of file graph_tpath.c.

References graph_get_nNodes(), nodes_to_terminal_paths::nnodes, SCIP_CALL, SCIP_OKAY, SCIPallocCleanBufferArray, nodes_to_terminal_paths::state, and UNKNOWN.

Referenced by tpathsRepair1st(), tpathsRepair2nd(), tpathsRepair3rd(), and tpathsRepair4th().

◆ tpathsRepairExitLevel()

static void tpathsRepairExitLevel ( SCIP scip,
int  level,
const GRAPH g,
TREPAIR repair 
)
inlinestatic

cleans and frees

Parameters
scipSCIP
level0 - 3
ggraph
repairdata for repairing

Definition at line 859 of file graph_tpath.c.

References FALSE, graph_knot_isInRange(), GRAPH::knots, SCIP_Bool, SCIPfreeCleanBufferArray, nodes_to_terminal_paths::state, STP_TPATHS_NTERMBASES, STP_Vectype, StpVecGetSize, and UNKNOWN.

Referenced by tpathsRepair1st(), tpathsRepair2nd(), tpathsRepair3rd(), and tpathsRepair4th().

◆ tpathsRepairTraverse1st()

static SCIP_RETCODE tpathsRepairTraverse1st ( SCIP scip,
int  start,
int  pred,
const GRAPH g,
TREPAIR repair 
)
static

traverses graph to find nodes that need to be reseted

Parameters
scipSCIP
startnode to start from
predpredecessor node
ggraph
repairdata for repairing

Definition at line 902 of file graph_tpath.c.

References a, EAT_LAST, shortest_path::edge, graph_knot_isInRange(), GRAPH::head, Is_term, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, SCIP_OKAY, SCIPdebugMessage, STP_Vectype, StpVecGetSize, StpVecIsEmpty, StpVecPopBack, GRAPH::tail, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and tpathsRepairResetNode.

Referenced by tpathsRepair1st().

◆ tpathsRepairTraverseLevelWithStack()

static void tpathsRepairTraverseLevelWithStack ( SCIP scip,
const GRAPH g,
int  level,
TREPAIR repair 
)
static

◆ tpathsRepairTraverseStackAddEdge()

static void tpathsRepairTraverseStackAddEdge ( SCIP scip,
const GRAPH g,
int  level,
TREPAIR repair 
)
static

adds outdated nodes whose predecessor points along edge to be deleted

Parameters
scipSCIP
ggraph
levellevel (1-3, level 0 is handled separately)
repairdata for repairing

Definition at line 1021 of file graph_tpath.c.

References shortest_path::edge, graph_get_nNodes(), GRAPH::head, nodes_to_terminal_paths::nnodes, GRAPH::tail, nodes_to_terminal_paths::termpaths, and tpathsRepairResetNode.

Referenced by tpathsRepairTraverseLevel().

◆ tpathsRepairTraverseStackAddBelow()

static void tpathsRepairTraverseStackAddBelow ( SCIP scip,
const GRAPH g,
int  level,
TREPAIR repair 
)
static

adds outdated nodes whose predecessor point to lower level

Parameters
scipSCIP
ggraph
levellevel (1-3, level 0 is handled separately)
repairdata for repairing

Definition at line 1050 of file graph_tpath.c.

References a, EAT_LAST, shortest_path::edge, graph_get_nNodes(), graph_knot_isInRange(), GRAPH::head, Is_term, nodes_to_terminal_paths::nnodes, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, SCIPdebugMessage, STP_Vectype, StpVecGetSize, GRAPH::tail, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termbases_org, nodes_to_terminal_paths::termpaths, and tpathsRepairResetNode.

Referenced by tpathsRepairTraverseLevel().

◆ tpathsRepairTraverseLevel()

static void tpathsRepairTraverseLevel ( SCIP scip,
const GRAPH g,
int  level,
TREPAIR repair 
)
static

Traverses graph to find nodes on given level that need to be reseted, by updating from previous levels. Also considers duplicates.

Parameters
scipSCIP
ggraph
levellevel (1-3, level 0 is handled separately)
repairdata for repairing

Definition at line 1117 of file graph_tpath.c.

References tpathsRepairTraverseLevelWithStack(), tpathsRepairTraverseStackAddBelow(), and tpathsRepairTraverseStackAddEdge().

Referenced by tpathsRepair2nd(), tpathsRepair3rd(), and tpathsRepair4th().

◆ tpathsRepairUpdate1st()

static void tpathsRepairUpdate1st ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

◆ tpathsRepairUpdateLevel()

static void tpathsRepairUpdateLevel ( SCIP scip,
const GRAPH g,
int  level,
TREPAIR repair 
)
static

◆ tpathsRepair1st()

static SCIP_RETCODE tpathsRepair1st ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

repairs TPATHS structure for imminent edge deletion (1st level)

Parameters
scipSCIP
ggraph
repairdata for repairing

Definition at line 1287 of file graph_tpath.c.

References GRAPH::cost, GRAPH::head, NULL, SCIP_CALL, SCIP_OKAY, GRAPH::tail, tpathsRepairExitLevel(), tpathsRepairInitLevel(), tpathsRepairTraverse1st(), tpathsRepairUpdate1st(), and tpathsScan1st().

Referenced by graph_tpathsRepair().

◆ tpathsRepair2nd()

static SCIP_RETCODE tpathsRepair2nd ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

repairs TPATHS structure for imminent edge deletion (2nd level)

Parameters
scipSCIP
ggraph
repairdata for repairing

Definition at line 1318 of file graph_tpath.c.

References GRAPH::cost, NULL, SCIP_CALL, SCIP_OKAY, tpathsRepairExitLevel(), tpathsRepairInitLevel(), tpathsRepairTraverseLevel(), tpathsRepairUpdateLevel(), and tpathsScan2nd().

Referenced by graph_tpathsRepair().

◆ tpathsRepair3rd()

static SCIP_RETCODE tpathsRepair3rd ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

repairs TPATHS structure for imminent edge deletion (3rd level)

Parameters
scipSCIP
ggraph
repairdata for repairing

Definition at line 1340 of file graph_tpath.c.

References GRAPH::cost, NULL, SCIP_CALL, SCIP_OKAY, tpathsRepairExitLevel(), tpathsRepairInitLevel(), tpathsRepairTraverseLevel(), tpathsRepairUpdateLevel(), and tpathsScan3rd().

Referenced by graph_tpathsRepair().

◆ tpathsRepair4th()

static SCIP_RETCODE tpathsRepair4th ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

repairs TPATHS structure for imminent edge deletion (4th level)

Parameters
scipSCIP
ggraph
repairdata for repairing

Definition at line 1363 of file graph_tpath.c.

References GRAPH::cost, NULL, SCIP_CALL, SCIP_OKAY, tpathsRepairExitLevel(), tpathsRepairInitLevel(), tpathsRepairTraverseLevel(), tpathsRepairUpdateLevel(), and tpathsScan4th().

Referenced by graph_tpathsRepair().

◆ tpathsRepairInit()

static void tpathsRepairInit ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

initializes

Parameters
scipSCIP
ggraph
repairdata for repairing

Definition at line 1386 of file graph_tpath.c.

References GRAPH::knots, STP_TPATHS_NTERMBASES, STP_TPATHS_RESERVESIZE, StpVecReserve, nodes_to_terminal_paths::termbases, and nodes_to_terminal_paths::termbases_org.

Referenced by graph_tpathsRepair().

◆ tpathsRepairExit()

static void tpathsRepairExit ( SCIP scip,
const GRAPH g,
TREPAIR repair 
)
static

◆ graph_add1stTermPaths()

void graph_add1stTermPaths ( const GRAPH g,
const SCIP_Real cost,
PATH path,
int *  vbase,
int *  state 
)

builds a Voronoi region w.r.t. shortest paths, for all terminals NOTE: serves as a wrapper

Parameters
ggraph data structure
costedge costs
pathpath data structure (leading to respective Voronoi base)
vbaseVoronoi base to each vertex
statearray to mark the state of each node during calculation

Definition at line 1464 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsAdd1st(), nodes_to_terminal_paths::nnodes, NULL, nodes_to_terminal_paths::state, and nodes_to_terminal_paths::termpaths.

Referenced by computeTransVoronoi(), redcosts_initializeDistances(), reduce_boundHopR(), reduce_boundHopRc(), and reduce_daPcMw().

◆ graph_add2ndTermPaths()

void graph_add2ndTermPaths ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path2,
int *  vbase2,
int *  state2 
)

2nd next terminal to all non terminal nodes NOTE: legacy wrapper

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path2path data structure (leading to first and second nearest terminal)
vbase2first and second nearest terminal to each non terminal
state2array to mark the state of each node during calculation

Definition at line 1482 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsAdd2nd(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by boundPruneHeur(), boundPruneHeurMw(), reduce_bound(), reduce_boundHop(), reduce_boundMw(), and reduce_daPcMw().

◆ graph_add3rdTermPaths()

void graph_add3rdTermPaths ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path3,
int *  vbase3,
int *  state3 
)

3rd next terminal to all non terminal nodes NOTE: legacy wrapper

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path3path data structure (leading to first, second and third nearest terminal)
vbase3first, second and third nearest terminal to each non terminal
state3array to mark the state of each node during calculation

Definition at line 1501 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsAdd3rd(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by boundPruneHeur(), and reduce_bound().

◆ graph_add4thTermPaths()

void graph_add4thTermPaths ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path4,
int *  vbase4,
int *  state4 
)
Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path4path data structure (leading to first, second, third and fourth nearest terminal)
vbase4first, second, third, and fourth nearest terminal to each non terminal
state4array to mark the state of each node during calculation

Definition at line 1521 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsAdd4th(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by reduce_bound().

◆ graph_get2nextTermPaths()

void graph_get2nextTermPaths ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path2,
int *  vbase2,
int *  state2 
)

gets non-terminal shortest paths to 2 closest terminal for each non-terminal NOTE: legacy wrapper

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path2path data structure (leading to first, second terminal)
vbase2first, second and third nearest terminal to each non terminal
state2array to mark the state of each node during calculation

Definition at line 1542 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsSetAll2(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by getRedCost2ndNextDistances(), redcosts_initializeDistances(), and reduce_daSlackPrune().

◆ graph_get3nextTermPaths()

void graph_get3nextTermPaths ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path3,
int *  vbase3,
int *  state3 
)

gets non-terminal shortest paths to 3 closest terminal for each non-terminal NOTE: legacy wrapper

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path3path data structure (leading to first, second and third nearest terminal)
vbase3first, second and third nearest terminal to each non terminal
state3array to mark the state of each node during calculation

Definition at line 1562 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsSetAll3(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by redcosts_initializeDistances().

◆ graph_get4nextTermPaths()

void graph_get4nextTermPaths ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
PATH path4,
int *  vbase4,
int *  state4 
)

gets non-terminal shortest paths to 4 closest terminal for each non-terminal NOTE: legacy wrapper

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
path4path data struture (leading to first, second, third and fouth nearest terminal)
vbase4first, second and third nearest terminal to each non terminal
state4array to mark the state of each node during calculation

Definition at line 1582 of file graph_tpath.c.

References graph_get_nNodes(), graph_tpathsSetAll4(), nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by reduce_sd(), and reduce_sdPc().

◆ graph_get4nextTTerms()

SCIP_RETCODE graph_get4nextTTerms ( SCIP scip,
GRAPH g,
const SCIP_Real cost,
PATH path,
int *  vbase,
int *  heap,
int *  state 
)

get 4 close terminals to each terminal

Parameters
scipSCIP data structure
ggraph data structure
costedge costs
pathpath data structure (leading to first, second, third and fourth nearest terminal)
vbasefirst, second and third nearest terminal to each non terminal
heaparray representing a heap
statearray to mark the state of each node during calculation

Definition at line 1601 of file graph_tpath.c.

References shortest_path::dist, EAT_LAST, GRAPH::edges, FARAWAY, graph_mark(), graph_pc_isPcMw(), GRAPH::head, Is_term, GRAPH::knots, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, GRAPH::tail, GRAPH::term, UNKNOWN, and utdist().

Referenced by reduce_bound(), and reduce_sdPc().

◆ graph_tpathsInit()

SCIP_RETCODE graph_tpathsInit ( SCIP scip,
GRAPH g,
TPATHS **  tpaths 
)

initializes TPATHS structure

Parameters
scipSCIP
ggraph NOTE: will mark the graph, thus not const :( terrible design
tpathsthe terminal paths

Definition at line 1682 of file graph_tpath.c.

References SCIP_CALL, SCIP_OKAY, STP_TPATHS_NTERMBASES, tpathsAlloc(), and tpathsBuild().

Referenced by reduce_sdInit(), testBiasedTerminalPathsTo4NextFound(), testTerminalPathsRepair(), testTerminalPathsRepair2(), testTerminalPathsRepair3(), and testTerminalPathsTo3NextFound().

◆ graph_tpathsInitBiased()

SCIP_RETCODE graph_tpathsInitBiased ( SCIP scip,
const SDPROFIT sdprofit,
GRAPH g,
TPATHS **  tpaths 
)

initializes biased TPATHS structure

Parameters
scipSCIP
sdprofitSD profit
ggraph NOTE: will mark the graph, thus not const :( terrible design
tpathsthe terminal paths

Definition at line 1700 of file graph_tpath.c.

References SCIP_CALL, SCIP_OKAY, STP_TPATHS_NTERMBASES, tpathsAlloc(), and tpathsBuildBiased().

Referenced by reduce_sdInitBiased(), reduce_sdInitBiasedBottleneck(), and testSdGraphStrongBiasedDistsAreValid().

◆ graph_tpathsRepairSetUp()

◆ graph_tpathsRepair()

SCIP_RETCODE graph_tpathsRepair ( SCIP scip,
int  edge,
SCIP_Bool  withEdgeReplacement,
const GRAPH g,
TPATHS tpaths 
)

repairs TPATHS structure for imminent edge deletion

Parameters
scipSCIP
edgeedge about to be eliminated
withEdgeReplacementwith edge replacement?
ggraph
tpathsthe terminal paths

Definition at line 1744 of file graph_tpath.c.

References graph_edge_isInRange(), graph_isMarked(), NULL, SCIP_CALL, SCIP_OKAY, STP_TPATHS_NTERMBASES, STP_Vectype, nodes_to_terminal_paths::termbases_org, tpathsRepair1st(), tpathsRepair2nd(), tpathsRepair3rd(), tpathsRepair4th(), tpathsRepairExit(), and tpathsRepairInit().

Referenced by reduce_sdRepair(), testTerminalPathsRepair(), testTerminalPathsRepair2(), and testTerminalPathsRepair3().

◆ graph_tpathsRecomputeBiased()

SCIP_RETCODE graph_tpathsRecomputeBiased ( const SDPROFIT sdprofit,
GRAPH g,
TPATHS tpaths 
)

recomputes biased TPATHS structure

Parameters
sdprofitSD profit
ggraph NOTE: will mark the graph, thus not const :( terrible design
tpathsthe terminal paths

Definition at line 1776 of file graph_tpath.c.

References SCIP_OKAY, STP_TPATHS_NTERMBASES, and tpathsBuildBiased().

Referenced by reduce_impliedProfitBased(), and reduce_impliedProfitBasedRpc().

◆ graph_tpathsPrintForNode()

void graph_tpathsPrintForNode ( const GRAPH g,
const SDPROFIT sdprofit,
const TPATHS tpaths,
int  node 
)

prints terminal paths from given node

Parameters
ggraph data structure
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths
nodenode to start from

Definition at line 1793 of file graph_tpath.c.

References shortest_path::dist, graph_get_nNodes(), graph_knot_isInRange(), graph_knot_printInfo(), Is_term, nodes_to_terminal_paths::nnodes, STP_TPATHS_NTERMBASES, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsPrintPath(), and UNKNOWN.

◆ graph_tpathsGetProfitNodes()

void graph_tpathsGetProfitNodes ( SCIP scip,
const GRAPH g,
const TPATHS tpaths,
const SDPROFIT sdprofit,
int  start,
int  base,
STP_Vectype(int)  profitnodes 
)

gets nodes with positive profit on path

Parameters
scipSCIP
ggraph data structure
tpathsstorage for terminal paths
sdprofitSD bias for nodes
startstart vertex
basebase vertex (terminal)
profitnodesNOTE: needs to be of capacity at least g->knots!

Definition at line 1842 of file graph_tpath.c.

References shortest_path::edge, graph_edge_isInRange(), graph_get_nNodes(), graph_knot_isInRange(), GT, Is_term, GRAPH::knots, nodes_to_terminal_paths::nnodes, reduce_sdprofitGetProfit(), SCIP_Real, STP_TPATHS_NTERMBASES, StpVecClear, StpVecGetcapacity, StpVecGetSize, StpVecPushBack, GRAPH::tail, GRAPH::term, nodes_to_terminal_paths::termbases, and nodes_to_terminal_paths::termpaths.

Referenced by sdgraphUpdateDistgraphFromTpaths().

◆ graph_tpathsAdd1st()

void graph_tpathsAdd1st ( const GRAPH g,
const SCIP_Real cost,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

Computes next terminal to all non-terminal nodes. Essentially a Voronoi diagram

Parameters
ggraph data structure
costedge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 1932 of file graph_tpath.c.

References FARAWAY, graph_get_nNodes(), Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::path_heap, nodes_to_terminal_paths::state, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsScan1st(), and UNKNOWN.

Referenced by graph_add1stTermPaths(), graph_tpathsSetAll2(), graph_tpathsSetAll3(), and graph_tpathsSetAll4().

◆ graph_tpathsAdd2nd()

void graph_tpathsAdd2nd ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 2nd next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 1987 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), SCIP_Real, nodes_to_terminal_paths::state, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), tpathsResetMembers(), and tpathsScan2nd().

Referenced by graph_add2ndTermPaths(), graph_tpathsSetAll2(), graph_tpathsSetAll3(), and graph_tpathsSetAll4().

◆ graph_tpathsAdd3rd()

void graph_tpathsAdd3rd ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 3rd next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 2044 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), SCIP_Real, nodes_to_terminal_paths::state, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), tpathsResetMembers(), and tpathsScan3rd().

Referenced by graph_add3rdTermPaths(), graph_tpathsSetAll3(), and graph_tpathsSetAll4().

◆ graph_tpathsAdd4th()

void graph_tpathsAdd4th ( const GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 4th next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 2112 of file graph_tpath.c.

References EAT_LAST, graph_get_nNodes(), GT, GRAPH::head, Is_term, GRAPH::mark, nodes_to_terminal_paths::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, pathheapCorrectDist(), SCIP_Real, nodes_to_terminal_paths::state, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, tpathsGetDistNew(), tpathsResetMembers(), and tpathsScan4th().

Referenced by graph_add4thTermPaths(), and graph_tpathsSetAll4().

◆ graph_tpathsSetAll2()

void graph_tpathsSetAll2 ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 2 next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 2180 of file graph_tpath.c.

References EPSILON, graph_get_nNodes(), graph_mark(), graph_pc_isPcMw(), graph_tpathsAdd1st(), graph_tpathsAdd2nd(), LE_FEAS_EPS, nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by graph_get2nextTermPaths().

◆ graph_tpathsSetAll3()

void graph_tpathsSetAll3 ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 3 next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 2219 of file graph_tpath.c.

References EPSILON, graph_get_nNodes(), graph_mark(), graph_pc_isPcMw(), graph_tpathsAdd1st(), graph_tpathsAdd2nd(), graph_tpathsAdd3rd(), LE_FEAS_EPS, nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by graph_get3nextTermPaths().

◆ graph_tpathsSetAll4()

void graph_tpathsSetAll4 ( GRAPH g,
const SCIP_Real cost,
const SCIP_Real costrev,
const SDPROFIT sdprofit,
TPATHS tpaths 
)

computes 4 next terminal to all non-terminal nodes

Parameters
ggraph data structure
costedge costs
costrevreversed edge costs
sdprofitSD bias for nodes or NULL
tpathsstorage for terminal paths

Definition at line 2260 of file graph_tpath.c.

References graph_get_nNodes(), graph_mark(), graph_tpathsAdd1st(), graph_tpathsAdd2nd(), graph_tpathsAdd3rd(), graph_tpathsAdd4th(), LE, nodes_to_terminal_paths::nnodes, NULL, and nodes_to_terminal_paths::termpaths.

Referenced by graph_get4nextTermPaths(), testBiasedTerminalPathsTo4NextFound(), testTerminalPathsRepair(), testTerminalPathsRepair2(), testTerminalPathsRepair3(), testTerminalPathsTo3NextFound(), tpathsBuild(), and tpathsBuildBiased().

◆ graph_tpathsFree()

◆ graph_tpathsGetClosestTerm()

void graph_tpathsGetClosestTerm ( const GRAPH g,
const TPATHS tpaths,
int  node,
int *RESTRICT  closeterm,
int *RESTRICT  firstedge,
SCIP_Real *RESTRICT  closeterm_dist 
)

gets (up to) four close terminals to given node i; with strict upper bound on allowed distances

Parameters
ggraph
tpathsthe terminal paths
nodenode
closetermterminal
firstedgecorresponding first edge (can be NULL)
closeterm_distterminal distance

Definition at line 2322 of file graph_tpath.c.

References shortest_path::dist, shortest_path::edge, graph_knot_isInRange(), Is_term, GRAPH::term, nodes_to_terminal_paths::termbases, nodes_to_terminal_paths::termpaths, and UNKNOWN.

◆ graph_tpathsGet3CloseTerms()

void graph_tpathsGet3CloseTerms ( const GRAPH g,
const TPATHS tpaths,
int  node,
SCIP_Real  maxdist_strict,
int *RESTRICT  closeterms,
int *RESTRICT  firstedges,
SCIP_Real *RESTRICT  closeterms_dist,
int *RESTRICT  ncloseterms 
)

gets (up to) three close terminals to given node i; with strict upper bound on allowed distances

Parameters
ggraph
tpathsthe terminal paths
nodenode
maxdist_strictmaximum valid distance (strict)
closetermsthree close terminals
firstedgescorresponding first edge (can be NULL)
closeterms_distthree close terminal distance
nclosetermsnumber of close terminals found

Definition at line 2356 of file graph_tpath.c.

References SCIP_Bool, tpathsGetKCloseTerms(), and TRUE.

◆ graph_tpathsGet4CloseTerms()

void graph_tpathsGet4CloseTerms ( const GRAPH g,
const TPATHS tpaths,
int  node,
SCIP_Real  maxdist_strict,
int *RESTRICT  closeterms,
int *RESTRICT  firstedges,
SCIP_Real *RESTRICT  closeterms_dist,
int *RESTRICT  ncloseterms 
)

gets (up to) four close terminals to given node i; with strict upper bound on allowed distances

Parameters
ggraph
tpathsthe terminal paths
nodenode
maxdist_strictmaximum valid distance (strict)
closetermsfour close terminals
firstedgescorresponding first edge (can be NULL)
closeterms_distfour close terminal distance
nclosetermsnumber of close terminals found

Definition at line 2374 of file graph_tpath.c.

References SCIP_Bool, tpathsGetKCloseTerms(), and TRUE.

◆ graph_tpathsGet4CloseTermsLE()

void graph_tpathsGet4CloseTermsLE ( const GRAPH g,
const TPATHS tpaths,
int  node,
SCIP_Real  maxdist_nonstrict,
int *RESTRICT  closeterms,
int *RESTRICT  firstedges,
SCIP_Real *RESTRICT  closeterms_dist,
int *RESTRICT  ncloseterms 
)

gets (up to) four close terminals to given node i with non-strict upper bound on allowed distances

Parameters
ggraph
tpathsthe terminal paths
nodenode
maxdist_nonstrictmaximum valid distance (not strict)
closetermsfour close terminals
firstedgescorresponding first edge (can be NULL)
closeterms_distfour close terminal distance
nclosetermsnumber of close terminals found

Definition at line 2392 of file graph_tpath.c.

References FALSE, SCIP_Bool, and tpathsGetKCloseTerms().