Scippy

SCIP

Solving Constraint Integer Programs

shortestpath.h File Reference

Detailed Description

Shortest path based algorithms for Steiner problems.

Author
Daniel Rehfeldt

This file encompasses various shortest path based algorithms. Note: This file is supposed to replace graph_path.c in the long run, as it includes faster implementations.

Definition in file shortestpath.h.

#include "graph.h"

Go to the source code of this file.

Data Structures

struct  stortest_path_prizecollecting
 
struct  stortest_paths
 

Typedefs

typedef struct stortest_path_prizecollecting SPATHSPC
 
typedef struct stortest_paths SPATHS
 

Functions

SCIP_RETCODE shortestpath_pcInit (SCIP *, const GRAPH *, const SCIP_Real *, const SCIP_Real *, SPATHSPC **)
 
void shortestpath_pcFree (SCIP *, SPATHSPC **)
 
void shortestpath_pcReset (SPATHSPC *)
 
void shortestpath_pcConnectNode (const GRAPH *, const STP_Bool *, int, SPATHSPC *)
 
void shortestpath_computeSteinerTree (const GRAPH *, int, SPATHS *)
 
void shortestpath_computeSteinerTreeBiased (const GRAPH *, const SDPROFIT *, int, SPATHS *)
 
void shortestpath_computeSteinerTreeDirected (SCIP *, const GRAPH *, int, SPATHS *)
 
void shortestpath_computeSteinerTreePcMw (const GRAPH *, int, const SCIP_Real *, SCIP_Bool, SPATHSPC *, SPATHS *)
 
void shortestpath_computeSteinerTreeRpcMw (const GRAPH *, int, const SCIP_Real *, SPATHSPC *, SPATHS *)
 
void shortestpath_computeSteinerTreePcMwFull (const GRAPH *, int, SPATHS *)
 

Typedef Documentation

◆ SPATHSPC

information needed for prize-collecting problems

◆ SPATHS

typedef struct stortest_paths SPATHS

information for shortest paths

Function Documentation

◆ shortestpath_pcInit()

SCIP_RETCODE shortestpath_pcInit ( SCIP scip,
const GRAPH graph,
const SCIP_Real costs,
const SCIP_Real prizes,
SPATHSPC **  sppc 
)

initializes

Parameters
scipSCIP data structure
graphgraph data structure
costscost for edges (might be negative for MWCS or RMWCS)
prizesprizes for all nodes
sppcPC/MW shortest path data

Definition at line 893 of file shortestpath.c.

References EAT_LAST, GRAPH::extended, FARAWAY, graph_get_nNodes(), graph_pc_isPcMw(), GRAPH::ieat, GRAPH::inpbeg, Is_pseudoTerm, nnodes, nterms, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocMemory, SCIPallocMemoryArray, SCIPsortDownRealInt(), STP_MWCSP, STP_RMWCSP, GRAPH::stp_type, GRAPH::term, and GRAPH::terms.

Referenced by runTmPcMW_mode().

◆ shortestpath_pcFree()

void shortestpath_pcFree ( SCIP scip,
SPATHSPC **  sppc 
)

frees

Parameters
scipSCIP data structure
sppcPC/MW shortest path data

Definition at line 964 of file shortestpath.c.

References SCIPfreeMemory, and SCIPfreeMemoryArray.

Referenced by runTmPcMW_mode().

◆ shortestpath_pcReset()

◆ shortestpath_pcConnectNode()

void shortestpath_pcConnectNode ( const GRAPH g,
const STP_Bool connected,
int  node_connected,
SPATHSPC sppc 
)

update maximum prize

Parameters
ggraph data structure
connectedarray to mark whether a vertex is part of computed Steiner tree
node_connectednode that is removed
sppcPC data

Definition at line 991 of file shortestpath.c.

References EQ, stortest_path_prizecollecting::maxoutprize, stortest_path_prizecollecting::maxoutprize_idx, stortest_path_prizecollecting::orderedprizes, stortest_path_prizecollecting::orderedprizes_id, and SCIP_Real.

Referenced by computeSteinerTree_connectPseudoTerm(), computeSteinerTree_execPcMw(), computeSteinerTree_execRpcMw(), graph_path_st_pcmw(), graph_path_st_rpcmw(), and stPcmwConnectNode().

◆ shortestpath_computeSteinerTree()

void shortestpath_computeSteinerTree ( const GRAPH g,
int  startnode,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree

Parameters
ggraph data structure
startnodestart vertex
spathsshortest paths data

Definition at line 1033 of file shortestpath.c.

References computeSteinerTree_allTermsAreReached(), computeSteinerTree_exec(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, graph_typeIsSpgLike(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, and stortest_paths::nodes_pred.

Referenced by computeSteinerTreeCsr(), and computeSteinerTreeKeyNodesCsr().

◆ shortestpath_computeSteinerTreeBiased()

void shortestpath_computeSteinerTreeBiased ( const GRAPH g,
const SDPROFIT sdprofit,
int  startnode,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree

Parameters
ggraph data structure
sdprofitimplied profit data structure
startnodestart vertex
spathsshortest paths data

Definition at line 1081 of file shortestpath.c.

References computeSteinerTree_allTermsAreReached(), computeSteinerTree_execBiased(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, graph_typeIsSpgLike(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, and stortest_paths::nodes_pred.

Referenced by computeSteinerTreeCsr(), and computeSteinerTreeKeyNodesCsr().

◆ shortestpath_computeSteinerTreeDirected()

void shortestpath_computeSteinerTreeDirected ( SCIP scip,
const GRAPH g,
int  startnode,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree

Parameters
scipSCIP data structure
ggraph data structure
startnodestart vertex
spathsshortest paths data

Definition at line 1055 of file shortestpath.c.

References computeSteinerTree_allTermsAreReached(), computeSteinerTree_execDirected(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, graph_typeIsDirected(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, stortest_paths::nodes_pred, SCIPdebugMessage, and GRAPH::source.

Referenced by computeSteinerTreeCsr().

◆ shortestpath_computeSteinerTreePcMw()

void shortestpath_computeSteinerTreePcMw ( const GRAPH g,
int  startnode,
const SCIP_Real prize,
SCIP_Bool  costIsBiased,
SPATHSPC spaths_pc,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree in PC/MW case

Parameters
ggraph data structure
startnodestart vertex
prize(possibly biased) prize
costIsBiasedis cost biased?
spaths_pcPC/MW shortest paths data
spathsshortest paths data

Definition at line 1104 of file shortestpath.c.

References computeSteinerTree_execPcMw(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, GRAPH::extended, graph_pc_isPcMw(), graph_pc_isRootedPcMw(), graph_pc_knotIsDummyTerm(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, and stortest_paths::nodes_pred.

Referenced by computeSteinerTreeDijkPcMw().

◆ shortestpath_computeSteinerTreeRpcMw()

void shortestpath_computeSteinerTreeRpcMw ( const GRAPH g,
int  startnode,
const SCIP_Real prize,
SPATHSPC spaths_pc,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree in rooted PC/MW case

Parameters
ggraph data structure
startnodestart vertex
prize(possibly biased) prize
spaths_pcPC/MW shortest paths data
spathsshortest paths data

Definition at line 1129 of file shortestpath.c.

References computeSteinerTree_execRpcMw(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, GRAPH::extended, graph_pc_isRootedPcMw(), graph_pc_knotIsDummyTerm(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, and stortest_paths::nodes_pred.

Referenced by computeSteinerTreeDijkPcMw().

◆ shortestpath_computeSteinerTreePcMwFull()

void shortestpath_computeSteinerTreePcMwFull ( const GRAPH g,
int  startnode,
SPATHS spaths 
)

shortest path based heuristic for computing a Steiner tree in PC/MW case that contains all (potential and fixed) terminals

Parameters
ggraph data structure
startnodestart vertex
spathsshortest paths data

Definition at line 1153 of file shortestpath.c.

References computeSteinerTree_execPcMwFull(), computeSteinerTree_init(), stortest_paths::csr, stortest_paths::dheap, GRAPH::extended, graph_pc_isPcMw(), graph_pc_knotIsDummyTerm(), GRAPH::knots, stortest_paths::nodes_dist, stortest_paths::nodes_isConnected, and stortest_paths::nodes_pred.

Referenced by computeSteinerTreeDijkPcMwFull().