Scippy

GCG

Branch-and-Price & Column Generation for Everyone

struct_decomp.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2021 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
28 /**@file struct_decomp.h
29  * @ingroup DECOMP
30  * @ingroup DATASTRUCTURES
31  * @brief structure information for decomposition information in GCG projects
32  * @author Martin Bergner
33  * @author Michael Bastubbe
34  */
35 
36 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37 
38 #ifndef GCG_STRUCT_DECOMP_H_
39 #define GCG_STRUCT_DECOMP_H_
40 
41 
42 #include "scip/scip.h"
43 #include "type_decomp.h"
44 #include "type_detector.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /** decomposition structure information */
51 struct DecDecomp
52 {
53  SCIP_Bool presolved; /**< does the decomposition refer to the presolved problem? */
54  int nblocks; /**< number of blocks in this decomposition */
55  SCIP_VAR*** subscipvars; /**< two dimensional array of variables in each block
56  Usage: Usage: subscipvars[b][v] is variable v in block b */
57  int* nsubscipvars; /**< array of number of variables in each block
58  Usage: nsubscipvars[b] is the number of variables of block b */
59  SCIP_CONS*** subscipconss; /**< two dimensional array of constraints in each block
60  Usage: subscipcons[b][c] is constraint c in block b */
61  int* nsubscipconss; /**< array of number of constraints in each block
62  Usage: nsubscipcons[b] is the number of constraints of block b */
63  SCIP_CONS** linkingconss; /**< array of constraints linking the blocks
64  Usage: linkingcons[c] is linking constraint number c */
65  int nlinkingconss; /**< number of linking constraints */
66  SCIP_VAR** linkingvars; /**< array of variables linking the blocks
67  Usage: linkingvars[v] is linking variable number v */
68  int nlinkingvars; /**< number of linking variables */
69  int nfixedlinkingvars; /**< number of linking variables that are fixed */
70  int nmastervars; /**< number of linking variables that are purely master variables*/
71  SCIP_VAR*** stairlinkingvars; /**< array of variables staircaselinking the blocks */
72  int* nstairlinkingvars; /**< number of staircaselinking variables */
73  SCIP_HASHMAP* vartoblock; /**< hashmap mapping variables to their blocks (from 1 to nblocks)
74  Usage: SCIPhashmapGetImage(vartoblock, var) returns b+1, where b is the block of
75  variable var. This map is somehow inverse of the subscipcvars array. */
76  SCIP_HASHMAP* constoblock; /**< hashmap mapping constraints to their blocks (from 1 to nblocks)
77  Usage: Usage: SCIPhashmapGetImage(constoblock, cons) returns b+1, where b is the block of
78  constraint cons. This map is somehow inverse of the subscipconss array.*/
79  SCIP_HASHMAP* varindex; /**< hashmap mapping variables to indices for a visual ordering */
80  SCIP_HASHMAP* consindex; /**< hashmap mapping constraints to indices for visual ordering */
81  DEC_DECTYPE type; /**< type of the decomposition */
82  DEC_DETECTOR** detectorchain; /**< array of detectors that worked on this decomposition */
83  DEC_DETECTOR* detector; /**< detector that found this decomposition */
84  int sizedetectorchain; /**< number of detectors that worked on this decomposition */
85  int partialdecid; /**< id of the partialdec this decomposition originates from */
86  SCIP_Real* detectorclocktimes; /**< times of the detectors that worked on this decomposition */
87  SCIP_Real* pctvarstoborder; /**< percentages of variables assigned to the border of the corresponding detectors on this decomposition */
88  SCIP_Real* pctconsstoborder; /**< percentages of constraints assigned to the border of the corresponding detectors on this decomposition */
89  SCIP_Real* pctvarstoblock; /**< percentages of variables assigned to a block of the corresponding detectors on this decomposition */
90  SCIP_Real* pctconsstoblock; /**< percentages of variables assigned to a block of the corresponding detectors on this decomposition */
91  SCIP_Real* pctvarsfromopen; /**< percentages of variables assigned to a block or border of the corresponding detectors on this decomposition */
92  SCIP_Real* pctconssfromopen; /**< percentages of constraints assigned to a block or the border of the corresponding detectors on this decomposition */
93  int* nnewblocks; /**< number of new blocks of the corresponding detectors on this decomposition */
94  char* detectorchainstring;/**< string for the detector information working on that decomposition */
95  SCIP_Real maxwhitescore; /**< maximum white score (i.e. [fraction of white area] (nonborder+nonblock) ) */
96 };
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* STRUCT_DECOMP_H_ */
SCIP_HASHMAP * constoblock
Definition: struct_decomp.h:76
SCIP_Real * pctvarstoborder
Definition: struct_decomp.h:87
SCIP_Real * pctconsstoblock
Definition: struct_decomp.h:90
int partialdecid
Definition: struct_decomp.h:85
type definitions for detectors in GCG projects
int nlinkingvars
Definition: struct_decomp.h:68
SCIP_Real * pctvarsfromopen
Definition: struct_decomp.h:91
SCIP_Real * pctvarstoblock
Definition: struct_decomp.h:89
DEC_DECTYPE type
Definition: struct_decomp.h:81
DEC_DETECTOR * detector
Definition: struct_decomp.h:83
SCIP_Real * detectorclocktimes
Definition: struct_decomp.h:86
SCIP_CONS ** linkingconss
Definition: struct_decomp.h:63
char * detectorchainstring
Definition: struct_decomp.h:94
SCIP_Bool presolved
Definition: struct_decomp.h:53
SCIP_CONS *** subscipconss
Definition: struct_decomp.h:59
SCIP_Real maxwhitescore
Definition: struct_decomp.h:95
SCIP_Real * pctconsstoborder
Definition: struct_decomp.h:88
SCIP_VAR *** subscipvars
Definition: struct_decomp.h:55
SCIP_HASHMAP * vartoblock
Definition: struct_decomp.h:73
SCIP_HASHMAP * varindex
Definition: struct_decomp.h:79
SCIP_Real * pctconssfromopen
Definition: struct_decomp.h:92
int nlinkingconss
Definition: struct_decomp.h:65
enum Dectype DEC_DECTYPE
Definition: type_decomp.h:56
int * nsubscipvars
Definition: struct_decomp.h:57
SCIP_HASHMAP * consindex
Definition: struct_decomp.h:80
int * nsubscipconss
Definition: struct_decomp.h:61
int nfixedlinkingvars
Definition: struct_decomp.h:69
int * nnewblocks
Definition: struct_decomp.h:93
int * nstairlinkingvars
Definition: struct_decomp.h:72
int nmastervars
Definition: struct_decomp.h:70
DEC_DETECTOR ** detectorchain
Definition: struct_decomp.h:82
SCIP_VAR *** stairlinkingvars
Definition: struct_decomp.h:71
int sizedetectorchain
Definition: struct_decomp.h:84
SCIP_VAR ** linkingvars
Definition: struct_decomp.h:66
type definitions for decomposition information in GCG projects