hyperrowgraph.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 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 
37 #ifndef GCG_HYPERROWGRAPH_H_
38 #define GCG_HYPERROWGRAPH_H_
39 
40 #include "matrixgraph.h"
41 #include "hypergraph.h"
42 #include "class_seeed.h"
43 #include "class_seeedpool.h"
44 
45 namespace gcg
46 {
47 template <class T>
49 {
50 private:
51  Hypergraph<T> graph;
52 public:
54  SCIP* scip,
55  Weights w
56  );
57 
58  virtual ~HyperrowGraph();
59 
63  SCIP_RETCODE writeToFile(
64  int fd,
65  SCIP_Bool edgeweights
66  );
67 
69  virtual int getNNodes();
70 
72  virtual int getNEdges();
73 
75  virtual int getNNeighbors(
76  int i
77  );
78 
79  virtual std::vector<int> getNeighbors(
80  int i
81  )
82  {
83  return this->graph.getNeighbors(i);
84  }
85 
86  virtual std::vector<int> getHyperedgeNodes(
87  int i
88  );
89 
94  virtual SCIP_RETCODE readPartition(
95  const char* filename
96  )
97  {
98  SCIP_CALL( this->graph.readPartition(filename) );
99  return SCIP_OKAY;
100  }
101 
103  virtual std::vector<int> getPartition()
104  {
105  return this->graph.getPartition();
106  }
107 
108  virtual SCIP_RETCODE createDecompFromPartition(
109  DEC_DECOMP** decomp
110  );
111 
113  virtual SCIP_RETCODE createSeeedFromPartition(
114  Seeed* oldSeeed,
115  Seeed** firstSeeed,
116  Seeed** secondSeeed,
117  Seeedpool* seeedpool
118  );
119 
121  virtual SCIP_RETCODE createSeeedFromPartition(
122  Seeed** firstSeeed,
123  Seeed** secondSeeed,
124  Seeedpool* seeedpool
125  );
126 
127  virtual SCIP_RETCODE createFromMatrix(
128  SCIP_CONS** conss,
129  SCIP_VAR** vars,
130  int nconss_,
131  int nvars_
132  );
133 
135  virtual SCIP_RETCODE createFromPartialMatrix(
136  Seeedpool* seeedpool,
137  Seeed* seeed
138  );
139 
140 };
141 
142 } /* namespace gcg */
143 #endif /* GCG_HYPERROWGRAPH_H_ */
std::vector< int > getNeighbors(int i)
miscellaneous matrixgraph methods for structure detection
miscellaneous hypergraph methods for structure detection
virtual SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
virtual std::vector< int > getPartition() const
virtual std::vector< int > getNeighbors(int i)
Definition: hyperrowgraph.h:79
virtual SCIP_RETCODE createDecompFromPartition(DEC_DECOMP **decomp)
HyperrowGraph(SCIP *scip, Weights w)
virtual std::vector< int > getHyperedgeNodes(int i)
virtual int getNNodes()
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 SCIP_RETCODE readPartition(const char *filename)
Definition: hyperrowgraph.h:94
virtual SCIP_RETCODE createSeeedFromPartition(Seeed *oldSeeed, Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
virtual int getNNeighbors(int i)
SCIP_RETCODE writeToFile(int fd, SCIP_Bool edgeweights)
virtual int getNEdges()
virtual std::vector< int > getPartition()
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
virtual SCIP_RETCODE createFromPartialMatrix(Seeedpool *seeedpool, Seeed *seeed)