Scippy

GCG

Branch-and-Price & Column Generation for Everyone

cons_decomp.hpp
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 cons_decomp.hpp
29  * @brief C++ interface of cons_decomp
30  * @author Erik Muehmer
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef GCG_CONS_DECOMP_HPP
36 #define GCG_CONS_DECOMP_HPP
37 
38 #include "class_partialdecomp.h"
39 
40 /** @brief gets vector of all partialdecs
41  * @returns finished partialdecs
42  */
43 extern
44 std::vector<gcg::PARTIALDECOMP*>* GCGconshdlrDecompGetPartialdecs(
45  SCIP* scip /**< SCIP data structure */
46 );
47 
48 extern
50  SCIP* scip,
51  SCIP_Bool transformed
52 );
53 
54 /** @brief local method to find a partialdec for a given id or NULL if no partialdec with such id is found
55  * @returns partialdec pointer of partialdec with given id or NULL if it does not exist
56  * @note returns NULL if no partialdec by this id is known */
57 extern
59  SCIP* scip, /**< SCIP data structure */
60  int partialdecid /**< partialdec id */
61 );
62 
63 /** @brief adds a preexisting partial dec to be considered at the beginning of the detection
64  *
65  * @note refines the partialdec to be consistent, adds meta data/statistics
66  * @returns SCIP return code
67 */
68 extern
70  SCIP* scip, /**< SCIP data structure */
71  gcg::PARTIALDECOMP* partialdec/**< partial dec to add */
72 );
73 
74 /** @brief deregisters a partialdec in the conshdlr
75  *
76  * Use this function at deletion of the partialdec.
77  * The partialdec is not destroyed in this function, the conshdlr will not know that it exists.
78  */
79 extern
81  SCIP* scip, /**< SCIP data structure */
82  gcg::PARTIALDECOMP* partialdec /**< the partialdec */
83 );
84 
85 /** @brief registers a partialdec in the conshdlr
86  *
87  * Use this function at initialization of the partialdec.
88  * If the partialdec already exists in the conshdlr it is ignored.
89  */
90 extern
92  SCIP* scip, /**< SCIP data structure */
93  gcg::PARTIALDECOMP* partialdec /**< the partialdec to register */
94 );
95 
96 /**
97  * @brief help method to access detprobdata for unpresolved problem
98  *
99  * @returns pointer to detprobdata in wrapper data structure
100  */
101 extern
103  SCIP* scip /**< SCIP data structure */
104 );
105 
106 /**
107  * @brief help method to access detprobdata for transformed problem
108  *
109  * @returns pointer to detprobdata in wrapper data structure
110  */
111 extern
113  SCIP* scip /**< SCIP data structure */
114 );
115 
116 /**
117  * @brief initilizes the candidates data structures with selected partialdecs
118  *
119  * initializes it with all if there are no selected partialdecs,
120  * sort them according to the current scoretype
121  * @param scip SCIP data structure
122  * @param candidates tuples of partialdecs and scores will be added to this vector (sorted w.r.t. the scores).
123  * @param original choose candidates for the original problem?
124  * @param printwarnings should warnings be printed?
125  * @returns SCIP return code
126  */
127 extern
129  SCIP* scip,
130  std::vector<std::pair<gcg::PARTIALDECOMP*, SCIP_Real> >& candidates,
131  SCIP_Bool original,
132  SCIP_Bool printwarnings
133  );
134 
135 /** @brief gets detector history of partialdec with given id
136  * @returns detector history of partialdec as string
137  */
138 extern
140  SCIP* scip, /**< SCIP data structure */
141  int id /**< id of partialdec */
142  );
143 
144 #endif //GCG_CONS_DECOMP_HPP
SCIP_RETCODE GCGconshdlrDecompAddPreexisitingPartialDec(SCIP *scip, gcg::PARTIALDECOMP *partialdec)
adds a preexisting partial dec to be considered at the beginning of the detection
void GCGconshdlrDecompRegisterPartialdec(SCIP *scip, gcg::PARTIALDECOMP *partialdec)
registers a partialdec in the conshdlr
SCIP_RETCODE GCGconshdlrDecompChooseCandidatesFromSelected(SCIP *scip, std::vector< std::pair< gcg::PARTIALDECOMP *, SCIP_Real > > &candidates, SCIP_Bool original, SCIP_Bool printwarnings)
initilizes the candidates data structures with selected partialdecs
gcg::DETPROBDATA * GCGconshdlrDecompGetDetprobdataPresolved(SCIP *scip)
help method to access detprobdata for transformed problem
std::string GCGconshdlrDecompGetDetectorHistoryByPartialdecId(SCIP *scip, int id)
gets detector history of partialdec with given id
std::vector< gcg::PARTIALDECOMP * > * GCGconshdlrDecompGetPartialdecs(SCIP *scip)
gets vector of all partialdecs
void GCGconshdlrDecompDeregisterPartialdec(SCIP *scip, gcg::PARTIALDECOMP *partialdec)
deregisters a partialdec in the conshdlr
gcg::DETPROBDATA * GCGconshdlrDecompGetDetprobdataOrig(SCIP *scip)
help method to access detprobdata for unpresolved problem
class to manage partial decompositions
gcg::PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(SCIP *scip, int partialdecid)
local method to find a partialdec for a given id or NULL if no partialdec with such id is found
class storing (potentially incomplete) decompositions
gcg::PARTIALDECOMP * DECgetPartialdecToWrite(SCIP *scip, SCIP_Bool transformed)