Scippy

SCIP

Solving Constraint Integer Programs

graph_path.c File Reference

Detailed Description

Shortest path based graph algorithms for Steiner problems.

Author
Thorsten Koch
Henriette Franz
Daniel Rehfeldt

This file encompasses various (heap-based) shortest path based algorithms including Dijkstra's algorithm.

Definition in file graph_path.c.

#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <assert.h>
#include "portab.h"
#include "graph.h"
#include "graphheaps.h"
#include "shortestpath.h"
#include "solstp.h"

Go to the source code of this file.

Functions

static void pathheapCorrect (int *RESTRICT heap, int *RESTRICT state, int *RESTRICT count, PATH *RESTRICT path, int l, int k, int edge, SCIP_Real cost, int mode)
 
static int pathheapGetNearest (int *RESTRICT heap, int *RESTRICT state, int *RESTRICT count, const PATH *path)
 
static void pathheapReset (PATH *RESTRICT path, int *RESTRICT heap, int *RESTRICT state, int *RESTRICT count, int node)
 
static void stPcmwConnectNode (int k, const GRAPH *g, SPATHSPC *spaths_pc, SCIP_Real *pathdist, int *pathedge, STP_Bool *connected, int *count, int *nterms)
 
static void stPcmwInit (GRAPH *g, SCIP_Real *pathdist, int *pathedge, STP_Bool *connected, int *npseudoterms)
 
static void stRpcmwInit (GRAPH *g, SCIP_Real *pathdist, int *pathedge, STP_Bool *connected, int *nrealterms)
 
static SCIP_Bool stDcTermIsConnectable (const GRAPH *g, int term, const int *deg_free, const int *pathedge, const STP_Bool *connected)
 
static void sdDcExtendTree (const GRAPH *g, const SCIP_Real *cost, int *heapsize, int *pathdeg_free, int *nodedeg_free, SCIP_Real *pathdist, int *pathedge, STP_Bool *connected, int *result, int *soldegfree, int *nsolterms)
 
void graph_pathHeapAdd (const PATH *path, int node, int *RESTRICT heap, int *RESTRICT state, int *count)
 
SCIP_RETCODE graph_path_init (SCIP *scip, GRAPH *g)
 
SCIP_Bool graph_path_exists (const GRAPH *g)
 
void graph_path_exit (SCIP *scip, GRAPH *g)
 
void graph_path_exec (SCIP *scip, const GRAPH *g, int mode, int start, const SCIP_Real *cost, PATH *path)
 
void graph_pathInLimitedExec (const GRAPH *g, const SCIP_Real *edges_cost, const SCIP_Bool *nodes_abort, int startnode, DIJK *dijkdata, SCIP_Real *abortdistance)
 
void graph_sdPaths (const GRAPH *g, PATH *path, const SCIP_Real *cost, SCIP_Real distlimit, int *heap, int *state, int *memlbl, int *nlbl, int tail, int head, int limit)
 
void graph_path_PcMwSd (SCIP *scip, const GRAPH *g, PATH *path, SCIP_Real *cost, SCIP_Real distlimit, int *pathmaxnode, int *heap, int *state, int *stateblock, int *memlbl, int *nlbl, int tail, int head, int limit)
 
void graph_path_execX (SCIP *scip, const GRAPH *g, int start, const SCIP_Real *cost, SCIP_Real *pathdist, int *pathedge)
 
void graph_path_invroot (SCIP *scip, const GRAPH *g, int start, const SCIP_Real *cost, SCIP_Real *pathdist, int *pathedge)
 
void graph_path_st_pcmw_extendOut (SCIP *scip, const GRAPH *g, int start, STP_Bool *connected, SCIP_Real *dist, int *pred, STP_Bool *connected_out, DHEAP *dheap, SCIP_Bool *success)
 
void graph_path_st (const GRAPH *g, const SCIP_Real *cost, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected)
 
SCIP_RETCODE graph_path_st_dc (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected, int *result, STP_Bool *solFound)
 
void graph_path_st_pcmw (GRAPH *g, SCIP_Real *orderedprizes, int *orderedprizes_id, const SCIP_Real *cost, const SCIP_Real *prize, SCIP_Bool costIsBiased, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected)
 
void graph_path_st_pcmw_reduce (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, SCIP_Real *tmpnodeweight, int *result, int start, STP_Bool *connected)
 
void graph_path_st_pcmw_full (GRAPH *g, const SCIP_Real *cost, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected)
 
void graph_path_st_pcmw_extend (SCIP *scip, const GRAPH *g, const SCIP_Real *cost, SCIP_Bool breakearly, PATH *path, STP_Bool *connected, SCIP_Bool *extensions)
 
void graph_path_st_pcmw_extendBiased (SCIP *scip, GRAPH *g, const SCIP_Real *cost, const SCIP_Real *prize, PATH *path, STP_Bool *connected, SCIP_Bool *extensions)
 
void graph_path_st_rpcmw (GRAPH *g, SCIP_Real *orderedprizes, int *orderedprizes_id, const SCIP_Real *cost, const SCIP_Real *prize, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected)
 
SCIP_RETCODE graph_path_st_brmwcs (SCIP *scip, GRAPH *g, const SCIP_Real *prize, SCIP_Real *pathdist, int *pathedge, int start, STP_Bool *connected, SCIP_Bool *solfound)
 

Function Documentation

◆ pathheapCorrect()

static void pathheapCorrect ( int *RESTRICT  heap,
int *RESTRICT  state,
int *RESTRICT  count,
PATH *RESTRICT  path,
int  l,
int  k,
int  edge,
SCIP_Real  cost,
int  mode 
)
inlinestatic

◆ pathheapGetNearest()

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

◆ pathheapReset()

static void pathheapReset ( PATH *RESTRICT  path,
int *RESTRICT  heap,
int *RESTRICT  state,
int *RESTRICT  count,
int  node 
)
inlinestatic

resets node

Definition at line 134 of file graph_path.c.

References GT.

Referenced by graph_path_st_pcmw_extend(), and graph_path_st_pcmw_extendBiased().

◆ stPcmwConnectNode()

static void stPcmwConnectNode ( int  k,
const GRAPH g,
SPATHSPC spaths_pc,
SCIP_Real pathdist,
int *  pathedge,
STP_Bool connected,
int *  count,
int *  nterms 
)
inlinestatic

connect given node to tree

Parameters
kthe vertex
ggraph data structure
spaths_pcshortest paths data
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
connectedarray to mark whether a vertex is part of computed Steiner tree
countfor the heap
ntermsterminal count

Definition at line 170 of file graph_path.c.

References Is_pseudoTerm, GRAPH::path_heap, GRAPH::path_state, resetX(), shortestpath_pcConnectNode(), GRAPH::tail, GRAPH::term, and TRUE.

Referenced by graph_path_st_pcmw().

◆ stPcmwInit()

static void stPcmwInit ( GRAPH g,
SCIP_Real pathdist,
int *  pathedge,
STP_Bool connected,
int *  npseudoterms 
)
inlinestatic

initialize

Parameters
ggraph data structure
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
connectedarray to mark whether a vertex is part of computed Steiner tree
npseudotermsnumber of pseudo terminals

Definition at line 209 of file graph_path.c.

References FALSE, FARAWAY, GRAPH::grad, graph_get_nNodes(), Is_pseudoTerm, Is_term, GRAPH::mark, nnodes, GRAPH::path_state, GRAPH::term, and UNKNOWN.

Referenced by graph_path_st_pcmw(), and graph_path_st_pcmw_full().

◆ stRpcmwInit()

static void stRpcmwInit ( GRAPH g,
SCIP_Real pathdist,
int *  pathedge,
STP_Bool connected,
int *  nrealterms 
)
inlinestatic

initialize

Parameters
ggraph data structure
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
connectedarray to mark whether a vertex is part of computed Steiner tree
nrealtermsnumber of real terminals

Definition at line 240 of file graph_path.c.

References FALSE, FARAWAY, graph_get_nNodes(), graph_pc_knotIsFixedTerm(), graph_pc_markOrgGraph(), Is_pseudoTerm, GRAPH::mark, nnodes, GRAPH::path_state, GRAPH::source, GRAPH::term, and UNKNOWN.

Referenced by graph_path_st_pcmw_full(), and graph_path_st_rpcmw().

◆ stDcTermIsConnectable()

static SCIP_Bool stDcTermIsConnectable ( const GRAPH g,
int  term,
const int *  deg_free,
const int *  pathedge,
const STP_Bool connected 
)
inlinestatic

For DCSTP can terminal be connected to current tree?

Parameters
ggraph data structure
termterminal to be checked
deg_freefree degree of each node
pathedgepredecessor edge array (on vertices)
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 278 of file graph_path.c.

References FALSE, Is_term, SCIPdebugMessage, STP_DCSTP, GRAPH::stp_type, GRAPH::tail, GRAPH::term, and TRUE.

Referenced by sdDcExtendTree().

◆ sdDcExtendTree()

static void sdDcExtendTree ( const GRAPH g,
const SCIP_Real cost,
int *  heapsize,
int *  pathdeg_free,
int *  nodedeg_free,
SCIP_Real pathdist,
int *  pathedge,
STP_Bool connected,
int *  result,
int *  soldegfree,
int *  nsolterms 
)
static

For DCSTP: extends (implicitly) given tree

Parameters
ggraph data structure
costedgecosts
heapsizeheap size
pathdeg_freecurrently available degree of path
nodedeg_freecurrently available degree of node
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
connectedarray to mark whether a vertex is part of computed Steiner tree
resultsolution array
soldegfreeper node: solution degree
nsoltermsnumber of solution terminals

Definition at line 327 of file graph_path.c.

References CONNECT, correctX(), EAT_LAST, EQ, GT, GRAPH::head, Is_term, nearestX(), GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, resetX(), SCIPdebugMessage, stDcTermIsConnectable(), GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

Referenced by graph_path_st_dc().

◆ graph_pathHeapAdd()

void graph_pathHeapAdd ( const PATH path,
int  node,
int *RESTRICT  heap,
int *RESTRICT  state,
int *  count 
)

adds element 'node' to heap

Definition at line 442 of file graph_path.c.

References GT.

◆ graph_path_init()

SCIP_RETCODE graph_path_init ( SCIP scip,
GRAPH g 
)

◆ graph_path_exists()

SCIP_Bool graph_path_exists ( const GRAPH g)

existing?

Parameters
ggraph data structure

Definition at line 497 of file graph_path.c.

References NULL, GRAPH::path_heap, and GRAPH::path_state.

Referenced by graph_free(), reduce_exec(), and substpsolver_solve().

◆ graph_path_exit()

◆ graph_path_exec()

◆ graph_pathInLimitedExec()

void graph_pathInLimitedExec ( const GRAPH g,
const SCIP_Real edges_cost,
const SCIP_Bool nodes_abort,
int  startnode,
DIJK dijkdata,
SCIP_Real abortdistance 
)

limited Dijkstra on incoming edges

Parameters
ggraph data structure
edges_costedge cost
nodes_abortnodes to abort at
startnodestart
dijkdataDijkstra data
abortdistancedistance at which abort happened

Definition at line 610 of file graph_path.c.

References CONNECT, dijkstra_data::dheap, FARAWAY, graph_heap_correct(), graph_heap_deleteMinReturnNode(), graph_knot_isInRange(), GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, LT, dijkstra_data::node_distance, dijkstra_data::node_visited, dijkstra_data::nvisits, dijkstra_heap::position, SCIP_Real, dijkstra_heap::size, GRAPH::tail, TRUE, UNKNOWN, and dijkstra_data::visitlist.

Referenced by dapathsRunShortestPaths().

◆ graph_sdPaths()

void graph_sdPaths ( const GRAPH g,
PATH path,
const SCIP_Real cost,
SCIP_Real  distlimit,
int *  heap,
int *  state,
int *  memlbl,
int *  nlbl,
int  tail,
int  head,
int  limit 
)

limited Dijkstra, stopping at terminals

Parameters
ggraph data structure
pathshortest paths data structure
costedge costs
distlimitdistance limit of the search
heaparray representing a heap
statearray to indicate whether a node has been scanned during SP calculation
memlblarray to save labelled nodes
nlblnumber of labelled nodes
tailtail of the edge
headhead of the edge
limitmaximum number of edges to consider during execution

Definition at line 684 of file graph_path.c.

References CONNECT, shortest_path::dist, FALSE, FARAWAY, FSP_MODE, GE, GRAPH::grad, graph_pc_isMw(), graph_typeIsUndirected(), GT, GRAPH::head, Is_term, GRAPH::mark, NULL, GRAPH::oeat, GRAPH::outbeg, pathheapCorrect(), pathheapGetNearest(), SCIP_Bool, GRAPH::term, TRUE, and UNKNOWN.

Referenced by reduce_getSdByPaths(), reduce_sdsp(), and reduce_sdspSap().

◆ graph_path_PcMwSd()

void graph_path_PcMwSd ( SCIP scip,
const GRAPH g,
PATH path,
SCIP_Real cost,
SCIP_Real  distlimit,
int *  pathmaxnode,
int *  heap,
int *  state,
int *  stateblock,
int *  memlbl,
int *  nlbl,
int  tail,
int  head,
int  limit 
)

limited Dijkstra for PCSTP, taking terminals into account

Parameters
scipSCIP data structure
ggraph data structure
pathshortest paths data structure
costedge costs
distlimitdistance limit of the search
pathmaxnodemaximum weight node on path
heaparray representing a heap
statearray to indicate whether a node has been scanned during SP calculation
stateblockarray to indicate whether a node has been scanned during previous SP calculation
memlblarray to save labelled nodes
nlblnumber of labelled nodes
tailtail of the edge
headhead of the edge
limitmaximum number of edges to consider during execution

Definition at line 788 of file graph_path.c.

References CONNECT, shortest_path::dist, EAT_LAST, FALSE, FSP_MODE, GRAPH::grad, GRAPH::head, Is_term, GRAPH::mark, NULL, GRAPH::oeat, GRAPH::outbeg, pathheapCorrect(), pathheapGetNearest(), GRAPH::prize, SCIP_Bool, SCIP_Real, SCIPisGT(), SCIPisLE(), STP_MWCSP, GRAPH::stp_type, GRAPH::term, TRUE, and UNKNOWN.

Referenced by reduce_sdsp(), and sdGetSdPcMw().

◆ graph_path_execX()

void graph_path_execX ( SCIP scip,
const GRAPH g,
int  start,
const SCIP_Real cost,
SCIP_Real pathdist,
int *  pathedge 
)

Dijkstra's algorithm starting from node 'start'

Parameters
scipSCIP data structure
ggraph data structure
startstart vertex
costedge costs
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)

Definition at line 905 of file graph_path.c.

References CONNECT, correctX(), EAT_LAST, FARAWAY, GRAPH::head, GRAPH::knots, GRAPH::mark, nearestX(), nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, SCIPisGT(), and UNKNOWN.

Referenced by buildTmAllSp(), computeStarts(), computeTransVoronoi(), getRedCost2ndNextDistances(), redcosts_initializeDistances(), reduce_boundHopR(), reduce_boundHopRc(), reduce_daPcMw(), reduce_daSlackPrune(), and reduce_rpt().

◆ graph_path_invroot()

void graph_path_invroot ( SCIP scip,
const GRAPH g,
int  start,
const SCIP_Real cost,
SCIP_Real pathdist,
int *  pathedge 
)

Dijkstra on incoming edges until root is reached

Parameters
scipSCIP data structure
ggraph data structure
startstart vertex
costedge costs
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)

Definition at line 973 of file graph_path.c.

References CONNECT, correctX(), EAT_LAST, FARAWAY, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::mark, nearestX(), nnodes, NULL, GRAPH::path_heap, GRAPH::path_state, SCIP_Real, SCIPisGT(), GRAPH::source, GRAPH::tail, and UNKNOWN.

◆ graph_path_st_pcmw_extendOut()

void graph_path_st_pcmw_extendOut ( SCIP scip,
const GRAPH g,
int  start,
STP_Bool connected,
SCIP_Real dist,
int *  pred,
STP_Bool connected_out,
DHEAP dheap,
SCIP_Bool success 
)

extension heuristic

Parameters
scipSCIP data structure
ggraph data structure
startstart
connectedarray to mark whether a vertex is part of computed Steiner tree
distdistances array
predpredecessor node
connected_outarray for internal stuff
dheapDijkstra heap
successextension successful?

Definition at line 1051 of file graph_path.c.

References csr_storage::cost, GRAPH::csr_storage, GRAPH::extended, FALSE, FARAWAY, graph_heap_clean(), graph_heap_correct(), graph_heap_deleteMinReturnNode(), graph_pc_isPcMw(), csr_storage::head, Is_term, GRAPH::knots, nnodes, dijkstra_heap::position, GRAPH::prize, SCIP_Real, SCIPisGE(), SCIPisGT(), dijkstra_heap::size, csr_storage::start, GRAPH::term, TRUE, and UNKNOWN.

Referenced by SCIPStpHeurLocalExtendPcMwOut().

◆ graph_path_st()

void graph_path_st ( const GRAPH g,
const SCIP_Real cost,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected 
)

Find a directed tree rooted in node 'start' and spanning all terminals

Parameters
ggraph data structure
costedgecosts
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 1199 of file graph_path.c.

References correctX(), EAT_LAST, FALSE, FARAWAY, GRAPH::head, Is_term, GRAPH::knots, GRAPH::mark, nearestX(), nnodes, nterms, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, resetX(), GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

Referenced by computeSteinerTreeDijk().

◆ graph_path_st_dc()

SCIP_RETCODE graph_path_st_dc ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected,
int *  result,
STP_Bool solFound 
)

For DCSTP: Find a directed tree rooted in node 'start' and spanning all terminals, while respecting degree constraints

Parameters
scipSCIP
ggraph data structure
costedgecosts
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree
resultsolution
solFoundpointer to store whether solution was found

Definition at line 1299 of file graph_path.c.

References BMScopyMemoryArray, FALSE, FARAWAY, graph_get_nEdges(), graph_get_nNodes(), graph_knot_isInRange(), graph_knot_printInfo(), Is_term, GRAPH::maxdeg, nnodes, GRAPH::path_heap, GRAPH::path_state, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPdebugMessage, SCIPfreeBufferArray, sdDcExtendTree(), STP_DCSTP, GRAPH::stp_type, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

◆ graph_path_st_pcmw()

void graph_path_st_pcmw ( GRAPH g,
SCIP_Real orderedprizes,
int *  orderedprizes_id,
const SCIP_Real cost,
const SCIP_Real prize,
SCIP_Bool  costIsBiased,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected 
)

!!!LEGACY CODE!!! Find a tree rooted in node 'start' and connecting positive vertices as long as this is profitable. Note that this function overwrites g->mark.

Parameters
ggraph data structure
orderedprizeslegacy code
orderedprizes_idlegacy code
costedge costs
prize(possibly biased) prize
costIsBiasedis cost biased?
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 1430 of file graph_path.c.

References correctX(), EAT_LAST, GRAPH::extended, FALSE, FARAWAY, graph_pc_isPc(), graph_pc_isPcMw(), graph_pc_isRootedPcMw(), graph_pc_knotIsNonLeafTerm(), GRAPH::head, Is_pseudoTerm, GRAPH::knots, LT, GRAPH::mark, stortest_path_prizecollecting::maxoutprize, nearestX(), nnodes, nterms, GRAPH::oeat, stortest_path_prizecollecting::orderedprizes, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, SCIP_Bool, SCIP_Real, SCIPdebugMessage, shortestpath_pcConnectNode(), shortestpath_pcReset(), stPcmwConnectNode(), stPcmwInit(), GRAPH::tail, GRAPH::term, TRUE, and UNKNOWN.

Referenced by computeSteinerTreeDijkPcMw().

◆ graph_path_st_pcmw_reduce()

void graph_path_st_pcmw_reduce ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
SCIP_Real tmpnodeweight,
int *  result,
int  start,
STP_Bool connected 
)

Reduce given solution Note that this function overwrites g->mark.

Parameters
scipSCIP data structure
ggraph data structure
costedge costs
tmpnodeweightnode weight array
resultincoming arc array
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 1556 of file graph_path.c.

References CONNECT, EAT_LAST, FALSE, GRAPH::head, Is_term, NULL, GRAPH::oeat, GRAPH::outbeg, SCIPfreeBufferArray, SCIPisGE(), GRAPH::term, and UNKNOWN.

◆ graph_path_st_pcmw_full()

void graph_path_st_pcmw_full ( GRAPH g,
const SCIP_Real cost,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected 
)

Find a tree rooted in node 'start' and connecting all positive vertices. Note that this function overwrites g->mark.

Parameters
ggraph data structure
costedge costs
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 1608 of file graph_path.c.

References correctX(), GRAPH::extended, graph_pc_isPcMw(), graph_pc_isRootedPcMw(), graph_pc_knotIsFixedTerm(), GT, GRAPH::head, Is_pseudoTerm, Is_term, GRAPH::knots, GRAPH::mark, nearestX(), nnodes, nterms, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, resetX(), stPcmwInit(), stRpcmwInit(), GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

Referenced by computeSteinerTreeDijkPcMwFull().

◆ graph_path_st_pcmw_extend()

void graph_path_st_pcmw_extend ( SCIP scip,
const GRAPH g,
const SCIP_Real cost,
SCIP_Bool  breakearly,
PATH path,
STP_Bool connected,
SCIP_Bool extensions 
)

greedy extension of a given tree for PC or MW problems

Parameters
scipSCIP data structure
ggraph data structure
costedge costs
breakearlyfinish computation early if no profitable extension possible?
pathshortest paths data structure
connectedarray to mark whether a vertex is part of computed Steiner tree
extensionsextensions performed?

Definition at line 1706 of file graph_path.c.

References shortest_path::dist, EAT_LAST, shortest_path::edge, GRAPH::extended, FALSE, FARAWAY, FSP_MODE, GRAPH::grad, GRAPH::head, Is_pseudoTerm, Is_term, GRAPH::knots, GRAPH::mark, nnodes, nterms, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, pathheapCorrect(), pathheapGetNearest(), pathheapReset(), GRAPH::prize, SCIP_Real, SCIPisGE(), SCIPisGT(), GRAPH::source, GRAPH::tail, GRAPH::term, TRUE, and UNKNOWN.

Referenced by SCIPStpHeurLocalExtendPcMw().

◆ graph_path_st_pcmw_extendBiased()

void graph_path_st_pcmw_extendBiased ( SCIP scip,
GRAPH g,
const SCIP_Real cost,
const SCIP_Real prize,
PATH path,
STP_Bool connected,
SCIP_Bool extensions 
)

greedy extension of a given tree for PC or MW problems; path[i].edge needs to be initialized

Parameters
scipSCIP data structure
ggraph data structure
costedge costs
prize(possibly biased) prize
pathshortest paths data structure with .edge initialized
connectedarray to mark whether a vertex is part of computed Steiner tree
extensionsextensions performed?

Definition at line 1845 of file graph_path.c.

References shortest_path::dist, shortest_path::edge, GRAPH::extended, FALSE, FARAWAY, FSP_MODE, graph_pc_knotIsFixedTerm(), graph_pc_markOrgGraph(), GRAPH::head, Is_pseudoTerm, GRAPH::knots, GRAPH::mark, nnodes, nterms, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, pathheapCorrect(), pathheapGetNearest(), pathheapReset(), SCIP_Real, SCIPisGE(), GRAPH::source, GRAPH::tail, GRAPH::term, TRUE, and UNKNOWN.

◆ graph_path_st_rpcmw()

void graph_path_st_rpcmw ( GRAPH g,
SCIP_Real orderedprizes,
int *  orderedprizes_id,
const SCIP_Real cost,
const SCIP_Real prize,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected 
)

!!!LEGACY CODE!!! Shortest path heuristic for the RMWCSP and RPCSPG Find a directed tree rooted in node 'start' and connecting all terminals as well as all positive vertices (as long as this is profitable).

Parameters
ggraph data structure
orderedprizeslegacy code
orderedprizes_idlegacy code
costedge costs
prize(possibly biased) prize
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree

Definition at line 1988 of file graph_path.c.

References correctX(), GRAPH::extended, FARAWAY, GE, graph_pc_isRootedPcMw(), graph_pc_knotIsDummyTerm(), graph_pc_knotIsFixedTerm(), graph_pc_knotIsNonLeafTerm(), GRAPH::head, Is_anyTerm, Is_pseudoTerm, Is_term, GRAPH::knots, GRAPH::mark, stortest_path_prizecollecting::maxoutprize, nearestX(), nnodes, nterms, GRAPH::oeat, stortest_path_prizecollecting::orderedprizes, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, resetX(), SCIPdebugMessage, shortestpath_pcConnectNode(), shortestpath_pcReset(), stRpcmwInit(), GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

Referenced by computeSteinerTreeDijkPcMw().

◆ graph_path_st_brmwcs()

SCIP_RETCODE graph_path_st_brmwcs ( SCIP scip,
GRAPH g,
const SCIP_Real prize,
SCIP_Real pathdist,
int *  pathedge,
int  start,
STP_Bool connected,
SCIP_Bool solfound 
)

todo refactor, was copied from Henriette's branch

Parameters
scipSCIP data structure
ggraph data structure
prize(possibly biased) prize
pathdistdistance array (on vertices)
pathedgepredecessor edge array (on vertices)
startstart vertex
connectedarray to mark whether a vertex is part of computed Steiner tree
solfoundcould a solution be found?

Definition at line 2146 of file graph_path.c.

References GRAPH::budget, correctX(), GRAPH::costbudget, EAT_LAST, FALSE, FARAWAY, graph_pc_markOrgGraph(), GRAPH::head, Is_term, GRAPH::knots, GRAPH::mark, nearestX(), nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, resetX(), SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, GRAPH::tail, GRAPH::term, GRAPH::terms, TRUE, and UNKNOWN.

Referenced by computeSteinerTreeDijkBMw().