GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
heur_gcgrens.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_gcgrens.c
30 * @brief LNS heuristic that finds the optimal rounding to a given point
31 * @author Timo Berthold
32 * @author Christian Puchert
33 */
34
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
36
37#include <assert.h>
38#include <string.h>
39#include <stdio.h>
40
41#include "gcg/heur_gcgrens.h"
42#include "gcg/gcg.h"
43
44#include "scip/scipdefplugins.h"
45#include "scip/cons_linear.h"
46
47/* default values for standard parameters that every primal heuristic has in SCIP */
48#define HEUR_NAME "gcgrens"
49#define HEUR_DESC "LNS exploring fractional neighborhood of relaxation's optimum"
50#define HEUR_DISPCHAR 'E'
51#define HEUR_PRIORITY -1100000
52#define HEUR_FREQ 0
53#define HEUR_FREQOFS 0
54#define HEUR_MAXDEPTH -1
55#define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE
56#define HEUR_USESSUBSCIP TRUE /**< does the heuristic use a secondary SCIP instance? */
57
58/* default values for RENS-specific plugins */
59#define DEFAULT_BINARYBOUNDS TRUE /**< should general integers get binary bounds [floor(.),ceil(.)] ? */
60#define DEFAULT_MAXNODES 5000LL /**< maximum number of nodes to regard in the subproblem */
61#define DEFAULT_MINFIXINGRATE 0.5 /**< minimum percentage of integer variables that have to be fixed */
62#define DEFAULT_MINIMPROVE 0.01 /**< factor by which RENS should at least improve the incumbent */
63#define DEFAULT_MINNODES 500LL /**< minimum number of nodes to regard in the subproblem */
64#define DEFAULT_NODESOFS 500LL /**< number of nodes added to the contingent of the total nodes */
65#define DEFAULT_NODESQUOT 0.1 /**< subproblem nodes in relation to nodes of the original problem */
66#define DEFAULT_USELPROWS FALSE /**< should subproblem be created out of the rows in the LP rows,
67 * otherwise, the copy constructors of the constraints handlers are used */
68#define DEFAULT_COPYCUTS TRUE /**< if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
69 * of the original scip be copied to constraints of the subscip
70 */
71#define DEFAULT_ADDALLSOLS FALSE /* should all subproblem solutions be added to the original SCIP? */
72
73
74/*
75 * Data structures
76 */
77
78/** primal heuristic data */
79struct SCIP_HeurData
80{
81 GCG* gcg; /**< GCG data structure */
82 SCIP_Longint maxnodes; /**< maximum number of nodes to regard in the subproblem */
83 SCIP_Longint minnodes; /**< minimum number of nodes to regard in the subproblem */
84 SCIP_Longint nodesofs; /**< number of nodes added to the contingent of the total nodes */
85 SCIP_Longint usednodes; /**< nodes already used by RENS in earlier calls */
86 SCIP_Real minfixingrate; /**< minimum percentage of integer variables that have to be fixed */
87 SCIP_Real minimprove; /**< factor by which RENS should at least improve the incumbent */
88 SCIP_Real nodesquot; /**< subproblem nodes in relation to nodes of the original problem */
89 SCIP_Bool binarybounds; /**< should general integers get binary bounds [floor(.),ceil(.)] ? */
90 SCIP_Bool uselprows; /**< should subproblem be created out of the rows in the LP rows? */
91 SCIP_Bool copycuts; /**< if uselprows == FALSE, should all active cuts from cutpool be copied
92 * to constraints in subproblem?
93 */
94 SCIP_Bool addallsols; /**< should all subproblem solutions be added to the original SCIP? */
95
96#ifdef SCIP_STATISTIC
97 SCIP_Longint nfixfails; /**< number of abortions due to a bad fixing rate */
98 SCIP_Real avgfixrate; /**< average rate of variables that are fixed */
99 SCIP_Real avgzerorate; /**< average rate of fixed variables that are zero */
100 SCIP_Longint totalsols; /**< total number of subSCIP solutions (including those which have not
101 * been added)
102 */
103 SCIP_Real subsciptime; /**< total subSCIP solving time in seconds */
104 SCIP_Real bestprimalbd; /**< objective value of best solution found by this heuristic */
105#endif
106};
107
108
109/*
110 * Local methods
111 */
112
113/** creates a subproblem by fixing a number of variables */
114static
116 SCIP* scip, /**< original SCIP data structure */
117 SCIP* subscip, /**< SCIP data structure for the subproblem */
118 SCIP_VAR** subvars, /**< the variables of the subproblem */
119 SCIP_Real minfixingrate, /**< percentage of integer variables that have to be fixed */
120 SCIP_Bool binarybounds, /**< should general integers get binary bounds [floor(.),ceil(.)] ? */
121 SCIP_Bool uselprows, /**< should subproblem be created out of the rows in the LP rows? */
122 SCIP_Real* intfixingrate, /**< percentage of integers that get actually fixed */
123 SCIP_Real* zerofixingrate, /**< percentage of variables fixed to zero */
124 SCIP_Bool* success /**< pointer to store whether the problem was created successfully */
125 )
126{
127 SCIP_VAR** vars; /* original SCIP variables */
128
129 int nbinvars;
130 int nintvars;
131 int i;
132
133 int fixingcounter;
134 int zerocounter;
135
136 assert(scip != NULL);
137 assert(subscip != NULL);
138 assert(subvars != NULL);
139
140 assert(0.0 <= minfixingrate && minfixingrate <= 1.0);
141
142 /* get required variable data */
144
145 fixingcounter = 0;
146 zerocounter = 0;
147
148 /* change bounds of variables of the subproblem */
149 for( i = 0; i < nbinvars + nintvars; i++ )
150 {
151 SCIP_Real lpsolval;
152 SCIP_Real lb;
153 SCIP_Real ub;
154
155 /* get the current LP solution for each variable */
156 lpsolval = SCIPgetRelaxSolVal(scip, vars[i]);
157
158 if( SCIPisFeasIntegral(scip, lpsolval) )
159 {
160 /* fix variables to current LP solution if it is integral,
161 * use exact integral value, if the variable is only integral within numerical tolerances
162 */
163 lb = SCIPfloor(scip, lpsolval+0.5);
164 ub = lb;
165 fixingcounter++;
166 if( SCIPisZero(scip, lb) )
167 zerocounter++;
168 }
169 else if( binarybounds )
170 {
171 /* if the sub problem should be a binary problem, change the bounds to nearest integers */
172 lb = SCIPfeasFloor(scip,lpsolval);
173 ub = SCIPfeasCeil(scip,lpsolval);
174 }
175 else
176 {
177 /* otherwise just copy bounds */
180 }
181
182 /* perform the bound change */
183 SCIP_CALL( SCIPchgVarLbGlobal(subscip, subvars[i], lb) );
184 SCIP_CALL( SCIPchgVarUbGlobal(subscip, subvars[i], ub) );
185 }
186
187 /* abort, if all integer variables were fixed (which should not happen for MIP) */
188 if( fixingcounter == nbinvars + nintvars )
189 {
190 *intfixingrate = 1.0;
191 *zerofixingrate = 1.0;
192 *success = FALSE;
193 return SCIP_OKAY;
194 }
195 else
196 {
197 *intfixingrate = fixingcounter / (SCIP_Real)(MAX(nbinvars + nintvars, 1));
198 *zerofixingrate = (SCIP_Real)zerocounter / MAX((SCIP_Real)fixingcounter, 1.0);
199 }
200
201 /* abort, if the amount of fixed variables is insufficient */
202 if( *intfixingrate < minfixingrate )
203 {
204 *success = FALSE;
205 SCIPstatisticPrintf("gcgrens statistic: fixed only %5.2f ( %5.2f zero) integer variables --> abort \n", *intfixingrate, *zerofixingrate);
206 return SCIP_OKAY;
207 }
208
209 if( uselprows )
210 {
211 SCIP_ROW** rows; /* original scip rows */
212 int nrows;
213
214 /* get the rows and their number */
215 SCIP_CALL( SCIPgetLPRowsData(scip, &rows, &nrows) );
216
217 /* copy all rows to linear constraints */
218 for( i = 0; i < nrows; i++ )
219 {
220 SCIP_CONS* cons;
221 SCIP_VAR** consvars;
222 SCIP_COL** cols;
223 SCIP_Real constant;
224 SCIP_Real lhs;
225 SCIP_Real rhs;
226 SCIP_Real* vals;
227 int nnonz;
228 int j;
229
230 /* ignore rows that are only locally valid */
231 if( SCIProwIsLocal(rows[i]) )
232 continue;
233
234 /* get the row's data */
235 constant = SCIProwGetConstant(rows[i]);
236 lhs = SCIProwGetLhs(rows[i]) - constant;
237 rhs = SCIProwGetRhs(rows[i]) - constant;
238 vals = SCIProwGetVals(rows[i]);
239 nnonz = SCIProwGetNNonz(rows[i]);
240 cols = SCIProwGetCols(rows[i]);
241
242 assert(lhs <= rhs);
243
244 /* allocate memory array to be filled with the corresponding subproblem variables */
245 SCIP_CALL( SCIPallocBufferArray(subscip, &consvars, nnonz) );
246 for( j = 0; j < nnonz; j++ )
247 consvars[j] = subvars[SCIPvarGetProbindex(SCIPcolGetVar(cols[j]))];
248
249 /* create a new linear constraint and add it to the subproblem */
250 SCIP_CALL( SCIPcreateConsLinear(subscip, &cons, SCIProwGetName(rows[i]), nnonz, consvars, vals, lhs, rhs,
252 SCIP_CALL( SCIPaddCons(subscip, cons) );
253 SCIP_CALL( SCIPreleaseCons(subscip, &cons) );
254
255 /* free temporary memory */
256 SCIPfreeBufferArray(subscip, &consvars);
257 }
258 }
259
260 *success = TRUE;
261 return SCIP_OKAY;
262}
263
264
265/** creates a new solution for the original problem by copying the solution of the subproblem */
266static
268 SCIP* scip, /**< original SCIP data structure */
269 SCIP* subscip, /**< SCIP structure of the subproblem */
270 SCIP_VAR** subvars, /**< the variables of the subproblem */
271 SCIP_HEUR* heur, /**< RENS heuristic structure */
272 SCIP_SOL* subsol, /**< solution of the subproblem */
273 SCIP_Bool* success /**< used to store whether new solution was found or not */
274 )
275{
276#ifdef SCIP_STATISTIC
278#endif
279 SCIP_VAR** vars; /* the original problem's variables */
280 int nvars; /* the original problem's number of variables */
281 SCIP_Real* subsolvals; /* solution values of the subproblem */
282 SCIP_SOL* newsol; /* solution to be created for the original problem */
283
284 assert(scip != NULL);
285 assert(subscip != NULL);
286 assert(subvars != NULL);
287 assert(subsol != NULL);
288
289#ifdef SCIP_STATISTIC
290 /* get heuristic data */
292 assert( heurdata != NULL );
293#endif
294
295 /* get variables' data */
297
298 /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
299 * since constraint copying may have required the copy of variables that are fixed in the main SCIP
300 */
301 assert(nvars <= SCIPgetNOrigVars(subscip));
302
303 SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
304
305 /* copy the solution */
306 SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
307
308 /* create new solution for the original problem */
309 SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
310 SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
311
312 /* try to add new solution to scip */
313#ifdef SCIP_STATISTIC
314 if( !*success || heurdata->addallsols )
315#endif
317
318#ifdef SCIP_STATISTIC
319 if( SCIPgetSolTransObj(scip, newsol) < heurdata->bestprimalbd )
320 heurdata->bestprimalbd = SCIPgetSolTransObj(scip, newsol);
321
322 SCIPstatisticPrintf("gcgrens statistic: Solution %13.6e found at node %"SCIP_LONGINT_FORMAT"\n",
323 SCIPgetSolTransObj(scip, newsol), SCIPsolGetNodenum(subsol));
324#endif
325
326 SCIP_CALL( SCIPfreeSol(scip, &newsol) );
327
328 SCIPfreeBufferArray(scip, &subsolvals);
329
330 return SCIP_OKAY;
331}
332
333/** main procedure of the GCG RENS heuristic, creates and solves a sub-SCIP */
334static
336 SCIP* scip, /**< original SCIP data structure */
337 SCIP_HEUR* heur, /**< heuristic data structure */
338 SCIP_RESULT* result, /**< result data structure */
339 SCIP_Real minfixingrate, /**< minimum percentage of integer variables that have to be fixed */
340 SCIP_Real minimprove, /**< factor by which RENS should at least improve the incumbent */
341 SCIP_Longint maxnodes, /**< maximum number of nodes for the subproblem */
342 SCIP_Longint nstallnodes, /**< number of stalling nodes for the subproblem */
343 SCIP_Bool binarybounds, /**< should general integers get binary bounds [floor(.),ceil(.)]? */
344 SCIP_Bool uselprows /**< should subproblem be created out of the rows in the LP rows? */
345 )
346{
347 SCIP* subscip; /* the subproblem created by RENS */
348 SCIP_HASHMAP* varmapfw; /* mapping of SCIP variables to sub-SCIP variables */
349 SCIP_VAR** vars; /* original problem's variables */
350 SCIP_VAR** subvars; /* subproblem's variables */
351 SCIP_HEURDATA* heurdata; /* heuristic's private data structure */
352
353 SCIP_Real timelimit; /* time limit for RENS subproblem */
354 SCIP_Real memorylimit; /* memory limit for RENS subproblem */
355 SCIP_Real allfixingrate; /* percentage of all variables fixed */
356 SCIP_Real intfixingrate; /* percentage of integer variables fixed */
357 SCIP_Real zerofixingrate; /* percentage of variables fixed to zero */
358
359 int nvars; /* number of original problem's variables */
360 int i;
361
364
365 assert(scip != NULL);
366 assert(heur != NULL);
367 assert(result != NULL);
368
369 assert(maxnodes >= 0);
370 assert(nstallnodes >= 0);
371
372 assert(0.0 <= minfixingrate && minfixingrate <= 1.0);
373 assert(0.0 <= minimprove && minimprove <= 1.0);
374
375 /* get heuristic data */
377 assert(heurdata != NULL);
378
379 /* check whether there is enough time and memory left */
380 timelimit = 0.0;
381 memorylimit = 0.0;
382 SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
383 if( !SCIPisInfinity(scip, timelimit) )
384 timelimit -= SCIPgetSolvingTime(scip);
385 SCIP_CALL( SCIPgetRealParam(scip, "limits/memory", &memorylimit) );
386
387 /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
388 if( !SCIPisInfinity(scip, memorylimit) )
389 {
390 memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
391 memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
392 }
393
394 /* abort if no time is left or not enough memory to create a copy of SCIP, including external memory usage */
395 if( timelimit <= 0.0 || memorylimit <= 2.0*SCIPgetMemExternEstim(scip)/1048576.0 )
396 return SCIP_OKAY;
397
399
400 /* get variable data */
402
403 /* initialize the subproblem */
404 SCIP_CALL( SCIPcreate(&subscip) );
405
406 /* create the variable mapping hash map */
409
410 /* different methods to create sub-problem: either copy LP relaxation or the CIP with all constraints */
411 if( uselprows )
412 {
413 char probname[SCIP_MAXSTRLEN];
414
415 /* copy all plugins */
417
418 /* get name of the original problem and add the string "_gcgrenssub" */
419 (void) SCIPsnprintf(probname, SCIP_MAXSTRLEN, "%s_gcgrenssub", SCIPgetProbName(scip));
420
421 /* create the subproblem */
422 SCIP_CALL( SCIPcreateProb(subscip, probname, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
423
424 /* copy all variables */
425 SCIP_CALL( SCIPcopyVars(scip, subscip, varmapfw, NULL, NULL, NULL, 0, TRUE) );
426 }
427 else
428 {
429 SCIP_Bool valid;
430
431 valid = FALSE;
432
433 /* copy complete SCIP instance */
434 SCIP_CALL( SCIPcopy(scip, subscip, varmapfw, NULL, "gcgrens", TRUE, FALSE, FALSE, TRUE, &valid) ); /** @todo check for thread safeness */
435
436 if( heurdata->copycuts )
437 {
438 /* copies all active cuts from cutpool of sourcescip to linear constraints in targetscip */
440 }
441
442 SCIPdebugMessage("Copying the SCIP instance was %s complete.\n", valid ? "" : "not ");
443 }
444
445 for( i = 0; i < nvars; i++ )
446 subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
447
448 /* free hash map */
450
451 SCIPstatisticPrintf("gcgrens statistic: called at node %"SCIP_LONGINT_FORMAT"\n", SCIPgetNNodes(scip));
452
453 /* create a new problem, which fixes variables with same value in bestsol and LP relaxation */
454 SCIP_CALL( createSubproblem(scip, subscip, subvars, minfixingrate, binarybounds, uselprows, &intfixingrate, &zerofixingrate, &success) );
455 SCIPdebugMessage("RENS subproblem: %d vars, %d cons, success=%u\n", SCIPgetNVars(subscip), SCIPgetNConss(subscip), success);
456
457 /* do not abort subproblem on CTRL-C */
458 SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
459
460 /* disable output to console */
461 SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
462
463 /* set limits for the subproblem */
464 SCIP_CALL( SCIPsetLongintParam(subscip, "limits/stallnodes", nstallnodes) );
465 SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", maxnodes) );
466 SCIP_CALL( SCIPsetRealParam(subscip, "limits/time", timelimit) );
467 SCIP_CALL( SCIPsetRealParam(subscip, "limits/memory", memorylimit) );
468
469 /* forbid recursive call of heuristics and separators solving sub-SCIPs */
470 SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
471
472 /* disable cutting plane separation */
474
475 /* disable expensive presolving */
477
478 /* use best estimate node selection */
479 if( SCIPfindNodesel(subscip, "estimate") != NULL && !SCIPisParamFixed(subscip, "nodeselection/estimate/stdpriority") )
480 {
481 SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/estimate/stdpriority", INT_MAX/4) );
482 }
483
484 /* use inference branching */
485 if( SCIPfindBranchrule(subscip, "inference") != NULL && !SCIPisParamFixed(subscip, "branching/inference/priority") )
486 {
487 SCIP_CALL( SCIPsetIntParam(subscip, "branching/inference/priority", INT_MAX/4) );
488 }
489
490 /* disable conflict analysis */
491 if( !SCIPisParamFixed(subscip, "conflict/enable") )
492 {
493 SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/enable", FALSE) );
494 }
495
496#ifdef SCIP_DEBUG
497 /* for debugging RENS, enable MIP output */
498 SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 5) );
499 SCIP_CALL( SCIPsetIntParam(subscip, "display/freq", 100000000) );
500#endif
501
502#ifdef SCIP_STATISTIC
503 heurdata->avgfixrate += intfixingrate;
504 heurdata->avgzerorate += zerofixingrate;
505#endif
506
507 /* if the subproblem could not be created, free memory and return */
508 if( !success )
509 {
511 SCIPfreeBufferArray(scip, &subvars);
512 SCIP_CALL( SCIPfree(&subscip) );
513#ifdef SCIP_STATISTIC
514 ++heurdata->nfixfails;
515#endif
516 return SCIP_OKAY;
517 }
518
519 /* if there is already a solution, add an objective cutoff */
520 if( SCIPgetNSols(scip) > 0 )
521 {
522 SCIP_Real cutoff; /* objective cutoff for the subproblem */
523 SCIP_Real upperbound;
525
526 upperbound = SCIPgetUpperbound(scip) - SCIPsumepsilon(scip);
527
529 {
530 cutoff = (1-minimprove)*SCIPgetUpperbound(scip) + minimprove*SCIPgetLowerbound(scip);
531 }
532 else
533 {
534 if( SCIPgetUpperbound ( scip ) >= 0 )
535 cutoff = ( 1 - minimprove ) * SCIPgetUpperbound ( scip );
536 else
537 cutoff = ( 1 + minimprove ) * SCIPgetUpperbound ( scip );
538 }
539 cutoff = MIN(upperbound, cutoff);
540 SCIP_CALL( SCIPsetObjlimit(subscip, cutoff) );
541 }
542 /* presolve the subproblem */
543 retcode = SCIPpresolve(subscip);
544
545 /* errors in solving the subproblem should not kill the overall solving process;
546 * hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
547 */
548 if( retcode != SCIP_OKAY )
549 {
550#ifndef NDEBUG
552#endif
553 SCIPwarningMessage(scip, "Error while presolving subproblem in GCG RENS heuristic; sub-SCIP terminated with code <%d>\n",retcode);
554
555 /* free */
556 SCIPfreeBufferArray(scip, &subvars);
557 SCIP_CALL( SCIPfree(&subscip) );
558 return SCIP_OKAY;
559 }
560
561 SCIPdebugMessage("GCG RENS presolved subproblem: %d vars, %d cons, success=%u\n", SCIPgetNVars(subscip), SCIPgetNConss(subscip), success);
562
563 allfixingrate = (SCIPgetNOrigVars(subscip) - SCIPgetNVars(subscip)) / (SCIP_Real)SCIPgetNOrigVars(subscip);
564
565 /* additional variables added in presolving may lead to the subSCIP having more variables than the original */
566 allfixingrate = MAX(allfixingrate, 0.0);
567
568 /* after presolving, we should have at least reached a certain fixing rate over ALL variables (including continuous)
569 * to ensure that not only the MIP but also the LP relaxation is easy enough
570 */
571 if( allfixingrate >= minfixingrate / 2.0 )
572 {
573 SCIP_SOL** subsols;
574 int nsubsols;
575
576 /* solve the subproblem */
577 SCIPdebugMessage("solving subproblem: nstallnodes=%"SCIP_LONGINT_FORMAT", maxnodes=%"SCIP_LONGINT_FORMAT"\n", nstallnodes, maxnodes);
578 retcode = SCIPsolve(subscip);
579
580 /* errors in solving the subproblem should not kill the overall solving process;
581 * hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
582 */
583 if( retcode != SCIP_OKAY )
584 {
585#ifndef NDEBUG
587#endif
588 SCIPwarningMessage(scip, "Error while solving subproblem in GCG RENS heuristic; sub-SCIP terminated with code <%d>\n",retcode);
589 }
590
591#ifdef SCIP_STATISTIC
592 heurdata->usednodes += SCIPgetNNodes(subscip);
593 heurdata->subsciptime += SCIPgetTotalTime(subscip);
594#endif
595
596 /* check, whether a solution was found;
597 * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
598 */
599 nsubsols = SCIPgetNSols(subscip);
600 subsols = SCIPgetSols(subscip);
601 success = FALSE;
602#ifdef SCIP_STATISTIC
603 heurdata->totalsols += nsubsols;
604 for( i = 0; i < nsubsols; ++i )
605#else
606 for( i = 0; i < nsubsols && (!success || heurdata->addallsols); ++i )
607#endif
608 {
609 SCIP_CALL( createNewSol(scip, subscip, subvars, heur, subsols[i], &success) );
610 if( success )
612 }
613
614 SCIPstatisticPrintf("gcgrens statistic: fixed %6.3f integer variables ( %6.3f zero), %6.3f all variables, needed %6.1f sec (SCIP time: %6.1f sec), %"SCIP_LONGINT_FORMAT" nodes, found %d solutions, solution %10.4f found at node %"SCIP_LONGINT_FORMAT"\n",
615 intfixingrate, zerofixingrate, allfixingrate, SCIPgetSolvingTime(subscip), SCIPgetSolvingTime(scip), SCIPgetNNodes(subscip), nsubsols,
616 success ? SCIPgetPrimalbound(scip) : SCIPinfinity(scip), nsubsols > 0 ? SCIPsolGetNodenum(SCIPgetBestSol(subscip)) : -1 );
617 }
618 else
619 {
620 SCIPstatisticPrintf("gcgrens statistic: fixed only %6.3f integer variables ( %6.3f zero), %6.3f all variables --> abort \n", intfixingrate, zerofixingrate, allfixingrate);
621 }
622
623 /* free subproblem */
624 SCIPfreeBufferArray(scip, &subvars);
625 SCIP_CALL( SCIPfree(&subscip) );
626
627 return SCIP_OKAY;
628}
629
630/*
631 * Callback methods of primal heuristic
632 */
633
634/** destructor of primal heuristic to free user data (called when SCIP is exiting) */
635static
636SCIP_DECL_HEURFREE(heurFreeGcgrens)
637{ /*lint --e{715}*/
639
640 assert( heur != NULL );
641 assert( scip != NULL );
642
643 /* get heuristic data */
645 assert( heurdata != NULL );
646
647 /* free heuristic data */
649 SCIPheurSetData(heur, NULL);
650
651 return SCIP_OKAY;
652}
653
654
655/** initialization method of primal heuristic (called after problem was transformed) */
656static
657SCIP_DECL_HEURINIT(heurInitGcgrens)
658{ /*lint --e{715}*/
660
661 assert( heur != NULL );
662 assert( scip != NULL );
663
664 /* get heuristic data */
666 assert( heurdata != NULL );
667
668 /* initialize data */
669 heurdata->usednodes = 0;
670
671 return SCIP_OKAY;
672}
673
674#ifdef SCIP_STATISTIC
675/** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
676static
677SCIP_DECL_HEURINITSOL(heurInitsolGcgrens)
678{ /*lint --e{715}*/
680
681 assert(heur != NULL);
682 assert(scip != NULL);
683
684 /* get heuristic data */
686 assert(heurdata != NULL);
687
688 /* initialize statistical data */
689 heurdata->avgfixrate = 0.0;
690 heurdata->avgzerorate = 0.0;
691 heurdata->totalsols = 0;
692 heurdata->subsciptime = 0.0;
693 heurdata->bestprimalbd = SCIPinfinity(scip);
694
695 return SCIP_OKAY;
696}
697
698/** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
699static
700SCIP_DECL_HEUREXITSOL(heurExitsolGcgrens)
701{ /*lint --e{715}*/
704
705 assert(heur != NULL);
706 assert(scip != NULL);
707
708 /* get heuristic data */
710 assert(heurdata != NULL);
711
713 heurdata->avgfixrate /= MAX((SCIP_Real)ncalls, 1.0);
714 heurdata->avgzerorate /= MAX((SCIP_Real)ncalls, 1.0);
715
716 /* print detailed statistics */
717 SCIPstatisticPrintf("LNS Statistics -- %s:\n", SCIPheurGetName(heur));
719 SCIPstatisticPrintf("Failed Fixings : %13"SCIP_LONGINT_FORMAT"\n", heurdata->nfixfails);
721 SCIPstatisticPrintf("Improving Sols : %13"SCIP_LONGINT_FORMAT"\n", SCIPheurGetNBestSolsFound(heur));
722 SCIPstatisticPrintf("Total Sols : %13"SCIP_LONGINT_FORMAT"\n", heurdata->totalsols);
723 SCIPstatisticPrintf("subSCIP time : %13.2f\n", heurdata->subsciptime);
724 SCIPstatisticPrintf("subSCIP nodes : %13"SCIP_LONGINT_FORMAT"\n", heurdata->usednodes);
725 SCIPstatisticPrintf("Avg. fixing rate : %13.2f\n", 100.0 * heurdata->avgfixrate);
726 SCIPstatisticPrintf("Avg. zero rate : %13.2f\n", 100.0 * heurdata->avgzerorate);
727 SCIPstatisticPrintf("Best primal bd. :");
728 if( SCIPisInfinity(scip, heurdata->bestprimalbd) )
729 SCIPstatisticPrintf(" infinity\n");
730 else
731 SCIPstatisticPrintf(" %13.6e\n", heurdata->bestprimalbd);
733
734 return SCIP_OKAY;
735}
736#endif
737
738/** execution method of primal heuristic */
739static
740SCIP_DECL_HEUREXEC(heurExecGcgrens)
741{ /*lint --e{715}*/
742
744 SCIP_HEURDATA* heurdata; /* heuristic's data */
745 SCIP_Longint nstallnodes; /* number of stalling nodes for the subproblem */
746
747 assert( heur != NULL );
748 assert( scip != NULL );
749 assert( result != NULL );
750
751 /* get heuristic data */
753 assert( heurdata != NULL );
754
755 /* get master problem */
758
760
761 /* do not execute the heuristic on invalid relaxation solutions
762 * (which is the case if the node has been cut off)
763 */
765 {
766 SCIPdebugMessage("skipping GCG RENS: invalid relaxation solution\n");
767 return SCIP_OKAY;
768 }
769
770 /* only call heuristic, if an optimal LP solution is at hand */
772 return SCIP_OKAY;
773
775
776 /* only continue with some fractional variables */
778 return SCIP_OKAY;
779
781
782 /* calculate the maximal number of branching nodes until heuristic is aborted */
783 nstallnodes = (SCIP_Longint)(heurdata->nodesquot * SCIPgetNNodes(scip));
784
785 /* reward RENS if it succeeded often */
786 nstallnodes = (SCIP_Longint)(nstallnodes * 3.0 * (SCIPheurGetNBestSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur) + 1.0));
787 nstallnodes -= 100 * SCIPheurGetNCalls(heur); /* count the setup costs for the sub-SCIP as 100 nodes */
788 nstallnodes += heurdata->nodesofs;
789
790 /* determine the node limit for the current process */
791 nstallnodes -= heurdata->usednodes;
792 nstallnodes = MIN(nstallnodes, heurdata->maxnodes);
793
794 /* check whether we have enough nodes left to call subproblem solving */
795 if( nstallnodes < heurdata->minnodes )
796 {
797 SCIPdebugMessage("skipping RENS: nstallnodes=%"SCIP_LONGINT_FORMAT", minnodes=%"SCIP_LONGINT_FORMAT"\n", nstallnodes, heurdata->minnodes);
798 return SCIP_OKAY;
799 }
800
801 if( SCIPisStopped(scip) )
802 return SCIP_OKAY;
803
806
807 return SCIP_OKAY;
808}
809
810
811
812/*
813 * primal heuristic specific interface methods
814 */
815
816/** creates GCG RENS primal heuristic and includes it in SCIP */
818 GCG* gcg /**< GCG data structure */
819 )
820{
822 SCIP_HEUR* heur;
824
825 /* create GCG RENS primal heuristic data */
827 heurdata->gcg = gcg;
828
829 /* include primal heuristic */
832 HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecGcgrens, heurdata) );
833
834 assert(heur != NULL);
835
836 /* set non-NULL pointers to callback methods */
837 SCIP_CALL( SCIPsetHeurFree(origprob, heur, heurFreeGcgrens) );
838 SCIP_CALL( SCIPsetHeurInit(origprob, heur, heurInitGcgrens) );
839#ifdef SCIP_STATISTIC
840 SCIP_CALL( SCIPsetHeurInitsol(origprob, heur, heurInitsolGcgrens) );
841 SCIP_CALL( SCIPsetHeurExitsol(origprob, heur, heurExitsolGcgrens) );
842#endif
843
844 /* add rens primal heuristic parameters */
845
846 SCIP_CALL( SCIPaddRealParam(origprob, "heuristics/"HEUR_NAME"/minfixingrate",
847 "minimum percentage of integer variables that have to be fixable",
849
850 SCIP_CALL( SCIPaddLongintParam(origprob, "heuristics/"HEUR_NAME"/maxnodes",
851 "maximum number of nodes to regard in the subproblem",
853
854 SCIP_CALL( SCIPaddLongintParam(origprob, "heuristics/"HEUR_NAME"/nodesofs",
855 "number of nodes added to the contingent of the total nodes",
857
858 SCIP_CALL( SCIPaddLongintParam(origprob, "heuristics/"HEUR_NAME"/minnodes",
859 "minimum number of nodes required to start the subproblem",
861
862 SCIP_CALL( SCIPaddRealParam(origprob, "heuristics/"HEUR_NAME"/nodesquot",
863 "contingent of sub problem nodes in relation to the number of nodes of the original problem",
865
866 SCIP_CALL( SCIPaddRealParam(origprob, "heuristics/"HEUR_NAME"/minimprove",
867 "factor by which RENS should at least improve the incumbent",
869
870 SCIP_CALL( SCIPaddBoolParam(origprob, "heuristics/"HEUR_NAME"/binarybounds",
871 "should general integers get binary bounds [floor(.),ceil(.)] ?",
873
874 SCIP_CALL( SCIPaddBoolParam(origprob, "heuristics/"HEUR_NAME"/uselprows",
875 "should subproblem be created out of the rows in the LP rows?",
877
878 SCIP_CALL( SCIPaddBoolParam(origprob, "heuristics/"HEUR_NAME"/copycuts",
879 "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
881
882 SCIP_CALL( SCIPaddBoolParam(origprob, "heuristics/"HEUR_NAME"/addallsols",
883 "should all subproblem solutions be added to the original SCIP?",
885
886 return SCIP_OKAY;
887}
SCIP_DECL_HEUREXITSOL(Heur2opt::scip_exitsol)
SCIP_DECL_HEURINIT(Heur2opt::scip_init)
SCIP_DECL_HEURINITSOL(Heur2opt::scip_initsol)
SCIP_DECL_HEURFREE(Heur2opt::scip_free)
SCIP_DECL_HEUREXEC(Heur2opt::scip_exec)
#define SCIP_MAXSTRLEN
#define SCIP_Longint
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define MAX(x, y)
#define SCIP_LONGINT_FORMAT
#define SCIP_LONGINT_MAX
#define TRUE
#define FALSE
GCG interface methods.
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 * GCGgetOrigprob(GCG *gcg)
Definition gcg.cpp:87
SCIP * GCGgetMasterprob(GCG *gcg)
Definition gcg.cpp:99
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STAGE SCIPgetStage(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)
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)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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 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 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 SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
int SCIPgetNExternBranchCands(SCIP *scip)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
const char * SCIPheurGetName(SCIP_HEUR *heur)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
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 SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
int SCIPgetNSols(SCIP *scip)
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 SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPpresolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPgetTotalTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
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
static SCIP_RETCODE createSubproblem(SCIP *scip, SCIP *subscip, SCIP_VAR **vars, SCIP_VAR **subvars, int nbinvars, int nintvars, SCIP_Bool uselprows, int *fixingcounter, int *zerocounter)
#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
SCIP_Longint ncalls
int nbinvars
int j
int nintvars
SCIP_Bool success
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
SCIP_RETCODE retcode
int i
static SCIP_HEURDATA * heurdata
int nvars
SCIPfreeBufferArray(scip, &cycles)
#define DEFAULT_BINARYBOUNDS
#define DEFAULT_ADDALLSOLS
#define DEFAULT_MINFIXINGRATE
static SCIP_RETCODE applyGcgrens(SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_Real minfixingrate, SCIP_Real minimprove, SCIP_Longint maxnodes, SCIP_Longint nstallnodes, SCIP_Bool binarybounds, SCIP_Bool uselprows)
SCIP_RETCODE GCGincludeHeurGcgrens(GCG *gcg)
LNS heuristic that finds the optimal rounding to a given point.
SCIP_Bool cutoff
#define NULL
#define SCIPstatisticPrintf
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_Longint nodesofs
SCIP_Bool addallsols
SCIP_Real nodesquot
SCIP_Real minimprove
SCIP_Bool uselprows
SCIP_Bool copycuts
SCIP_Real minfixingrate
SCIP_Longint usednodes
SCIP_Longint maxnodes
SCIP_Longint minnodes
SCIP_Bool binarybounds
struct SCIP_Cons SCIP_CONS
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_LPSOLSTAT_OPTIMAL
struct SCIP_HashMap SCIP_HASHMAP
SCIP_PARAMSETTING_OFF
SCIP_PARAMSETTING_FAST
SCIP_DIDNOTRUN
SCIP_DELAYED
SCIP_DIDNOTFIND
SCIP_FOUNDSOL
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
SCIP_STAGE_SOLVING
struct SCIP_Sol SCIP_SOL
struct SCIP_Var SCIP_VAR