Detailed Description
includes several methods for Steiner problem sub-graphs
This file contains several basic methods to process subgraph of Steiner problem graphs.
Definition in file graph_sub.c.
#include "scip/misc.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "portab.h"
#include "graph.h"
#include "stpvector.h"
Go to the source code of this file.
Data Structures | |
struct | edge_transfer |
struct | subgraph_extraction_insertion |
Typedefs | |
typedef struct edge_transfer | EDGETRANS |
Typedef Documentation
◆ EDGETRANS
typedef struct edge_transfer EDGETRANS |
edge transfer
Function Documentation
◆ extractSubgraphGetSizeAndMap()
initializes subgraph
- Parameters
-
orggraph original graph subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 79 of file graph_sub.c.
References EAT_LAST, graph_get_nNodes(), GRAPH::head, Is_term, GRAPH::mark, nnodes, GRAPH::oeat, GRAPH::outbeg, and GRAPH::term.
Referenced by extractSubgraphBuild().
◆ extractSubgraphAddNodes()
|
static |
helper
- Parameters
-
orggraph original graph subinout data structure for handling inclusion/exclusion of sub-problems subgraph graph to fill
Definition at line 135 of file graph_sub.c.
References graph_knot_add(), graph_knot_isInRange(), Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::source, STP_TERM, STP_TERM_NONE, GRAPH::term, and TRUE.
Referenced by extractSubgraphBuild().
◆ extractSubgraphInitHistory()
|
static |
helper
- Parameters
-
scip SCIP data structure orggraph original graph moveFixedEdges move fixed edges? subgraph graph to fill
Definition at line 175 of file graph_sub.c.
References GRAPH::ancestors, GRAPH::esize, graph_addPseudoAncestors(), graph_copyFixed(), graph_getNpseudoAncestors(), graph_initPseudoAncestorsSized(), SCIP_CALL, SCIP_OKAY, and SCIPallocMemoryArray.
Referenced by extractSubgraphBuild(), and graph_subgraphCompleteNewHistory().
◆ extractSubgraphAddEdge()
|
static |
helper
- Parameters
-
scip SCIP data structure useNewHistory use new history? moveEdges move edges and in particular their history? edgetrans helper for edge transfer source_graph source graph target_graph graph to fill
Definition at line 201 of file graph_sub.c.
References GRAPH::ancestors, GRAPH::cost, Edge_even, EQ, FALSE, flipedge, graph_edge_add(), graph_edge_getAncestors(), graph_edge_getPseudoAncestors(), graph_edge_isInRange(), graph_edge_nPseudoAncestors(), graph_edge_redirect(), graph_knot_isInRange(), graph_pseudoAncestors_appendCopyArrayToEdge(), graph_typeIsUndirected(), NULL, edge_transfer::redirectEdge, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPintListNodeAppendCopy(), edge_transfer::source_edge, edge_transfer::target_edge, edge_transfer::target_head, and edge_transfer::target_tail.
Referenced by extractSubgraphAddEdgesWithHistory(), and reinsertSubgraphTransferEdges().
◆ reinsertSubgraphAdaptSubToOrgMap()
|
static |
contracts border nodes of subgraph with remaining
- Parameters
-
subgraph sub graph orggraph original graph subinout helper
Definition at line 274 of file graph_sub.c.
References GRAPH::grad, graph_get_nNodes(), graph_knot_isInRange(), Is_term, GRAPH::term, and GRAPH::terms.
Referenced by reinsertSubgraph().
◆ extractSubgraphAddEdgesWithHistory()
|
static |
helper
- Parameters
-
scip SCIP data structure orggraph original graph subinout data structure for inserting/extracting sub-problem subgraph graph to fill
Definition at line 327 of file graph_sub.c.
References EAT_LAST, GRAPH::edges, GRAPH::esize, extractSubgraphAddEdge(), FALSE, flipedge, graph_get_nNodes(), graph_knot_isInRange(), GRAPH::head, GRAPH::mark, MAX, GRAPH::oeat, GRAPH::orgedges, GRAPH::outbeg, SCIP_Bool, SCIP_CALL, SCIP_OKAY, edge_transfer::source_edge, and GRAPH::tail.
Referenced by extractSubgraphBuild().
◆ borderNodesCollect()
|
static |
collects border nodes (cut vertices) of subgraph
- Parameters
-
scip SCIP data structure orggraph original graph subgraph sub graph subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 383 of file graph_sub.c.
References EAT_LAST, graph_get_nNodes(), graph_knot_isInRange(), GRAPH::head, Is_term, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, SCIPdebugMessage, StpVecGetSize, StpVecPushBack, and GRAPH::term.
Referenced by graph_subgraphExtract().
◆ borderNodesContract()
|
static |
contracts border nodes of subgraph with remaining
- Parameters
-
scip SCIP data structure subgraph sub graph subinout helper orggraph original graph
Definition at line 423 of file graph_sub.c.
References GRAPH::grad, graph_contractTrace(), graph_knot_contract(), graph_knot_hasContractTrace(), graph_knot_isInRange(), Is_term, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, STP_Vectype, StpVecClear, StpVecGetSize, GRAPH::term, and GRAPH::terms.
Referenced by reinsertSubgraph().
◆ extractSubgraphBuild()
|
static |
builds subgraph
- Parameters
-
scip SCIP data structure orggraph original graph subinout data structure for handling inclusion/exclusion of sub-problems subgraph graph to be created
Definition at line 481 of file graph_sub.c.
References GRAPH::esize, extractSubgraphAddEdgesWithHistory(), extractSubgraphAddNodes(), extractSubgraphGetSizeAndMap(), extractSubgraphInitHistory(), graph_init(), graph_initContractTracing(), graph_path_init(), graph_typeIsSpgLike(), GRAPH::ksize, SCIP_CALL, SCIP_OKAY, STP_SPG, GRAPH::stp_type, and TRUE.
Referenced by graph_subgraphExtract().
◆ reinsertSubgraphTransferFixedHistory()
|
static |
helper
- Parameters
-
scip SCIP data structure subgraph sub-graph orggraph original graph
Definition at line 516 of file graph_sub.c.
References GRAPH::fixedcomponents, graph_addPseudoAncestors(), graph_fixed_resetMoved(), graph_free_fixed(), graph_getNfixpseudonodes(), graph_getNpseudoAncestors(), and NULL.
Referenced by reinsertSubgraph().
◆ reinsertSubgraphTransferEdges()
|
static |
helper
- Parameters
-
scip SCIP data structure subgraph graph to be inserted subinsertion data structure for handling inclusion/exclusion of sub-problems orggraph original graph
Definition at line 548 of file graph_sub.c.
References EAT_FREE, extractSubgraphAddEdge(), FALSE, graph_edge_isDeleted(), graph_get_nEdges(), graph_knot_isInRange(), GRAPH::head, GRAPH::oeat, SCIP_CALL, SCIP_OKAY, edge_transfer::source_edge, STP_Vectype, StpVecGetSize, StpVecPopBack, GRAPH::tail, and TRUE.
Referenced by reinsertSubgraph().
◆ reinsertSubgraphTransferTerminals()
|
static |
helper
- Parameters
-
subgraph graph to be inserted subinout data structure for handling inclusion/exclusion of sub-problems orggraph original graph
Definition at line 591 of file graph_sub.c.
References GRAPH::contracttrace, GRAPH::grad, graph_contractTrace(), graph_get_nNodes(), graph_knot_chg(), graph_knot_hasContractTrace(), graph_knot_isInRange(), Is_term, SCIP_OKAY, GRAPH::source, and GRAPH::term.
Referenced by reinsertSubgraph().
◆ reinsertSubgraphDeleteOldEdges()
|
static |
helper
- Parameters
-
scip SCIP data structure subgraph graph to be inserted subinout data structure for handling inclusion/exclusion of sub-problems orggraph original graph
Definition at line 634 of file graph_sub.c.
References EAT_LAST, graph_edge_del(), graph_get_nNodes(), graph_knot_isInRange(), GRAPH::head, GRAPH::oeat, GRAPH::outbeg, SCIP_OKAY, StpVecPushBack, and TRUE.
Referenced by reinsertSubgraph().
◆ reinsertSubgraph()
|
static |
builds subgraph
- Parameters
-
scip SCIP data structure subgraph graph to be inserted subinout data structure for inserting/extracting sub-problem orggraph original graph
Definition at line 675 of file graph_sub.c.
References borderNodesContract(), GRAPH::edges, GRAPH::knots, reinsertSubgraphAdaptSubToOrgMap(), reinsertSubgraphDeleteOldEdges(), reinsertSubgraphTransferEdges(), reinsertSubgraphTransferFixedHistory(), reinsertSubgraphTransferTerminals(), SCIP_CALL, SCIP_OKAY, StpVecClear, and StpVecGetSize.
Referenced by graph_subgraphReinsert().
◆ graph_subgraphExtract()
SCIP_RETCODE graph_subgraphExtract | ( | SCIP * | scip, |
GRAPH * | orggraph, | ||
SUBINOUT * | subinout, | ||
GRAPH ** | subgraph | ||
) |
Obtains a new subgraph corresponding to marked nodes. Also fills a node map from the new to the original nodes. Creates a shallow copy and moves parts wrt ancestor information: ancestors and pseudo-ancestors are kept/moved and will be modified also for original graph!
- Parameters
-
scip SCIP data structure orggraph original graph subinout data structure for inserting/extracting sub-problem subgraph graph to be created
Definition at line 712 of file graph_sub.c.
References borderNodesCollect(), extractSubgraphBuild(), graph_pc_isPcMw(), GRAPH::knots, SCIP_CALL, SCIP_OKAY, and GRAPH::withInexactReductions.
Referenced by decomposeExactSubTry(), decomposeGetSubgraph(), and decomposeReduceSubDoIt().
◆ graph_subinoutInit()
SCIP_RETCODE graph_subinoutInit | ( | SCIP * | scip, |
const GRAPH * | orggraph, | ||
SUBINOUT ** | subinout | ||
) |
initializes
- Parameters
-
scip SCIP data structure orggraph original graph subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 733 of file graph_sub.c.
References FALSE, graph_get_nNodes(), nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocMemory, SCIPallocMemoryArray, and sub.
Referenced by bidecomposition_initSubInOut().
◆ graph_subinoutActivateEdgeMap()
SCIP_RETCODE graph_subinoutActivateEdgeMap | ( | const GRAPH * | orggraph, |
SUBINOUT * | subinout | ||
) |
activates
- Parameters
-
orggraph original graph subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 769 of file graph_sub.c.
References graph_get_nEdges(), SCIP_CALL, SCIP_OKAY, SCIPallocMemoryArray, and TRUE.
Referenced by decomposeExec(), and decomposePartialExact().
◆ graph_subinoutActivateNewHistory()
void graph_subinoutActivateNewHistory | ( | SUBINOUT * | subinout | ) |
activates
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 788 of file graph_sub.c.
References TRUE.
Referenced by decomposeExec(), and decomposePartialExact().
◆ graph_subinoutGetSubToOrgNodeMap()
const int* graph_subinoutGetSubToOrgNodeMap | ( | const SUBINOUT * | subinout | ) |
gets nodes map
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 799 of file graph_sub.c.
Referenced by decomposeReduceSubDoIt().
◆ graph_subinoutGetSubToOrgEdgeMap()
const int* graph_subinoutGetSubToOrgEdgeMap | ( | const SUBINOUT * | subinout | ) |
gets edge map
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 812 of file graph_sub.c.
Referenced by decomposeExactFixSol(), decomposeExactSubDoIt(), decomposeSolveSub(), and subsolFixOrgEdges().
◆ graph_subinoutGetOrgToSubNodeMap()
const int* graph_subinoutGetOrgToSubNodeMap | ( | const SUBINOUT * | subinout | ) |
gets nodes map
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 825 of file graph_sub.c.
Referenced by bidecomposition_getMarkedSubRoot(), and decomposeReduceSubDoIt().
◆ graph_subinoutGetContractionRecord()
const int* graph_subinoutGetContractionRecord | ( | const SUBINOUT * | subinout | ) |
get contraction record for cut nodes (-1 if no contraction)
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 837 of file graph_sub.c.
Referenced by bidecomposition_markSub().
◆ graph_subinoutUsesNewHistory()
new history per subproblem is being used?
- Parameters
-
subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 848 of file graph_sub.c.
Referenced by decomposeSolveSub().
◆ graph_subinoutFree()
frees
- Parameters
-
scip SCIP data structure subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 859 of file graph_sub.c.
References SCIPfreeMemory, SCIPfreeMemoryArray, SCIPfreeMemoryArrayNull, StpVecFree, and sub.
Referenced by bidecomposition_free().
◆ graph_subinoutClean()
cleans
- Parameters
-
scip SCIP data structure subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 882 of file graph_sub.c.
References StpVecClear.
Referenced by decomposeExactSubDoIt(), and decomposeSolveSub().
◆ graph_knot_getContractionRecordAncestor()
int graph_knot_getContractionRecordAncestor | ( | int | node, |
const SUBINOUT * | subinout | ||
) |
gets ancestor
- Parameters
-
node node to get ancestors for subinout data structure for handling inclusion/exclusion of sub-problems
Definition at line 895 of file graph_sub.c.
Referenced by bidecomposition_markSub().
◆ graph_subgraphCompleteNewHistory()
SCIP_RETCODE graph_subgraphCompleteNewHistory | ( | SCIP * | scip, |
const int * | edgemap_subToOrg, | ||
GRAPH * | orggraph, | ||
GRAPH * | subgraph | ||
) |
completes history NOTE: necessary to allocate block memory on subscip
- Parameters
-
scip SCIP data structure edgemap_subToOrg maps edges of subgraph to original graph orggraph original graph subgraph graph to fill
Definition at line 920 of file graph_sub.c.
References BMScopyMemoryArray, GRAPH::cost, EQ, extractSubgraphInitHistory(), FALSE, GRAPH::fixedcomponents, graph_edge_getPseudoAncestors(), graph_edge_nPseudoAncestors(), graph_free_fixedEdgesOnly(), graph_get_nEdges(), graph_initAncestors(), graph_pseudoAncestors_appendCopyArrayToEdge(), GRAPH::head, GRAPH::orghead, GRAPH::orgtail, GRAPH::pseudoancestors, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocMemoryArray, and GRAPH::tail.
Referenced by substpsolver_transferHistory().
◆ graph_subgraphReinsert()
SCIP_RETCODE graph_subgraphReinsert | ( | SCIP * | scip, |
SUBINOUT * | subinout, | ||
GRAPH * | orggraph, | ||
GRAPH ** | subgraph | ||
) |
reinserts extracted (and modified) subgraph; also deletes subgraph. Dual to "graph_subgraphExtract"
- Parameters
-
scip SCIP data structure subinout data structure for handling inclusion/exclusion of sub-problems orggraph original graph subgraph graph to be reinserted (and freed)
Definition at line 983 of file graph_sub.c.
References FALSE, GRAPH::fixedcomponents, graph_free(), graph_path_exit(), graph_pc_isPcMw(), graph_valid(), NULL, GRAPH::orghead, GRAPH::orgtail, reinsertSubgraph(), SCIP_CALL, SCIP_OKAY, and SCIPfreeMemoryArray.
Referenced by decomposeReduceSubDoIt().
◆ graph_subgraphFree()
frees extracted subgraph. NOTE: fixed history components are not deleted
- Parameters
-
scip SCIP data structure subgraph graph to be freed
Definition at line 1022 of file graph_sub.c.
References FALSE, graph_free(), and graph_path_exit().