Scippy

SCIP

Solving Constraint Integer Programs

heur_randrounding.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2017 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file heur_randrounding.c
17  * @brief randomized LP rounding heuristic which also generates conflicts via an auxiliary probing tree
18  * @author Gregor Hendel
19  *
20  * Randomized LP rounding uses a random variable from a uniform distribution
21  * over [0,1] to determine whether the fractional LP value x should be rounded
22  * up with probability x - floor(x) or down with probability ceil(x) - x.
23  *
24  * This implementation uses domain propagation techniques to tighten the variable domains after every
25  * rounding step.
26  */
27 
28 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
29 
30 #include <assert.h>
31 #include <string.h>
32 
33 #include "scip/heur_randrounding.h"
34 #include "scip/pub_misc.h"
35 
36 
37 #define HEUR_NAME "randrounding"
38 #define HEUR_DESC "fast LP rounding heuristic"
39 #define HEUR_DISPCHAR 'G'
40 #define HEUR_PRIORITY -200
41 #define HEUR_FREQ 20
42 #define HEUR_FREQOFS 0
43 #define HEUR_MAXDEPTH -1
44 #define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP
45 #define HEUR_USESSUBSCIP FALSE /**< does the heuristic use a secondary SCIP instance? */
46 
47 #define DEFAULT_ONCEPERNODE FALSE /**< should the heuristic only be called once per node? */
48 #define DEFAULT_RANDSEED 23 /**< default random seed */
49 #define DEFAULT_USESIMPLEROUNDING FALSE /**< should the heuristic apply the variable lock strategy of simple rounding,
50  * if possible? */
51 #define DEFAULT_MAXPROPROUNDS 1 /**< limit of rounds for each propagation call */
52 #define DEFAULT_PROPAGATEONLYROOT TRUE /**< should the probing part of the heuristic be applied exclusively at the root node */
53 
54 /* locally defined heuristic data */
55 struct SCIP_HeurData
56 {
57  SCIP_SOL* sol; /**< working solution */
58  SCIP_RANDNUMGEN* randnumgen; /**< random number generation */
59  SCIP_Longint lastlp; /**< last LP number where the heuristic was applied */
60  int maxproprounds; /**< limit of rounds for each propagation call */
61  SCIP_Bool oncepernode; /**< should the heuristic only be called once per node? */
62  SCIP_Bool usesimplerounding; /**< should the heuristic apply the variable lock strategy of simple rounding,
63  * if possible? */
64  SCIP_Bool propagateonlyroot; /**< should the probing part of the heuristic be applied exclusively at the root node? */
65 };
66 
67 /*
68  * Local methods
69  */
70 
71 /** perform randomized rounding of the given solution. Domain propagation is optionally applied after every rounding
72  * step
73  */
74 static
76  SCIP* scip, /**< SCIP main data structure */
77  SCIP_HEURDATA* heurdata, /**< heuristic data */
78  SCIP_SOL* sol, /**< solution to round */
79  SCIP_VAR** cands, /**< candidate variables */
80  int ncands, /**< number of candidates */
81  SCIP_Bool propagate, /**< should the rounding be propagated? */
82  SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
83  )
84 {
85  int c;
86  SCIP_Bool stored;
87  SCIP_VAR** permutedcands;
88  SCIP_Bool cutoff;
89 
90  assert(heurdata != NULL);
91 
92  /* start probing tree before rounding begins */
93  if( propagate )
94  {
95  SCIP_CALL( SCIPstartProbing(scip) );
97  }
98 
99  /* copy and permute the candidate array */
100  SCIP_CALL( SCIPduplicateBufferArray(scip, &permutedcands, cands, ncands) );
101 
102  assert(permutedcands != NULL);
103 
104  SCIPrandomPermuteArray(heurdata->randnumgen, (void **)permutedcands, 0, ncands);
105  cutoff = FALSE;
106 
107  /* loop over candidates and perform randomized rounding and optionally probing. */
108  for (c = 0; c < ncands && !cutoff; ++c)
109  {
110  SCIP_VAR* var;
111  SCIP_Real oldsolval;
112  SCIP_Real newsolval;
113  SCIP_Bool mayrounddown;
114  SCIP_Bool mayroundup;
115  SCIP_Longint ndomreds;
116  SCIP_Real lb;
117  SCIP_Real ub;
118  SCIP_Real ceilval;
119  SCIP_Real floorval;
120 
121  /* get next variable from permuted candidate array */
122  var = permutedcands[c];
123  oldsolval = SCIPgetSolVal(scip, sol, var);
124  lb = SCIPvarGetLbLocal(var);
125  ub = SCIPvarGetUbLocal(var);
126 
127  assert( ! SCIPisFeasIntegral(scip, oldsolval) );
128  assert( SCIPvarGetStatus(var) == SCIP_VARSTATUS_COLUMN );
129 
130  mayrounddown = SCIPvarMayRoundDown(var);
131  mayroundup = SCIPvarMayRoundUp(var);
132  ceilval = SCIPfeasCeil(scip, oldsolval);
133  floorval = SCIPfeasFloor(scip, oldsolval);
134 
135  SCIPdebugMsg(scip, "rand rounding heuristic: var <%s>, val=%g, rounddown=%u, roundup=%u\n",
136  SCIPvarGetName(var), oldsolval, mayrounddown, mayroundup);
137 
138  /* abort if rounded ceil and floor value lie outside the variable domain. Otherwise, check if
139  * bounds allow only one rounding direction, anyway */
140  if( lb > ceilval + 0.5 || ub < floorval - 0.5 )
141  {
142  cutoff = TRUE;
143  break;
144  }
145  else if( SCIPisFeasEQ(scip, lb, ceilval) )
146  {
147  /* only rounding up possible */
148  assert(SCIPisFeasGE(scip, ub, ceilval));
149  newsolval = ceilval;
150  }
151  else if( SCIPisFeasEQ(scip, ub, floorval) )
152  {
153  /* only rounding down possible */
154  assert(SCIPisFeasLE(scip,lb, floorval));
155  newsolval = floorval;
156  }
157  else if( !heurdata->usesimplerounding || !(mayroundup || mayrounddown) )
158  {
159  /* the standard randomized rounding */
160  SCIP_Real randnumber;
161 
162  randnumber = SCIPrandomGetReal(heurdata->randnumgen, 0.0, 1.0);
163  if( randnumber <= oldsolval - floorval )
164  newsolval = ceilval;
165  else
166  newsolval = floorval;
167  }
168  /* choose rounding direction, if possible, or use the only direction guaranteed to be feasible */
169  else if( mayrounddown && mayroundup )
170  {
171  /* we can round in both directions: round in objective function direction */
172  if ( SCIPvarGetObj(var) >= 0.0 )
173  newsolval = floorval;
174  else
175  newsolval = ceilval;
176  }
177  else if( mayrounddown )
178  newsolval = floorval;
179  else
180  {
181  assert(mayroundup);
182  newsolval = ceilval;
183  }
184 
185  assert(SCIPisFeasLE(scip, lb, newsolval));
186  assert(SCIPisFeasGE(scip, ub, newsolval));
187 
188  /* if propagation is enabled, fix the candidate variable to its rounded value and propagate the solution */
189  if( propagate )
190  {
191  SCIP_Bool lbadjust;
192  SCIP_Bool ubadjust;
193 
194  lbadjust = SCIPisGT(scip, newsolval, lb);
195  ubadjust = SCIPisLT(scip, newsolval, ub);
196 
197  assert( lbadjust || ubadjust || SCIPisFeasEQ(scip, lb, ub));
198 
199  /* enter a new probing node if the variable was not already fixed before */
200  if( lbadjust || ubadjust )
201  {
202  if( SCIPisStopped(scip) )
203  break;
204 
205  /* We only want to create a new probing node if we do not exceeed the maximal tree depth,
206  * otherwise we finish at this point.
207  * @todo: Maybe we want to continue with the same node because we do not backtrack.
208  */
209  if( SCIPgetDepth(scip) < SCIP_MAXTREEDEPTH )
210  {
211  SCIP_CALL( SCIPnewProbingNode(scip) );
212  }
213  else
214  break;
215 
216  /* tighten the bounds to fix the variable for the probing node */
217  if( lbadjust )
218  {
219  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newsolval) );
220  }
221  if( ubadjust )
222  {
223  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newsolval) );
224  }
225 
226  /* call propagation routines for the reduced problem */
227  SCIP_CALL( SCIPpropagateProbing(scip, heurdata->maxproprounds, &cutoff, &ndomreds) );
228  }
229  }
230  /* store new solution value */
231  SCIP_CALL( SCIPsetSolVal(scip, sol, var, newsolval) );
232  }
233 
234  /* if no cutoff was detected, the solution is a candidate to be checked for feasibility */
235  if( !cutoff && ! SCIPisStopped(scip) )
236  {
237  if( SCIPallColsInLP(scip) )
238  {
239  /* check solution for feasibility, and add it to solution store if possible
240  * neither integrality nor feasibility of LP rows has to be checked, because all fractional
241  * variables were already moved in feasible direction to the next integer
242  */
243  SCIP_CALL( SCIPtrySol(scip, sol, FALSE, FALSE, FALSE, FALSE, TRUE, &stored) );
244  }
245  else
246  {
247  /* if there are variables which are not present in the LP, e.g., for
248  * column generation, we need to check their bounds
249  */
250  SCIP_CALL( SCIPtrySol(scip, sol, FALSE, FALSE, TRUE, FALSE, TRUE, &stored) );
251  }
252 
253  if( stored )
254  {
255 #ifdef SCIP_DEBUG
256  SCIPdebugMsg(scip, "found feasible rounded solution:\n");
257  SCIP_CALL( SCIPprintSol(scip, sol, NULL, FALSE) );
258 #endif
259  *result = SCIP_FOUNDSOL;
260  }
261  }
262 
263  assert( !propagate || SCIPinProbing(scip) );
264 
265  /* exit probing mode and free locally allocated memory */
266  if( propagate )
267  {
268  SCIP_CALL( SCIPendProbing(scip) );
269  }
270 
271  SCIPfreeBufferArray(scip, &permutedcands);
272 
273  return SCIP_OKAY;
274 }
275 
276 /** perform randomized LP-rounding */
277 static
279  SCIP* scip, /**< SCIP main data structure */
280  SCIP_HEURDATA* heurdata, /**< heuristic data */
281  SCIP_HEURTIMING heurtiming, /**< heuristic timing mask */
282  SCIP_Bool propagate, /**< should the heuristic apply SCIP's propagation? */
283  SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
284  )
285 {
286  SCIP_SOL* sol;
287  SCIP_VAR** lpcands;
288  SCIP_Longint nlps;
289  int nlpcands;
290 
291  /* only call heuristic, if an optimal LP solution is at hand */
293  return SCIP_OKAY;
294 
295  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
296  if( SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)) )
297  return SCIP_OKAY;
298 
299  /* get fractional variables, that should be integral */
300  SCIP_CALL( SCIPgetLPBranchCands(scip, &lpcands, NULL, NULL, &nlpcands, NULL, NULL) );
301 
302  /* only call heuristic, if LP solution is fractional; except we are called during pricing, in this case we
303  * want to detect a (mixed) integer (LP) solution which is primal feasible */
304  if ( nlpcands == 0 && heurtiming != SCIP_HEURTIMING_DURINGPRICINGLOOP )
305  return SCIP_OKAY;
306 
307  /* get the working solution from heuristic's local data */
308  sol = heurdata->sol;
309  assert( sol != NULL );
310 
311  /* copy the current LP solution to the working solution */
312  SCIP_CALL( SCIPlinkLPSol(scip, sol) );
313 
314  /* don't call heuristic, if we have already processed the current LP solution */
315  nlps = SCIPgetNLPs(scip);
316  if( nlps == heurdata->lastlp )
317  return SCIP_OKAY;
318  heurdata->lastlp = nlps;
319 
320  *result = SCIP_DIDNOTFIND;
321 
322  /* perform random rounding */
323  SCIPdebugMsg(scip, "executing rand LP-rounding heuristic: %d fractionals\n", nlpcands);
324  SCIP_CALL( performRandRounding(scip, heurdata, sol, lpcands, nlpcands, propagate, result) );
325 
326  return SCIP_OKAY;
327 }
328 
329 /*
330  * Callback methods
331  */
332 
333 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
334 static
335 SCIP_DECL_HEURCOPY(heurCopyRandrounding)
336 { /*lint --e{715}*/
337  assert(scip != NULL);
338  assert(heur != NULL);
339  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
340 
341  /* call inclusion method of primal heuristic */
343 
344  return SCIP_OKAY;
345 }
346 
347 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
348 static
349 SCIP_DECL_HEURFREE(heurFreeRandrounding) /*lint --e{715}*/
350 { /*lint --e{715}*/
351  SCIP_HEURDATA* heurdata;
352 
353  assert(heur != NULL);
354  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
355  assert(scip != NULL);
356 
357  /* free heuristic data */
358  heurdata = SCIPheurGetData(heur);
359  assert(heurdata != NULL);
360  SCIPfreeBlockMemory(scip, &heurdata);
361  SCIPheurSetData(heur, NULL);
362 
363  return SCIP_OKAY;
364 }
365 
366 /** initialization method of primal heuristic (called after problem was transformed) */
367 static
368 SCIP_DECL_HEURINIT(heurInitRandrounding) /*lint --e{715}*/
369 { /*lint --e{715}*/
370  SCIP_HEURDATA* heurdata;
371 
372  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
373  heurdata = SCIPheurGetData(heur);
374  assert(heurdata != NULL);
375 
376  /* create heuristic data */
377  SCIP_CALL( SCIPcreateSol(scip, &heurdata->sol, heur) );
378  heurdata->lastlp = -1;
379 
380  /* create random number generator */
381  SCIP_CALL( SCIPrandomCreate(&heurdata->randnumgen, SCIPblkmem(scip),
383 
384  return SCIP_OKAY;
385 }
386 
387 /** deinitialization method of primal heuristic (called before transformed problem is freed) */
388 static
389 SCIP_DECL_HEUREXIT(heurExitRandrounding) /*lint --e{715}*/
390 { /*lint --e{715}*/
391  SCIP_HEURDATA* heurdata;
392 
393  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
394 
395  /* free heuristic data */
396  heurdata = SCIPheurGetData(heur);
397  assert(heurdata != NULL);
398  SCIP_CALL( SCIPfreeSol(scip, &heurdata->sol) );
399 
400  /* free random number generator */
401  SCIPrandomFree(&heurdata->randnumgen);
402 
403  return SCIP_OKAY;
404 }
405 
406 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
407 static
408 SCIP_DECL_HEURINITSOL(heurInitsolRandrounding)
409 {
410  SCIP_HEURDATA* heurdata;
411 
412  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
413 
414  heurdata = SCIPheurGetData(heur);
415  assert(heurdata != NULL);
416  heurdata->lastlp = -1;
417 
418  /* change the heuristic's timingmask, if it should be called only once per node */
419  if( heurdata->oncepernode )
421 
422  return SCIP_OKAY;
423 }
424 
425 
426 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
427 static
428 SCIP_DECL_HEUREXITSOL(heurExitsolRandrounding)
429 {
430  /* reset the timing mask to its default value */
432 
433  return SCIP_OKAY;
434 }
435 
436 /** execution method of primal heuristic */
437 static
438 SCIP_DECL_HEUREXEC(heurExecRandrounding) /*lint --e{715}*/
439 { /*lint --e{715}*/
440  SCIP_HEURDATA* heurdata;
441  SCIP_Bool propagate;
442 
443  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
444  assert(result != NULL);
445  assert(SCIPhasCurrentNodeLP(scip));
446 
447  *result = SCIP_DIDNOTRUN;
448 
449  /* only call heuristic, if an optimal LP solution is at hand or if relaxation solution is available */
451  return SCIP_OKAY;
452 
453  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
454  if( SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)) )
455  return SCIP_OKAY;
456 
457  /* get heuristic data */
458  heurdata = SCIPheurGetData(heur);
459  assert(heurdata != NULL);
460 
461  /* don't call heuristic, if we have already processed the current LP solution but no relaxation solution is available */
462  if ( SCIPgetNLPs(scip) == heurdata->lastlp && ! SCIPisRelaxSolValid(scip) )
463  return SCIP_OKAY;
464 
465  propagate = (!heurdata->propagateonlyroot || SCIPgetDepth(scip) == 0);
466 
467  /* try to round LP solution */
468  SCIP_CALL( performLPRandRounding(scip, heurdata, heurtiming, propagate, result) );
469 
470  return SCIP_OKAY;
471 }
472 
473 /*
474  * heuristic specific interface methods
475  */
476 
477 /** creates the rand rounding heuristic and includes it in SCIP */
479  SCIP* scip /**< SCIP data structure */
480  )
481 {
482  SCIP_HEURDATA* heurdata;
483  SCIP_HEUR* heur;
484 
485  /* create heuristic data */
486  SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
487 
488  /* include primal heuristic */
489  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
491  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecRandrounding, heurdata) );
492  assert(heur != NULL);
493 
494  /* set non-NULL pointers to callback methods */
495  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyRandrounding) );
496  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitRandrounding) );
497  SCIP_CALL( SCIPsetHeurExit(scip, heur, heurExitRandrounding) );
498  SCIP_CALL( SCIPsetHeurInitsol(scip, heur, heurInitsolRandrounding) );
499  SCIP_CALL( SCIPsetHeurExitsol(scip, heur, heurExitsolRandrounding) );
500  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeRandrounding) );
501 
502  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/oncepernode",
503  "should the heuristic only be called once per node?",
504  &heurdata->oncepernode, TRUE, DEFAULT_ONCEPERNODE, NULL, NULL) );
505  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/usesimplerounding", "should the heuristic apply the variable lock strategy of simple rounding, if possible?",
506  &heurdata->usesimplerounding, TRUE, DEFAULT_USESIMPLEROUNDING, NULL, NULL) );
507  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/propagateonlyroot",
508  "should the probing part of the heuristic be applied exclusively at the root node?",
509  &heurdata->propagateonlyroot, TRUE, DEFAULT_PROPAGATEONLYROOT, NULL, NULL) );
510  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/maxproprounds",
511  "limit of rounds for each propagation call",
512  &heurdata->maxproprounds, TRUE, DEFAULT_MAXPROPROUNDS,
513  -1, INT_MAX, NULL, NULL) );
514  return SCIP_OKAY;
515 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip.c:8124
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:36128
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition: misc.c:8693
#define HEUR_FREQOFS
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37672
static SCIP_DECL_HEUREXIT(heurExitRandrounding)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46086
SCIP_RETCODE SCIPincludeHeurRandrounding(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:42499
unsigned int SCIP_HEURTIMING
Definition: type_timing.h:97
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: scip.c:8092
static SCIP_RETCODE performRandRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *sol, SCIP_VAR **cands, int ncands, SCIP_Bool propagate, SCIP_RESULT *result)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17222
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45803
#define DEFAULT_RANDSEED
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46138
#define FALSE
Definition: def.h:64
#define TRUE
Definition: def.h:63
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
Definition: misc.c:8794
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
static SCIP_DECL_HEUREXEC(heurExecRandrounding)
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip.h:21907
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)
Definition: scip.c:7999
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35220
#define SCIP_HEURTIMING_DURINGPRICINGLOOP
Definition: type_timing.h:85
#define HEUR_DESC
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:21933
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:21937
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1102
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:21890
#define SCIPdebugMsg
Definition: scip.h:451
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)
Definition: scip.c:4202
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:46223
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:46211
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
Definition: misc.c:8710
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip.c:8108
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1181
static SCIP_DECL_HEURCOPY(heurCopyRandrounding)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:8060
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45764
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip.c:35477
#define SCIP_HEURTIMING_AFTERLPNODE
Definition: type_timing.h:73
static SCIP_DECL_HEUREXITSOL(heurExitsolRandrounding)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:45519
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:35187
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16552
#define NULL
Definition: lpi_spx1.cpp:137
#define HEUR_USESSUBSCIP
#define SCIP_CALL(x)
Definition: def.h:306
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46112
static SCIP_DECL_HEURFREE(heurFreeRandrounding)
#define DEFAULT_USESIMPLEROUNDING
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:28769
#define HEUR_NAME
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:37867
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:61
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:28854
#define HEUR_PRIORITY
#define DEFAULT_ONCEPERNODE
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:42094
static SCIP_RETCODE performLPRandRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_HEURTIMING heurtiming, SCIP_Bool propagate, SCIP_RESULT *result)
#define HEUR_TIMING
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
Definition: scip.c:25467
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip.c:37631
void SCIPenableVarHistory(SCIP *scip)
Definition: scip.c:25520
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17014
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)
Definition: scip.c:39749
#define SCIP_MAXTREEDEPTH
Definition: def.h:242
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:8745
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:35033
#define HEUR_MAXDEPTH
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:28897
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45790
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:19659
#define HEUR_DISPCHAR
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:8076
#define DEFAULT_MAXPROPROUNDS
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16671
#define SCIP_Real
Definition: def.h:135
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1138
static SCIP_DECL_HEURINIT(heurInitRandrounding)
void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
Definition: heur.c:1221
#define SCIP_Longint
Definition: def.h:120
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:29244
#define HEUR_FREQ
randomized LP rounding heuristic which also generates conflicts via an auxiliary probing tree ...
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:8044
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17232
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:35092
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46187
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:35055
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1092
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:41363
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35264
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:38007
SCIP_Bool SCIPvarMayRoundUp(SCIP_VAR *var)
Definition: var.c:3280
SCIP_Bool SCIPvarMayRoundDown(SCIP_VAR *var)
Definition: var.c:3272
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)
Definition: scip.c:4176
static SCIP_DECL_HEURINITSOL(heurInitsolRandrounding)
#define DEFAULT_PROPAGATEONLYROOT
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37005
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38421