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 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_origbranch.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 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#ifndef GCG_CONS_ORIGBRANCH_H__
38#define GCG_CONS_ORIGBRANCH_H__
39
40#include "scip/scip.h"
41#include "gcg/type_branchgcg.h"
42#include "gcg/gcg.h"
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48/** creates the handler for origbranch constraints and includes it in SCIP */
51 GCG* gcg /**< GCG data structure */
52 );
53
54/** creates and captures a origbranch constraint */
57 GCG* gcg, /**< GCG data structure */
58 SCIP_CONS** cons, /**< pointer to hold the created constraint */
59 const char* name, /**< name of constraint */
60 SCIP_NODE* node, /**< the node to which this origbranch constraint belongs */
61 SCIP_CONS* parentcons, /**< origbranch constraint associated with the father node */
62 GCG_BRANCHRULE* branchrule, /**< the branching rule that created the b&b node the constraint belongs to */
63 GCG_BRANCHDATA* branchdata /**< branching data storing information about the branching restrictions at the
64 * corresponding node */
65 );
66
67/** returns the branch orig constraint of the current node, only needs the pointer to scip */
70 GCG* gcg /**< GCG data structure */
71 );
72
73/** returns the stack and the number of elements on it */
76 GCG* gcg, /**< GCG data structure */
77 SCIP_CONS*** stack, /**< return value: pointer to the stack */
78 int* nstackelements /**< return value: pointer to int, for number of elements on the stack */
79 );
80
81/** sets the branching data for a given origbranch constraint */
84 SCIP_CONS* cons, /**< origbranch constraint for which the branching data is requested */
85 GCG_BRANCHDATA* branchdata /**< branching data */
86 );
87
88/** returns the branching data for a given origbranch constraint */
91 SCIP_CONS* cons /**< origbranch constraint for which the branching data is requested */
92 );
93
94/** returns the branching rule for a given origbranch constraint */
97 SCIP_CONS* cons /**< origbranch constraint for which the branchrule is requested */
98 );
99
100/** returns the node in the B&B tree at which the given origbranch constraint is sticking */
103 SCIP_CONS* cons /**< origbranch constraint for which the corresponding node is requested */
104 );
105
106/** returns the origbranch constraint of the B&B father of the node at which the
107 * given origbranch constraint is sticking
108 */
111 SCIP_CONS* cons /**< origbranch constraint for which the origbranch constraint of
112 * the father node is requested */
113 );
114
115/** returns the number of origbranch constraints of the children of the node at which the
116 * given origbranch constraint is sticking
117 */
120 SCIP_CONS* cons /**< constraint pointer */
121 );
122
123/** returns an origbranch constraint of a child of the node at which the
124 * given origbranch constraint is sticking
125 */
128 SCIP_CONS* cons, /**< constraint */
129 int childnr /**< number of child */
130 );
131
132
133/** sets the masterbranch constraint of the node in the master program corresponding to the node
134 * at which the given origbranchbranch constraint is sticking
135 */
138 SCIP_CONS* cons, /**< origbranch constraint for which the masterbranch constraint should be set */
139 SCIP_CONS* mastercons /**< masterbranch constraint corresponding to the given origbranch constraint */
140 );
141
142/** returns the masterbranch constraint of the node in the master program corresponding to the node
143 * at which the given origbranchbranch constraint is sticking
144 */
147 SCIP_CONS* cons /**< origbranch constraint for which the corresponding masterbranch
148 * constraint is requested */
149 );
150
151/** adds initial constraint to root node */
154 GCG* gcg /**< GCG data structure */
155 );
156
157/** checks the consistency of the origbranch constraints in the problem */
160 GCG* gcg /**< GCG data structure */
161 );
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif
GCG_EXPORT GCG_BRANCHDATA * GCGconsOrigbranchGetBranchdata(SCIP_CONS *cons)
GCG_EXPORT void GCGconsOrigbranchSetMastercons(SCIP_CONS *cons, SCIP_CONS *mastercons)
GCG_EXPORT SCIP_RETCODE GCGconsOrigbranchAddRootCons(GCG *gcg)
GCG_EXPORT SCIP_CONS * GCGconsOrigbranchGetChildcons(SCIP_CONS *cons, int childnr)
GCG_EXPORT void GCGconsOrigbranchGetStack(GCG *gcg, SCIP_CONS ***stack, int *nstackelements)
GCG_EXPORT SCIP_NODE * GCGconsOrigbranchGetNode(SCIP_CONS *cons)
GCG_EXPORT void GCGconsOrigbranchCheckConsistency(GCG *gcg)
GCG_EXPORT SCIP_CONS * GCGconsOrigbranchGetMastercons(SCIP_CONS *cons)
GCG_EXPORT SCIP_CONS * GCGconsOrigbranchGetActiveCons(GCG *gcg)
GCG_EXPORT int GCGconsOrigbranchGetNChildconss(SCIP_CONS *cons)
GCG_EXPORT GCG_BRANCHRULE * GCGconsOrigbranchGetBranchrule(SCIP_CONS *cons)
GCG_EXPORT SCIP_CONS * GCGconsOrigbranchGetParentcons(SCIP_CONS *cons)
GCG_EXPORT SCIP_RETCODE GCGcreateConsOrigbranch(GCG *gcg, SCIP_CONS **cons, const char *name, SCIP_NODE *node, SCIP_CONS *parentcons, GCG_BRANCHRULE *branchrule, GCG_BRANCHDATA *branchdata)
GCG_EXPORT void GCGconsOrigbranchSetBranchdata(SCIP_CONS *cons, GCG_BRANCHDATA *branchdata)
GCG_EXPORT SCIP_RETCODE GCGincludeConshdlrOrigbranch(GCG *gcg)
#define GCG_EXPORT
Definition: def.h:59
GCG interface methods.
Definition: struct_gcg.h:55
type definitions for branching rules in GCG projects
enum SCIP_Retcode SCIP_RETCODE