hypercolgraph.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-2018 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 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef GCG_HYPERCOLGRAPH_H_
36 #define GCG_HYPERCOLGRAPH_H_
37 
38 #include "matrixgraph.h"
39 #include "hypergraph.h"
40 #include "class_seeed.h"
41 #include "class_seeedpool.h"
42 
43 namespace gcg
44 {
45 template <class T>
47 {
48 
49 private:
50  Hypergraph<T> graph;
51 protected:
52  class function {
53  int diff;
54  public:
55  function(int i):diff(i) {}
56  int operator()(int i) { return i-diff;}
57  };
58 
59 public:
61  SCIP* scip,
62  Weights w
63  );
64 
65  virtual ~HypercolGraph();
66 
70  SCIP_RETCODE writeToFile(
71  int fd,
72  SCIP_Bool edgeweights
73  );
74 
76  virtual int getNNodes();
77 
79  virtual int getNEdges();
80 
81  virtual std::vector<int> getNeighbors(
82  int i
83  )
84  {
85  return this->graph.getNeighbors(i);
86  }
87 
88  virtual std::vector<int> getHyperedgeNodes(
89  int i
90  );
91 
96  virtual SCIP_RETCODE readPartition(
97  const char* filename
98  )
99  {
100  SCIP_CALL( this->graph.readPartition(filename) );
101  return SCIP_OKAY;
102  }
103 
104  virtual SCIP_RETCODE createFromMatrix(
105  SCIP_CONS** conss,
106  SCIP_VAR** vars,
107  int nconss_,
108  int nvars_
109  );
110 
112  virtual SCIP_RETCODE createFromPartialMatrix(
113  Seeedpool* seeedpool,
114  Seeed* seeed
115  );
116 
117  virtual SCIP_RETCODE createDecompFromPartition(
118  DEC_DECOMP** decomp
119  );
120 
122  virtual SCIP_RETCODE createSeeedFromPartition(
123  Seeed** firstSeeed,
124  Seeed** secondSeeed,
125  Seeedpool* seeedpool
126  );
127 
129  virtual SCIP_RETCODE createSeeedFromPartition(
130  Seeed* oldSeeed,
131  Seeed** firstSeeed,
132  Seeed** secondSeeed,
133  Seeedpool* seeedpool
134  );
135 };
136 
137 } /* namespace gcg */
138 #endif /* GCG_HYPERCOLGRAPH_H_ */
virtual SCIP_RETCODE readPartition(const char *filename)
Definition: hypercolgraph.h:96
std::vector< int > getNeighbors(int i)
miscellaneous matrixgraph methods for structure detection
virtual SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
miscellaneous hypergraph methods for structure detection
virtual SCIP_RETCODE createSeeedFromPartition(Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
virtual SCIP_RETCODE createFromPartialMatrix(Seeedpool *seeedpool, Seeed *seeed)
virtual SCIP_RETCODE createDecompFromPartition(DEC_DECOMP **decomp)
virtual std::vector< int > getHyperedgeNodes(int i)
virtual int getNEdges()
virtual std::vector< int > getNeighbors(int i)
Definition: hypercolgraph.h:81
SCIP_RETCODE readPartition(const char *filename)
class to manage partial decompositions (aka seeed), each seeed corresponds to one seeedpool which con...
Definition: class_seeed.h:71
virtual int getNNodes()
SCIP_RETCODE writeToFile(int fd, SCIP_Bool edgeweights)
class with functions for seeed pool where a seeed is a (potentially incomplete) description of a deco...
struct DecDecomp DEC_DECOMP
Definition: type_decomp.h:43
HypercolGraph(SCIP *scip, Weights w)