GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
hyperrowcolgraph.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
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-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file hyperrowcolgraph.h
30 * @brief A hypergraph with row and column nodes
31 * @author Martin Bergner
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#ifndef GCG_HYPERROWCOLGRAPH_H_
37#define GCG_HYPERROWCOLGRAPH_H_
38
39#include "graph/matrixgraph.h"
40#include "graph/hypergraph.h"
43
44namespace gcg {
45template <class T>
47{
48private:
49 Graph<T> graph;
50public:
52 GCG* gcg, /**< GCG data structure */
53 Weights w /**< weights for the given graph */
54 );
55 virtual ~HyperrowcolGraph();
56
58 SCIP_CONS** conss, /**< constraints for which graph should be created */
59 SCIP_VAR** vars, /**< variables for which graph should be created */
60 int nconss, /**< number of constraints */
61 int nvars /**< number of variables */
62 );
63
64 /** creates a graph with open constraints and open variables of the partialdec */
66 DETPROBDATA* detprobdata, /**< detection process information and data */
67 PARTIALDECOMP* partialdec /**< partial decomposition to use for matrix */
68 );
69
70 /** writes the graph to the given file.
71 * The format is graph dependent
72 */
74 int fd, /**< file descriptor where the graph should be written to */
75 SCIP_Bool writeweights /**< whether to write weights */
76 );
77
78
80 GCG_DECOMP** decomp /**< decomposition structure to generate */
81 );
82
83 /** creates a new partialdec by dint of a graph created with all constraints and variables */
85 PARTIALDECOMP** firstpartialdec, /**< pointer to buffer the new partialdec created by dint of the graph (can be NULL) */
86 PARTIALDECOMP** secondpartialdec, /**< pointer to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL) */
87 DETPROBDATA* detprobdata /**< detection process information and data */
88 );
89
90 /** amplifies a partialdec by dint of a graph created with open constraints and open variables of the partialdec */
92 PARTIALDECOMP* oldpartialdec, /**< partialdec which should be amplifies */
93 PARTIALDECOMP** firstpartialdec, /**< pointer to buffer the new partialdec amplified by dint of the graph (can be NULL) */
94 PARTIALDECOMP** secondpartialdec, /**< pinter to buffer the new partialdec whose border is amplified by dint of the graph (can be NULL) */
95 DETPROBDATA* detprobdata /**< detection process information and data */
96 );
97
98 /**
99 * reads the partition from the given file.
100 * The format is graph dependent. The default is a file with one line for each node a
101 */
103 const char* filename /**< filename where the partition is stored */
104 );
105
106 virtual std::vector<int> getNeighbors(
107 int i
108 );
109
110 virtual std::vector<int> getHyperedgeNodes(
111 int i
112 );
113
114 std::vector<int> getConsNonzeroNodes(
115 int i
116 );
117
118 std::vector<int> getVarNonzeroNodes(
119 int i
120 );
121
122};
123
124} /* namespace gcg */
125#endif /* GCG_HYPERROWCOLGRAPH_H_ */
SCIP_VAR * w
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
std::vector< int > getConsNonzeroNodes(int i)
virtual SCIP_RETCODE createDecompFromPartition(GCG_DECOMP **decomp)
virtual std::vector< int > getNeighbors(int i)
virtual SCIP_RETCODE writeToFile(int fd, SCIP_Bool writeweights)
SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss, int nvars)
virtual SCIP_RETCODE readPartition(const char *filename)
virtual SCIP_RETCODE createFromPartialMatrix(DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
virtual SCIP_RETCODE createPartialdecFromPartition(PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
virtual std::vector< int > getHyperedgeNodes(int i)
std::vector< int > getVarNonzeroNodes(int i)
HyperrowcolGraph(GCG *gcg, Weights w)
MatrixGraph(GCG *gcgstruct, Weights w)
class to manage partial decompositions
#define SCIP_Bool
SCIP_VAR ** vars
int i
miscellaneous hypergraph methods for structure detection
miscellaneous matrixgraph methods for structure detection
struct SCIP_Cons SCIP_CONS
struct GCG_Decomp GCG_DECOMP
Definition type_decomp.h:45
struct Gcg GCG
Definition type_gcg.h:44
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_Var SCIP_VAR