Scippy

GCG

Branch-and-Price & Column Generation for Everyone

cons_masterbranch.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 cons_masterbranch.h
30 * @ingroup CONSHDLRS-GCG
31 * @brief constraint handler for storing the branching decisions at each node of the tree
32 * @author Gerald Gamrath
33 * @author Martin Bergner
34 * @author Christian Puchert
35 * @author Marcel Schmickerath
36 */
37
38#ifndef GCG_CONS_MASTERBRANCH_H__
39#define GCG_CONS_MASTERBRANCH_H__
40
41#include "scip/scip.h"
42#include "gcg/type_branchgcg.h"
43#include "gcg/gcg.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49
50/** creates the handler for masterbranch constraints and includes it in SCIP */
53 GCG* gcg /**< GCG data structure */
54 );
55
56/** creates and captures a masterbranch constraint */
59 GCG* gcg, /**< GCG data structure */
60 SCIP_CONS** cons, /**< pointer to hold the created constraint */
61 const char* name, /**< name of the constraint */
62 SCIP_NODE* node, /**< node at which the constraint should be created */
63 SCIP_CONS* parentcons, /**< parent constraint */
64 GCG_BRANCHRULE* branchrule, /**< pointer to the branching rule */
65 GCG_BRANCHDATA* branchdata, /**< branching data */
66 SCIP_CONS** origbranchconss, /**< original constraints enforcing the branching decision */
67 int norigbranchconss, /**< number of original constraints */
68 int maxorigbranchconss /**< capacity origbranchconss */
69 );
70
71/** returns the name of the constraint */
74 SCIP_CONS* cons /**< masterbranch constraint for which the data is requested */
75 );
76
77/** returns the node in the B&B tree at which the given masterbranch constraint is sticking */
80 SCIP_CONS* cons /**< constraint pointer */
81 );
82
83/** returns the masterbranch constraint of the B&B father of the node at which the
84 * given masterbranch constraint is sticking
85 */
88 SCIP_CONS* cons /**< constraint pointer */
89 );
90
91/** returns the number of masterbranch constraints of the children of the node at which the
92 * given masterbranch constraint is sticking
93 */
96 SCIP_CONS* cons /**< constraint pointer */
97 );
98
99/** returns a masterbranch constraint of a child of the node at which the
100 * given masterbranch constraint is sticking
101 */
104 SCIP_CONS* cons, /**< constraint pointer */
105 int childnr /**< index of the child node */
106 );
107
108/** returns the origbranch constraint of the node in the original program corresponding to the node
109 * which the given masterbranch constraint is sticking
110 */
113 SCIP_CONS* cons /**< constraint pointer */
114 );
115
116/** sets the origbranch constraint of the node in the master program corresponding to the node
117 * at which the given masterbranchbranch constraint is sticking
118 */
121 SCIP_CONS* cons, /**< constraint pointer */
122 SCIP_CONS* origcons /**< original branching constraint */
123 );
124
125/** returns the branching data for a given masterbranch constraint */
128 SCIP_CONS* cons /**< constraint pointer */
129 );
130
131/** sets the branching data for a given masterbranch constraint */
134 SCIP_CONS* cons, /**< masterbranch constraint for which the branching data is requested */
135 GCG_BRANCHDATA* branchdata /**< branching data */
136 );
137
138/** returns the branching rule of the constraint */
141 SCIP_CONS* cons /**< masterbranch constraint for which the data is requested */
142 );
143
144/** adds a bound change on an original variable that was directly copied to the master problem */
147 GCG* gcg, /**< GCG data structure */
148 SCIP_CONS* cons, /**< masterbranch constraint to which the bound change is added */
149 SCIP_VAR* var, /**< variable on which the bound change was performed */
150 GCG_BOUNDTYPE boundtype, /**< bound type of the bound change */
151 SCIP_Real newbound /**< new bound of the variable after the bound change */
152 );
153
154/** returns the constraints in the original problem that enforce the branching decision */
157 SCIP_CONS* cons /**< masterbranch constraint for which the data is requested */
158 );
159
160/** returns the number of constraints in the original problem that enforce the branching decision */
163 SCIP_CONS* cons /**< masterbranch constraint for which the data is requested */
164 );
165
166/** releases the constraints in the original problem that enforce the branching decision
167 * and frees the array holding the constraints
168 */
171 GCG* gcg, /**< GCG instance */
172 SCIP_CONS* cons /**< masterbranch constraint for which the data is freed */
173 );
174
175/** returns the masterbranch constraint of the current node */
178 GCG* gcg /**< GCG data structure */
179 );
180
181/** returns the stack and the number of elements on it */
184 GCG* gcg, /**< GCG data structure */
185 SCIP_CONS*** stack, /**< return value: pointer to the stack */
186 int* nstackelements /**< return value: pointer to int, for number of elements on the stack */
187 );
188
189/** returns the number of elements on the stack */
192 GCG* gcg /**< GCG data structure */
193 );
194
195/** adds initial constraint to root node */
198 GCG* gcg /**< GCG data structure */
199 );
200
201/** adjusts the active-cut bookkeeping of all active masterbranch nodes after a master separator
202 * cut has been removed from the active cuts at the given position */
205 GCG* gcg, /**< GCG data structure */
206 int removedidx /**< position the removed cut had in the active cuts */
207 );
208
209/** check whether the node was generated by generic branching */
212 GCG* gcg /**< GCG data structure */
213 );
214
215/** checks the consistency of the masterbranch constraints in the problem */
218 GCG* gcg /**< GCG data structure */
219 );
220
221#ifdef __cplusplus
222}
223#endif
224
225#endif
GCG_EXPORT SCIP_RETCODE GCGconsMasterbranchAddCopiedVarBndchg(GCG *gcg, SCIP_CONS *cons, SCIP_VAR *var, GCG_BOUNDTYPE boundtype, SCIP_Real newbound)
GCG_EXPORT SCIP_CONS * GCGconsMasterbranchGetActiveCons(GCG *gcg)
GCG_EXPORT GCG_BRANCHDATA * GCGconsMasterbranchGetBranchdata(SCIP_CONS *cons)
GCG_EXPORT GCG_BRANCHRULE * GCGconsMasterbranchGetBranchrule(SCIP_CONS *cons)
GCG_EXPORT void GCGconsMasterbranchGetStack(GCG *gcg, SCIP_CONS ***stack, int *nstackelements)
GCG_EXPORT void GCGconsMasterbranchSetOrigcons(SCIP_CONS *cons, SCIP_CONS *origcons)
GCG_EXPORT SCIP_RETCODE GCGconsMasterbranchReleaseOrigbranchConss(GCG *gcg, SCIP_CONS *cons)
GCG_EXPORT SCIP_CONS * GCGconsMasterbranchGetChildcons(SCIP_CONS *cons, int childnr)
GCG_EXPORT SCIP_CONS * GCGconsMasterbranchGetOrigcons(SCIP_CONS *cons)
GCG_EXPORT void GCGconsMasterbranchCheckConsistency(GCG *gcg)
GCG_EXPORT SCIP_RETCODE GCGcreateConsMasterbranch(GCG *gcg, SCIP_CONS **cons, const char *name, SCIP_NODE *node, SCIP_CONS *parentcons, GCG_BRANCHRULE *branchrule, GCG_BRANCHDATA *branchdata, SCIP_CONS **origbranchconss, int norigbranchconss, int maxorigbranchconss)
GCG_EXPORT char * GCGconsMasterbranchGetName(SCIP_CONS *cons)
GCG_EXPORT int GCGconsMasterbranchGetNStackelements(GCG *gcg)
GCG_EXPORT void GCGconsMasterbranchSetBranchdata(SCIP_CONS *cons, GCG_BRANCHDATA *branchdata)
GCG_EXPORT SCIP_RETCODE GCGconsMasterbranchAddRootCons(GCG *gcg)
GCG_EXPORT SCIP_CONS ** GCGconsMasterbranchGetOrigbranchConss(SCIP_CONS *cons)
GCG_EXPORT int GCGconsMasterbranchGetNChildconss(SCIP_CONS *cons)
GCG_EXPORT SCIP_RETCODE GCGconsMasterbranchActiveCutRemoved(GCG *gcg, int removedidx)
GCG_EXPORT SCIP_Bool GCGcurrentNodeIsGeneric(GCG *gcg)
GCG_EXPORT SCIP_CONS * GCGconsMasterbranchGetParentcons(SCIP_CONS *cons)
GCG_EXPORT int GCGconsMasterbranchGetNOrigbranchConss(SCIP_CONS *cons)
GCG_EXPORT SCIP_RETCODE GCGincludeConshdlrMasterbranch(GCG *gcg)
GCG_EXPORT SCIP_NODE * GCGconsMasterbranchGetNode(SCIP_CONS *cons)
#define GCG_EXPORT
Definition: def.h:59
#define SCIP_Bool
GCG interface methods.
Definition: struct_gcg.h:55
type definitions for branching rules in GCG projects
enum GCG_BoundType GCG_BOUNDTYPE
enum SCIP_Retcode SCIP_RETCODE