Scippy

SCIP

Solving Constraint Integer Programs

graph_util.c File Reference

Detailed Description

includes graph utility methods for Steiner problems

Author
Daniel Rehfeldt

Graph utility methods for Steiner problems, such as CSR data structure

Definition in file graph_util.c.

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

Go to the source code of this file.

Data Structures

struct  compressed_sparse_storages_depository
 

Macros

#define DHEAP_MAX_KEY   (1e20)
 
#define DHEAP_MIN_KEY   -(1e20)
 

Functions

static SCIP_RETCODE trail (SCIP *scip, const GRAPH *g, int start, SCIP_Bool costAware, SCIP_Bool *nodevisited)
 
static SCIP_Bool csrdepoCsrIsSet (const CSR *csr, SCIP_Bool verbose)
 
static void csrdepoCsrUnsetDebug (CSR *csr)
 
static void csrdepoCleanDebug (CSRDEPO *depository)
 
static SCIP_Real csrdepoCsrWeight (const CSR *csr)
 
static SCIP_Real csrdepoGetTopWeight (const CSRDEPO *depository)
 
static int csrdepoGetTopIndex (const CSRDEPO *depository)
 
static int csrdepoGetNnodes (const CSRDEPO *depository, int index)
 
static int csrdepoGetNedges (const CSRDEPO *depository, int index)
 
static void csrdepoFillCSR (const CSRDEPO *depository, int index, CSR *csr)
 
SCIP_RETCODE graph_trail_arr (SCIP *scip, const GRAPH *g, int start, SCIP_Bool *nodevisited)
 
SCIP_RETCODE graph_trail_costAware (SCIP *scip, const GRAPH *g, int start, SCIP_Bool *nodevisited)
 
SCIP_RETCODE graph_termsReachable (SCIP *scip, const GRAPH *g, SCIP_Bool *reachable)
 
SCIP_RETCODE graph_findCentralTerminal (SCIP *scip, const GRAPH *g, int centertype, int *central_term)
 
void graph_buildOrgNodesToReducedMap (const GRAPH *g, int *map)
 
SCIP_RETCODE graph_csrdepo_init (SCIP *scip, int ncsrs_max, int datasize_max, CSRDEPO **depository)
 
void graph_csrdepo_free (SCIP *scip, CSRDEPO **depository)
 
void graph_csrdepo_getCSR (const CSRDEPO *depository, int index, CSR *csr)
 
void graph_csrdepo_getTopCSR (const CSRDEPO *depository, CSR *csr)
 
int graph_csrdepo_getDataSize (const CSRDEPO *depository)
 
int graph_csrdepo_getNcsrs (const CSRDEPO *depository)
 
void graph_csrdepo_removeTop (CSRDEPO *depository)
 
void graph_csrdepo_clean (CSRDEPO *depository)
 
void graph_csrdepo_addEmptyTop (CSRDEPO *depository, int nnodes, int nedges)
 
void graph_csrdepo_addEmptyTopTree (CSRDEPO *depository, int nnodes)
 
SCIP_Bool graph_csrdepo_isEmpty (const CSRDEPO *depository)
 
SCIP_Bool graph_csrdepo_hasEmptyTop (const CSRDEPO *depository)
 
void graph_csrdepo_getEmptyTop (const CSRDEPO *depository, CSR *csr)
 
void graph_csrdepo_emptyTopSetMarked (CSRDEPO *depository)
 
void graph_csrdepo_print (const CSRDEPO *depository)
 
void graph_heap_clean (SCIP_Bool cleanposition, DHEAP *heap)
 
SCIP_Bool graph_heap_isClean (const DHEAP *heap)
 
SCIP_RETCODE graph_heap_create (SCIP *scip, int capacity, int *position, DENTRY *entries, DHEAP **heap)
 
void graph_heap_free (SCIP *scip, SCIP_Bool freePositions, SCIP_Bool freeEntries, DHEAP **heap)
 
void graph_heap_deleteMin (int *node, SCIP_Real *key, DHEAP *heap)
 
void graph_heap_deleteMinGetNode (int *node, DHEAP *heap)
 
int graph_heap_deleteMinReturnNode (DHEAP *heap)
 
void graph_heap_correct (int node, SCIP_Real newkey, DHEAP *heap)
 
SCIP_RETCODE graph_csr_alloc (SCIP *scip, int nnodes, int nedges, CSR **csr)
 
SCIP_RETCODE graph_csr_allocWithEdgeId (SCIP *scip, int nnodes, int nedges, CSR **csr)
 
void graph_csr_chgCosts (const GRAPH *g, const SCIP_Real *edgecosts, CSR *csr)
 
void graph_csr_build (const GRAPH *g, const SCIP_Real *edgecosts, CSR *csr)
 
void graph_csr_buildCosts (const GRAPH *g, const CSR *csr, const SCIP_Real *edgecosts_g, SCIP_Real *RESTRICT edgecosts_csr)
 
SCIP_Bool graph_csr_costsAreInSync (const GRAPH *g, const CSR *csr, const SCIP_Real *edgecosts_g)
 
void graph_csr_copy (const CSR *csr_in, CSR *csr_out)
 
void graph_csr_print (const CSR *csr)
 
int graph_csr_getNedges (const CSR *csr)
 
void graph_csr_free (SCIP *scip, CSR **csr)
 
SCIP_RETCODE graph_init_csr (SCIP *scip, GRAPH *g)
 
SCIP_RETCODE graph_init_csrWithEdgeId (SCIP *scip, GRAPH *g)
 
void graph_free_csr (SCIP *scip, GRAPH *g)
 
SCIP_Bool graph_csr_isValid (const CSR *csr, SCIP_Bool verbose)
 
SCIP_Bool graph_valid_csr (const GRAPH *g, SCIP_Bool verbose)
 
SCIP_RETCODE graph_init_dcsr (SCIP *scip, GRAPH *g)
 
void graph_free_dcsr (SCIP *scip, GRAPH *g)
 
void graph_update_dcsr (SCIP *scip, GRAPH *g)
 
void graph_dcsr_deleteEdge (DCSR *dcsr, int tail, int e_csr)
 
void graph_dcsr_deleteEdgeBi (SCIP *scip, DCSR *dcsr, int e_csr)
 
SCIP_Bool graph_valid_dcsr (const GRAPH *g, SCIP_Bool verbose)
 
SCIP_RETCODE graph_dijkLimited_init (SCIP *scip, const GRAPH *g, DIJK **dijkdata)
 
SCIP_RETCODE graph_dijkLimited_initPcShifts (SCIP *scip, const GRAPH *g, DIJK *dijkdata)
 
void graph_dijkLimited_clean (const GRAPH *g, DIJK *dijkdata)
 
void graph_dijkLimited_reset (const GRAPH *g, DIJK *dijkdata)
 
void graph_dijkLimited_free (SCIP *scip, DIJK **dijkdata)
 

Macro Definition Documentation

◆ DHEAP_MAX_KEY

#define DHEAP_MAX_KEY   (1e20)

◆ DHEAP_MIN_KEY

#define DHEAP_MIN_KEY   -(1e20)

Definition at line 30 of file graph_util.c.

Referenced by graph_heap_correct(), and graph_heap_create().

Function Documentation

◆ trail()

static SCIP_RETCODE trail ( SCIP scip,
const GRAPH g,
int  start,
SCIP_Bool  costAware,
SCIP_Bool nodevisited 
)
static

traverses the graph from vertex 'start' and marks all reached nodes

Parameters
scipSCIP
gthe new graph
startnode to start from
costAwarebe cost aware?
nodevisitedmarks which node has been visited

Definition at line 60 of file graph_util.c.

References a, GRAPH::cost, EAT_LAST, FALSE, FARAWAY, GE, GRAPH::grad, GRAPH::head, GRAPH::knots, nnodes, GRAPH::oeat, GRAPH::outbeg, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, and TRUE.

Referenced by graph_trail_arr(), and graph_trail_costAware().

◆ csrdepoCsrIsSet()

static SCIP_Bool csrdepoCsrIsSet ( const CSR csr,
SCIP_Bool  verbose 
)
static

has the CSR been initialized?

Parameters
csrpointer to CSR struct to fill
verbosebe verbose?

Definition at line 114 of file graph_util.c.

References csr_storage::cost, FALSE, csr_storage::head, LT, csr_storage::nedges_max, csr_storage::nnodes, csr_storage::start, and TRUE.

Referenced by graph_csrdepo_getTopCSR().

◆ csrdepoCsrUnsetDebug()

static void csrdepoCsrUnsetDebug ( CSR csr)
static

de-initialize CSR (in debug mode)

Parameters
csrpointer to CSR struct to fill

Definition at line 161 of file graph_util.c.

References csr_storage::cost, csr_storage::head, csr_storage::nedges_max, csr_storage::nnodes, and csr_storage::start.

Referenced by graph_csrdepo_removeTop().

◆ csrdepoCleanDebug()

◆ csrdepoCsrWeight()

static SCIP_Real csrdepoCsrWeight ( const CSR csr)
static

gets top CSR edge weight

Parameters
csrpointer to CSR struct to fill

Definition at line 215 of file graph_util.c.

References csr_storage::cost, csr_storage::nedges_max, and SCIP_Real.

Referenced by csrdepoGetTopWeight(), and graph_csrdepo_getTopCSR().

◆ csrdepoGetTopWeight()

static SCIP_Real csrdepoGetTopWeight ( const CSRDEPO depository)
static

gets top CSR edge weight

Parameters
depositorythe depository

Definition at line 232 of file graph_util.c.

References csrdepoCsrWeight(), graph_csrdepo_getCSR(), and compressed_sparse_storages_depository::ncsrs_curr.

Referenced by graph_csrdepo_emptyTopSetMarked().

◆ csrdepoGetTopIndex()

static int csrdepoGetTopIndex ( const CSRDEPO depository)
inlinestatic

◆ csrdepoGetNnodes()

static int csrdepoGetNnodes ( const CSRDEPO depository,
int  index 
)
inlinestatic

gets number of nodes of CSR stored at position 'index'

Parameters
depositorythe depository
indexthe index of the CSR

Definition at line 262 of file graph_util.c.

References compressed_sparse_storages_depository::csr_nnodes, compressed_sparse_storages_depository::csr_ptrsStart, compressed_sparse_storages_depository::ncsrs_curr, and nnodes.

Referenced by csrdepoFillCSR(), and graph_csrdepo_getDataSize().

◆ csrdepoGetNedges()

static int csrdepoGetNedges ( const CSRDEPO depository,
int  index 
)
inlinestatic

gets number of edges of CSR stored at position 'index'

Parameters
depositorythe depository
indexthe index of the CSR

Definition at line 283 of file graph_util.c.

References compressed_sparse_storages_depository::csr_nedges, compressed_sparse_storages_depository::csr_ptrsData, and compressed_sparse_storages_depository::ncsrs_curr.

Referenced by csrdepoFillCSR(), and graph_csrdepo_getDataSize().

◆ csrdepoFillCSR()

◆ graph_trail_arr()

SCIP_RETCODE graph_trail_arr ( SCIP scip,
const GRAPH g,
int  start,
SCIP_Bool nodevisited 
)

traverses the graph from vertex 'start' and marks all reached nodes

Parameters
scipSCIP
gthe new graph
startnode to start from
nodevisitedmarks which node has been visited

Definition at line 336 of file graph_util.c.

References FALSE, SCIP_OKAY, and trail().

Referenced by graph_termsReachable(), graph_valid(), graph_validInput(), reduce_unconnected(), and reduce_unconnectedInfeas().

◆ graph_trail_costAware()

SCIP_RETCODE graph_trail_costAware ( SCIP scip,
const GRAPH g,
int  start,
SCIP_Bool nodevisited 
)

traverses the graph and marks all reached nodes, does not take edge of cost >= FARAWAY

Parameters
scipSCIP
gthe new graph
startnode to start from
nodevisitedmarks which node has been visited

Definition at line 353 of file graph_util.c.

References SCIP_OKAY, trail(), and TRUE.

Referenced by graphisValidPcMw(), pcmwUpdate(), and reduce_unconnectedForDirected().

◆ graph_termsReachable()

SCIP_RETCODE graph_termsReachable ( SCIP scip,
const GRAPH g,
SCIP_Bool reachable 
)

checks whether all terminals are reachable from root

Parameters
scipscip struct
gthe new graph
reachableare they reachable?

Definition at line 370 of file graph_util.c.

References FALSE, graph_trail_arr(), Is_term, GRAPH::knots, nnodes, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, GRAPH::source, GRAPH::term, and TRUE.

◆ graph_findCentralTerminal()

SCIP_RETCODE graph_findCentralTerminal ( SCIP scip,
const GRAPH g,
int  centertype,
int *  central_term 
)

◆ graph_buildOrgNodesToReducedMap()

void graph_buildOrgNodesToReducedMap ( const GRAPH g,
int *  map 
)

builds mapping from original vertices to non-zero degree ones

Parameters
gthe graph
mapmap

Definition at line 560 of file graph_util.c.

References GRAPH::grad, graph_get_nNodes(), nnodes, and UNKNOWN.

◆ graph_csrdepo_init()

◆ graph_csrdepo_free()

◆ graph_csrdepo_getCSR()

void graph_csrdepo_getCSR ( const CSRDEPO depository,
int  index,
CSR csr 
)

gets CSR from depository

Parameters
depositorythe depository
indexthe index of the CSR to get
csrpointer to CSR struct to fill

Definition at line 667 of file graph_util.c.

References compressed_sparse_storages_depository::csr_isEmpty, csrdepoFillCSR(), compressed_sparse_storages_depository::ncsrs_curr, and csr_storage::start.

Referenced by csrdepoGetTopWeight(), csrdepoTest2(), graph_csrdepo_getTopCSR(), graph_csrdepo_print(), and ruledOut().

◆ graph_csrdepo_getTopCSR()

void graph_csrdepo_getTopCSR ( const CSRDEPO depository,
CSR csr 
)

◆ graph_csrdepo_getDataSize()

int graph_csrdepo_getDataSize ( const CSRDEPO depository)

◆ graph_csrdepo_getNcsrs()

int graph_csrdepo_getNcsrs ( const CSRDEPO depository)

◆ graph_csrdepo_removeTop()

◆ graph_csrdepo_clean()

void graph_csrdepo_clean ( CSRDEPO depository)

cleans CSR depository

Parameters
depositorythe depository

Definition at line 781 of file graph_util.c.

References csrdepoCleanDebug(), graph_csrdepo_isEmpty(), graph_csrdepo_removeTop(), and compressed_sparse_storages_depository::ncsrs_curr.

Referenced by postCleanMSTs().

◆ graph_csrdepo_addEmptyTop()

◆ graph_csrdepo_addEmptyTopTree()

void graph_csrdepo_addEmptyTopTree ( CSRDEPO depository,
int  nnodes 
)

adds empty top for tree to CSR depository

Parameters
depositorythe depository
nnodesnodes of new top

Definition at line 836 of file graph_util.c.

References graph_csrdepo_addEmptyTop().

Referenced by baseMstInitMsts(), and compMstInitMsts().

◆ graph_csrdepo_isEmpty()

SCIP_Bool graph_csrdepo_isEmpty ( const CSRDEPO depository)

◆ graph_csrdepo_hasEmptyTop()

SCIP_Bool graph_csrdepo_hasEmptyTop ( const CSRDEPO depository)

is top of CSR depository empty?

Parameters
depositorythe depository

Definition at line 863 of file graph_util.c.

References compressed_sparse_storages_depository::csr_isEmpty, and csrdepoGetTopIndex().

Referenced by graph_csrdepo_addEmptyTop(), graph_csrdepo_getTopCSR(), and graph_csrdepo_removeTop().

◆ graph_csrdepo_getEmptyTop()

void graph_csrdepo_getEmptyTop ( const CSRDEPO depository,
CSR csr 
)

Gets empty top of current depository.

Parameters
depositorythe depository
csrpointer to csr struct to fill

Definition at line 874 of file graph_util.c.

References compressed_sparse_storages_depository::csr_isEmpty, csrdepoFillCSR(), csrdepoGetTopIndex(), and compressed_sparse_storages_depository::ncsrs_max.

Referenced by add1NodeMst(), baseMstInitMsts(), compMstInitMsts(), csrdepoTest1(), and csrdepoTest2().

◆ graph_csrdepo_emptyTopSetMarked()

void graph_csrdepo_emptyTopSetMarked ( CSRDEPO depository)

◆ graph_csrdepo_print()

void graph_csrdepo_print ( const CSRDEPO depository)

Prints depository.

Parameters
depositorythe depository

Definition at line 908 of file graph_util.c.

References compressed_sparse_storages_depository::csr_weight, graph_csrdepo_getCSR(), graph_csrdepo_getNcsrs(), csr_storage::nedges_max, and csr_storage::nnodes.

Referenced by baseMstFinalizeNew(), and compMstFinalizeNew().

◆ graph_heap_clean()

◆ graph_heap_isClean()

SCIP_Bool graph_heap_isClean ( const DHEAP heap)

is the heap clean?

Parameters
heapthe heap

Definition at line 962 of file graph_util.c.

References dijkstra_heap::capacity, FALSE, dijkstra_heap::position, SCIPdebugMessage, dijkstra_heap::size, TRUE, and UNKNOWN.

Referenced by cmst_computeMst(), graph_heap_clean(), sdCliqueStarInit(), sdStarInit(), and vnoiInit().

◆ graph_heap_create()

SCIP_RETCODE graph_heap_create ( SCIP scip,
int  capacity,
int *  position,
DENTRY entries,
DHEAP **  heap 
)

creates new heap. If entries array is provided, it must be of size capacity + 2

Parameters
scipSCIP
capacityheap capacity
positionheap position array or NULL
entriesentries array or NULL
heapthe heap

Definition at line 992 of file graph_util.c.

References DHEAP_MAX_KEY, DHEAP_MIN_KEY, graph_heap_clean(), dijkstra_heap_entry::key, SCIP_CALL, SCIP_OKAY, SCIPallocMemory, SCIPallocMemoryArray, and TRUE.

Referenced by checkSdWalk(), cmst_init(), distCloseNodesCompute(), distGetRestricted(), dpsolverInitData(), extreduce_distDataInit(), graph_dijkLimited_init(), graph_vnoiCompute(), graph_vnoiComputeImplied(), mst_init(), reduce_redLoopPc(), SCIPStpHeurLocalExtendPcMwOut(), stptest_dheap(), and tmBaseInit().

◆ graph_heap_free()

void graph_heap_free ( SCIP scip,
SCIP_Bool  freePositions,
SCIP_Bool  freeEntries,
DHEAP **  heap 
)

frees the heap

Parameters
scipSCIP
freePositionsfree positions array?
freeEntriesfree entries array?
heapthe heap

Definition at line 1034 of file graph_util.c.

References SCIPfreeMemory, and SCIPfreeMemoryArray.

Referenced by checkSdWalk(), cmst_free(), distCloseNodesCompute(), distGetRestricted(), dpsolverFreeData(), extreduce_distDataFree(), graph_dijkLimited_free(), graph_vnoiCompute(), graph_vnoiComputeImplied(), mst_free(), reduce_redLoopPc(), SCIPStpHeurLocalExtendPcMwOut(), stptest_dheap(), and tmBaseFree().

◆ graph_heap_deleteMin()

void graph_heap_deleteMin ( int *  node,
SCIP_Real key,
DHEAP heap 
)

deletes heap minimum

Parameters
nodepointer to value of minimum
keypointer to key of minimum
heapthe heap

Definition at line 1053 of file graph_util.c.

References dijkstra_heap::entries, graph_heap_deleteMinGetNode(), and dijkstra_heap_entry::key.

Referenced by propagateUBs(), subtreesExtend(), and subtreesRemoveNonValids().

◆ graph_heap_deleteMinGetNode()

void graph_heap_deleteMinGetNode ( int *  node,
DHEAP heap 
)

deletes heap minimum

Parameters
nodepointer to node stored in minimum (set by method)
heapthe heap

Definition at line 1065 of file graph_util.c.

References graph_heap_deleteMinReturnNode().

Referenced by graph_heap_deleteMin(), and stptest_dheap().

◆ graph_heap_deleteMinReturnNode()

◆ graph_heap_correct()

◆ graph_csr_alloc()

SCIP_RETCODE graph_csr_alloc ( SCIP scip,
int  nnodes,
int  nedges,
CSR **  csr 
)

◆ graph_csr_allocWithEdgeId()

SCIP_RETCODE graph_csr_allocWithEdgeId ( SCIP scip,
int  nnodes,
int  nedges,
CSR **  csr 
)

allocates empty (and invalid!) CSR storage

Parameters
scipSCIP data structure
nnodesnodes
nedgesedges
csrCSR

Definition at line 1270 of file graph_util.c.

References csr_storage::edge_id, graph_csr_alloc(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocMemoryArray.

Referenced by graph_init_csrWithEdgeId(), mst_init(), and tmBaseInit().

◆ graph_csr_chgCosts()

void graph_csr_chgCosts ( const GRAPH g,
const SCIP_Real edgecosts,
CSR csr 
)

Changes edge costs. NOTE: for PC/MW no dummy nodes are considered!

Parameters
gthe graph
edgecostsedge costs (w.r.t graph 'g')
csrCSR

Definition at line 1298 of file graph_util.c.

References csr_storage::cost, csr_storage::edge_id, GRAPH::edges, FARAWAY, flipedge, GRAPH::grad, graph_csr_isValid(), graph_get_nEdges(), graph_get_nNodes(), graph_pc_isPcMw(), graph_pc_knotIsDummyTerm(), csr_storage::head, GRAPH::head, csr_storage::nedges_max, nnodes, csr_storage::nnodes, NULL, GRAPH::oeat, GRAPH::outbeg, SCIP_Bool, SCIP_Real, csr_storage::start, and TRUE.

Referenced by pcmwSetEdgeCosts().

◆ graph_csr_build()

void graph_csr_build ( const GRAPH g,
const SCIP_Real edgecosts,
CSR csr 
)

◆ graph_csr_buildCosts()

void graph_csr_buildCosts ( const GRAPH g,
const CSR csr,
const SCIP_Real edgecosts_g,
SCIP_Real *RESTRICT  edgecosts_csr 
)

builds CSR costs from given edgecosts array

Parameters
gthe graph
csrCSR
edgecosts_gedge costs (w.r.t graph 'g')
edgecosts_csrnew edgecosts for CSR

Definition at line 1418 of file graph_util.c.

References csr_storage::edge_id, graph_get_nEdges(), graph_get_nNodes(), nnodes, csr_storage::nnodes, and csr_storage::start.

◆ graph_csr_costsAreInSync()

SCIP_Bool graph_csr_costsAreInSync ( const GRAPH g,
const CSR csr,
const SCIP_Real edgecosts_g 
)

are CSR and graph costs corresponding?

Parameters
gthe graph
csrCSR
edgecosts_gedge costs w.r.t graph 'g'

Definition at line 1448 of file graph_util.c.

References csr_storage::cost, csr_storage::edge_id, EQ, FALSE, graph_get_nEdges(), graph_get_nNodes(), nnodes, csr_storage::nnodes, SCIP_Real, csr_storage::start, and TRUE.

Referenced by runTmPcMW_mode(), and solstp_pruneFromTmHeur_csr().

◆ graph_csr_copy()

void graph_csr_copy ( const CSR csr_in,
CSR csr_out 
)

◆ graph_csr_print()

void graph_csr_print ( const CSR csr)

prints CSR storage

Parameters
csrCSR to print

Definition at line 1514 of file graph_util.c.

References csr_storage::cost, FALSE, graph_csr_isValid(), csr_storage::head, csr_storage::nedges_max, csr_storage::nnodes, SCIP_Real, and csr_storage::start.

Referenced by baseMstFinalizeNew(), and compMstFinalizeNew().

◆ graph_csr_getNedges()

int graph_csr_getNedges ( const CSR csr)

◆ graph_csr_free()

void graph_csr_free ( SCIP scip,
CSR **  csr 
)

◆ graph_init_csr()

SCIP_RETCODE graph_init_csr ( SCIP scip,
GRAPH g 
)

initializes CSR storage of graph

Parameters
scipSCIP data structure
gthe graph

Definition at line 1581 of file graph_util.c.

References GRAPH::cost, GRAPH::csr_storage, GRAPH::edges, graph_csr_alloc(), graph_csr_build(), graph_valid_csr(), GRAPH::knots, NULL, SCIP_CALL, SCIP_OKAY, and TRUE.

Referenced by dpborder_solve(), and SCIPStpHeurLocalExtendPcMwOut().

◆ graph_init_csrWithEdgeId()

SCIP_RETCODE graph_init_csrWithEdgeId ( SCIP scip,
GRAPH g 
)

initializes CSR storage of graph

Parameters
scipSCIP data structure
gthe graph

Definition at line 1603 of file graph_util.c.

References GRAPH::cost, GRAPH::csr_storage, GRAPH::edges, graph_csr_allocWithEdgeId(), graph_csr_build(), graph_valid_csr(), GRAPH::knots, NULL, SCIP_CALL, SCIP_OKAY, and TRUE.

Referenced by dpborder_probePotential(), and dpterms_solve().

◆ graph_free_csr()

void graph_free_csr ( SCIP scip,
GRAPH g 
)

frees dynamic CSR storage of graph

Parameters
scipSCIP data structure
gthe graph

Definition at line 1623 of file graph_util.c.

References GRAPH::csr_storage, graph_csr_free(), and NULL.

Referenced by dpborder_probePotential(), dpborder_solve(), dpterms_solve(), graph_free(), and SCIPStpHeurLocalExtendPcMwOut().

◆ graph_csr_isValid()

SCIP_Bool graph_csr_isValid ( const CSR csr,
SCIP_Bool  verbose 
)

is CSR storage valid?

Parameters
csrthe CSR graph
verbosebe verbose?

Definition at line 1637 of file graph_util.c.

References FALSE, csr_storage::head, csr_storage::nedges_max, nnodes, csr_storage::nnodes, csr_storage::start, and TRUE.

Referenced by graph_csr_build(), graph_csr_chgCosts(), graph_csr_copy(), graph_csr_print(), graph_valid_csr(), and reduce_dcmstMstIsValid().

◆ graph_valid_csr()

SCIP_Bool graph_valid_csr ( const GRAPH g,
SCIP_Bool  verbose 
)

is CSR storage of graph valid?

Parameters
gthe graph
verbosebe verbose?

Definition at line 1694 of file graph_util.c.

References csr_storage::cost, GRAPH::csr_storage, GRAPH::edges, FALSE, graph_csr_isValid(), csr_storage::head, GRAPH::knots, csr_storage::nedges_max, and csr_storage::nnodes.

Referenced by graph_init_csr(), and graph_init_csrWithEdgeId().

◆ graph_init_dcsr()

◆ graph_free_dcsr()

◆ graph_update_dcsr()

void graph_update_dcsr ( SCIP scip,
GRAPH g 
)

updates dynamic CSR storage

Parameters
scipSCIP data structure
gthe graph

Definition at line 1829 of file graph_util.c.

◆ graph_dcsr_deleteEdge()

void graph_dcsr_deleteEdge ( DCSR dcsr,
int  tail,
int  e_csr 
)

deletes CSR indexed edge

Parameters
dcsrDCSR container
tailtail of edge
e_csrCSR indexed edge

Definition at line 1840 of file graph_util.c.

References dynamic_csr_storage::cost, dynamic_csr_storage::cost2, dynamic_csr_storage::cost3, dynamic_csr_storage::edgeid, csr_range::end, FARAWAY, dynamic_csr_storage::head, dynamic_csr_storage::id2csredge, nnodes, dynamic_csr_storage::range, and SCIP_Real.

Referenced by graph_dcsr_deleteEdgeBi().

◆ graph_dcsr_deleteEdgeBi()

void graph_dcsr_deleteEdgeBi ( SCIP scip,
DCSR dcsr,
int  e_csr 
)

◆ graph_valid_dcsr()

◆ graph_dijkLimited_init()

◆ graph_dijkLimited_initPcShifts()

SCIP_RETCODE graph_dijkLimited_initPcShifts ( SCIP scip,
const GRAPH g,
DIJK dijkdata 
)

initializes PC shifts per node

Parameters
scipSCIP
gthe graph
dijkdatadata for limited Dijkstra

Definition at line 2031 of file graph_util.c.

References GRAPH::cost, EAT_LAST, EQ, GRAPH::extended, FARAWAY, graph_get_nNodes(), graph_pc_isPc(), graph_pc_isRootedPcMw(), GT, GRAPH::ieat, GRAPH::inpbeg, Is_term, nnodes, dijkstra_data::node_bias, GRAPH::prize, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocMemoryArray, GRAPH::source, GRAPH::tail, and GRAPH::term.

Referenced by extreduce_distDataInit().

◆ graph_dijkLimited_clean()

◆ graph_dijkLimited_reset()

void graph_dijkLimited_reset ( const GRAPH g,
DIJK dijkdata 
)

◆ graph_dijkLimited_free()