GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
type_branchgcg.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 type_branchgcg.h
30 * @ingroup TYPEDEFINITIONS
31 * @brief type definitions for branching rules in GCG projects
32 * @author Gerald Gamrath
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#ifndef GCG_TYPE_BRANCHGCG_H__
38#define GCG_TYPE_BRANCHGCG_H__
39
40#include "scip/def.h"
41#include "scip/type_result.h"
42#include "scip/type_scip.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49typedef struct GCG_BranchData GCG_BRANCHDATA; /**< branching data */
50typedef struct GCG_Branchrule GCG_BRANCHRULE; /**< branching rule */
51typedef struct GCG_BranchConsData GCG_BRANCHCONSDATA; /**< branching cons data */
52
53/** type of variable bound: lower or upper bound */
55{
56 GCG_BOUNDTYPE_LOWER = 0, /**< lower bound */
57 GCG_BOUNDTYPE_UPPER = 1, /**< upper bound */
58 GCG_BOUNDTYPE_FIXED = 2, /**< variable fixed */
59 GCG_BOUNDTYPE_NONE = 3 /**< no bound */
60};
62
63/** activation method for branchrule, called when a node in the master problem is activated,
64 * should perform changes to the current node's problem due to the branchdata
65 *
66 * input:
67 * - gcg : GCG main data structure
68 * - branchdata : the branching data
69 */
70#define GCG_DECL_BRANCHACTIVEMASTER(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata)
71
72/** deactivation method for branchrule, called when a node in the master problem is deactivated,
73 * should undo changes to the current node's problem due to the branchdata
74 *
75 * input:
76 * - gcg : GCG main data structure
77 * - branchdata : the branching data
78 */
79#define GCG_DECL_BRANCHDEACTIVEMASTER(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata)
80
81/** propagation method for branchrule, called when a node in the master problem is propagated,
82 * should perform propagation at the current node due to the branchdata
83 *
84 * input:
85 * - gcg : GCG main data structure
86 * - branchdata : the branching data
87 * - node : the activated node
88 * - result : pointer to store the result of the propagation call
89 *
90 * possible return values for *result:
91 * - SCIP_CUTOFF : the node is infeasible in the variable's bounds and can be cut off
92 * - SCIP_REDUCEDDOM : at least one domain reduction was found
93 * - SCIP_DIDNOTFIND : the propagator searched but did not find any domain reductions
94 * - SCIP_DIDNOTRUN : the propagator was skipped
95 * - SCIP_DELAYED : the propagator was skipped, but should be called again
96
97 */
98#define GCG_DECL_BRANCHPROPMASTER(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata, SCIP_RESULT* result)
99
100/** method for branchrule, called when the master LP is solved at one node,
101 * can store pseudocosts for the branching decisions
102 *
103 * input:
104 * - gcg : GCG main data structure
105 * - branchdata : the branching data
106 * - newlowerbound : the new local lower bound
107 *
108 */
109#define GCG_DECL_BRANCHMASTERSOLVED(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata, SCIP_Real newlowerbound)
110
111/** frees branching data of an origbranch constraint (called when the origbranch constraint is deleted)
112 *
113 * input:
114 * gcg : GCG main data structure
115 * branchdata : pointer to the branching data to free
116 * origbranch : true iff an origbranch triggered this call
117 * force : branch data must be deleted if true
118 */
119#define GCG_DECL_BRANCHDATADELETE(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA** branchdata, SCIP_Bool origbranch, SCIP_Bool force)
120
121/** notify the branching rule that a new mastervariable was created while this node was active
122 *
123 * input:
124 * gcg : GCG main data structure
125 * branchdata : the branching data
126 * mastervar : pointer to the new master variable
127 */
128#define GCG_DECL_BRANCHNEWCOL(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata, SCIP_VAR* mastervar)
129
130/** get the extendedmasterconsdata created by this branching rule, if any
131 *
132 * input:
133 * gcg : GCG main data structure
134 * branchdata : the branching data
135 */
136#define GCG_DECL_BRANCHGETEXTENDEDMASTERCONS(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata, GCG_EXTENDEDMASTERCONSDATA** extendedmasterconsdata)
137
138/** determine the coefficient of a column solution in the extended master cons
139 *
140 * input:
141 * gcg : GCG data structure
142 * branchdata : branch data created by the branch rule
143 * extendedmasterconsdata : the extended master cons data
144 * solvars : array of column solution variables
145 * solvals : array of column solution values
146 * nsolvars : number of column solution variables and values
147 * probnr : the pricing problem that the column belongs to
148 * gcgcol : gcg column if available (or NULL)
149 * coef : the calculated coefficient
150 */
151#define GCG_DECL_BRANCHGETEXTENDEDMASTERCONSCOEFF(x) SCIP_RETCODE x (GCG* gcg, GCG_BRANCHDATA* branchdata, GCG_EXTENDEDMASTERCONSDATA* extendedmasterconsdata, SCIP_VAR** solvars, SCIP_Real* solvals, int nsolvars, int probnr, GCG_COL* gcgcol, SCIP_Real* coef)
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif
struct GCG_BranchData GCG_BRANCHDATA
struct GCG_BranchConsData GCG_BRANCHCONSDATA
enum GCG_BoundType GCG_BOUNDTYPE
GCG_BoundType
@ GCG_BOUNDTYPE_UPPER
@ GCG_BOUNDTYPE_FIXED
@ GCG_BOUNDTYPE_LOWER
@ GCG_BOUNDTYPE_NONE
struct GCG_Branchrule GCG_BRANCHRULE
type definitions for extended master conss in GCG projects