GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
sepa_subsetrow.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 sepa_subsetrow.c
30 * @brief subset row separator for master problem
31 * @author Chantal Reinartz Groba
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35//#define SCIP_DEBUG
36
37#include <assert.h>
38#include <scip/cons_linear.h>
39
40#include "gcg/mastersepacut.h"
41#include "gcg/pricer_gcg.h"
42#include "gcg/relax_gcg.h"
43#include "gcg/scip_misc.h"
44#include "gcg/sepa_subsetrow.h"
46#include "gcg/struct_sepagcg.h"
48
49#define SEPA_NAME "subsetrow"
50#define SEPA_DESC "subsetrow separator"
51#define SEPA_ENABLED FALSE /**< should the separator be enabled by default? */
52#define SEPA_PRIORITY 100
53#define SEPA_FREQ 1 /**< default frequency: 1 --> callback is executed for subproblems at every level*/
54#define SEPA_MAXBOUNDDIST 1.0
55#define SEPA_USESSUBSCIP FALSE /**< does the separator use a secondary SCIP instance? */
56#define SEPA_DELAY TRUE /**< should separation method be delayed, if other separators found cuts? */
57
58#define DEFAULT_RANDSEED 71 /**< initial seed for RandomNumber Generator which picks the constraint indices*/
59#define DEFAULT_MAXROUNDS 1 /**< maximal number of subset row separation rounds per non-root node */
60#define DEFAULT_MAXROUNDSROOT 1 /**< maximal number of subset row separation calls in the root node */
61#define DEFAULT_MAXCUTCANDS 1000 /**< maximal number of subset row cut candidates per call in non-root nodes */
62#define DEFAULT_MAXCUTCANDSROOT 2000 /**< maximal number of subset row cut candidates per call in root node */
63#define DEFAULT_MAXCUTS 100 /**< maximal number of subset row cuts in total */
64#define DEFAULT_MINEFFICACY 0.01 /**< required minimum cut efficacy */
65#define DEFAULT_ONLYROOT FALSE /**< only apply separator in root node */
66#define DEFAULT_STRATEGY 2 /**< strategy which is used to determine which rows to consider for cut computation */
67#define DEFAULT_N 3 /**< number of rows used to create a new cut */
68#define DEFAULT_L 2 /**< inverse of weight used for cut generation */
69#define DEFAULT_ONLYAGGREGATED TRUE /**< run only on aggregated problems */
70
71#define STRATEGY_SR_RANDOM 0 /**< randomly select n constraints */
72#define STRATEGY_ZEROHALF 1 /**< use zerohalf cut separator to select constraints */
73#define STRATEGY_SR_ENUMERATE 2 /**< enumerate all subsets of size n */
74#define STRATEGY_MAX 2 /**< maximal strategy value */
75
76/*
77 * Data structures
78 */
79
80/** separator data */
81struct SCIP_SepaData
82{
83 GCG* gcg; /**< GCG data structure */
84 GCG_SEPA* sepa; /**< gcg master separator instance */
85 SCIP_RANDNUMGEN* randnumgen; /**< random number generator (for strategy RANDOM) */
86 SCIP_Bool enable; /**< is this separator enabled? */
87 int ngeneratedcut; /**< counts the total number of cuts generated */
88 int maxrounds; /**< maximal number of separation calls per non-root node */
89 int maxroundsroot; /**< maximal number of separation calls for root node */
90 int maxcutcandsroot; /**< number of cut candidates generated per separation call of root node */
91 int maxcutcands; /**< number of cut candidates generated per separation call at non-root node */
92 int maxcuts; /**< maximal number of cuts generated in total */
93 SCIP_Real minefficacy; /**< required minimum cut efficacy */
94 int strategy; /**< strategy used to separate cuts (see defines above) */
95 int n; /**< n = |S| > 0 : number of constraints used to construct cut */
96 int l; /**< l > 0 : defines the weights 1/l */
97 SCIP_Bool onlyaggregated; /**< indicates if separator should only run on aggregated problems */
98 SCIP_CONS** origmasterconss; /**< array of (filtered) orig master conss (is only allocated if not equal to data of relaxator) */
99 SCIP_CONS** masterconss; /**< array of (filtered) master conss (is only allocated if not equal to data of relaxator) */
100 int* conssfullindices; /**< for each (filtered) master cons its index in the relaxator's master conss array (only allocated if filtered) */
101 int nmasterconss; /**< number of (filtered) master conss */
102 SCIP_Bool filteredmasterconss; /**< do origmasterconss and masterconss point to allocated arrays? */
103 SCIP_Bool paramschgd; /**< have the parameters been changed? */
104};
105
106
107/** randomly selects n different constraints from the master problem */
108static
110 SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
111 int nmasterconss, /**< number of constraints in the master problem */
112 int* selectedmasterconssidx, /**< pointer to store the indices of the selected constraints */
113 int n /**< number of constraints to be selected */
114 )
115{
116 int i;
117 int j;
118
119 assert(n > 0 && n < nmasterconss);
120
121 /* randomly select n indices out of [0, ..., nmasterconss - 1] */
122 i = 0;
123 while( i < n )
124 {
125 selectedmasterconssidx[i] = SCIPrandomGetInt(randnumgen, 0, nmasterconss-1);
126
127 /* if we get an element that we already had, we will draw again */
128 for( j = 0; j < i; j++ )
129 {
130 if( selectedmasterconssidx[i] == selectedmasterconssidx[j] )
131 {
132 --i;
133 break;
134 }
135 }
136 ++i;
137 }
138#ifdef SCIP_DEBUG
139 /*for( i = 0; i < n; i++ )
140 {
141 SCIPdebugMessage("select index %i\n", selectedmasterconssidx[i]);
142 assert(0 <= selectedmasterconssidx[i] && selectedmasterconssidx[i] < nmasterconss);
143 }*/
144#endif
145
146 return SCIP_OKAY;
147}
148
149/** create a new row for master problem and fill it with the variables (+ their coefficients) and right-hand side*/
150static
152 SCIP* masterscip, /**< SCIP data structure (master problem) */
153 SCIP_ROW** ssrc, /**< pointer to store subset row cut */
154 SCIP_HASHMAP* mapmastervarxcoeffs, /**< maps master variables to their coefficient in subset-row cut */
155 SCIP_Real rhs_ssrc, /**< right hand side of subset row cut */
156 SCIP_SEPA* sepa, /**< separator which creates subset row cut */
157 SCIP_Bool local /**< is the cut local? */
158 )
159{
160 SCIP_SEPADATA* sepadata;
161 char name[SCIP_MAXSTRLEN]; // name of the ssrc
162 int nentries;
163 int i;
164
165 assert(GCGisMaster(masterscip));
166 assert(sepa != NULL);
167
168 sepadata = SCIPsepaGetData(sepa);
169
170 /* create 'empty' subset row cut of form -inf <= ... <= rhs_ssrc
171 * - local, removable, modifiable */
172 rhs_ssrc = SCIPfeasFloor(masterscip, rhs_ssrc);
173 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "ssrc_%i", sepadata->ngeneratedcut);
174 SCIP_CALL( SCIPcreateEmptyRowSepa(masterscip, &(*ssrc), sepa, name, -SCIPinfinity(masterscip), rhs_ssrc, local, TRUE, TRUE) );
175 assert(ssrc != NULL);
176 assert(*ssrc != NULL);
177
178 /* fill the row with master variables and their coefficients */
179 nentries = SCIPhashmapGetNEntries(mapmastervarxcoeffs);
180 SCIP_CALL( SCIPcacheRowExtensions(masterscip, *ssrc) );
181 for( i = 0; i < nentries; i++ )
182 {
183 SCIP_HASHMAPENTRY* entry;
184 SCIP_Real varcoeff;
185 SCIP_VAR* mastervar;
186
187 entry = SCIPhashmapGetEntry(mapmastervarxcoeffs, i);
188 if( entry == NULL )
189 continue;
190
191 mastervar = (SCIP_VAR*) SCIPhashmapEntryGetOrigin(entry);
192 varcoeff = SCIPhashmapEntryGetImageReal(entry);
193 varcoeff = SCIPfeasFloor(masterscip, varcoeff);
194 if( !SCIPisZero(masterscip, varcoeff) )
195 SCIP_CALL( SCIPaddVarToRow(masterscip, *ssrc, mastervar, varcoeff) );
196 }
197 SCIP_CALL( SCIPflushRowExtensions(masterscip, *ssrc) );
198
199 return SCIP_OKAY;
200}
201
202/** computes the rhs (w^Tb) and the coefficient for each variable (w^Ta_p) in the cut (still non-rounded) */
203static
205 SCIP* masterscip, /**< SCIP data structure (master problem) */
206 SCIP_SEPA* sepa, /**< SCIP separator */
207 SCIP_CONS** masterconss, /**< constraints of the master problem */
208 int* selectedconssidx, /**< indices of the selected constraints */
209 int nselectedconss, /**< number of selected constraints */
210 SCIP_Real** weights, /**< pointer to store weights of the selected constraints */
211 SCIP_Real* rhs_ssrc, /**< pointer to store rhs of subset row cut */
212 SCIP_HASHMAP* mapmastervarxcoeff, /**< maps master variable to its coefficient in subset-row cut */
213 SCIP_Bool* local /**< pointer to store if the cut is local */
214 )
215{
216 SCIP_SEPADATA* sepadata;
218 int nmasterconsvars;
219 int i;
220 int j;
221 int l;
222
223 assert(masterscip != NULL);
224 assert(sepa != NULL);
225 sepadata = SCIPsepaGetData(sepa);
226 assert(sepadata != NULL);
227
228 *rhs_ssrc = 0;
229 *local = FALSE;
230
231 if( sepadata->strategy == STRATEGY_ZEROHALF )
232 l = 2;
233 else
234 l = sepadata->l;
235
236 for( i = 0; i < nselectedconss; i++ )
237 {
238 SCIP_CONS* mastercons;
239 SCIP_VAR** masterconsvars = NULL;
240 SCIP_Real* masterconscoeffs = NULL;
241 SCIP_Real rhs_mastercons;
242 SCIP_Real lhs_mastercons;
243
244 /* lhs <= ax <= rhs */
245 SCIPdebugMessage("select constraint: %i\n", selectedconssidx[i]);
246 mastercons = masterconss[selectedconssidx[i]];
247
248 if( SCIPconsIsLocal(mastercons) )
249 *local = TRUE;
250
251 SCIPdebugPrintCons(masterscip, mastercons, NULL);
252 lhs_mastercons = SCIPconsGetLhs(masterscip, mastercons, &success);
254 rhs_mastercons = SCIPconsGetRhs(masterscip, mastercons, &success);
256
257 /* we want all constraints to have form ax <= b to simplify the summation
258 * - if constraint has form ax <= b: weight is 1/l
259 * - if constraint has form b <= ax: weight is -1/l (to transform it to -ax <= -b) */
260 if( SCIPisInfinity(masterscip, -lhs_mastercons ) ) // lhs = -inf --> constraint has form: ax <= b
261 {
262 (*weights)[i] = 1.0 / l;
263 (*rhs_ssrc) += (*weights)[i] * rhs_mastercons;
264 SCIPdebugMessage("master constraint %s (ax <= %f) with weight %f\n", SCIPconsGetName(mastercons), rhs_mastercons, (*weights)[i]);
265 }
266 else if( SCIPisInfinity(masterscip, rhs_mastercons ) ) // lhs != -inf & rhs = inf --> constraint has form: b <= ax
267 {
268 (*weights)[i] = -1.0 / l;
269 (*rhs_ssrc) += (*weights)[i] * lhs_mastercons;
270 SCIPdebugMessage("master constraint %s (%f <= ax) with weight %f\n", SCIPconsGetName(mastercons), lhs_mastercons, (*weights)[i]);
271 }
272 else // lhs != -inf & rhs != inf --> constraint has form: b_l <= ax <= b_r
273 {
274 /* we use the right side: ax <= b_r */
275 (*weights)[i] = 1.0 / l;
276 (*rhs_ssrc) += (*weights)[i] * rhs_mastercons;
277 SCIPdebugMessage("master constraint %s (%f <= ax <= %f) with weight %f\n", SCIPconsGetName(mastercons), lhs_mastercons, rhs_mastercons, (*weights)[i]);
278 }
279
280 /* get all variables and their corresponding coefficients in the master constraint */
281 SCIP_CALL( SCIPgetConsNVars(masterscip, mastercons, &nmasterconsvars, &success) );
283 if( nmasterconsvars == 0 )
284 {
285 SCIPdebugMessage("constraint has no variables\n");
286 continue;
287 }
288 SCIPallocBufferArray(masterscip, &masterconsvars, nmasterconsvars);
289 SCIPallocBufferArray(masterscip, &masterconscoeffs, nmasterconsvars);
290 SCIP_CALL( SCIPgetConsVars(masterscip, mastercons, masterconsvars, nmasterconsvars, &success) );
292 SCIP_CALL( SCIPgetConsVals(masterscip, mastercons, masterconscoeffs, nmasterconsvars, &success) );
294
295 /* for each variable: add its weighted coefficient in this constraint to its coefficient for the subset row cut */
296 for( j = 0; j < nmasterconsvars; j++ )
297 {
298 SCIP_Real varcoeff;
299
300 varcoeff = SCIPhashmapGetImageReal(mapmastervarxcoeff, masterconsvars[j]);
301 if( varcoeff == SCIP_INVALID )
302 varcoeff = (*weights)[i] * masterconscoeffs[j];
303 else
304 varcoeff += (*weights)[i] * masterconscoeffs[j];
305
306 SCIPhashmapSetImageReal(mapmastervarxcoeff, masterconsvars[j], varcoeff);
307 }
308
309 SCIPfreeBufferArrayNull(masterscip, &masterconsvars);
310 SCIPfreeBufferArrayNull(masterscip, &masterconscoeffs);
311 }
312
313 return SCIP_OKAY;
314}
315
316/** computes the (non-rounded) coefficients for the pricing variables used in the pricing constraints */
317static
319 GCG* gcg, /**< GCG data structure */
320 SCIP_CONS** originalconss, /**< constraints in the original problem */
321 int* selectedconssidx, /**< indices of selected constraints */
322 int nselectedconss, /**< number of selected constraints */
323 SCIP_Real* weights, /**< weights for selected constraints */
324 SCIP_HASHMAP* mappricingvarxcoeff /**< map to store the coefficient for each pricing variable */
325 )
326{
327 SCIP* origscip;
328 SCIP_CONS* origcons;
329 SCIP_VAR** origconsvars;
330 SCIP_VAR* pricingvar;
331 SCIP_Real* origconscoeffs;
332 SCIP_Real coeff_pricing;
333 int norigconsvars;
334 int i;
335 int j;
336
337 assert(nselectedconss > 0);
338
339 origscip = GCGgetOrigprob(gcg);
340
341 SCIPdebugMessage("compute the coefficients of the pricing variables\n");
342 /* - compute w_1 * A_1j + ... + w_m * A_mj for each pricing variable x_j */
343 for( i = 0; i < nselectedconss; i++ )
344 {
345 /* get all variables and their corresponding coefficients in the original constraint */
346 origcons = originalconss[selectedconssidx[i]];
347 SCIPdebugPrintCons(origscip, origcons, NULL);
348 norigconsvars = GCGconsGetNVars(origscip, origcons);
349
350 if( norigconsvars == 0 )
351 {
352 SCIPdebugMessage("constraint has no variables\n");
353 continue;
354 }
355
356 origconsvars = NULL;
357 origconscoeffs = NULL;
358 SCIPallocBufferArray(origscip, &origconsvars, norigconsvars);
359 SCIPallocBufferArray(origscip, &origconscoeffs, norigconsvars);
360 SCIP_CALL( GCGconsGetVars(origscip, origcons, origconsvars, norigconsvars) );
361 SCIP_CALL( GCGconsGetVals(origscip, origcons, origconscoeffs, norigconsvars) );
362
363 for( j = 0; j < norigconsvars; j++ )
364 {
365 assert(GCGvarIsOriginal(origconsvars[j]));
366
367 /* use the pricing variable corresponding to the original variable as key in map */
368 pricingvar = GCGoriginalVarGetPricingVar(origconsvars[j]);
369 if( pricingvar == NULL )
370 {
371 SCIPdebugMessage("original variable %s does not have a corresponding pricing var!\n", SCIPvarGetName(origconsvars[j]));
372 continue;
373 }
374 assert(pricingvar != NULL);
375 assert(GCGvarGetBlock(pricingvar) >= 0 && GCGvarGetBlock(origconsvars[j]) >= 0);
376
377 /* in case we have aggregated pricing problems:
378 * - multiple original variables in the same constraint are mapped to the same pricing variable
379 * - we only need to consider one of those original variables
380 * --> only consider the original variables associated with the relevant pricing problem block */
381 if( GCGvarGetBlock(pricingvar) != GCGvarGetBlock(origconsvars[j]))
382 {
384 continue;
385 }
387
388 coeff_pricing = SCIPhashmapGetImageReal(mappricingvarxcoeff, pricingvar);
389 if( coeff_pricing == SCIP_INVALID )
390 SCIP_CALL( SCIPhashmapSetImageReal(mappricingvarxcoeff, pricingvar, weights[i] * origconscoeffs[j]) );
391 else
392 SCIP_CALL( SCIPhashmapSetImageReal(mappricingvarxcoeff, pricingvar, coeff_pricing + weights[i] * origconscoeffs[j]) );
393 }
394
395 SCIPfreeBufferArrayNull(origscip, &origconsvars);
396 SCIPfreeBufferArrayNull(origscip, &origconscoeffs);
397 }
398 return SCIP_OKAY;
399}
400
401/** select the indices of constraints to use for construction of cuts randomly */
402static
404 GCG* gcg, /**< GCG data structure */
405 GCG_CUTINDICES*** cutindices, /**< pointer to store array of constraint indices for cuts */
406 int* ncutindices, /**< pointer to store the number of cuts for which constraint indices were found */
407 int depth, /**< depth of current B&B node */
408 SCIP_SEPADATA* sepadata /**< data of separator */
409 )
410{
411 int nconss;
412 int nmasterconss;
413 SCIP_RANDNUMGEN* randnumgen;
414 int maxcuts;
415 int i;
416 SCIP* masterscip;
417
418 nmasterconss = sepadata->nmasterconss;
419 nconss = sepadata->n > nmasterconss ? nmasterconss : sepadata->n;
420 randnumgen = sepadata->randnumgen;
421
422 assert(gcg != NULL);
423 assert(randnumgen != NULL);
424
425 *ncutindices = 0;
426 masterscip = GCGgetMasterprob(gcg);
427
428 /* determine the number of cuts to generate based on node type */
429 if( depth == 0 )
430 maxcuts = sepadata->maxcutcandsroot;
431 else
432 maxcuts = sepadata->maxcutcands;
433
434 SCIP_CALL( SCIPallocBufferArray(masterscip, cutindices, maxcuts) );
435
436 for( i = 0; i < maxcuts; i++ )
437 {
438 GCG_CUTINDICES* cutindex;
439 int* selectedindices;
440
441 SCIPallocBufferArray(masterscip, &selectedindices, nconss);
442 SCIP_CALL( selectRandomRows(randnumgen, nmasterconss, selectedindices, nconss) );
443
444 SCIP_CALL( GCGcreateCutIndicesFromArray(masterscip, &cutindex, nconss, selectedindices) );
445 (*cutindices)[(*ncutindices)] = cutindex;
446 (*ncutindices)++;
447 }
448
449 assert(*ncutindices == maxcuts);
450
451 return SCIP_OKAY;
452}
453
454/** select the indices of constraints to use for construction of cuts using strategy devised for zero-half-cuts
455 * @to-do: finished implementing alternative strategy */
456static
458 GCG* gcg, /**< GCG data structure */
459 GCG_CUTINDICES*** cutindices, /**< pointer to store array of constraint indices for cuts */
460 int* ncutindices, /**< pointer to store the number of cuts for which constraint indices were found */
461 int ncalls, /**< number of time separator has bin called at current node */
462 SCIP_Bool allowlocal, /**< local cuts allowed? */
463 int depth, /**< depth of current node */
464 SCIP_SOL* sol, /**< current best solution, if available (else NULL) */
465 SCIP_SEPADATA* sepadata /**< data of separator */
466 )
467{
468 GCG_ZEROHALFDATA zhdata;
469 int maxcuts;
470
471 zhdata.maxslack = 0.0;
472 zhdata.maxslackroot = 0.0;
473 zhdata.minviol = 0.1;
474 zhdata.dynamiccuts = TRUE;
475 zhdata.maxrowdensity = 1.0;
476 zhdata.densityoffset = 0;
477 zhdata.infeasible = FALSE;
478 zhdata.nreductions = 0;
479 zhdata.nmasterconss = sepadata->nmasterconss;
480 zhdata.origmasterconss = sepadata->origmasterconss;
481 zhdata.masterconss = sepadata->masterconss;
482 *ncutindices = 0;
483
484 /* determine the number of cuts to generate based on node type */
485 if( depth == 0 )
486 maxcuts = sepadata->maxcutcandsroot;
487 else
488 maxcuts = sepadata->maxcutcands;
489
490 SCIP_CALL( SCIPallocBufferArray(GCGgetMasterprob(gcg), cutindices, maxcuts) );
491
492 SCIP_CALL( GCGselectConstraintsZeroHalf(gcg, sol, allowlocal, depth, &zhdata, ncalls, maxcuts, cutindices, ncutindices) );
493
494 return SCIP_OKAY;
495}
496
497/** select the indices of constraints to use for construction of cuts randomly */
498static
500 GCG* gcg, /**< GCG data structure */
501 GCG_CUTINDICES*** cutindices, /**< pointer to store array of constraint indices for cuts */
502 int* ncutindices, /**< pointer to store the number of cuts for which constraint indices were found */
503 int depth, /**< depth of current B&B node */
504 SCIP_SEPADATA* sepadata /**< data of separator */
505 )
506{
507 int nmasterconss;
508 int maxcuts;
509 SCIP* masterscip;
510 int* tmpselectedindices;
511 int i, n;
512
513 nmasterconss = sepadata->nmasterconss;
514
515 assert(gcg != NULL);
516
517 *ncutindices = 0;
518
519 masterscip = GCGgetMasterprob(gcg);
520
521 n = sepadata->n > nmasterconss ? nmasterconss : sepadata->n;
522
523 if( sepadata->paramschgd )
524 {
525 sepadata->paramschgd = FALSE;
526 if( n <= 1 )
527 return SCIP_OKAY;
528 if( n == 2 )
529 maxcuts = (nmasterconss*(nmasterconss-1)/2);
530 else if( n == 3 )
531 maxcuts = (nmasterconss*(nmasterconss-1)*(nmasterconss-2)/6);
532 else
533 {
534 int j;
535 // calculate binomial coefficient
536 maxcuts = 1;
537 j = 2 * n > nmasterconss ? nmasterconss - n : n;
538 for( i = 0; i < j; i++ )
539 {
540 if( maxcuts > INT_MAX / (nmasterconss - i) / (i + 1) )
541 {
542 SCIPwarningMessage(masterscip, "Too many cuts to be generated for n = %d.\n", sepadata->n);
543 maxcuts = 0;
544 break;
545 }
546 maxcuts = maxcuts * (nmasterconss - i) / (i + 1);
547 }
548 }
549 sepadata->maxcutcands = maxcuts;
550 sepadata->maxcutcandsroot = maxcuts;
551 }
552 else
553 {
554 maxcuts = sepadata->maxcutcands;
555 }
556
557 if( maxcuts > 0 )
558 {
559 SCIP_CALL( SCIPallocBufferArray(masterscip, cutindices, maxcuts) );
560 SCIP_CALL( SCIPallocBlockMemoryArray(masterscip, &tmpselectedindices, n) );
561
562 for( i = 0; i < n; i++ )
563 tmpselectedindices[n - i - 1] = i;
564
565 while( TRUE )
566 {
567 GCG_CUTINDICES* cutindex;
568 int* selectedindices;
569
570 assert(*ncutindices < maxcuts);
571
572 SCIP_CALL( SCIPduplicateBufferArray(masterscip, &selectedindices, tmpselectedindices, n) );
573 SCIP_CALL( GCGcreateCutIndicesFromArray(masterscip, &cutindex, n, selectedindices) );
574 (*cutindices)[(*ncutindices)] = cutindex;
575 (*ncutindices)++;
576
577 /* get next combination of n indices */
578 i = 0;
579 while( i < n && tmpselectedindices[i] >= nmasterconss - i - 1 )
580 i++;
581 if( i == n )
582 break;
583 tmpselectedindices[i]++;
584 assert(tmpselectedindices[i] < nmasterconss);
585 for( i = i - 1; i >= 0; i-- )
586 {
587 tmpselectedindices[i] = tmpselectedindices[i + 1] + 1;
588 assert(tmpselectedindices[i] < nmasterconss);
589 }
590 }
591 SCIPfreeBlockMemoryArray(masterscip, &tmpselectedindices, n);
592 }
593
594 assert(*ncutindices == maxcuts);
595
596 return SCIP_OKAY;
597}
598
599/** creates a subset row cut */
600static
602 SCIP* masterscip, /**< SCIP data structure (master problem) */
603 SCIP_SEPADATA* sepadata, /**< sepa data */
604 GCG_CUTINDICES* cutindex, /**< indices of the master constraints to use for the construction of subset row cut */
605 SCIP_SEPA* sepa, /**< subset row separator */
606 int nmastervars, /**< number of variables in the master problem*/
607 SCIP_CONS** masterconss, /**< constraints of the master problem */
608 SCIP_Real** weights, /**< sign (1, -1) with which to multiply each selected constraint before adding to cut*/
609 SCIP_ROW** ssrc, /**< pointer to store subset row cut */
610 SCIP_HASHMAP* mapmastervarxcoeff /**< temporary map to store coefficients */
611 )
612{
613
614 SCIP_Real rhs_ssrc;
615 int nentries;
616 SCIP_Real norm = 0.0;
617 SCIP_Real activity = 0.0;
618 SCIP_Real efficacy;
619 int i;
620 SCIP_Bool local;
621
622 assert(masterscip != NULL);
623 /* determine the master variables, their coefficients and rhs for subset row (non-rounded) */
624 SCIP_CALL( computeSubsetRowCoefficientsAndRHS(masterscip, sepa, masterconss, cutindex->indices, cutindex->nindices,
625 weights, &rhs_ssrc, mapmastervarxcoeff, &local) );
626
627 nentries = SCIPhashmapGetNEntries(mapmastervarxcoeff);
628 for( i = 0; i < nentries; i++ )
629 {
630 SCIP_HASHMAPENTRY* entry;
631 SCIP_Real varcoeff;
632 SCIP_VAR* mastervar;
633
634 entry = SCIPhashmapGetEntry(mapmastervarxcoeff, i);
635 if( entry == NULL )
636 continue;
637
638 mastervar = (SCIP_VAR*) SCIPhashmapEntryGetOrigin(entry);
639 varcoeff = SCIPhashmapEntryGetImageReal(entry);
640 varcoeff = SCIPfeasFloor(masterscip, varcoeff);
641 if( !SCIPisZero(masterscip, varcoeff) )
642 {
643 activity += varcoeff * SCIPgetSolVal(masterscip, NULL, mastervar);
644 norm += SQR(varcoeff);
645 }
646 }
647 norm = sqrt(norm);
648 efficacy = (activity - SCIPfeasFloor(masterscip, rhs_ssrc)) / MAX(1e-6, norm);
649
650 if( efficacy >= sepadata->minefficacy /*SCIPisEfficacious(masterscip, efficacy)*/ )
651 {
652 /* create the subset row cut */
653 SCIP_CALL( createSubsetRowCut(masterscip, ssrc, mapmastervarxcoeff, rhs_ssrc, sepa, local) );
654 }
655
656 SCIPhashmapRemoveAll(mapmastervarxcoeff);
657
658 return SCIP_OKAY;
659}
660
661/** creates the master cut data for the subset row cut */
662static
664 GCG* gcg, /**< GCG data structure */
665 SCIP_ROW* ssrc, /**< subset row cut */
666 GCG_MASTERSEPACUT* mastercut, /**< master sepa cut */
667 int npricingproblems, /**< number of pricing problems */
668 SCIP_SEPADATA* sepadata, /**< subset row separator data */
669 SCIP_HASHMAP* mappricingvarxcoeff /**< map storing the coefficients for the pricing constraints for subset row cut */
670 )
671{
672 SCIP* masterscip;
673 GCG_EXTENDEDMASTERCONSDATA* mastercutdata = NULL; // master cut data for subset row cut
674 GCG_PRICINGMODIFICATION** pricingmodifications = NULL; // pricing modifications associated with cut
675 GCG_PRICINGMODIFICATION** pricingmodificationsbuffer = NULL;
677 char name[SCIP_MAXSTRLEN]; // name of the subset row cut
678 int npricingmodifications = 0; // counter for number of pricing modifications
679 int j;
680
681 masterscip = GCGgetMasterprob(gcg);
682
683 SCIPallocBufferArray(masterscip, &pricingmodificationsbuffer, GCGgetNRelPricingprobs(gcg));
684
685 /* create the pricing modification for every (relevant) pricing problem */
686 for( j = 0; j < npricingproblems; j++ )
687 {
688 SCIP* pricingproblem;
689 /* we add at most one constraint to each pricing problem */
690 SCIP_CONS* pricingconslb;
691 //SCIP_CONS* pricingconsub;
692 SCIP_CONS** pricingconss = NULL;
693 SCIP_VAR** pricingvars;
694 SCIP_VAR* coeffvar = NULL; // y
695 SCIP_Real pricingcoeff;
696 int npricingvars;
697 int nvars;
698 int l;
699
700 /* in case of aggregated pricing problems, we skip the non-representative ones */
701 pricingproblem = GCGgetPricingprob(gcg, j);
702 if( pricingproblem == NULL || !GCGisPricingprobRelevant(gcg, j) )
703 continue;
704
707
708 npricingvars = SCIPgetNVars(pricingproblem);
709 pricingvars = SCIPgetVars(pricingproblem);
710
711 /* create (and capture) 'empty' pricing constraint: -inf <= ... <= 1 - EPSILON */
712 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "pp%i_cons_ssrc_%i_lb", j, sepadata->ngeneratedcut);
713 SCIPcreateConsBasicLinear(pricingproblem, &pricingconslb, name, 0, NULL, NULL, -SCIPinfinity(pricingproblem),
714 1 - 0.0001); // released via GCGpricingmodificationFree
715
716 /* create (and capture) 'empty' pricing constraint: -EPSILON <= ... <= inf */
717 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "pp%i_cons_ssrc_%i_ub", j, sepadata->ngeneratedcut);
718 //SCIPcreateConsBasicLinear(pricingproblem, &pricingconsub, name, 0, NULL, NULL, -0.0001,
719 // SCIPinfinity(pricingproblem)); // released via GCGpricingmodificationFree
720
721 /* add w^TAx to constraints */
722 for( l = 0; l < npricingvars; l++ )
723 {
724 assert(GCGvarIsPricing(pricingvars[l]));
725 pricingcoeff = SCIPhashmapGetImageReal(mappricingvarxcoeff, pricingvars[l]);
726 if( pricingcoeff == SCIP_INVALID )
727 continue;
728
729 if( !SCIPisZero(pricingproblem, pricingcoeff) ) // @todo: == 0.0??
730 {
731 SCIPaddCoefLinear(pricingproblem, pricingconslb, pricingvars[l], pricingcoeff);
732 //SCIPaddCoefLinear(pricingproblem, pricingconsub, pricingvars[l], pricingcoeff);
733 }
734 }
735
736 /* if no variables were actually added, the constraint is useless and can be released */
737 SCIPgetConsNVars(pricingproblem, pricingconslb, &nvars, &success);
738 if( nvars == 0 )
739 {
740 SCIPdebugMessage("constraint was empty --> release\n");
741 SCIPreleaseCons(pricingproblem, &pricingconslb);
742 //SCIPreleaseCons(pricingproblem, &pricingconsub);
743 continue;
744 }
745
746 /* create (and capture) y: -inf <= y <= inf (integer) */
747 SCIPdebugMessage("create new (inferred) pricing variable y for pricing problem %i\n", j);
748 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "pp%i_y_ssrc_%i", j, sepadata->ngeneratedcut);
749 GCGcreateInferredPricingVar(pricingproblem, &coeffvar, name, -SCIPinfinity(pricingproblem),
750 SCIPinfinity(pricingproblem), TRUE, -1.0, SCIP_VARTYPE_INTEGER, j) ; // released in GCGpricingmodificationFree
751 assert(coeffvar != NULL);
752
753 /* add y to constraints */
754 SCIPaddCoefLinear(pricingproblem, pricingconslb, coeffvar, -1.0);
755 //SCIPaddCoefLinear(pricingproblem, pricingconsub, coeffvar, -1.0);
756 SCIPdebugPrintCons(pricingproblem, pricingconslb, NULL);
757 //SCIPdebugPrintCons(pricingproblem, pricingconsub, NULL);
758
759 assert(GCGgetNRelPricingprobs(gcg) > npricingmodifications);
760
761 /* create pricing modifications containing y as the coeffvar and the single constraint we created */
762 SCIPallocBlockMemoryArray(masterscip, &pricingconss, 1); // freed via GCGpricingmodificationFree
763 pricingconss[0] = pricingconslb;
764 //pricingconss[1] = pricingconsub;
765 GCGpricingmodificationCreate(gcg, &pricingmodificationsbuffer[npricingmodifications], j, coeffvar, NULL, 0, pricingconss, 1); // released in GCGpricingmodificationFree
766
767 npricingmodifications++;
768 }
769 SCIPdebugMessage("number of pricing mods: %i\n", npricingmodifications);
770
771 if( npricingmodifications > 0 )
772 {
773 SCIPduplicateBlockMemoryArray(masterscip, &pricingmodifications, pricingmodificationsbuffer, npricingmodifications);
774 }
775 SCIPfreeBufferArray(masterscip, &pricingmodificationsbuffer);
776
777 /* create master cut data containing y, ssrc and the pricing modifications */
778 GCGextendedmasterconsCreateForSepamastercut(gcg, &mastercutdata, mastercut, ssrc, pricingmodifications, npricingmodifications); // freed in GCGextendedmasterconsFree
779 sepadata->ngeneratedcut++;
780
781 return mastercutdata;
782}
783
784/*
785 * Callback methods of separator
786 */
787
788#define sepaCopySubsetrow NULL
789
790static
791SCIP_DECL_SEPAEXIT(sepaExitSubsetrow)
792{
793 SCIP_SEPADATA* sepadata;
794 assert(sepa != NULL);
795 sepadata = SCIPsepaGetData(sepa);
796
797 if( sepadata->origmasterconss != NULL && sepadata->filteredmasterconss )
798 {
802 }
803
804 sepadata->origmasterconss = NULL;
805 sepadata->masterconss = NULL;
806 sepadata->conssfullindices = NULL;
807 sepadata->nmasterconss = 0;
808 sepadata->filteredmasterconss = FALSE;
809
810 return SCIP_OKAY;
811}
812
813/** destructor of separator to free user data (called when SCIP is exiting) */
814static
815SCIP_DECL_SEPAFREE(sepaFreeSubsetrow)
816{
817 SCIP_SEPADATA* sepadata;
818
819 assert(scip != NULL);
820 assert(sepa != NULL);
821
822 SCIPdebugMessage("free separator data for subset row separator\n");
823 sepadata = SCIPsepaGetData(sepa);
824 SCIPfreeRandom(scip, &(sepadata->randnumgen));
825 SCIPfreeBlockMemory(scip, &sepadata);
826
827 return SCIP_OKAY;
828}
829
830/** LP solution separation method of separator */
831static
832SCIP_DECL_SEPAEXECLP(sepaExeclpSubsetrow)
833{
834 GCG* gcg;
835 SCIP_SEPADATA* sepadata;
836 SCIP_HASHMAP* mappricingvarxcoeff = NULL; // maps pricing variable to its coefficient in its pricing constraint
837 GCG_CUTINDICES** cutindices = NULL; // Ss : for every cut contains the S defining it
838 SCIP_Bool infeasible;
839 SCIP_Bool isroot;
840 int ncutindices; // |Ss| : number of S-sets created
841 int npricingproblems; // |K| : number of pricing problems
842 int nmastervars; // |X'| : number of variables in (reduced) master problem
843 int ncontmastervars; // number of continuous variables in (reduced) master problem
844 int ncalls; // number of times separator was called in this node
845 int curfound; // number of generated subset-row cuts
846 int i;
847 GCG_MASTERSEPACUT* mastercut;
848 SCIP_HASHMAP* mapmastervarxcoeff = NULL;
849 SCIP* origprob;
850
851 assert(scip != NULL);
852 assert(result != NULL);
853 assert(sepa != NULL);
855
856 sepadata = SCIPsepaGetData(sepa);
857 assert(sepadata != NULL);
858
859 gcg = sepadata->gcg;
861
863
864 if( !sepadata->enable )
865 {
866 SCIPdebugMessage("subset row separator is not enabled.\n");
868 return SCIP_OKAY;
869 }
870
871 isroot = (depth == 0);
873
875 {
876 SCIPdebugMessage("master LP not solved to optimality, do no separation!\n");
877 return SCIP_OKAY;
878 }
879
880 if( (isroot && ncalls >= sepadata->maxroundsroot) || (!isroot && ncalls >= sepadata->maxrounds) )
881 {
882 SCIPdebugMessage("exceeded max rounds for this node.\n");
884 return SCIP_OKAY;
885 }
886
889 {
890 SCIPdebugMessage("subset row separator does not run on probing or refocus nodes.\n");
892 return SCIP_OKAY;
893 }
894
895 if( sepadata->ngeneratedcut >= sepadata->maxcuts )
896 {
897 SCIPdebugMessage("already generated the maximal number of cuts.\n");
899 return SCIP_OKAY;
900 }
901
903 {
904 SCIPdebugMessage("subset row separator is skipped since no pricing problem is aggregated.\n");
906 return SCIP_OKAY;
907 }
908
909 /* get info of master problem */
910 npricingproblems = GCGgetNPricingprobs(gcg);
912 ncontmastervars = SCIPgetNContVars(scip);
913
914 if( sepadata->origmasterconss == NULL )
915 {
916 if( sepadata->onlyaggregated )
917 {
918 SCIP_CONS** origmasterconss;
919 SCIP_CONS** masterconss;
920 int nmasterconss;
921 SCIP_VAR** vars;
922 int nvars;
923 int j;
924 SCIP_Bool add;
925
926 nmasterconss = GCGgetNMasterConss(gcg);
927 origmasterconss = GCGgetOrigMasterConss(gcg);
928 masterconss = GCGgetMasterConss(gcg);
929
930 sepadata->filteredmasterconss = TRUE;
931 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &sepadata->origmasterconss, nmasterconss) );
932 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &sepadata->masterconss, nmasterconss) );
933 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &sepadata->conssfullindices, nmasterconss) );
934
935 /* ignore constraints that contain variables of not aggregated pricing problems */
936 sepadata->nmasterconss = 0;
937 for( i = 0; i < nmasterconss; ++i )
938 {
939 SCIP_VAR* pricingvar;
940 add = TRUE;
941 nvars = GCGconsGetNVars(origprob, origmasterconss[i]);
943 GCGconsGetVars(origprob, origmasterconss[i], vars, nvars);
944 for( j = 0; j < nvars; ++j )
945 {
947 pricingvar = GCGoriginalVarGetPricingVar(vars[j]);
948 if( pricingvar != NULL && GCGpricingVarGetNOrigvars(pricingvar) <= 1)
949 {
950 add = FALSE;
951 break;
952 }
953 }
955
956 if( add )
957 {
958 sepadata->origmasterconss[sepadata->nmasterconss] = origmasterconss[i];
959 sepadata->masterconss[sepadata->nmasterconss] = masterconss[i];
960 sepadata->conssfullindices[sepadata->nmasterconss] = i;
961 sepadata->nmasterconss++;
962 }
963 }
964
965 /* shrink the arrays to the filtered size, so that they are freed with the correct size in sepaExitSubsetrow */
966 if( sepadata->nmasterconss < nmasterconss )
967 {
968 if( sepadata->nmasterconss > 0 )
969 {
970 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &sepadata->origmasterconss, nmasterconss, sepadata->nmasterconss) );
971 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &sepadata->masterconss, nmasterconss, sepadata->nmasterconss) );
972 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &sepadata->conssfullindices, nmasterconss, sepadata->nmasterconss) );
973 }
974 else
975 {
976 SCIPfreeBlockMemoryArray(scip, &sepadata->conssfullindices, nmasterconss);
977 SCIPfreeBlockMemoryArray(scip, &sepadata->masterconss, nmasterconss);
978 SCIPfreeBlockMemoryArray(scip, &sepadata->origmasterconss, nmasterconss);
979 }
980 }
981 }
982 else
983 {
986 sepadata->masterconss = GCGgetMasterConss(gcg);
987 }
988 }
989
990 /* we only apply the separator on pure integer master problems */
991 if( ncontmastervars > 0 )
992 {
994 return SCIP_OKAY;
995 }
996
997 /* select which constraints to use for new subset row cuts */
998 SCIP_CALL( SCIPhashmapCreate(&mappricingvarxcoeff, SCIPblkmem(scip), sepadata->n) );
999 ncutindices = 0;
1000 if( sepadata->strategy == STRATEGY_SR_RANDOM )
1001 SCIP_CALL( selectConstraintsRandom(gcg, &cutindices, &ncutindices, depth, sepadata) );
1002 else if( sepadata->strategy == STRATEGY_ZEROHALF )
1003 SCIP_CALL( selectConstraintsZerohalf(gcg, &cutindices, &ncutindices, ncalls, allowlocal, depth, NULL, sepadata) );
1004 else if( sepadata->strategy == STRATEGY_SR_ENUMERATE )
1005 SCIP_CALL( selectConstraintsEnumerate(gcg, &cutindices, &ncutindices, depth, sepadata) );
1006 else
1007 {
1009 return SCIP_OKAY;
1010 }
1011
1012 curfound = 0;
1013 SCIP_CALL( SCIPhashmapCreate(&mapmastervarxcoeff, SCIPblkmem(scip), sepadata->n) );
1014 for( i = ncutindices - 1; i >= 0; i-- )
1015 {
1016 GCG_EXTENDEDMASTERCONSDATA* mastercutdata = NULL;
1017 SCIP_ROW* ssrc = NULL;
1018 SCIP_Real* weights = NULL;
1019
1020 SCIPallocBufferArray(scip, &weights, cutindices[i]->nindices);
1021
1022 // create the subset row cut based on the selected indices
1023 SCIP_CALL( createCut(scip, sepadata, cutindices[i], sepa, nmastervars, sepadata->masterconss, &weights, &ssrc, mapmastervarxcoeff) );
1024
1025 // row is empty --> useless
1026 if( ssrc == NULL || SCIProwGetNNonz(ssrc) == 0 )
1027 {
1028 SCIPdebugMessage("created an empty row: release row\n");
1029 SCIPfreeBufferArrayNull(scip, &weights);
1030 SCIP_CALL( GCGfreeCutIndices(scip, &cutindices[i]) );
1031 if( ssrc != NULL )
1032 SCIP_CALL( SCIPreleaseRow(scip, &ssrc) );
1033
1034 continue;
1035 }
1036
1037#ifdef SCIP_DEBUG
1038 SCIPprintRow(scip, ssrc, NULL);
1039#endif
1040 // determine the pricing variables and their coefficients for the pricing constraints
1041 SCIP_CALL( computePricingConssCoefficients(gcg, sepadata->origmasterconss, cutindices[i]->indices, cutindices[i]->nindices,
1042 weights, mappricingvarxcoeff) );
1043
1044 /* translate them from the filtered index space */
1045 if( sepadata->filteredmasterconss )
1046 {
1047 int j;
1048 for( j = 0; j < cutindices[i]->nindices; j++ )
1049 cutindices[i]->indices[j] = sepadata->conssfullindices[cutindices[i]->indices[j]];
1050 }
1051
1052 // add cut to separation store and corresponding master separator cut to sepacut event handler
1053 SCIP_CALL( GCGcreateChvatalGomoryCut(gcg, &mastercut, sepadata->sepa, NULL, weights, cutindices[i]->indices, cutindices[i]->nindices) );
1054 assert(mastercut != NULL);
1055 mastercutdata = createMastercutData(gcg, ssrc, mastercut, npricingproblems, sepadata, mappricingvarxcoeff);
1056 SCIP_CALL( SCIPaddRow(scip, ssrc, FALSE, &infeasible) );
1057 SCIP_CALL( GCGaddGeneratedMastersepacut(gcg, mastercutdata) );
1058 curfound++;
1059
1060 // cleanup
1061 SCIPfreeBufferArrayNull(scip, &weights);
1062 SCIP_CALL( GCGfreeCutIndices(scip, &cutindices[i]) );
1063 SCIP_CALL( SCIPhashmapRemoveAll(mappricingvarxcoeff) );
1064 }
1065 SCIPhashmapFree(&mapmastervarxcoeff);
1066
1067 SCIPfreeBufferArrayNull(scip, &cutindices);
1068 SCIPhashmapFree(&mappricingvarxcoeff);
1069
1070 if( curfound > 0 )
1072
1073 return SCIP_OKAY;
1074}
1075
1076/** compute cut coefficient for a column */
1077static
1078GCG_DECL_SEPAGETCOLCOEFFICIENT(sepaGetColCoefficientSubsetrow)
1079{
1081 if( gcgcol != NULL )
1082 return GCGchvatalGomoryCutGetColumnCoefficient(gcg, cut, gcgcol, coef);
1083 else
1084 return GCGchvatalGomoryCutGetVariableCoefficient(gcg, cut, vars, vals, nvars, probnr, coef);
1085}
1086
1087/** deletes mastersepacutdata */
1088static
1089GCG_DECL_SEPAMASTERCUTDELETE(sepaMastercutDeleteSubsetrow)
1090{
1092 return GCGfreeChvatalGomoryCutData(gcg, data);
1093}
1094
1095/** initialization method of separator (called after problem was transformed) */
1096static
1097SCIP_DECL_SEPAINIT(sepaInitSubsetrow)
1098{
1099 SCIP_SEPADATA* sepadata;
1100
1101 assert(scip != NULL);
1102 assert(sepa != NULL);
1104
1105 sepadata = SCIPsepaGetData(sepa);
1106 assert(sepadata != NULL);
1107
1108 sepadata->ngeneratedcut = 0;
1109
1110 return SCIP_OKAY;
1111}
1112
1113/** param changed method */
1114static
1115SCIP_DECL_PARAMCHGD(sepaParamChgdSubsetrow)
1116{
1117 SCIP_SEPADATA* sepadata;
1118
1119 assert(scip != NULL);
1120
1121 sepadata = (SCIP_SEPADATA*) SCIPparamGetData(param);
1122 assert(sepadata != NULL);
1123
1124 sepadata->paramschgd = TRUE;
1125
1126 return SCIP_OKAY;
1127}
1128
1129/*
1130 * separator specific interface methods
1131 */
1132
1133/** creates the scip separator of the subset row separator and includes it in master SCIP*/
1135 GCG* gcg /**< GCG data structure */
1136 )
1137{
1138 SCIP* scip;
1139 SCIP_SEPADATA* sepadata;
1140 SCIP_SEPA* sepa;
1141 GCG_SEPA* gcgsepa;
1142 SCIP* origscip;
1143
1145
1146 /* create subsetrow separator data */
1147 SCIP_CALL( SCIPallocBlockMemory(scip, &sepadata) );
1148 sepadata->gcg = gcg;
1149 sepadata->ngeneratedcut = 0;
1150 sepadata->randnumgen = NULL;
1151 sepadata->enable = FALSE;
1152 sepadata->origmasterconss = NULL;
1153 sepadata->masterconss = NULL;
1154 sepadata->conssfullindices = NULL;
1155 sepadata->nmasterconss = 0;
1156 sepadata->filteredmasterconss = FALSE;
1157 sepadata->paramschgd = TRUE;
1158
1159 /* create random number generator */
1162
1164 SEPA_USESSUBSCIP, SEPA_DELAY, sepaExeclpSubsetrow, NULL, sepadata, sepaGetColCoefficientSubsetrow,
1165 sepaMastercutDeleteSubsetrow) );
1166
1167 assert(sepa != NULL);
1168 assert(gcgsepa != NULL);
1169 sepadata->sepa = gcgsepa;
1170
1171 /* set non fundamental callbacks via setter functions */
1172 SCIP_CALL( SCIPsetSepaFree(scip, sepa, sepaFreeSubsetrow) );
1173 SCIP_CALL( SCIPsetSepaInit(scip, sepa, sepaInitSubsetrow) );
1174 SCIP_CALL( SCIPsetSepaExitsol(scip, sepa, sepaExitSubsetrow) );
1175
1176 origscip = GCGgetOrigprob(gcg);
1177 assert(origscip != NULL);
1178
1179 /* define setting parameters */
1180 SCIP_CALL( SCIPaddBoolParam(origscip, "sepa/" SEPA_NAME "/enable", "enable subsetrow separator",
1181 &(sepadata->enable), FALSE, SEPA_ENABLED, NULL, NULL) );
1182
1183 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/maxrounds", "maximal number of subsetrow separation rounds per node (-1: unlimited)",
1184 &sepadata->maxrounds, FALSE, DEFAULT_MAXROUNDS, -1, INT_MAX, NULL, NULL) );
1185
1186 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/maxroundsroot", "maximal number of subsetrow separation rounds in the root node (-1: unlimited)",
1187 &sepadata->maxroundsroot, FALSE, DEFAULT_MAXROUNDSROOT, -1, INT_MAX, NULL, NULL) );
1188
1189 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/maxcutcands", "maximal number of subsetrow cut candidates per separation round",
1190 &sepadata->maxcutcands, FALSE, DEFAULT_MAXCUTCANDS, 0, INT_MAX, NULL, NULL) );
1191
1192 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/maxcutcandsroot", "maximal number of subsetrow cut candidates per separation round in the root node",
1193 &sepadata->maxcutcandsroot, FALSE, DEFAULT_MAXCUTCANDSROOT, 0, INT_MAX, NULL, NULL) );
1194
1195 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/maxcuts", "maximal number of subsetrow cuts that will be added over the whole solving process",
1196 &sepadata->maxcuts, FALSE, DEFAULT_MAXCUTS, 0, INT_MAX, NULL, NULL) );
1197
1198 SCIP_CALL( SCIPaddRealParam(origscip, "sepa/" SEPA_NAME "/minefficacy", "required minimum cut efficacy",
1200
1201 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/strategy", "0: random SR cuts, 1: zerohalf cuts (ignores l and n parameters), 2: full enumeration of SR cuts (updates maxcutcands parameters)",
1202 &sepadata->strategy, FALSE, DEFAULT_STRATEGY, 0, STRATEGY_MAX, NULL, NULL) );
1203
1204 SCIP_CALL( SCIPaddIntParam(origscip,"sepa/" SEPA_NAME "/n", "number of rows used to create a new subset row cut ",
1205 &(sepadata->n), FALSE, DEFAULT_N, 0, INT_MAX, sepaParamChgdSubsetrow, (SCIP_PARAMDATA*) sepadata) );
1206
1207 SCIP_CALL( SCIPaddIntParam(origscip, "sepa/" SEPA_NAME "/l", "inverse weight used to create new subset row cut",
1208 &(sepadata->l), FALSE, DEFAULT_L, 1, INT_MAX, NULL, NULL) );
1209
1210 SCIP_CALL( SCIPaddBoolParam(origscip, "sepa/" SEPA_NAME "/onlyaggregated", "apply subsetrow separator only on aggregated problems",
1212
1213 return SCIP_OKAY;
1214}
1215
1216
#define DEFAULT_RANDSEED
#define SCIP_MAXSTRLEN
#define SCIP_REAL_MAX
#define SCIP_INVALID
#define SCIP_Bool
#define SCIP_Real
#define SQR(x)
#define MAX(x, y)
#define TRUE
#define FALSE
SCIP_DECL_PARAMCHGD(SCIPparamChgdDispActive)
SCIP_RETCODE GCGaddGeneratedMastersepacut(GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastersepacut)
event handler which manages the active master separator cuts
SCIP_RETCODE GCGchvatalGomoryCutGetColumnCoefficient(GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastercutdata, GCG_COL *gcgcol, SCIP_Real *coeff)
Definition gcgcgcut.c:161
SCIP_RETCODE GCGcreateChvatalGomoryCut(GCG *gcg, GCG_MASTERSEPACUT **mastersepacut, GCG_SEPA *sepa, GCG_VARHISTORY *varhistory, SCIP_Real *weights, int *indices, int n)
Definition gcgcgcut.c:53
SCIP_RETCODE GCGfreeChvatalGomoryCutData(GCG *gcg, GCG_MASTERSEPACUTDATA **data)
Definition gcgcgcut.c:88
SCIP_RETCODE GCGchvatalGomoryCutGetVariableCoefficient(GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastercutdata, SCIP_VAR **vars, SCIP_Real *vals, int nvars, int probnr, SCIP_Real *coef)
Definition gcgcgcut.c:204
SCIP_SEPA * GCGsepaGetScipSeparator(GCG_SEPA *gcgsepa)
Definition gcgsepa.c:219
SCIP_Bool GCGvarIsOriginal(SCIP_VAR *var)
Definition gcgvar.c:231
SCIP_RETCODE GCGcreateInferredPricingVar(SCIP *pricingscip, SCIP_VAR **newvar, const char *varname, SCIP_Real lb, SCIP_Real ub, SCIP_Bool iscoefvar, SCIP_Real objcoeff, SCIP_VARTYPE vartype, int prob)
Definition gcgvar.c:1674
SCIP_VAR * GCGoriginalVarGetPricingVar(SCIP_VAR *var)
Definition gcgvar.c:281
int GCGpricingVarGetNOrigvars(SCIP_VAR *var)
Definition gcgvar.c:1082
int GCGvarGetBlock(SCIP_VAR *var)
Definition gcgvar.c:1118
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
SCIP_RETCODE GCGpricingmodificationCreate(GCG *gcg, GCG_PRICINGMODIFICATION **pricingmodification, int blocknr, SCIP_VAR *coefvar, SCIP_VAR **additionalvars, int nadditionalvars, SCIP_CONS **additionalconss, int nadditionalconss)
GCG_EXPORT SCIP * GCGgetPricingprob(GCG *gcg, int pricingprobnr)
Definition relax_gcg.c:4075
GCG_EXPORT SCIP_CONS ** GCGgetMasterConss(GCG *gcg)
Definition relax_gcg.c:4228
GCG_EXPORT SCIP_CONS ** GCGgetOrigMasterConss(GCG *gcg)
Definition relax_gcg.c:4245
GCG_EXPORT int GCGgetNMasterConss(GCG *gcg)
Definition relax_gcg.c:4211
GCG_EXPORT int GCGgetNRelPricingprobs(GCG *gcg)
Definition relax_gcg.c:4095
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
SCIP_Bool GCGisMaster(SCIP *scip)
Definition misc.c:709
GCG_EXPORT int GCGgetNPricingprobs(GCG *gcg)
Definition relax_gcg.c:4113
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
GCG_EXPORT SCIP_Bool GCGisPricingprobRelevant(GCG *gcg, int pricingprobnr)
Definition relax_gcg.c:4132
int SCIPgetNContVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapSetImageReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
SCIP_Real SCIPhashmapEntryGetImageReal(SCIP_HASHMAPENTRY *entry)
SCIP_RETCODE GCGconsGetVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars)
Definition scip_misc.c:487
SCIP_RETCODE GCGconsGetVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int nvals)
Definition scip_misc.c:618
int GCGconsGetNVars(SCIP *scip, SCIP_CONS *cons)
Definition scip_misc.c:433
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
unsigned int SCIPinitializeRandomSeed(SCIP *scip, unsigned int initialseedvalue)
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool GCGvarIsPricing(SCIP_VAR *var)
Definition gcgvar.c:159
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIP * origprob
* result
SCIP_VAR ** vars
SCIP_Longint ncalls
int j
SCIP_Bool success
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
int i
int nvars
SCIPfreeBufferArray(scip, &cycles)
SCIP_SOL * sol
int nmastervars
int depth
#define NULL
SCIP_RETCODE GCGextendedmasterconsCreateForSepamastercut(GCG *gcg, GCG_EXTENDEDMASTERCONSDATA **extendedmastercons, GCG_MASTERSEPACUT *cut, SCIP_ROW *row, GCG_PRICINGMODIFICATION **pricingmodifications, int npricingmodifications)
SCIP_Real SCIPconsGetLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_RETCODE SCIPgetConsVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int varssize, SCIP_Bool *success)
SCIP_Real SCIPconsGetRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
GCG variable pricer.
#define SCIPdebugPrintCons(x, y, z)
SCIP_RETCODE GCGrelaxIncludeSepa(GCG *gcg, SCIP_SEPA **sepa, GCG_SEPA **gcgsepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata, GCG_DECL_SEPAGETCOLCOEFFICIENT((*sepagetcolcoef)),)
Definition relax_gcg.c:5807
GCG relaxator.
various SCIP helper methods
#define SEPA_PRIORITY
Definition sepa_basis.c:60
static SCIP_DECL_SEPAFREE(sepaFreeBasis)
Definition sepa_basis.c:814
#define SEPA_DELAY
Definition sepa_basis.c:64
static SCIP_DECL_SEPAINIT(sepaInitBasis)
Definition sepa_basis.c:828
#define SEPA_DESC
Definition sepa_basis.c:59
#define SEPA_USESSUBSCIP
Definition sepa_basis.c:63
#define SEPA_MAXBOUNDDIST
Definition sepa_basis.c:62
#define SEPA_FREQ
Definition sepa_basis.c:61
#define SEPA_NAME
Definition sepa_basis.c:58
static SCIP_DECL_SEPAEXIT(sepaExitBasis)
Definition sepa_basis.c:895
#define DEFAULT_MAXCUTS
#define DEFAULT_STRATEGY
#define SEPA_ENABLED
static SCIP_RETCODE computeSubsetRowCoefficientsAndRHS(SCIP *masterscip, SCIP_SEPA *sepa, SCIP_CONS **masterconss, int *selectedconssidx, int nselectedconss, SCIP_Real **weights, SCIP_Real *rhs_ssrc, SCIP_HASHMAP *mapmastervarxcoeff, SCIP_Bool *local)
static SCIP_RETCODE computePricingConssCoefficients(GCG *gcg, SCIP_CONS **originalconss, int *selectedconssidx, int nselectedconss, SCIP_Real *weights, SCIP_HASHMAP *mappricingvarxcoeff)
#define DEFAULT_MINEFFICACY
static SCIP_RETCODE selectConstraintsZerohalf(GCG *gcg, GCG_CUTINDICES ***cutindices, int *ncutindices, int ncalls, SCIP_Bool allowlocal, int depth, SCIP_SOL *sol, SCIP_SEPADATA *sepadata)
static SCIP_RETCODE selectRandomRows(SCIP_RANDNUMGEN *randnumgen, int nmasterconss, int *selectedmasterconssidx, int n)
#define STRATEGY_SR_RANDOM
static SCIP_RETCODE createSubsetRowCut(SCIP *masterscip, SCIP_ROW **ssrc, SCIP_HASHMAP *mapmastervarxcoeffs, SCIP_Real rhs_ssrc, SCIP_SEPA *sepa, SCIP_Bool local)
#define DEFAULT_MAXROUNDSROOT
#define DEFAULT_L
#define STRATEGY_SR_ENUMERATE
#define DEFAULT_N
#define STRATEGY_ZEROHALF
static SCIP_RETCODE createCut(SCIP *masterscip, SCIP_SEPADATA *sepadata, GCG_CUTINDICES *cutindex, SCIP_SEPA *sepa, int nmastervars, SCIP_CONS **masterconss, SCIP_Real **weights, SCIP_ROW **ssrc, SCIP_HASHMAP *mapmastervarxcoeff)
#define DEFAULT_MAXCUTCANDSROOT
#define DEFAULT_MAXCUTCANDS
#define DEFAULT_MAXROUNDS
static SCIP_RETCODE selectConstraintsEnumerate(GCG *gcg, GCG_CUTINDICES ***cutindices, int *ncutindices, int depth, SCIP_SEPADATA *sepadata)
SCIP_RETCODE SCIPincludeSepaSubsetrow(GCG *gcg)
#define STRATEGY_MAX
static SCIP_RETCODE selectConstraintsRandom(GCG *gcg, GCG_CUTINDICES ***cutindices, int *ncutindices, int depth, SCIP_SEPADATA *sepadata)
#define DEFAULT_ONLYAGGREGATED
static GCG_EXTENDEDMASTERCONSDATA * createMastercutData(GCG *gcg, SCIP_ROW *ssrc, GCG_MASTERSEPACUT *mastercut, int npricingproblems, SCIP_SEPADATA *sepadata, SCIP_HASHMAP *mappricingvarxcoeff)
subset row separator for master problem
SCIP_CONS ** masterconss
SCIP_CONS ** origmasterconss
SCIP_CONS ** origmasterconss
SCIP_RANDNUMGEN * randnumgen
GCG_SEPA * sepa
SCIP_Bool enable
Definition sepa_basis.c:88
SCIP_Bool onlyaggregated
SCIP_Bool filteredmasterconss
SCIP_CONS ** masterconss
SCIP_Bool paramschgd
SCIP_Real minefficacy
data structures for separators for master
struct SCIP_Cons SCIP_CONS
struct GCG_ExtendedMasterConsData GCG_EXTENDEDMASTERCONSDATA
struct GCG_PricingModification GCG_PRICINGMODIFICATION
struct Gcg GCG
Definition type_gcg.h:44
struct SCIP_Row SCIP_ROW
SCIP_LPSOLSTAT_OPTIMAL
struct GCG_Mastersepacut GCG_MASTERSEPACUT
struct SCIP_HashMap SCIP_HASHMAP
struct SCIP_HashMapEntry SCIP_HASHMAPENTRY
struct SCIP_RandNumGen SCIP_RANDNUMGEN
struct SCIP_ParamData SCIP_PARAMDATA
SCIP_OBJSENSE_MINIMIZE
SCIP_DIDNOTRUN
SCIP_DIDNOTFIND
SCIP_SEPARATED
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct SCIP_SepaData SCIP_SEPADATA
#define SCIP_DECL_SEPAEXECLP(x)
struct SCIP_Sepa SCIP_SEPA
struct GCG_Sepa GCG_SEPA
#define GCG_DECL_SEPAGETCOLCOEFFICIENT(x)
#define GCG_DECL_SEPAMASTERCUTDELETE(x)
struct SCIP_Sol SCIP_SOL
SCIP_NODETYPE_REFOCUSNODE
SCIP_NODETYPE_PROBINGNODE
struct SCIP_Var SCIP_VAR
SCIP_VARTYPE_INTEGER
SCIP_RETCODE GCGcreateCutIndicesFromArray(SCIP *scip, GCG_CUTINDICES **cutindices, int nindices, int *indices)
SCIP_RETCODE GCGselectConstraintsZeroHalf(GCG *gcg, SCIP_SOL *sol, SCIP_Bool allowlocal, int depth, GCG_ZEROHALFDATA *zhdata, int ncalls, int maxcuts, GCG_CUTINDICES ***cutindices, int *ncutindices)
SCIP_RETCODE GCGfreeCutIndices(SCIP *scip, GCG_CUTINDICES **cutindices)
struct GCG_ZeroHalfData GCG_ZEROHALFDATA
struct GCG_CutIndices GCG_CUTINDICES