GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
gcgsepa.c
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 gcgsepa.c
30 * @brief methods for GCG separators
31 * @author Christian Puchert
32 * @author Jonas Witt
33 * @author Erik Muehmer
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#include "gcg/gcg.h"
39
40#include "gcg/pub_gcgsepa.h"
41#include "gcg/struct_sepagcg.h"
42
43
44/** resets the parameters to disable separators */
45static
47 GCG* gcg /**< GCG data structure */
48 )
49{
52
53 /* set specific parameters for GCG basis separator, if the separator is included */
54#ifndef NDEBUG
55 if( SCIPfindSepa(GCGgetMasterprob(gcg), "basis") != NULL )
56#endif
57 {
58 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/basis/enable", FALSE) );
59 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/enable = FALSE\n");
60 }
61
62 /* set specific parameters for GCG master separator, if the separator is included */
63#ifndef NDEBUG
64 if( SCIPfindSepa(GCGgetMasterprob(gcg), "master") != NULL )
65#endif
66 {
67 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/master/enable", FALSE) );
68 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/enable = FALSE\n");
69 }
70
71 return SCIP_OKAY;
72}
73
74/** resets the parameters to their default value */
75static
77 GCG* gcg /**< GCG data structure */
78 )
79{
82
83 /* set specific parameters for GCG basis separator, if the separator is included */
84#ifndef NDEBUG
85 if( SCIPfindSepa(GCGgetMasterprob(gcg), "basis") != NULL )
86#endif
87 {
88 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/basis/enable", TRUE) );
89 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/enable = TRUE\n");
90
91 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/basis/paramsetting", 0) );
92 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/paramsetting = %d\n", 0);
93 }
94
95 /* set specific parameters for GCG master separator, if the separator is included */
96#ifndef NDEBUG
97 if( SCIPfindSepa(GCGgetMasterprob(gcg), "master") != NULL )
98#endif
99 {
100 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/master/enable", TRUE) );
101 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/enable = TRUE\n");
102
103 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/master/paramsetting", 0) );
104 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/paramsetting = %d\n", 0);
105 }
106
107 return SCIP_OKAY;
108}
109
110/** sets the parameters to aggressive values */
111static
113 GCG* gcg /**< GCG data structure */
114 )
115{
117 assert(origprob != NULL);
118
119 /* set specific parameters for GCG basis separator, if the separator is included */
120#ifndef NDEBUG
121 if( SCIPfindSepa(GCGgetMasterprob(gcg), "basis") != NULL )
122#endif
123 {
124 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/basis/enable", TRUE) );
125 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/enable = TRUE\n");
126
127 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/basis/paramsetting", 1) );
128 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/paramsetting = %d\n", 1);
129 }
130
131 /* set specific parameters for GCG master separator, if the separator is included */
132#ifndef NDEBUG
133 if( SCIPfindSepa(GCGgetMasterprob(gcg), "master") != NULL )
134#endif
135 {
136 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/master/enable", TRUE) );
137 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/enable = TRUE\n");
138
139 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/master/paramsetting", 1) );
140 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/paramsetting = %d\n", 1);
141 }
142
143 return SCIP_OKAY;
144}
145
146/** sets the parameters to fast values */
147static
149 GCG* gcg /**< GCG data structure */
150 )
151{
153 /* set specific parameters for GCG basis separator, if the separator is included */
154#ifndef NDEBUG
155 if( SCIPfindSepa(GCGgetMasterprob(gcg), "basis") != NULL )
156#endif
157 {
158 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/basis/enable", TRUE) );
159 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/enable = TRUE\n");
160
161 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/basis/paramsetting", 2) );
162 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/basis/paramsetting = %d\n", 2);
163 }
164
165 /* set specific parameters for GCG master separator, if the separator is included */
166#ifndef NDEBUG
167 if( SCIPfindSepa(GCGgetMasterprob(gcg), "master") != NULL )
168#endif
169 {
170 SCIP_CALL( SCIPsetBoolParam(origprob, "sepa/master/enable", TRUE) );
171 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/enable = TRUE\n");
172
173 SCIP_CALL( SCIPsetIntParam(origprob, "sepa/master/paramsetting", 2) );
174 SCIPverbMessage(origprob, SCIP_VERBLEVEL_NORMAL, NULL, "sepa/master/paramsetting = %d\n", 2);
175 }
176
177 return SCIP_OKAY;
178}
179
180/** sets separator parameters values to
181 *
182 * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separator parameters
183 * - SCIP_PARAMSETTING_FAST such that the time spend for separator is decreased
184 * - SCIP_PARAMSETTING_AGGRESSIVE such that the separator are called more aggregative
185 * - SCIP_PARAMSETTING_OFF which turns off all separators
186 */
188 GCG* gcg, /**< GCG data structure */
189 SCIP_PARAMSETTING paramsetting /**< parameter settings */
190 )
191{
192 assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
193 || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
194
195 switch( paramsetting )
196 {
199 break;
202 break;
205 break;
208 break;
209 default:
210 SCIPerrorMessage("The given paramsetting is invalid!\n");
211 break;
212 }
213
214 return SCIP_OKAY;
215}
216
217#ifndef NDEBUG
218/** returns the pointer to the SCIP_SEPA object */
220 GCG_SEPA* gcgsepa /**< gcg separator data structure */
221 )
222{
223 assert(gcgsepa != NULL);
224 return gcgsepa->separator;
225}
226#endif
#define TRUE
#define FALSE
GCG interface methods.
static SCIP_RETCODE setSeparatorsDefault(GCG *gcg)
Definition gcgsepa.c:76
static SCIP_RETCODE setSeparatorsOff(GCG *gcg)
Definition gcgsepa.c:46
static SCIP_RETCODE setSeparatorsAggressive(GCG *gcg)
Definition gcgsepa.c:112
SCIP_SEPA * GCGsepaGetScipSeparator(GCG_SEPA *gcgsepa)
Definition gcgsepa.c:219
static SCIP_RETCODE setSeparatorsFast(GCG *gcg)
Definition gcgsepa.c:148
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
SCIP_RETCODE GCGsetSeparators(GCG *gcg, SCIP_PARAMSETTING paramsetting)
Definition gcgsepa.c:187
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIP * origprob
#define NULL
public methods for GCG separators
#define SCIPerrorMessage
SCIP_SEPA * separator
data structures for separators for master
struct Gcg GCG
Definition type_gcg.h:44
SCIP_VERBLEVEL_NORMAL
SCIP_PARAMSETTING_OFF
SCIP_PARAMSETTING_AGGRESSIVE
SCIP_PARAMSETTING_DEFAULT
SCIP_PARAMSETTING_FAST
enum SCIP_ParamSetting SCIP_PARAMSETTING
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct SCIP_Sepa SCIP_SEPA
struct GCG_Sepa GCG_SEPA