Scippy

GCG

Branch-and-Price & Column Generation for Everyone

rowgraph.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 rowgraph.h
29  * @brief A row graph where each row is a node and rows are adjacent if they share a variable
30  * @author Martin Bergner
31  * @author Annika Thome
32  */
33 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #ifndef GCG_ROWGRAPH_H_
37 #define GCG_ROWGRAPH_H_
38 
39 #include "graph.h"
40 #include "bipartitegraph.h"
41 #include "matrixgraph.h"
42 
43 namespace gcg {
44 template <class T>
45 class RowGraph : public gcg::MatrixGraph<T>
46 {
47 protected:
49 
50 public:
51  RowGraph(
52  SCIP* scip, /**< SCIP data structure */
53  Weights w /**< weights for the given graph */
54  );
55  virtual ~RowGraph();
56 
57  virtual SCIP_RETCODE createDecompFromPartition(
58  DEC_DECOMP** decomp /**< decomposition structure to generate */
59  );
60 
61  /** amplifies a partialdec by dint of a graph created with open constraints and open variables of the partialdec */
62  virtual SCIP_RETCODE createPartialdecFromPartition(
63  PARTIALDECOMP* oldpartialdec, /**< partialdec which should be amplifies */
64  PARTIALDECOMP** firstpartialdec, /**< pointer to buffer the new partialdec amplified by dint of the graph */
65  PARTIALDECOMP** secondpartialdec, /**< pointer to buffer the new partialdec whose border is amplified by dint of the graph */
66  DETPROBDATA* detprobdata /**< datprobdata the partialdecs correspond to */
67  );
68 
69  virtual SCIP_RETCODE createFromMatrix(
70  SCIP_CONS** conss, /**< constraints for which graph should be created */
71  SCIP_VAR** vars, /**< variables for which graph should be created */
72  int nconss_, /**< number of constraints */
73  int nvars_ /**< number of variables */
74  );
75 };
76 
77 } /* namespace gcg */
78 #endif /* GCG_ROWGRAPH_H_ */
virtual SCIP_RETCODE createDecompFromPartition(DEC_DECOMP **decomp)
Definition: rowgraph_def.h:62
miscellaneous matrixgraph methods for structure detection
virtual SCIP_RETCODE createPartialdecFromPartition(PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
Definition: rowgraph_def.h:131
gcg::Graph< T > graph
Definition: rowgraph.h:48
RowGraph(SCIP *scip, Weights w)
Definition: rowgraph_def.h:46
virtual ~RowGraph()
Definition: rowgraph_def.h:56
class to manage partial decompositions
miscellaneous graph methods for structure detection
virtual SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
Definition: rowgraph_def.h:243