GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
heur_ipcolgen.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 heur_ipcolgen.c
30 * @brief The integer programming column generation heuristic
31 * @author Stephen J. Maher
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#include <assert.h>
37#include <string.h>
38
39#include "gcg/heur_ipcolgen.h"
40#include "gcg/gcg.h"
41#include "gcg/pricer_gcg.h"
42#include "gcg/scip_misc.h"
43
44#include "scip/scipdefplugins.h"
45#include "scip/scip_event.h"
46
47#define HEUR_NAME "ipcolgen"
48#define HEUR_DESC "A destroy and repair heuristic for the master problem that uses a modified pricing problem"
49#define HEUR_DISPCHAR 'I'
50#define HEUR_PRIORITY -1110000
51#define HEUR_FREQ -1 /**< experiments shows that the best frequency is 5 */
52#define HEUR_FREQOFS 0
53#define HEUR_MAXDEPTH -1
54#define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_DURINGPRICINGLOOP | SCIP_HEURTIMING_AFTERNODE
55#define HEUR_USESSUBSCIP TRUE
56
57#define DEFAULT_MAXNODES 5000LL /**< maximum number of nodes to regard in the repair problem */
58#define DEFAULT_MINFIXINGRATE 0.2 /**< minimum percentage of integer variables that have to be fixed */
59#define DEFAULT_MINIMPROVE 0.01 /**< factor by which restricted master should at least improve the incumbent */
60#define DEFAULT_MINNODES 50LL /**< minimum number of nodes to regard in the repair problem */
61#define DEFAULT_NODESOFS 500LL /**< number of nodes added to the contingent of the total nodes */
62#define DEFAULT_NODESQUOT 0.5 /**< repair problem nodes in relation to nodes of the original problem */
63#define DEFAULT_LPLIMFAC 2.0 /* factor by which the limit on the number of LP depends on the node limit */
64#define DEFAULT_USELPROWS FALSE /**< should repair problem be created out of the rows in the LP rows,
65 * otherwise, the copy constructor of the constraints handlers are used*/
66#define DEFAULT_COPYCUTS TRUE /**< if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
67 * of the original scip be copied to constraints of the subscip */
68#define DEFAULT_SOLVEAUXPROB TRUE /**< should an auxiliary problem be solved to find improving solutions */
69#define DEFAULT_DUALWEIGHT 0.25 /**< the default value for the dual weight in the pricing objective */
70#define DEFAULT_INITDYNAMICPEN 0.1 /**< the default value for the initial dynamic penalty for the pricing objective */
71#define DEFAULT_BIGM 1234.56 /**< the big-M penalty for the pricing objective */
72#define DEFAULT_WAITNEWSOL TRUE /**< should the heuristic wait until a new solution is found before executing */
73#define DEFAULT_MININITIALGAP 0.5 /**< the minimum optimality gap necessary prior to the first call of the heuristic.
74 * The results from the paper show that this could be reduced to 0.25 */
75#define DEFAULT_CALLSPERNODE 4 /**< the number of times that the heuristic is called per node */
76#define DEFAULT_MAXITER 10 /**< the maximum number of weighted pricing iterations */
77#define DEFAULT_NOIMPROVEITER 3 /**< the number of weighted pricing iterations without primal improvement.
78 * Experiments showed significant performance degradation when increasing this value */
79#define DEFAULT_RINSFIXING FALSE /**< should a RINS style fixing be used for the repair master problem */
80
81#define DEFAULT_RANDSEED 31 /**< initial random seed */
82
83#define DEFAULT_ARRAYSIZE 100
84#define PREVLPOBJSIZE 5
85
86/* event handler properties */
87#define EVENTHDLR_NAME "IPColGen"
88#define EVENTHDLR_DESC "LP event handler for " HEUR_NAME " heuristic"
89
90/* pricing callback properties */
91#define PRICINGCB_NAME "IPColGen"
92#define PRICINGCB_DESC "pre- and post-pricing methods for adding relaxation and dual weights to the pricing problem objective"
93#define PRICINGCB_PRIORITY 1000000
94#define PRICINGCB_EXCLUSIVE TRUE
95
96/*
97 * Data structures
98 */
99
109
110/** primal heuristic data */
111struct SCIP_HeurData
112{
113 GCG* gcg; /**< GCG data structure */
114 SCIP_SOL* lastsol; /**< the last incumbent solution used as reference point */
115 SCIP_SOL* partialsol; /**< the partial solution that is used for the weighted pricing */
116 SCIP_RANDNUMGEN* randnumgen; /**< random number generator */
117 SCIP_NODE* prevnode; /**< the node where this heuristic was previously called */
118 SCIP_Longint maxnodes; /**< maximum number of nodes to regard in the repair problem */
119 SCIP_Longint minnodes; /**< minimum number of nodes to regard in the repair problem */
120 SCIP_Longint nodesofs; /**< number of nodes added to the contingent of the total nodes */
121 SCIP_Longint usednodes; /**< nodes already used by repair problem in earlier calls */
122 SCIP_Real minfixingrate; /**< minimum percentage of integer variables that have to be fixed */
123 SCIP_Real minimprove; /**< factor by which ipcolgen should at least improve the incumbent */
124 SCIP_Real nodesquot; /**< repair problem nodes in relation to nodes of the original problem */
125 SCIP_Real nodelimit; /**< the nodelimit employed in the current sub-SCIP for the repair problem,
126 * for the event handler*/
127 SCIP_Real lplimfac; /**< factor by which the limit on the number of LP depends on the node limit */
128 SCIP_Real dualweight; /**< the default value for the dual weight in the pricing objective */
129 SCIP_Real initdynamicpen; /**< the initial value for the dynamic penalty for the pricing objective */
130 SCIP_Bool uselprows; /**< should the repair problem be created out of the rows in the LP rows? */
131 SCIP_Bool copycuts; /**< if uselprows == FALSE, should all active cuts from cutpool be copied
132 * to constraints in repair problem? */
133 SCIP_Bool waitnewsol; /**< should the heuristic wait until a new solution is found before executing */
134 SCIP_Bool solveauxproblem; /**< should the repair problem be solved to find improving solutions */
135 SCIP_Real mininitialgap; /**< the minimum initial gap required before the first call of the heuristic */
136 int callspernode; /**< the number of times that the heuristic is called per node */
137 int maxiter; /**< the maximum number of weighted pricing iterations */
138 int noimproveiter; /**< the number of weighted pricing iterations without primal improvement */
139 SCIP_Bool rinsfixing; /**< should a RINS style fixing be used for the repair master problem */
140
141 /* parameters used for controlling the execution of the ipcolgen heuristic */
142 SCIP_Bool inheur; /**< flag to avoid recursive calls to the heuristic */
143 int numexec; /**< the number of times the heuristic is executed */
144 SCIP_Bool firstexec; /**< flag to indicate whether the first execution of the heuristic has been performed */
145 SCIP_Longint prevpricingiter; /**< the number of pricing iterations performed before this node */
146 SCIP_Real* prevlpobjs; /**< the LP objectives during the previous call to this heuristic */
147 int nprevlpobjs; /**< the number of previous LP objectives stored */
148 int prevlpobjssize; /**< the size of previous LP objectives array */
149 int prevnsolsfound; /**< the previous number of solutions found */
150 SCIP_Longint prevnnodes; /**< the number of nodes processed in the previous call to the heuristic */
151 SCIP_Longint nwaitnodes; /**< the number of nodes to wait until the heuristic is called next */
152
153 /* statistics */
154 SCIP_Real firstcallgap; /**< the optimality gap when the heuristic is first called */
155 SCIP_Real firstcallabsgap; /**< the absolute gap when the heuristic is first called */
156
157 /* the data required for the pricing callback functions */
158 SCIP_SOL* bestsol; /**< the current best solution during the pricing loop */
159 SCIP_Real* penalties; /**< the penalties applied to each constraint in the pricing objective */
160 int* penaltiesids; /**< the ids corresponding to the constraints to apply the penalties */
161 IPC_PENALTYTYPE* penaltytypes; /**< the type of penalty, this is used for the penalty adjustment */
162 int npenalties; /**< the number of penalties */
163 int penaltiessize; /**< the length of the penalties array */
164 int nmastervars; /**< the number of variables in the master problem */
165 int npricingprobs; /**< the number of pricing problems */
166 int nfixedvars; /**< the number of variables fixed to form the partial solution */
167 int infeascount; /**< the number of iterations that the partial solution is infeasible */
168 SCIP_Bool abort; /**< should the weighted pricing be aborted */
169};
170
171/* ---------------- Callback methods of event handler ---------------- */
172
173/* exec the event handler
174 *
175 * we interrupt the solution process each time the LP is solved. This is used to interrupt the solving process of the
176 * repair problem
177 */
178static
179SCIP_DECL_EVENTEXEC(eventExecIpcolgen)
180{
182
183 assert(eventhdlr != NULL);
184 assert(eventdata != NULL);
185 assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
186 assert(event != NULL);
188
189 heurdata = (SCIP_HEURDATA*)eventdata;
190 assert(heurdata != NULL);
191
192 /* interrupt solution process of sub-SCIP */
194 {
195 SCIPdebugMsg(scip, "interrupt after %" SCIP_LONGINT_FORMAT " LPs\n",SCIPgetNLPs(scip));
197 }
198
199 return SCIP_OKAY;
200}
201
202
203/** creates a starting solution for the heuristic if no solution has been previously found
204 *
205 * The start solution is created by greedily adding the most recently generated columns. Once a column is added for
206 * each pricing problem, then the start solution has been created.
207 */
208static
210 GCG* gcg, /**< the GCG data structure */
211 SCIP_SOL* startsol, /**< the starting solution that will be populated with variables */
212 SCIP_Bool* success /**< pointer to store whether creating the starting solution was successful */
213 )
214{
215 SCIP* scip;
216 SCIP_VAR** vars;
217 int nvars;
218 int npricingprobs;
219
220 SCIP_Bool* blockvaradded;
221 int nvarsadded;
222 int i;
223
224 assert(gcg != NULL);
225 assert(startsol != NULL);
226
228
229 /* getting the master problem variables */
232
233 npricingprobs = GCGgetNPricingprobs(gcg);
234 SCIP_CALL( SCIPallocClearBufferArray(scip, &blockvaradded, npricingprobs) );
235
236 /* adding a variable for each block to the solution */
237 nvarsadded = 0;
238 for( i = nvars - 1; i >= 0 && nvarsadded < npricingprobs; i-- )
239 {
240 SCIP_Real varval;
241 int blocknum;
242
243 /* getting the block number for the variable */
244 blocknum = GCGvarGetBlock(vars[i]);
245 assert(blocknum >= 0 && blocknum < npricingprobs);
246
247 /* if the block number is negative, then the variable is a master-only variable. Thus, it can be ignored. */
248 if( blocknum < 0 )
249 continue;
250
251 /* if a variable has been added for the block, then the variable is ignored */
252 if( blockvaradded[blocknum] )
253 continue;
254
255 /* adding the variable to the solution by setting the value to the variables upper bound. If the upper bound is
256 * infinity, then the variable is set to 1.0
257 */
258 varval = SCIPvarGetUbGlobal(vars[i]);
259 if( SCIPisFeasGE(scip, varval, SCIPinfinity(scip)) )
260 varval = 1.0;
261
262 SCIP_CALL( SCIPsetSolVal(scip, startsol, vars[i], varval) );
263
264 blockvaradded[blocknum] = TRUE;
265 nvarsadded++;
266 }
267
268 /* at least half of the blocks must have a variable added to the solution */
269 (*success) = (nvarsadded >= npricingprobs/2.0);
270
271 /* freeing the buffer memory */
272 SCIPfreeBufferArray(scip, &blockvaradded);
273
274 return SCIP_OKAY;
275}
276
277
278/** creates a partial solution by destroying a source complete solution */
279static
281 SCIP* scip, /**< the SCIP data structure */
282 SCIP_SOL* partialsol, /**< the new partial solution */
283 SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
284 SCIP_Real minfixingrate, /**< percentage of integer variables that have to be fixed */
285 int nblocks, /**< the number of blocks in the problem */
286 int* nfixedvars, /**< returns the number of variables fixed to zero in the partial solution */
287 SCIP_Bool* success /**< pointer to store whether the problem was created successfully */
288 )
289{
291 SCIP_Real mastersolval;
292 int nmastervars;
293
294 SCIP_Real fixingrate;
295 int fixingcounter;
296 int i;
297
298 assert(scip != NULL);
299 assert(partialsol != NULL);
300
301 /* get variable data of the master problem */
304 assert(nmastervars >= 0);
305
306 i = 0;
307 fixingrate = 0.0;
308 fixingcounter = 0;
309
310 /* setting variables to zero variables in the partial solution */
311 while( i < nmastervars && fixingrate < minfixingrate)
312 {
313 int varidx;
314
315 varidx = SCIPrandomGetInt(randnumgen, 0, nmastervars - 1);
316
317 mastersolval = SCIPgetSolVal(scip, partialsol, mastervars[varidx]);
318
319 /* if variable takes a non-zero value in the master solution, then it is fixed to zero.
320 * the master variable must be a priced variable
321 */
322 if( GCGvarGetBlock(mastervars[varidx]) >= 0 && !SCIPisFeasZero(scip, mastersolval) )
323 {
324 SCIPdebugMsg(scip, "Fixing <%s> to zero (%g)\n", SCIPvarGetName(mastervars[varidx]), mastersolval);
325 SCIP_CALL( SCIPsetSolVal(scip, partialsol, mastervars[varidx], 0.0) );
326 fixingcounter++;
327 }
328
329 i++;
330 fixingrate = fixingcounter / (SCIP_Real)(MAX(nblocks, 1));
331 }
332
333 (*nfixedvars) = fixingcounter;
334
335 /* abort, if no variables are fixed (which should not happen) */
336 if( fixingcounter == 0 )
337 {
338 SCIPdebugMessage(" -> no master variables fixed, not solving problem.\n");
339 *success = FALSE;
340 return SCIP_OKAY;
341 }
342
343 SCIPdebugMessage(" -> %d out of %d (%.2f percent) blocks fixed.\n", fixingcounter, nblocks, fixingrate * 100.0);
344
345 (*success) = TRUE;
346
347 return SCIP_OKAY;
348}
349
350/** adds a penalty to the dynamic penalties */
351static
353 SCIP* scip, /**< the SCIP data structure */
354 SCIP_Real addpenalty, /**< the penalty to be added */
355 int addpenaltyid, /**< the constraint id for the added penalty */
356 IPC_PENALTYTYPE addpenaltytype, /**< the type of the added penalty */
357 SCIP_Real** penalties, /**< the relaxation penaltys */
358 int** penaltiesids, /**< the relaxtion penalty constraint ids */
359 IPC_PENALTYTYPE** penaltytypes, /**< the penalty types */
360 int* npenalties, /**< the number of dynamic penalties */
361 int* penaltiessize /**< the number of elements in the penalties array */
362 )
363{
364 assert(scip != NULL);
365 assert(penalties != NULL);
366 assert(penaltiesids != NULL);
367 assert(npenalties != NULL);
368 assert(penaltiessize != NULL);
369
370 if( *npenalties >= *penaltiessize )
371 {
372 int oldsize = *penaltiessize;
373 *penaltiessize = SCIPcalcMemGrowSize(scip, *penaltiessize + 1);
374 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, penalties, oldsize, *penaltiessize) );
375 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, penaltiesids, oldsize, *penaltiessize) );
376 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, penaltytypes, oldsize, *penaltiessize) );
377 }
378 assert(*npenalties < *penaltiessize);
379
380 (*penalties)[*npenalties] = addpenalty;
381 (*penaltiesids)[*npenalties] = addpenaltyid;
382 (*penaltytypes)[*npenalties] = addpenaltytype;
383 (*npenalties)++;
384
385 return SCIP_OKAY;
386}
387
388/** checks whether the constraint is of a valid type and the sign of the penalty is returned */
389static
391 SCIP* scip, /**< the SCIP data structure */
392 SCIP_CONS* cons /**< the constraint to check for validity */
393 )
394{
395 consType ctype;
396
397 /* getting the constraint type */
398 ctype = GCGconsGetType(scip, cons);
399
400 if( ctype == setpacking )
401 return CONSTYPE_SETPACK;
402 if( ctype == setcovering )
403 return CONSTYPE_SETCOVER;
404 if( ctype == setpartitioning )
405 return CONSTYPE_SETPART;
406
407 if( ctype == linear )
408 {
409 SCIP_Real* consvals;
410 int nconsvars;
411 int i;
412
413 consvals = SCIPgetValsLinear(scip, cons);
414 nconsvars = SCIPgetNVarsLinear(scip, cons);
415
416 for( i = 0; i < nconsvars; i++ )
417 {
418 if( !(SCIPisZero(scip, consvals[i]) || SCIPisEQ(scip, consvals[i], 1.0)) )
419 return CONSTYPE_INVALID;
420 }
421
423 return CONSTYPE_SETPACK;
424
426 return CONSTYPE_SETCOVER;
427
428 if( SCIPisEQ(scip, SCIPgetLhsLinear(scip, cons), 1.0) && SCIPisEQ(scip, SCIPgetRhsLinear(scip, cons), 1.0) )
429 return CONSTYPE_SETPART;
430 }
431
432 return CONSTYPE_INVALID;
433}
434
435/** using the current solution, compute the dynamic penalties to apply to the column generation pricing problem */
436static
438 GCG* gcg, /**< the SCIP data structure */
439 SCIP_SOL* sol, /**< the solution used to set up the repair problem */
440 SCIP_Real initdynamicpen, /**< the value of the initial dynamic penalty */
441 SCIP_Real** penalties, /**< the dynamic penalties, or NULL if the penalties are not computed */
442 int** penaltiesids, /**< the dynamic penalties constraint ids, or NULL if the penalties are not computed */
443 IPC_PENALTYTYPE** penaltytypes, /**< the penalty types */
444 int* npenalties, /**< the number of dynamic penalties, or NULL if the penalties are not computed */
445 int* penaltiessize, /**< the number of elements in the dynamic penalties array, or NULL if the penalties are not computed */
446 SCIP_Bool repairsol /**< should variables be fixed to zero to repair the solution */
447 )
448{
449 SCIP* scip;
450 SCIP_CONS** masterconss;
451 int nmasterconss;
452 int i;
453 int j;
454
455 assert(gcg != NULL);
456 assert(sol != NULL);
457
459
460 nmasterconss = GCGgetNMasterConss(gcg);
461 masterconss = GCGgetMasterConss(gcg);
462
463 /* setting the dynamic penalties per constraint. The penalties can only be applied to set covering or set packing
464 * constraints. This is because all constraint coefficients are positive and the LHS != RHS.
465 * TODO: extend this to handling more general constraints
466 */
467 for( i = 0; i < nmasterconss; i++ )
468 {
469 SCIP_HEURCONSTYPE constype;
470
471 constype = getConstraintType(scip, masterconss[i]);
472
473 /* if the constraint is of type SET COVERING or SET PACKING, then we add penalties to the pricing objective.
474 * Otherwise, no penalties will be added
475 */
476 if( constype == CONSTYPE_SETPACK || constype == CONSTYPE_SETCOVER || constype == CONSTYPE_SETPART )
477 {
478 SCIP_VAR** consvars;
479 int nconsvars;
480 SCIP_Real sum;
481 SCIP_Real conspenalty;
482
483 nconsvars = GCGconsGetNVars(scip, masterconss[i]);
484 SCIP_CALL( SCIPallocBufferArray(scip, &consvars, nconsvars) );
485
486 if( nconsvars > 0 )
487 {
488 SCIP_CALL( GCGconsGetVars(scip, masterconss[i], consvars, nconsvars) );
489 }
490
491 /* computing the activity of the constraint */
492 sum = 0.0;
493 for( j = 0; j < nconsvars; j++ )
494 sum += SCIPgetSolVal(scip, sol, consvars[j]);
495
496 SCIPdebugMsg(scip, "constraint <%s> activity: %g\n", SCIPconsGetName(masterconss[i]), sum);
497
498 /* if the solution should be repaired, then any set packing or set partitioning constraint with an activity
499 * currently exceeding 1.0 will have all variables fixed to zero
500 */
501 if( repairsol && (constype == CONSTYPE_SETPACK || constype == CONSTYPE_SETPART) && SCIPisSumGT(scip, sum, 1.0) )
502 {
504
505 j = 0;
506 while( SCIPisSumGT(scip, sum, 1.0) && j < nconsvars )
507 {
508 solval = SCIPgetSolVal(scip, sol, consvars[j]);
509 if( SCIPisGE(scip, solval, 1.0) )
510 {
511 SCIP_CALL( SCIPsetSolVal(scip, sol, consvars[j], 0.0) );
512 sum -= solval;
513 }
514 j++;
515 }
516 }
517
518 /* for set packing, if the constraint is satisfied, then we must penalise any non-zeros in that constraint.
519 * for set covering, if the constraint is violated, then we must reward any non-zeros in that constraint
520 */
521 if( penalties != NULL )
522 {
523 assert(penaltiesids != NULL);
524 assert(penaltytypes != NULL);
525 assert(npenalties != NULL);
526 assert(penaltiessize != NULL);
527
528 conspenalty = initdynamicpen*MAX(sum, 1.0);
529 if( SCIPisSumGE(scip, sum, 1.0) )
530 {
531 if( constype == CONSTYPE_SETPART || constype == CONSTYPE_SETPACK )
532 {
533 SCIP_CALL( addPenalty(scip, DEFAULT_BIGM, i, PENALTYTYPE_BIGM, penalties, penaltiesids, penaltytypes,
534 npenalties, penaltiessize) );
535 }
536 }
537 else
538 {
539 if( constype == CONSTYPE_SETPACK )
540 {
541 SCIP_CALL( addPenalty(scip, conspenalty, i, PENALTYTYPE_SETPACK, penalties, penaltiesids, penaltytypes,
542 npenalties, penaltiessize) );
543 }
544 else if( constype == CONSTYPE_SETCOVER )
545 {
546 SCIP_CALL( addPenalty(scip, -1.0*conspenalty, i, PENALTYTYPE_SETCOVER, penalties, penaltiesids, penaltytypes,
547 npenalties, penaltiessize) );
548 }
549 else if( constype == CONSTYPE_SETPART )
550 {
551 SCIP_CALL( addPenalty(scip, conspenalty, i, PENALTYTYPE_SETPACK, penalties, penaltiesids, penaltytypes,
552 npenalties, penaltiessize) );
553 SCIP_CALL( addPenalty(scip, -1.0*conspenalty, i, PENALTYTYPE_SETCOVER, penalties, penaltiesids, penaltytypes,
554 npenalties, penaltiessize) );
555 }
556 }
557 }
558
559 SCIPfreeBufferArray(scip, &consvars);
560 }
561 }
562
563 return SCIP_OKAY;
564}
565
566/** adjusts the dynamic penalties w.r.t to the added columns */
567static
569 GCG* gcg, /**< the GCG data structure */
570 SCIP_HEURDATA* heurdata /**< the heuristic data */
571 )
572{
573 SCIP* scip;
574 SCIP_SOL* augsol;
576 SCIP_CONS** masterconss;
577 int nmastervars;
578 int i;
579 int j;
580
581 SCIP_Bool penaltychanged;
582 SCIP_Bool abort;
583 SCIP_Bool infinitepenalty;
584
585 assert(gcg != NULL);
589
591
592 /* getting the master variables. It is assumed that the variables at the end of the array correspond to the newly
593 * added variables
594 */
597
598 masterconss = GCGgetMasterConss(gcg);
599
600 /* if no columns have been added to the master problem, then no penalty update will be performed */
602 return SCIP_OKAY;
603
604 /* creating the new augmentation solution */
605 SCIP_CALL( SCIPcreateSol(scip, &augsol, NULL) );
606
607 /* setting the values in the augmentation and partial solution */
608 for( i = heurdata->nmastervars; i < nmastervars; i++ )
609 {
610 SCIP_CALL( SCIPsetSolVal(scip, augsol, mastervars[i], 1.0) );
611 }
612
613 /* scanning all of the constraints that have been previously identified and computing their activity with respect to
614 * the new priced columns
615 */
616 abort = TRUE;
617 penaltychanged = FALSE;
618 infinitepenalty = FALSE;
619 for( i = 0; i < heurdata->npenalties; i++ )
620 {
621 IPC_PENALTYTYPE penaltytype;
622 SCIP_CONS* cons;
623 SCIP_VAR** consvars;
624 int nconsvars;
625 SCIP_Real sum;
626 SCIP_Real factor;
627
628 penaltytype = heurdata->penaltytypes[i];
629
630 /* if the penalty is a BIGM penalty, then the penalty is not adjusted */
631 if( penaltytype == PENALTYTYPE_BIGM )
632 continue;
633
635 cons = masterconss[heurdata->penaltiesids[i]];
636
637 nconsvars = GCGconsGetNVars(scip, cons);
638 SCIP_CALL( SCIPallocBufferArray(scip, &consvars, nconsvars) );
639
640 if( nconsvars > 0 )
641 {
642 SCIP_CALL( GCGconsGetVars(scip, cons, consvars, nconsvars) );
643 }
644
645 /* computing the activity of the constraint */
646 sum = 0.0;
647 for( j = 0; j < nconsvars; j++ )
648 sum += SCIPgetSolVal(scip, augsol, consvars[j]);
649
650 SCIPdebugMsg(scip, "adjusting penalties -- constraint <%s> activity: %g\n", SCIPconsGetName(cons), sum);
651
652 /* if the activity is positive, this means that the new variable is covering the constraints. As such, the penalties
653 * must be adjusted
654 * for set packing, the penalty is increased
655 * for set covering, the penalty is decreased
656 */
657 factor = 3*MAX(sum, 1.0);
658 if( SCIPisSumGE(scip, sum, 1.0) )
659 {
660 if( penaltytype == PENALTYTYPE_SETPACK )
661 {
662 heurdata->penalties[i] *= factor;
663 penaltychanged = TRUE;
664 }
665 else if( penaltytype == PENALTYTYPE_SETCOVER )
666 {
667 heurdata->penalties[i] /= factor;
668 penaltychanged = TRUE;
669 }
670 }
671 else
672 {
673 if( penaltytype == PENALTYTYPE_SETPACK )
674 {
675 heurdata->penalties[i] /= factor;
676 penaltychanged = TRUE;
677 }
678 else if( penaltytype == PENALTYTYPE_SETCOVER )
679 {
680 heurdata->penalties[i] *= factor;
681 penaltychanged = TRUE;
682 }
683 }
684
685 SCIPdebugMsg(scip, "new penalty for constraint <%s>: %g\n", SCIPconsGetName(cons), heurdata->penalties[i]);
686
688 abort = FALSE;
689 else
690 heurdata->penalties[i] = 0.0;
691
692 if( SCIPisGT(scip, heurdata->penalties[i], 1e+5) || SCIPisGT(scip, -heurdata->penalties[i], 1e+5) )
693 infinitepenalty = TRUE;
694
695 SCIPfreeBufferArray(scip, &consvars);
696 }
697
698 /* freeing the solution */
699 SCIP_CALL( SCIPfreeSol(scip, &augsol) );
700
701 /* if no penalty has been changed, then the weighted pricing is aborted */
702 heurdata->abort = abort || !penaltychanged || infinitepenalty;
703
704 return SCIP_OKAY;
705}
706
707
708/* ---------------- Callback methods of the pricing callback plugin ---------------- */
709
710/** the pre-pricing method of the pricing callback technique
711 *
712 * This method is called immediately before the pricing is performed in the GCG pricer. At this point, it is possible
713 * to modify the solving data is used within the pricing for new variables. Any data that is modified should be
714 * reverted in the post-pricing method.
715 */
716static
717GCG_DECL_PRICINGCBPREPRICING(pricingcbPrepricingIpcolgen)
718{
719#ifdef SCIP_DEBUG
720 int i;
721#endif
722 SCIP* scip;
723 SCIP_HEUR* heur;
725
726 assert(gcg != NULL);
727 assert(pricer != NULL);
728
730
731 (*result) = SCIP_DIDNOTRUN;
732
733 /* the callback is only executed during redcost pricing */
734 if( type != GCG_PRICETYPE_REDCOST )
735 return SCIP_OKAY;
736
737 /* getting the IP colgen heuristic */
738 heur = SCIPfindHeur(scip, HEUR_NAME);
739 assert(heur != NULL);
740
741 /* get heuristic's data */
743 assert(heurdata != NULL);
744
745 /* this callback can only be executed during the heuristic */
746 if( !heurdata->inheur )
747 return SCIP_OKAY;
748
749 /* aborting the weighted pricing */
750 if( heurdata->abort )
751 {
752 (*abort) = TRUE;
753 return SCIP_OKAY;
754 }
755
756 /* setting the weight and dynamic penalties for the dual values and the master constraints, respectively */
759
760#ifdef SCIP_DEBUG
761 for( i = 0; i < heurdata->npenalties; i++ )
762 {
763 if( heurdata->penalties[i] != 0.0 )
764 SCIPdebugMsg(scip, "penalty[%d](%d): %g\n", i, heurdata->penaltiesids[i], heurdata->penalties[i]);
765 }
766#endif
767
768 (*result) = SCIP_SUCCESS;
769
770 return SCIP_OKAY;
771}
772
773
774/** the post-pricing method of the pricing callback technique
775 *
776 * This method is called immediately after the pricing is performed in the GCG pricer. This method should be used to
777 * revert any changes made to in the pre-pricing method.
778 */
779static
780GCG_DECL_PRICINGCBPOSTPRICING(pricingcbPostpricingIpcolgen)
781{
782 SCIP* scip;
783 SCIP_HEUR* heur;
785
786 assert(gcg != NULL);
787 assert(pricer != NULL);
788
790 (*result) = SCIP_DIDNOTRUN;
791
792 /* the callback is only executed during redcost pricing */
793 if( type != GCG_PRICETYPE_REDCOST )
794 return SCIP_OKAY;
795
796 /* getting the IP colgen heuristic */
797 heur = SCIPfindHeur(scip, HEUR_NAME);
798 assert(heur != NULL);
799
800 /* get heuristic's data */
802 assert(heurdata != NULL);
803
804 /* this callback can only be executed during the heuristic */
805 if( !heurdata->inheur )
806 return SCIP_OKAY;
807
809
810 /* resetting the dual weight and the dynamic penalties */
813
815
816 (*result) = SCIP_SUCCESS;
817
818 return SCIP_OKAY;
819}
820
821/*
822 * Local methods
823 */
824
825/** pricing in new variables with a weighted objective function for the original master scip instance. The new variables
826 * will not form part of any stored solution, so they will not be fixed when setting up the repair problem
827 */
828static
830 GCG* gcg, /**< the GCG data structure */
831 SCIP_HEURDATA* heurdata, /**< the heuristic data */
832 int nblocks /**< the number of blocks in the problem */
833 )
834{
835 SCIP* scip;
836 SCIP* origprob;
837 int npricingiter;
841 SCIP_Real lpobjval;
842#ifdef SCIP_DEBUG
843 int i;
844#endif
845
846 /* pricing parameter settings */
847 int maxcolsroundredcostroot;
848 int maxcolsroundredcost;
849 int maxroundsredcost;
850 int heurpricingiters;
851 char sorting;
852
853 assert(gcg != NULL);
854
857 assert(origprob != NULL);
858
859 SCIPdebugMsg(scip, "Performing weighted pricing\n");
860
861 /* the number of pricing iterations is dependent on the number of pricing problems */
862 npricingiter = nblocks;
863
864 /* setting a flag to indicate that the next solve is from within the heuristic */
866
868
870
871 /* storing the previously set pricing parameter settings */
872 SCIP_CALL( SCIPgetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcostroot", &maxcolsroundredcostroot) );
873 SCIP_CALL( SCIPgetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcost", &maxcolsroundredcost) );
874 SCIP_CALL( SCIPgetIntParam(origprob, "pricing/masterpricer/maxroundsredcost", &maxroundsredcost) );
875 SCIP_CALL( SCIPgetIntParam(origprob, "pricing/masterpricer/heurpricingiters", &heurpricingiters) );
876 SCIP_CALL( SCIPgetCharParam(origprob, "pricing/masterpricer/sorting", &sorting) );
877
878 /* setting the pricing parameters for the repair phase of the heuristic */
879 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcostroot", 1) );
880 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcost", 1) );
881 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxroundsredcost", 1) );
882 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/heurpricingiters", INT_MAX) );
883 SCIP_CALL( SCIPsetCharParam(origprob, "pricing/masterpricer/sorting", 'd') );
884
885#ifdef SCIP_MOREDEBUG
886 SCIP_CALL( SCIPsetBoolParam(scip, "display/lpinfo", TRUE) );
887#endif
888
889 /* enabling the pricing callback plugin and marking at as exclusive */
892
893 /* solving the restricted master problem with the alternative pricing objective function */
894 SCIP_CALL( GCGrelaxPerformProbingWithPricing(gcg, npricingiter, NULL, NULL, &lpobjval, &lpsolved, &lperror, &cutoff) );
895 assert(!lperror);
896
897 /* disabling the pricing callback plugin */
900
901 /* resetting the pricing parameter settings */
902 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcostroot", maxcolsroundredcostroot) );
903 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxcolsroundredcost", maxcolsroundredcost) );
904 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/maxroundsredcost", maxroundsredcost) );
905 SCIP_CALL( SCIPsetIntParam(origprob, "pricing/masterpricer/heurpricingiters", heurpricingiters) );
906 SCIP_CALL( SCIPsetCharParam(origprob, "pricing/masterpricer/sorting", sorting) );
907
908#ifdef SCIP_MOREDEBUG
909 SCIP_CALL( SCIPsetBoolParam(scip, "display/lpinfo", FALSE) );
910#endif
911
912 /* after the solve, the recursion flag can be unset */
914
915 return SCIP_OKAY;
916}
917
918/** destroys and repairs the current best solution. This is the main loop of the ipcolgen heuristic. */
919static
921 GCG* gcg, /**< the GCG data structure */
922 SCIP_HEURDATA* heurdata, /**< the heuristic data */
923 SCIP_SOL* partialsol, /**< the partial solution that will be updated */
924 int npricingprobs, /**< the number of pricing problems */
925 SCIP_Bool* terminate /**< indicates whether the heuristic must be terminated */
926 )
927{
928 SCIP* scip;
930 SCIP_Bool updatesol;
931 int i;
932
933 assert(gcg != NULL);
934 assert(heurdata != NULL);
935
937
938 SCIPdebugMsg(scip, "Destroy and repair\n");
939
941
942 /* setting the number of relaxation penalties to zero to overwrite the previous penalties */
943 heurdata->npenalties = 0;
945 heurdata->npricingprobs = npricingprobs;
946
947 updatesol = TRUE;
948
949 for( i = 0; i < 3; i++ )
950 {
951 if( updatesol )
952 {
953 SCIP_Real initdynamicpen = heurdata->initdynamicpen;
954
956 npricingprobs, &heurdata->nfixedvars, &success) );
957
958 /* setting the number of penalties to zero to avoid the reallocation of the memory arrays */
959 heurdata->npenalties = 0;
960
961 /* computing the relaxation penalties */
962 SCIP_CALL( computeDynamicPenalties(gcg, partialsol, initdynamicpen, &heurdata->penalties,
964
965 updatesol = FALSE;
966 }
967
968 /* if a sufficient number of fixings were not performed, then the heuristic will exit */
969 if( !success || !heurdata->npenalties )
970 {
971 (*terminate) = TRUE;
972 break;
973 }
974
975 /* pricing in new columns that will be used to find new solutions when solving the repair problem */
976 SCIP_CALL( performWeightedPricing(gcg, heurdata, npricingprobs) );
977
978 /* if the best solution is updated, then the partial solution needs to be updated */
980 {
981 SCIP_CALL( SCIPfreeSol(scip, &partialsol) );
984 SCIP_CALL( SCIPunlinkSol(scip, partialsol) );
985
986 updatesol = TRUE;
987 }
988 }
989
990 /* resetting the number of relaxation penalties to zero */
991 heurdata->npenalties = 0;
992
993 return SCIP_OKAY;
994}
995
996/** creates the sub-SCIP for the repair problem that is solved to find improving solutions */
997static
999 SCIP* scip, /**< the SCIP data structure */
1000 SCIP** repairprob, /**< the SCIP data structure for the repair problem */
1001 SCIP_HEURDATA* heurdata, /**< the heuristic data */
1002 SCIP_VAR** repairprobvars /**< an array to store the variables of the repair problem */
1003 )
1004{
1005 SCIP_HASHMAP* varmapfw; /* mapping of master variables to repair problem variables */
1007 int nmastervars;
1008 int i;
1009
1010 assert(scip != NULL);
1011
1012 /* get variable data of the master problem */
1015 assert(nmastervars >= 0);
1016
1017 /* initializing the repair problem */
1018 SCIP_CALL( SCIPcreate(repairprob) );
1019
1020 /* create the variable mapping hash map */
1022
1023 if( heurdata->uselprows )
1024 {
1025 char probname[SCIP_MAXSTRLEN];
1026
1027 /* copy all plugins */
1028 SCIP_CALL( SCIPincludeDefaultPlugins((*repairprob)) );
1029
1030 /* get name of the original problem and add the string "_repair" */
1031 (void) SCIPsnprintf(probname, SCIP_MAXSTRLEN, "%s_repair", SCIPgetProbName(scip));
1032
1033 /* create the repair problem */
1034 SCIP_CALL( SCIPcreateProb((*repairprob), probname, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
1035
1036 /* copy all variables */
1037 SCIP_CALL( SCIPcopyVars(scip, (*repairprob), varmapfw, NULL, NULL, NULL, 0, TRUE) );
1038 }
1039 else
1040 {
1041 SCIP_Bool valid;
1042
1043 valid = FALSE;
1044
1045 SCIP_CALL( SCIPcopy(scip, (*repairprob), varmapfw, NULL, "repairprob", TRUE, FALSE, FALSE, TRUE, &valid) ); /** @todo check for thread safeness */
1046
1047 if( heurdata->copycuts )
1048 {
1049 /* copies all active cuts from cutpool of sourcescip to linear constraints in targetscip */
1050 SCIP_CALL( SCIPcopyCuts(scip, (*repairprob), varmapfw, NULL, TRUE, NULL) );
1051 }
1052
1053 SCIPdebugMessage("Copying the SCIP instance was %scomplete.\n", valid ? "" : "not ");
1054 }
1055
1056 for( i = 0; i < nmastervars; i++ )
1057 repairprobvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, mastervars[i]);
1058
1059 /* free hash map */
1061
1062 return SCIP_OKAY;
1063}
1064
1065/** set up the repair problem by fixing variables based on the provide solution values */
1066static
1068 SCIP* scip, /**< SCIP data structure for master problem */
1069 SCIP* repairprob, /**< SCIP data structure for repair problem */
1070 SCIP_VAR** repairprobvars, /**< the variables of the repair problem */
1071 SCIP_SOL* sol, /**< the source solution */
1072 SCIP_Bool uselprows, /**< should repair problem be created out of the rows in the LP rows? */
1073 SCIP_Bool rinsfixing /**< should a RINS-style fixing be used for the master problem */
1074 )
1075{
1077 int nmastervars;
1078 int i;
1079
1080 /* get variable data of the master problem */
1083 assert(nmastervars >= 0);
1084
1085 /* fix variables based upon sol or the current LP solution in the repair problem */
1086 for( i = 0; i < nmastervars; i++ )
1087 {
1088 SCIP_Real mastersolval;
1089
1090 mastersolval = SCIPgetSolVal(scip, sol, mastervars[i]);
1091
1092 if( rinsfixing )
1093 {
1094 SCIP_Real lpsolval;
1095
1096 lpsolval = SCIPgetSolVal(scip, NULL, mastervars[i]);
1097
1098 /* if the variable takes the same value in the primal solution and the relaxation, then it is fixed */
1099 if( GCGvarGetBlock(mastervars[i]) >= 0 && !SCIPisFeasEQ(scip, lpsolval, mastersolval) )
1100 {
1101 SCIP_CALL( SCIPchgVarUbGlobal(repairprob, repairprobvars[i], mastersolval) );
1102 SCIP_CALL( SCIPchgVarLbGlobal(repairprob, repairprobvars[i], mastersolval) );
1103 }
1104 }
1105 else
1106 {
1107 /* if variable takes a non-zero value in the master solution, then it is fixed to that value */
1108 if( GCGvarGetBlock(mastervars[i]) >= 0 && !SCIPisZero(scip, mastersolval) )
1109 {
1110 SCIP_CALL( SCIPchgVarUbGlobal(repairprob, repairprobvars[i], mastersolval) );
1111 SCIP_CALL( SCIPchgVarLbGlobal(repairprob, repairprobvars[i], mastersolval) );
1112 }
1113 }
1114 }
1115
1116 if( uselprows )
1117 {
1118 SCIP_ROW** rows; /* original scip rows */
1119 int nrows;
1120
1121 /* get the rows and their number */
1122 SCIP_CALL( SCIPgetLPRowsData(scip, &rows, &nrows) );
1123
1124 /* copy all rows to linear constraints */
1125 for( i = 0; i < nrows; i++ )
1126 {
1127 SCIP_CONS* cons;
1128 SCIP_VAR** consvars;
1129 SCIP_COL** cols;
1130 SCIP_Real constant;
1131 SCIP_Real lhs;
1132 SCIP_Real rhs;
1133 SCIP_Real* vals;
1134 int nnonz;
1135 int j;
1136
1137 /* ignore rows that are only locally valid */
1138 if( SCIProwIsLocal(rows[i]) )
1139 continue;
1140
1141 /* get the row's data */
1142 constant = SCIProwGetConstant(rows[i]);
1143 lhs = SCIProwGetLhs(rows[i]) - constant;
1144 rhs = SCIProwGetRhs(rows[i]) - constant;
1145 vals = SCIProwGetVals(rows[i]);
1146 nnonz = SCIProwGetNNonz(rows[i]);
1147 cols = SCIProwGetCols(rows[i]);
1148
1149 assert(lhs <= rhs);
1150
1151 /* allocate memory array to be filled with the corresponding repair problem variables */
1152 SCIP_CALL( SCIPallocBufferArray(repairprob, &consvars, nnonz) );
1153 for( j = 0; j < nnonz; j++ )
1154 consvars[j] = repairprobvars[SCIPvarGetProbindex(SCIPcolGetVar(cols[j]))];
1155
1156 /* create a new linear constraint and add it to the repair problem */
1157 SCIP_CALL( SCIPcreateConsLinear(repairprob, &cons, SCIProwGetName(rows[i]), nnonz, consvars, vals, lhs, rhs,
1159 SCIP_CALL( SCIPaddCons(repairprob, cons) );
1160 SCIP_CALL( SCIPreleaseCons(repairprob, &cons) );
1161
1162 /* free temporary memory */
1163 SCIPfreeBufferArray(repairprob, &consvars);
1164 }
1165 }
1166
1167 return SCIP_OKAY;
1168}
1169
1170/** creates a new solution for the original problem by translating the solution of the repair problem */
1171static
1173 GCG* gcg, /**< GCG data structure */
1174 SCIP* repairprob, /**< SCIP structure of repair problem */
1175 SCIP_VAR** repairprobvars, /**< the variables of the restricted master problem */
1176 SCIP_HEUR* heur, /**< Restricted Master heuristic structure */
1177 SCIP_SOL* repairprobsol, /**< solution of the restricted master problem */
1178 SCIP_Bool* success /**< used to store whether new solution was found or not */
1179 )
1180{
1181 SCIP* origprob;
1182 SCIP* scip;
1183 SCIP_VAR** vars;
1185 int nvars;
1186 int nmastervars;
1187 SCIP_Real* repairprobvals;
1188 SCIP_SOL* newmastersol;
1189
1190 assert(gcg != NULL);
1191 assert(repairprob != NULL);
1192 assert(repairprobvars != NULL);
1193 assert(repairprobsol != NULL);
1194
1197
1198 /* get variables' data */
1201 assert(nmastervars == SCIPgetNOrigVars(repairprob));
1202
1203 SCIP_CALL( SCIPallocBufferArray(scip, &repairprobvals, nmastervars) );
1204
1205 /* copy the solution */
1206 SCIP_CALL( SCIPgetSolVals(repairprob, repairprobsol, nmastervars, repairprobvars, repairprobvals) );
1207
1208 /* create new solution for the master problem */
1209 SCIP_CALL( SCIPcreateSol(scip, &newmastersol, heur) );
1210 SCIP_CALL( SCIPsetSolVals(scip, newmastersol, nmastervars, mastervars, repairprobvals) );
1211
1212 /* add solution to the master problem, GCG will translate it and add it to the original problem*/
1213#ifdef SCIP_DEBUG
1214 SCIP_CALL( SCIPprintSol(scip, newmastersol, NULL, FALSE) );
1215 SCIP_CALL( SCIPtrySolFree(scip, &newmastersol, TRUE, TRUE, TRUE, TRUE, TRUE, success) );
1216#else
1217 SCIP_CALL( SCIPtrySolFree(scip, &newmastersol, FALSE, FALSE, TRUE, TRUE, TRUE, success) );
1218#endif
1219 if( *success == FALSE )
1220 {
1221 SCIPdebugMessage("WARNING: original solution feasible, but no solution has been added to master problem.\n");
1222 }
1223
1224 SCIPfreeBufferArray(scip, &repairprobvals);
1225
1226 return SCIP_OKAY;
1227}
1228
1229
1230/** solve repair problem */
1231static
1233 GCG* gcg, /**< GCG data structure */
1234 SCIP* repairprob, /**< SCIP data structure of the repair problem */
1235 SCIP_HEUR* heur, /**< the ipcolgen heuristic structure */
1236 SCIP_HEURDATA* heurdata, /**< the heuristic data */
1237 SCIP_VAR** repairprobvars, /**< the variables of the repair problem */
1238 SCIP_Longint nnodes, /**< the number of nodes provided to the heuristic */
1239 SCIP_RESULT* result /**< the result from performing the heuristic */
1240 )
1241{
1242 SCIP* origprob;
1243 SCIP* scip;
1244 SCIP_EVENTHDLR* eventhdlr;
1246 SCIP_Real upperbound;
1247 SCIP_SOL** repairprobsols;
1248 int nrepairprobsols;
1250
1251 int i;
1252
1253#ifdef NDEBUG
1254 SCIP_RETCODE retstat;
1255#endif
1256
1257 assert(repairprob != NULL);
1258 assert(heurdata != NULL);
1259
1262
1263 eventhdlr = NULL;
1264 /* create event handler for LP events */
1265 SCIP_CALL( SCIPincludeEventhdlrBasic(repairprob, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecIpcolgen, NULL) );
1266 if( eventhdlr == NULL )
1267 {
1268 SCIPerrorMessage("event handler for " HEUR_NAME " heuristic not found.\n");
1269 return SCIP_PLUGINNOTFOUND;
1270 }
1271
1272 /* do not abort repair problem on CTRL-C */
1273 SCIP_CALL( SCIPsetBoolParam(repairprob, "misc/catchctrlc", FALSE) );
1274
1275 /* disable output to console */
1276#ifdef SCIP_DEBUG
1277 SCIP_CALL( SCIPsetIntParam(repairprob, "display/verblevel", SCIP_VERBLEVEL_FULL) );
1278#else
1279 SCIP_CALL( SCIPsetIntParam(repairprob, "display/verblevel", SCIP_VERBLEVEL_NONE) );
1280 SCIP_CALL( SCIPsetBoolParam(repairprob, "timing/statistictiming", FALSE) );
1281#endif
1282
1283 /* set limits for the repair problem */
1284 SCIP_CALL( SCIPcopyLimits(scip, repairprob) );
1285 SCIP_CALL( SCIPsetLongintParam(repairprob, "limits/stallnodes", MAX(10, nnodes/10)) );
1286 SCIP_CALL( SCIPsetLongintParam(repairprob, "limits/nodes", nnodes) );
1287
1288 /* forbid recursive call of heuristics solving subMIPs */
1289 SCIP_CALL( SCIPsetSubscipsOff(repairprob, TRUE) );
1290
1291 /* disable cutting plane separation */
1293
1294 /* disable expensive presolving */
1296
1297 /* use best estimate node selection */
1298 if( SCIPfindNodesel(scip, "estimate") != NULL )
1299 {
1300 SCIP_CALL( SCIPsetIntParam(repairprob, "nodeselection/estimate/stdpriority", INT_MAX/4) );
1301 }
1302
1303 /* use inference branching */
1304 if( SCIPfindBranchrule(scip, "inference") != NULL )
1305 {
1306 SCIP_CALL( SCIPsetIntParam(repairprob, "branching/inference/priority", INT_MAX/4) );
1307 }
1308
1309 /* disable conflict analysis */
1310 if( !SCIPisParamFixed(repairprob, "conflict/enable") )
1311 {
1312 SCIP_CALL( SCIPsetBoolParam(repairprob, "conflict/enable", FALSE) );
1313 }
1314
1315 /* setting an objective cutoff with respect to the best solution */
1317
1319
1321 {
1323 }
1324 else
1325 {
1326 if( SCIPgetUpperbound ( origprob ) >= 0 )
1328 else
1330 }
1331 cutoff = MIN(upperbound, cutoff);
1332 SCIP_CALL( SCIPsetObjlimit(repairprob, cutoff) );
1333
1334 /* solve the repair problem */
1335
1336 /* Errors in the LP solver should not kill the overall solving process, if the LP is just needed for a heuristic.
1337 * Hence in optimized mode, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
1338 */
1339#ifdef NDEBUG
1340 retstat = SCIPpresolve(repairprob);
1341 if( retstat != SCIP_OKAY )
1342 {
1343 SCIPwarningMessage(scip, "Error while presolving subMIP in IPColGen; IPColGen terminated with code <%d>\n",retstat);
1344 }
1345#else
1346 SCIP_CALL( SCIPpresolve(repairprob) );
1347#endif
1348
1349 SCIPdebugMessage("presolved the IPColGen repair problem: %d vars, %d cons\n", SCIPgetNVars(repairprob), SCIPgetNConss(repairprob));
1350
1351 SCIPdebugMessage("solving the IPColGen repair problem: maxnodes=%"SCIP_LONGINT_FORMAT"\n", nnodes);
1352
1353 /* catching the LP solved events */
1355
1356#ifdef NDEBUG
1357 retstat = SCIPsolve(repairprob);
1358 if( retstat != SCIP_OKAY )
1359 {
1360 SCIPwarningMessage(scip, "Error while solving subMIP in IPColGen; IPColGen terminated with code <%d>\n",retstat);
1361 }
1362#else
1363 SCIP_CALL( SCIPsolve(repairprob) );
1364#endif
1365
1366 /* drop LP events of sub-SCIP */
1367 SCIP_CALL( SCIPdropEvent(repairprob, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, -1) );
1368
1369 /* print solving statistics of repair problem if we are in SCIP's debug mode */
1370 SCIPdebug( SCIP_CALL( SCIPprintStatistics(repairprob, NULL) ) );
1371
1372 SCIPdebugMessage(" -> %d feasible solution(s) found.\n", SCIPgetNSols(repairprob));
1373
1374 heurdata->usednodes += SCIPgetNNodes(repairprob);
1375
1376 /* check, whether a solution was found;
1377 * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
1378 */
1379 nrepairprobsols = SCIPgetNSols(repairprob);
1380 repairprobsols = SCIPgetSols(repairprob);
1381 success = FALSE;
1382 for( i = 0; i < nrepairprobsols && !success; ++i )
1383 {
1384 SCIP_CALL( createNewSol(gcg, repairprob, repairprobvars, heur, repairprobsols[i], &success) );
1385 }
1386
1387 if( success )
1389
1390 return SCIP_OKAY;
1391}
1392
1393
1394/** checks conditions to determine whether the ipcolgen heuristic should be executed.
1395 * Prior to the first call of the ipcolgen heuristic, the average LP objective value is computed to identify the point
1396 * when the tailing-off effect starts. This is when the heuristic is first called.
1397 */
1398static
1400 GCG* gcg, /**< the GCG data structure */
1401 SCIP_HEURDATA* heurdata, /**< the heuristic data */
1402 SCIP_Bool* execute /**< returns whether the heuristic should be executed */
1403 )
1404{
1405 SCIP* scip;
1406 int maxdepth;
1407 int nblocks;
1408 int i;
1409
1410 assert(gcg != NULL);
1411 assert(heurdata != NULL);
1412 assert(execute != NULL);
1413
1414 (*execute) = FALSE;
1415
1417
1418 nblocks = GCGgetNPricingprobs(gcg);
1419
1420 /* if the previously called node is different to the current node, then the number of pricing iterations must be
1421 * reset
1422 */
1424 {
1426 heurdata->numexec = 0;
1428 }
1429
1430 /* storing the number of solutions found before the heuristic is called */
1432
1433 /* a solution must exist before the heuristic can be executed */
1434 if( SCIPgetBestSol(scip) == NULL )
1435 return SCIP_OKAY;
1436
1437 /* imposing the maximum depth setting */
1439 if( maxdepth >= 0 && SCIPgetDepth(scip) > maxdepth )
1440 return SCIP_OKAY;
1441
1442 /* the heuristic will only be called if the current gap is large enough. */
1444 return SCIP_OKAY;
1445
1446 /* the heuristic is only called if a new incumbent solution is found */
1448 && SCIPgetDepth(scip) == 0 )
1449 return SCIP_OKAY;
1450
1451 /* only run the heuristic if enough nodes have been processed since the last call */
1453 return SCIP_OKAY;
1454
1455 /* we require at least n blocks of pricing iterations to be performed before the first execution of the heuristic */
1456 if( SCIPpricerGetNCalls(SCIPfindPricer(scip, "gcg")) < nblocks )
1457 return SCIP_OKAY;
1458
1459 /* restricting the number of executions */
1461 return SCIP_OKAY;
1462
1463 /* if the heuristic has been executed once, then we require nblocks*0.1 pricing iterations */
1464 if( heurdata->firstexec )
1465 {
1466 if( SCIPpricerGetNCalls(SCIPfindPricer(scip, "gcg")) - heurdata->prevpricingiter > nblocks*0.1 )
1467 (*execute) = TRUE;
1468
1469 return SCIP_OKAY;
1470 }
1471
1472 /* collecting the previous LP objective values after we have reached the pricer calls threshold */
1474 {
1475 for( i = 0; i < heurdata->prevlpobjssize - 1; i++ )
1476 {
1478 }
1479 }
1480 else
1482
1484
1485 /* if enough previous LP objectives have been collected, then average difference is computed and used to assess the
1486 * execution of the heuristic
1487 */
1489 {
1490 SCIP_Real avgobj = 0.0;
1491 int objcount = 0;
1492
1493 for( i = 0; i < heurdata->nprevlpobjs; i++ )
1494 {
1496 {
1497 avgobj += heurdata->prevlpobjs[i];
1498 objcount++;
1499 }
1500 }
1501
1502 if( objcount < heurdata->nprevlpobjs )
1503 return SCIP_OKAY;
1504
1505 avgobj = avgobj/(SCIP_Real) objcount;
1506 SCIPdebugMsg(scip, "Average objective: %g Current Objective: %g Relative Difference: %g\n", avgobj,
1508
1509 /* if the average objective and the current object are equal, this could indicate that the column generation has
1510 * stalled. So we ignore this situation
1511 */
1512 if( SCIPisFeasEQ(scip, avgobj, SCIPgetLPObjval(scip)) )
1513 return SCIP_OKAY;
1514
1515 /* the threshold for starting the heuristic is if the average difference in the lp objectives is 0.01% of the LP
1516 * objective value
1517 */
1518 if( !SCIPisZero(scip, avgobj)
1519 && SCIPisLT(scip, (avgobj - SCIPgetLPObjval(scip))/REALABS(SCIPgetLPObjval(scip)), 0.0001) )
1520 {
1521 (*execute) = TRUE;
1522 }
1523 }
1524
1525 if( (*execute) && !heurdata->firstexec )
1526 {
1528
1529 /* storing first executing statistics */
1532 }
1533
1534 return SCIP_OKAY;
1535}
1536
1537/*
1538 * Callback methods of primal heuristic
1539 */
1540
1541/** copy method for primal heuristic plugins (called when SCIP copies plugins) */
1542#define heurCopyIPcolgen NULL
1543
1544/** destructor of primal heuristic to free user data (called when SCIP is exiting) */
1545static
1546SCIP_DECL_HEURFREE(heurFreeIPcolgen)
1547{ /*lint --e{715}*/
1549
1550 assert(heur != NULL);
1551 assert(scip != NULL);
1552
1553 /* get heuristic data */
1554 heurdata = SCIPheurGetData(heur);
1555 assert(heurdata != NULL);
1556
1558
1559 /* free heuristic data */
1561 SCIPheurSetData(heur, NULL);
1562
1563 return SCIP_OKAY;
1564}
1565
1566
1567/** initialization method of primal heuristic (called after problem was transformed) */
1568static
1569SCIP_DECL_HEURINIT(heurInitIPcolgen)
1570{ /*lint --e{715}*/
1572
1573 assert(heur != NULL);
1574 assert(scip != NULL);
1575
1576 /* get heuristic's data */
1577 heurdata = SCIPheurGetData(heur);
1578 assert(heurdata != NULL);
1579
1580 /* initialize data */
1581 heurdata->usednodes = 0;
1584 heurdata->numexec = 0;
1585
1587
1590
1592 heurdata->prevnnodes = 0;
1593 heurdata->nwaitnodes = 0;
1594
1596 heurdata->nprevlpobjs = 0;
1598
1599 /* create random number generator */
1602
1603 /* initialising the dynamic penalties arrays */
1607 heurdata->npenalties = 0;
1609
1610 /* initialising the statistics */
1613
1614 return SCIP_OKAY;
1615}
1616
1617
1618/** deinitialization method of primal heuristic (called before transformed problem is freed) */
1619static
1620SCIP_DECL_HEUREXIT(heurExitIPcolgen)
1621{ /*lint --e{715}*/
1623
1624 assert(heur != NULL);
1625 assert(scip != NULL);
1626
1627 /* get heuristic data */
1628 heurdata = SCIPheurGetData(heur);
1629 assert(heurdata != NULL);
1630
1631 /* freeing the relaxation penalties arrays */
1635
1637
1638 /* free random number generator */
1640
1641 return SCIP_OKAY;
1642}
1643
1644
1645/** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
1646#define heurInitsolIPcolgen NULL
1647
1648
1649/** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
1650#define heurExitsolIPcolgen NULL
1651
1652
1653/** execution method of primal heuristic */
1654static
1655SCIP_DECL_HEUREXEC(heurExecIPcolgen)
1656{ /*lint --e{715}*/
1657 GCG* gcg;
1658 SCIP* origprob;
1660 SCIP_Real timelimit;
1661 SCIP_Real memorylimit;
1662 SCIP_Bool discretization;
1664 SCIP_Bool execute;
1666
1667 SCIP* repairprob;
1668 SCIP_VAR** repairprobvars;
1669
1670 SCIP_SOL* bestsol;
1671 SCIP_RESULT locresult;
1672 int iter;
1673 int solcount;
1674 int noimprove;
1675 int maxiter;
1676 int maxsol;
1677 int maxnoimprove;
1678
1679 assert(heur != NULL);
1680 assert(scip != NULL);
1681 assert(result != NULL);
1683
1684 /* get heuristic's data */
1685 heurdata = SCIPheurGetData(heur);
1686 assert(heurdata != NULL);
1687
1688 gcg = heurdata->gcg;
1690
1691 /* get original problem */
1693 assert(origprob != NULL);
1694
1695 maxiter = heurdata->maxiter;
1696 maxsol = 200;
1697 maxnoimprove = heurdata->noimproveiter;
1698
1700
1701 /* checking whether the current call is a recursive call to the heuristic. If this heuristic is called from the
1702 * repair problem, then it is not executed.
1703 */
1704 if( heurdata->inheur )
1705 return SCIP_OKAY;
1706
1707 /* this heuristic works only for the discretization approach */
1708 SCIP_CALL( SCIPgetBoolParam(origprob, "relaxing/gcg/discretization", &discretization) );
1709 if( !discretization )
1710 return SCIP_OKAY;
1711
1713
1714 /* checking whether the heuristic should be executed */
1715 SCIP_CALL( executeHeuristic(gcg, heurdata, &execute) );
1716
1717 if( !execute )
1718 return SCIP_OKAY;
1719
1721
1722 /* calculate the maximal number of branching nodes until heuristic is aborted */
1724
1725 /* reward the heuristic if it succeeded often */
1726 nnodes = (SCIP_Longint)(nnodes * (SCIPheurGetNSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur) + 1.0));
1727 nnodes -= (SCIP_Longint)(100.0 * SCIPheurGetNCalls(heur)); /* count the setup costs for the sub-MIP as 100 nodes */
1729
1730 /* determine the node limit for the current process */
1734
1735 /* check whether we have enough nodes left to call IPColGen */
1736 if( nnodes < heurdata->minnodes )
1737 return SCIP_OKAY;
1738
1739 /* check whether there is enough time and memory left */
1740 SCIP_CALL( SCIPgetRealParam(origprob, "limits/time", &timelimit) );
1741 if( !SCIPisInfinity(origprob, timelimit) )
1742 timelimit -= SCIPgetSolvingTime(origprob);
1743 SCIP_CALL( SCIPgetRealParam(origprob, "limits/memory", &memorylimit) );
1744 if( !SCIPisInfinity(origprob, memorylimit) )
1745 memorylimit -= SCIPgetMemUsed(origprob)/1048576.0;
1746 if( timelimit < 10.0 || memorylimit <= 0.0 )
1747 return SCIP_OKAY;
1748
1749 if( SCIPisStopped(scip) )
1750 return SCIP_OKAY;
1751
1752 SCIPdebugMsg(scip, "Executing IPColGen ...\n");
1753
1755
1756 /* creating the partial solution for setting the dynamic penalties and fixings in the repair problem */
1757 bestsol = SCIPgetBestSol(scip);
1758
1759 /* if the best solution doesn't exist, then a starting solution is created */
1760 if( bestsol == NULL )
1761 {
1762 SCIP_SOL* startsol;
1763
1764 /* creating the starting solution */
1765 SCIP_CALL( SCIPcreateSol(scip, &startsol, NULL) );
1766
1767 success = FALSE;
1768 SCIP_CALL( createStartSolution(gcg, startsol, &success) );
1769
1770 if( !success )
1771 {
1772 SCIP_CALL( SCIPfreeSol(scip, &startsol) );
1773 return SCIP_OKAY;
1774 }
1775
1778
1779 SCIP_CALL( SCIPfreeSol(scip, &startsol) );
1780 }
1781 else
1782 {
1785 }
1786
1787 iter = 0;
1788 solcount = 0;
1789 noimprove = 0;
1790 while( iter < maxiter && solcount < maxsol && noimprove < maxnoimprove )
1791 {
1792 SCIP_Bool terminate;
1793
1794 /* entering probing mode for the master problem */
1796
1797 locresult = SCIP_DIDNOTFIND;
1798
1799 /* performing the destroy and repair of the best solution */
1801
1802 terminate = FALSE;
1803 if( terminate )
1804 {
1806
1807 /* the partial solution is no longer needed */
1809
1810 goto TERMINATE;
1811 }
1812
1814 {
1815 success = FALSE;
1816
1817 /* allocating memory for the repair problem variables */
1818 SCIP_CALL( SCIPallocBufferArray(scip, &repairprobvars, SCIPgetNVars(scip)) );
1819
1820 /* creates the repair problem to find improving solutions */
1821 SCIP_CALL( createRepairProblem(scip, &repairprob, heurdata, repairprobvars) );
1822
1823 /* set up repair problem by fixing variables based on the partial solution */
1824 SCIP_CALL( setupRepairProblem(scip, repairprob, repairprobvars, heurdata->partialsol, heurdata->uselprows,
1825 heurdata->rinsfixing) );
1826 SCIPdebugMessage("IPColGen repair problem: %d vars, %d cons, success=%u\n", SCIPgetNVars(repairprob),
1827 SCIPgetNConss(repairprob), success);
1828
1829 /* solve the repair problem to find improving integer solutions */
1830 SCIP_CALL( solveRepairProblem(gcg, repairprob, heur, heurdata, repairprobvars, nnodes,
1831 &locresult) );
1832
1833 /* free the repair problem */
1834 SCIPfreeBufferArray(scip, &repairprobvars);
1835 SCIP_CALL( SCIPfree(&repairprob) );
1836 }
1837
1838 /* incrementing the iteration counter */
1839 iter++;
1840
1841 /* incrementing the solution counter */
1842 if( bestsol != SCIPgetBestSol(scip) )
1843 {
1845 bestsol = SCIPgetBestSol(scip);
1848
1849 solcount++;
1850 noimprove = 0;
1851 }
1852 else
1853 noimprove++;
1854
1855 (*result) = MAX(locresult, (*result));
1856
1857 /* ending probing mode for the master problem */
1859 }
1860
1861 /* the partial solution is freed between every iteration of the algorithm.
1862 * NOTE: this is probably not very efficient and it may be possible to free the solution only when the incumbent is
1863 * updated
1864 */
1866
1867 SCIPdebugMessage("Finished IPColGen ...\n");
1868
1869TERMINATE:
1870 /* if a new solution is found, then the number of waiting nodes is reset. Otherwise, it is increased */
1872 heurdata->nwaitnodes = 0;
1873 else
1875
1876 /* updating the last stored solution */
1878
1879 /* incrementing the number of executions */
1880 heurdata->numexec++;
1881
1882 /* updating the number of pricing iterations */
1884
1885 /* updating the number of nodes processed */
1887
1888 return SCIP_OKAY;
1889}
1890
1891
1892
1893
1894/*
1895 * primal heuristic specific interface methods
1896 */
1897
1898/** creates the IPColGen heuristic and includes it in SCIP */
1900 GCG* gcg /**< GCG data structure */
1901 )
1902{
1903 SCIP* scip;
1905
1907
1908 /* create IPColGen data */
1910 heurdata->gcg = gcg;
1911
1912 /* include primal heuristic */
1915 heurCopyIPcolgen, heurFreeIPcolgen, heurInitIPcolgen, heurExitIPcolgen,
1916 heurInitsolIPcolgen, heurExitsolIPcolgen, heurExecIPcolgen,
1917 heurdata) );
1918
1919 /* include the pricing callback plugin */
1921 NULL, NULL, NULL, NULL, NULL, pricingcbPrepricingIpcolgen, pricingcbPostpricingIpcolgen, NULL) );
1922
1923 /* add IPColGen parameters */
1924 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/minfixingrate",
1925 "minimum percentage of integer variables that have to be fixed",
1927
1928 SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/"HEUR_NAME"/maxnodes",
1929 "maximum number of nodes to regard in the repair problem",
1931
1932 SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/"HEUR_NAME"/nodesofs",
1933 "number of nodes added to the contingent of the total nodes",
1935
1936 SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/"HEUR_NAME"/minnodes",
1937 "minimum number of nodes required to start IPColGen",
1939
1940 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/nodesquot",
1941 "contingent of repair problem nodes in relation to the number of nodes of the original problem",
1943
1944 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/lplimfac",
1945 "factor by which the limit on the number of LP depends on the node limit",
1947
1948 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/minimprove",
1949 "factor by which IPColGen should at least improve the incumbent ",
1951
1952 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/uselprows",
1953 "should the repair problem be created out of the rows in the LP rows?",
1955
1956 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/copycuts",
1957 "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in repair problem?",
1959
1960 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/dualweight",
1961 "the weight for the dual values in the pricing problem objective",
1963
1964 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/initdynamicpen",
1965 "the initial dynamic penalty for the master constraints in the pricing problem objective",
1967
1968 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/waitnewsol",
1969 "should the heuristic wait until a new solution is found before executing",
1971
1972 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/solveauxproblem",
1973 "should an auxiliary problem be solved to find improving solutions",
1975
1976 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/mininitialgap",
1977 "the minimum initial gap that is necessary before the first call of the heuristic",
1979
1980 SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/callspernode",
1981 "the maximum number of times that the heuristic is called in each node",
1983
1984 SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/maxiter",
1985 "the maximum number of weighted pricing iterations",
1986 &heurdata->maxiter, TRUE, DEFAULT_MAXITER, 0, INT_MAX, NULL, NULL) );
1987
1988 SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/noimproveiter",
1989 "the maximum number of weighted pricing iterations without primal improvement",
1991
1992 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/rinsfixing",
1993 "should a RINS-style fixing be used for the repair master problem",
1995
1996 return SCIP_OKAY;
1997}
SCIP_DECL_EVENTEXEC(EventhdlrNewSol::scip_exec)
SCIP_DECL_HEUREXIT(Heur2opt::scip_exit)
SCIP_DECL_HEURINIT(Heur2opt::scip_init)
SCIP_DECL_HEURFREE(Heur2opt::scip_free)
SCIP_DECL_HEUREXEC(Heur2opt::scip_exec)
#define EVENTHDLR_DESC
#define EVENTHDLR_NAME
#define DEFAULT_RANDSEED
#define SCIP_MAXSTRLEN
#define SCIP_Longint
#define SCIP_REAL_MAX
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define MAX(x, y)
#define SCIP_LONGINT_FORMAT
#define REALABS(x)
#define SCIP_LONGINT_MAX
#define TRUE
#define FALSE
GCG interface methods.
int GCGvarGetBlock(SCIP_VAR *var)
Definition gcgvar.c:1118
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global)
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
void GCGsetPricingObjDualWeight(GCG *gcg, SCIP_Real dualweight)
void GCGsetPricingObjRelaxWeight(GCG *gcg, SCIP_Real *weights, int *weightids, int nweights)
GCG_PRICINGCB * GCGpricerFindPricingcb(GCG *gcg, const char *name)
SCIP_RETCODE GCGpricerIncludePricingcb(GCG *gcg, const char *name, const char *desc, int priority, GCG_DECL_PRICINGCBFREE((*pricingcbfree)), GCG_DECL_PRICINGCBINIT((*pricingcbinit)), GCG_DECL_PRICINGCBEXIT((*pricingcbexit)), GCG_DECL_PRICINGCBINITSOL((*pricingcbinitsol)), GCG_DECL_PRICINGCBEXITSOL((*pricingcbexitsol)), GCG_DECL_PRICINGCBPREPRICING((*pricingcbprepricing)), GCG_DECL_PRICINGCBPOSTPRICING((*pricingcbpostpricing)), GCG_PRICINGCBDATA *pricingcbdata)
GCG_EXPORT SCIP_CONS ** GCGgetMasterConss(GCG *gcg)
Definition relax_gcg.c:4228
GCG_EXPORT int GCGgetNMasterConss(GCG *gcg)
Definition relax_gcg.c:4211
SCIP * GCGgetDwMasterprob(GCG *gcg)
Definition gcg.cpp:123
SCIP * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
GCG_EXPORT int GCGgetNPricingprobs(GCG *gcg)
Definition relax_gcg.c:4113
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
const char * SCIPgetProbName(SCIP *scip)
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
consType GCGconsGetType(SCIP *scip, SCIP_CONS *cons)
Definition scip_misc.c:52
SCIP_RETCODE GCGconsGetVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars)
Definition scip_misc.c:487
int GCGconsGetNVars(SCIP *scip, SCIP_CONS *cons)
Definition scip_misc.c:433
#define SCIPdebugMsg
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
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 SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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 SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
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 SCIPgetIntParam(SCIP *scip, const char *name, int *value)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value)
void GCGpricingcbSetExclusive(GCG_PRICINGCB *pricingcb, SCIP_Bool exclusive)
Definition pricingcb.c:581
void GCGpricingcbSetEnabled(GCG_PRICINGCB *pricingcb, SCIP_Bool enabled)
Definition pricingcb.c:570
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeur(SCIP *scip, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEURCOPY((*heurcopy)), SCIP_DECL_HEURFREE((*heurfree)), SCIP_DECL_HEURINIT((*heurinit)), SCIP_DECL_HEUREXIT((*heurexit)), SCIP_DECL_HEURINITSOL((*heurinitsol)), SCIP_DECL_HEUREXITSOL((*heurexitsol)), SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
int SCIPheurGetMaxdepth(SCIP_HEUR *heur)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocClearBufferArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
SCIP_PRICER * SCIPfindPricer(SCIP *scip, const char *name)
int SCIPpricerGetNCalls(SCIP_PRICER *pricer)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
int SCIPgetNSols(SCIP *scip)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPpresolve(SCIP *scip)
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_Real SCIPgetGap(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetDepth(SCIP *scip)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
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,...)
SCIPfreeMemory(GCGgetOrigprob(gcg), &divingdata)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
#define HEUR_FREQOFS
#define HEUR_DESC
#define HEUR_DISPCHAR
#define HEUR_MAXDEPTH
#define HEUR_PRIORITY
#define HEUR_NAME
SCIP * origprob
#define HEUR_FREQ
#define DEFAULT_NODESQUOT
#define DEFAULT_NODESOFS
#define DEFAULT_COPYCUTS
#define DEFAULT_MAXNODES
#define HEUR_TIMING
#define DEFAULT_MINNODES
#define DEFAULT_MINIMPROVE
#define DEFAULT_USELPROWS
#define HEUR_USESSUBSCIP
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
SCIP_HASHMAP * varmapfw
* result
SCIP_VAR ** vars
int j
SCIP_Bool success
SCIP_Real solval
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
int i
static SCIP_HEURDATA * heurdata
int nvars
SCIPfreeBufferArray(scip, &cycles)
#define DEFAULT_MINFIXINGRATE
SCIP_SOL * sol
SCIP_Longint nnodes
SCIP_VAR ** mastervars
int nmastervars
enum SCIP_HeurConsType SCIP_HEURCONSTYPE
#define PREVLPOBJSIZE
static SCIP_RETCODE destroyAndRepairSolution(GCG *gcg, SCIP_HEURDATA *heurdata, SCIP_SOL *partialsol, int npricingprobs, SCIP_Bool *terminate)
#define PRICINGCB_DESC
static SCIP_RETCODE adjustDynamicPenalties(GCG *gcg, SCIP_HEURDATA *heurdata)
static SCIP_RETCODE setupRepairProblem(SCIP *scip, SCIP *repairprob, SCIP_VAR **repairprobvars, SCIP_SOL *sol, SCIP_Bool uselprows, SCIP_Bool rinsfixing)
#define DEFAULT_DUALWEIGHT
static SCIP_RETCODE createStartSolution(GCG *gcg, SCIP_SOL *startsol, SCIP_Bool *success)
SCIP_RETCODE SCIPincludeHeurIPcolgen(GCG *gcg)
static SCIP_RETCODE computeDynamicPenalties(GCG *gcg, SCIP_SOL *sol, SCIP_Real initdynamicpen, SCIP_Real **penalties, int **penaltiesids, IPC_PENALTYTYPE **penaltytypes, int *npenalties, int *penaltiessize, SCIP_Bool repairsol)
#define PRICINGCB_NAME
static SCIP_RETCODE solveRepairProblem(GCG *gcg, SCIP *repairprob, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_VAR **repairprobvars, SCIP_Longint nnodes, SCIP_RESULT *result)
#define DEFAULT_LPLIMFAC
#define DEFAULT_MININITIALGAP
#define DEFAULT_BIGM
#define DEFAULT_SOLVEAUXPROB
#define DEFAULT_INITDYNAMICPEN
#define DEFAULT_CALLSPERNODE
#define heurCopyIPcolgen
static SCIP_RETCODE performWeightedPricing(GCG *gcg, SCIP_HEURDATA *heurdata, int nblocks)
static SCIP_RETCODE executeHeuristic(GCG *gcg, SCIP_HEURDATA *heurdata, SCIP_Bool *execute)
static SCIP_HEURCONSTYPE getConstraintType(SCIP *scip, SCIP_CONS *cons)
#define DEFAULT_WAITNEWSOL
static SCIP_RETCODE createPartialSolution(SCIP *scip, SCIP_SOL *partialsol, SCIP_RANDNUMGEN *randnumgen, SCIP_Real minfixingrate, int nblocks, int *nfixedvars, SCIP_Bool *success)
#define heurExitsolIPcolgen
#define DEFAULT_ARRAYSIZE
#define DEFAULT_NOIMPROVEITER
#define heurInitsolIPcolgen
static SCIP_RETCODE addPenalty(SCIP *scip, SCIP_Real addpenalty, int addpenaltyid, IPC_PENALTYTYPE addpenaltytype, SCIP_Real **penalties, int **penaltiesids, IPC_PENALTYTYPE **penaltytypes, int *npenalties, int *penaltiessize)
#define PRICINGCB_PRIORITY
static SCIP_RETCODE createRepairProblem(SCIP *scip, SCIP **repairprob, SCIP_HEURDATA *heurdata, SCIP_VAR **repairprobvars)
SCIP_HeurConsType
@ CONSTYPE_NCONSTYPES
@ CONSTYPE_SETPART
@ CONSTYPE_INVALID
@ CONSTYPE_SETPACK
@ CONSTYPE_SETCOVER
#define DEFAULT_RINSFIXING
#define DEFAULT_MAXITER
LNS heuristic that generates columns that are more likely to be in integer feasible solutions.
enum IPC_PenaltyType IPC_PENALTYTYPE
@ PENALTYTYPE_SETCOVER
@ PENALTYTYPE_BIGM
@ PENALTYTYPE_SETPACK
SCIP_Bool lperror
int maxdepth
SCIP_Bool cutoff
SCIP_Bool lpsolved
#define NULL
GCG variable pricer.
#define SCIPerrorMessage
#define SCIPdebug(x)
SCIP_RETCODE GCGrelaxStartProbing(GCG *gcg, SCIP_HEUR *probingheur)
Definition relax_gcg.c:4390
SCIP_RETCODE GCGrelaxPerformProbingWithPricing(GCG *gcg, int maxpricerounds, SCIP_Longint *nlpiterations, int *npricerounds, SCIP_Real *lpobjvalue, SCIP_Bool *lpsolved, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition relax_gcg.c:4775
SCIP_RETCODE GCGrelaxEndProbing(GCG *gcg)
Definition relax_gcg.c:4794
various SCIP helper methods
consType
Definition scip_misc.h:49
@ setcovering
Definition scip_misc.h:50
@ linear
Definition scip_misc.h:50
@ setpartitioning
Definition scip_misc.h:50
@ setpacking
Definition scip_misc.h:50
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_Bool rinsfixing
SCIP_SOL * partialsol
SCIP_Bool waitnewsol
SCIP_Longint nodesofs
SCIP_SOL * lastsol
SCIP_Real nodelimit
SCIP_Bool firstexec
SCIP_Real nodesquot
SCIP_Longint prevpricingiter
SCIP_Real lplimfac
SCIP_Bool solveauxproblem
SCIP_Real firstcallgap
SCIP_Bool inheur
SCIP_Real * prevlpobjs
SCIP_NODE * prevnode
SCIP_Bool abort
SCIP_Real dualweight
SCIP_RANDNUMGEN * randnumgen
IPC_PENALTYTYPE * penaltytypes
SCIP_Real firstcallabsgap
SCIP_Longint nwaitnodes
SCIP_Real minimprove
SCIP_Real initdynamicpen
SCIP_Bool uselprows
SCIP_Bool copycuts
SCIP_SOL * bestsol
SCIP_Real minfixingrate
SCIP_Longint prevnnodes
SCIP_Longint usednodes
SCIP_Real mininitialgap
SCIP_Longint maxnodes
SCIP_Longint minnodes
SCIP_Real * penalties
struct SCIP_Cons SCIP_CONS
struct SCIP_Eventhdlr SCIP_EVENTHDLR
struct SCIP_EventData SCIP_EVENTDATA
#define SCIP_EVENTTYPE_LPSOLVED
struct Gcg GCG
Definition type_gcg.h:44
struct SCIP_HeurData SCIP_HEURDATA
struct SCIP_Heur SCIP_HEUR
struct SCIP_Row SCIP_ROW
struct SCIP_Col SCIP_COL
SCIP_VERBLEVEL_NONE
SCIP_VERBLEVEL_FULL
struct SCIP_HashMap SCIP_HASHMAP
struct SCIP_RandNumGen SCIP_RANDNUMGEN
SCIP_PARAMSETTING_OFF
SCIP_PARAMSETTING_FAST
@ GCG_PRICETYPE_REDCOST
#define GCG_DECL_PRICINGCBPREPRICING(x)
#define GCG_DECL_PRICINGCBPOSTPRICING(x)
SCIP_DIDNOTRUN
SCIP_DELAYED
SCIP_DIDNOTFIND
SCIP_FOUNDSOL
SCIP_SUCCESS
enum SCIP_Result SCIP_RESULT
SCIP_PLUGINNOTFOUND
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct SCIP_Sol SCIP_SOL
struct SCIP_Node SCIP_NODE
struct SCIP_Var SCIP_VAR