Scippy

SCIP

Solving Constraint Integer Programs

bidecomposition.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file bidecomposition.h
17  * @brief several decomposition methods for Steiner tree problems
18  * @author Daniel Rehfeldt
19  *
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 
25 #ifndef APPLICATIONS_STP_SRC_BIDECOMPOSITION_H_
26 #define APPLICATIONS_STP_SRC_BIDECOMPOSITION_H_
27 
28 #include "scip/scip.h"
29 #include "graph.h"
30 #include "stpvector.h"
31 
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 //#define CUTTREE_PRINT_STATISTICS
39 
40 
41 /** decompose */
43 {
44  SUBINOUT* subinout; /**< helper */
45  int* nodes; /**< nodes */
46  int* starts; /**< starts array per component */
47  int nbicomps; /**< number of components */
48 } BIDECOMP;
49 
50 
51 
52 /** for internal computation */
54 
55 
56 /** cut nodes/ articulation points todo: hide */
57 typedef struct cut_nodes
58 {
59  SCIP* scip; /**< SCIP data structure */
60 #ifdef CUTTREE_PRINT_STATISTICS
61  int* childcount_nodes; /**< number of nodes below each node */
62  int* childcount_terms; /**< number of terminals below each node */
63 #endif
64  STACK_NODE* stack_nodes; /**< data for iterative computation */
65  STP_Vectype(int) biconn_stack; /**< stack for marking bi-connected component */
66  int* biconn_nodesmark; /**< marks in which component each node is 0, 1,.., biconn_ncomps - 1 */
67  int* biconn_comproots; /**< root of each component with index 0,1,...,biconn_ncomps - 1 */
68  STP_Vectype(int) artpoints; /**< cut nodes */
69  int* nodes_hittime; /**< hit time 0,1,... */
70  int stack_size; /**< size of stack */
71  int biconn_ncomps; /**< number of components */
72  int dfsroot; /**< root */
73  int nrootcomps; /**< number of root components */
74  int curr_lowpoint; /**< current low-point */
75  int curr_hittime; /**< current hit time */
76 } CUTNODES;
77 
78 
81 extern void bidecomposition_cutnodesCompute(const GRAPH*, CUTNODES*);
82 
83 extern SCIP_RETCODE bidecomposition_init(SCIP*, const CUTNODES*, const GRAPH*, BIDECOMP**);
85 extern void bidecomposition_free(SCIP*, BIDECOMP**);
86 extern void bidecomposition_markSub(const BIDECOMP*, int, GRAPH*);
89 extern SCIP_RETCODE bidecomposition_getMarkedSubRoot(SCIP*, const BIDECOMP*, const GRAPH*, const GRAPH*, int*);
92 
93 
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 
100 #endif /* APPLICATIONS_STP_SRC_BIDECOMPOSITION_H_ */
struct cut_nodes CUTNODES
#define STP_Vectype(type)
Definition: stpvector.h:44
SCIP_Bool bidecomposition_isPossible(const GRAPH *)
SCIP_Real bidecomposition_getMaxcompNodeRatio(const BIDECOMP *)
int * biconn_comproots
SCIP_RETCODE bidecomposition_init(SCIP *, const CUTNODES *, const GRAPH *, BIDECOMP **)
SCIP_RETCODE bidecomposition_cutnodesInit(SCIP *, const GRAPH *, CUTNODES **)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
includes various files containing graph methods used for Steiner tree problems
header only, simple implementation of an STL like vector
struct biconnected_component_decomposition BIDECOMP
SCIP_RETCODE bidecomposition_initSubInOut(SCIP *, const GRAPH *, BIDECOMP *)
int * nodes_hittime
int * biconn_nodesmark
STACK_NODE * stack_nodes
void bidecomposition_cutnodesCompute(const GRAPH *, CUTNODES *)
#define SCIP_Bool
Definition: def.h:84
SCIP_RETCODE bidecomposition_getMarkedSubRoot(SCIP *, const BIDECOMP *, const GRAPH *, const GRAPH *, int *)
void bidecomposition_cutnodesFree(SCIP *, CUTNODES **)
SCIP_Real bidecomposition_getCompNodeRatio(const BIDECOMP *, int)
void bidecomposition_markSub(const BIDECOMP *, int, GRAPH *)
#define SCIP_Real
Definition: def.h:177
SCIP_Bool bidecomposition_componentIsTrivial(const BIDECOMP *, int)
void bidecomposition_free(SCIP *, BIDECOMP **)
SCIP callable library.