Scippy

GCG

Branch-and-Price & Column Generation for Everyone

cons_origbranch.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 cons_origbranch.h
29  * @brief constraint handler for storing the branching decisions at each node of the tree
30  * @author Gerald Gamrath
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef GCG_CONS_ORIGBRANCH_H__
36 #define GCG_CONS_ORIGBRANCH_H__
37 
38 #include "scip/scip.h"
39 #include "type_branchgcg.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /** creates the handler for origbranch constraints and includes it in SCIP */
46 extern
48  SCIP* scip /**< SCIP data structure */
49  );
50 
51 /** creates and captures a origbranch constraint */
52 extern
53 SCIP_RETCODE GCGcreateConsOrigbranch(
54  SCIP* scip, /**< SCIP data structure */
55  SCIP_CONS** cons, /**< pointer to hold the created constraint */
56  const char* name, /**< name of constraint */
57  SCIP_NODE* node, /**< the node to which this origbranch constraint belongs */
58  SCIP_CONS* parentcons, /**< origbranch constraint associated with the father node */
59  SCIP_BRANCHRULE* branchrule, /**< the branching rule that created the b&b node the constraint belongs to */
60  GCG_BRANCHDATA* branchdata /**< branching data storing information about the branching restrictions at the
61  * corresponding node */
62  );
63 
64 /** returns the branch orig constraint of the current node, only needs the pointer to scip */
65 extern
67  SCIP* scip /**< SCIP data structure */
68  );
69 
70 /** returns the stack and the number of elements on it */
71 extern
73  SCIP* scip, /**< SCIP data structure */
74  SCIP_CONS*** stack, /**< return value: pointer to the stack */
75  int* nstackelements /**< return value: pointer to int, for number of elements on the stack */
76  );
77 
78 /** set the branching data for a given origbranch constraint */
79 extern
81  SCIP_CONS* cons, /**< origbranch constraint for which the branching data is requested */
82  GCG_BRANCHDATA* branchdata /**< branching data */
83  );
84 
85 /** returns the branching data for a given origbranch constraint */
86 extern
88  SCIP_CONS* cons /**< origbranch constraint for which the branching data is requested */
89  );
90 
91 /** returns the branching rule for a given origbranch constraint */
92 extern
93 SCIP_BRANCHRULE* GCGconsOrigbranchGetBranchrule(
94  SCIP_CONS* cons /**< origbranch constraint for which the branchrule is requested */
95  );
96 
97 /** returns the node in the B&B tree at which the given origbranch constraint is sticking */
98 extern
99 SCIP_NODE* GCGconsOrigbranchGetNode(
100  SCIP_CONS* cons /**< origbranch constraint for which the corresponding node is requested */
101  );
102 
103 /** returns the origbranch constraint of the B&B father of the node at which the
104  * given origbranch constraint is sticking
105  */
106 extern
108  SCIP_CONS* cons /**< origbranch constraint for which the origbranch constraint of
109  * the father node is requested */
110  );
111 
112 /** returns the number of origbranch constraints of the children of the node at which the
113  * given origbranch constraint is sticking
114  */
115 extern
117  SCIP_CONS* cons /**< constraint pointer */
118  );
119 
120 /** returns an origbranch constraint of a child of the node at which the
121  * given origbranch constraint is sticking
122  */
123 extern
125  SCIP_CONS* cons, /**< constraint */
126  int childnr /**< number of child */
127  );
128 
129 
130 /** sets the masterbranch constraint of the node in the master program corresponding to the node
131  * at which the given origbranchbranch constraint is sticking
132  */
133 extern
135  SCIP_CONS* cons, /**< origbranch constraint for which the masterbranch constraint should be set */
136  SCIP_CONS* mastercons /**< masterbranch constraint corresponding to the given origbranch constraint */
137  );
138 
139 /** returns the masterbranch constraint of the node in the master program corresponding to the node
140  * at which the given origbranchbranch constraint is sticking
141  */
142 extern
144  SCIP_CONS* cons /**< origbranch constraint for which the corresponding masterbranch
145  * constraint is requested */
146  );
147 
148 /** adds initial constraint to root node */
149 extern
150 SCIP_RETCODE GCGconsOrigbranchAddRootCons(
151  SCIP* scip /**< SCIP data structure */
152  );
153 
154 /** checks the consistency of the origbranch constraints in the problem */
155 extern
157  SCIP* scip /**< SCIP data structure */
158  );
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif
type definitions for branching rules in GCG projects
SCIP_RETCODE SCIPincludeConshdlrOrigbranch(SCIP *scip)
SCIP_RETCODE GCGcreateConsOrigbranch(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_NODE *node, SCIP_CONS *parentcons, SCIP_BRANCHRULE *branchrule, GCG_BRANCHDATA *branchdata)
void GCGconsOrigbranchSetMastercons(SCIP_CONS *cons, SCIP_CONS *mastercons)
GCG_BRANCHDATA * GCGconsOrigbranchGetBranchdata(SCIP_CONS *cons)
SCIP_RETCODE GCGconsOrigbranchAddRootCons(SCIP *scip)
void GCGconsOrigbranchCheckConsistency(SCIP *scip)
SCIP_CONS * GCGconsOrigbranchGetChildcons(SCIP_CONS *cons, int childnr)
SCIP_NODE * GCGconsOrigbranchGetNode(SCIP_CONS *cons)
SCIP_BRANCHRULE * GCGconsOrigbranchGetBranchrule(SCIP_CONS *cons)
SCIP_CONS * GCGconsOrigbranchGetActiveCons(SCIP *scip)
SCIP_CONS * GCGconsOrigbranchGetParentcons(SCIP_CONS *cons)
void GCGconsOrigbranchSetBranchdata(SCIP_CONS *cons, GCG_BRANCHDATA *branchdata)
SCIP_CONS * GCGconsOrigbranchGetMastercons(SCIP_CONS *cons)
int GCGconsOrigbranchGetNChildconss(SCIP_CONS *cons)
void GCGconsOrigbranchGetStack(SCIP *scip, SCIP_CONS ***stack, int *nstackelements)