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-2016 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 
35 
36 #define HEUR_NAME "randrounding"
37 #define HEUR_DESC "fast LP rounding heuristic"
38 #define HEUR_DISPCHAR 'G'
39 #define HEUR_PRIORITY -200
40 #define HEUR_FREQ 20
41 #define HEUR_FREQOFS 0
42 #define HEUR_MAXDEPTH -1
43 #define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP
44 #define HEUR_USESSUBSCIP FALSE /**< does the heuristic use a secondary SCIP instance? */
45 
46 #define DEFAULT_ONCEPERNODE FALSE /**< should the heuristic only be called once per node? */
47 #define DEFAULT_RANDSEED 14081986 /**< default random seed */
48 #define DEFAULT_USESIMPLEROUNDING FALSE /**< should the heuristic apply the variable lock strategy of simple rounding,
49  * if possible? */
50 #define DEFAULT_MAXPROPROUNDS 1 /**< limit of rounds for each propagation call */
51 #define DEFAULT_PROPAGATEONLYROOT TRUE /**< should the probing part of the heuristic be applied exclusively at the root node */
52 
53 /* locally defined heuristic data */
54 struct SCIP_HeurData
55 {
56  SCIP_SOL* sol; /**< working solution */
57  SCIP_Longint lastlp; /**< last LP number where the heuristic was applied */
58  unsigned int randseed; /**< seed for random number generation */
59  int maxproprounds; /**< limit of rounds for each propagation call */
60  SCIP_Bool oncepernode; /**< should the heuristic only be called once per node? */
61  SCIP_Bool usesimplerounding; /**< should the heuristic apply the variable lock strategy of simple rounding,
62  * if possible? */
63  SCIP_Bool propagateonlyroot; /**< should the probing part of the heuristic be applied exclusively at the root node? */
64 };
65 
66 /*
67  * Local methods
68  */
69 
70 /** perform randomized rounding of the given solution. Domain propagation is optionally applied after every rounding
71  * step
72  */
73 static
75  SCIP* scip, /**< SCIP main data structure */
76  SCIP_HEURDATA* heurdata, /**< heuristic data */
77  SCIP_SOL* sol, /**< solution to round */
78  SCIP_VAR** cands, /**< candidate variables */
79  int ncands, /**< number of candidates */
80  SCIP_Bool propagate, /**< should the rounding be propagated? */
81  SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
82  )
83 {
84  int c;
85  SCIP_Bool stored;
86  SCIP_VAR** permutedcands;
87  SCIP_Bool cutoff;
88 
89  assert(heurdata != NULL);
90 
91  /* start probing tree before rounding begins */
92  if( propagate )
93  {
94  SCIP_CALL( SCIPstartProbing(scip) );
96  }
97 
98  /* copy and permute the candidate array */
99  SCIP_CALL( SCIPduplicateBufferArray(scip, &permutedcands, cands, ncands) );
100 
101  assert(permutedcands != NULL);
102 
103  SCIPpermuteArray((void **)permutedcands, 0, ncands, &heurdata->randseed);
104  cutoff = FALSE;
105 
106  /* loop over candidates and perform randomized rounding and optionally probing. */
107  for (c = 0; c < ncands && !cutoff; ++c)
108  {
109  SCIP_VAR* var;
110  SCIP_Real oldsolval;
111  SCIP_Real newsolval;
112  SCIP_Bool mayrounddown;
113  SCIP_Bool mayroundup;
114  SCIP_Longint ndomreds;
115  SCIP_Real lb;
116  SCIP_Real ub;
117  SCIP_Real ceilval;
118  SCIP_Real floorval;
119 
120  /* get next variable from permuted candidate array */
121  var = permutedcands[c];
122  oldsolval = SCIPgetSolVal(scip, sol, var);
123  lb = SCIPvarGetLbLocal(var);
124  ub = SCIPvarGetUbLocal(var);
125 
126  assert( ! SCIPisFeasIntegral(scip, oldsolval) );
127  assert( SCIPvarGetStatus(var) == SCIP_VARSTATUS_COLUMN );
128 
129  mayrounddown = SCIPvarMayRoundDown(var);
130  mayroundup = SCIPvarMayRoundUp(var);
131  ceilval = SCIPfeasCeil(scip, oldsolval);
132  floorval = SCIPfeasFloor(scip, oldsolval);
133 
134  SCIPdebugMessage("rand rounding heuristic: var <%s>, val=%g, rounddown=%u, roundup=%u\n",
135  SCIPvarGetName(var), oldsolval, mayrounddown, mayroundup);
136 
137  /* abort if rounded ceil and floor value lie outside the variable domain. Otherwise, check if
138  * bounds allow only one rounding direction, anyway */
139  if( lb > ceilval + 0.5 || ub < floorval - 0.5 )
140  {
141  cutoff = TRUE;
142  break;
143  }
144  else if( SCIPisFeasEQ(scip, lb, ceilval) )
145  {
146  /* only rounding up possible */
147  assert(SCIPisFeasGE(scip, ub, ceilval));
148  newsolval = ceilval;
149  }
150  else if( SCIPisFeasEQ(scip, ub, floorval) )
151  {
152  /* only rounding down possible */
153  assert(SCIPisFeasLE(scip,lb, floorval));
154  newsolval = floorval;
155  }
156  else if( !heurdata->usesimplerounding || !(mayroundup || mayrounddown) )
157  {
158  /* the standard randomized rounding */
159  SCIP_Real randnumber;
160 
161  randnumber = SCIPgetRandomReal(0.0, 1.0, &heurdata->randseed);
162  if( randnumber <= oldsolval - floorval )
163  newsolval = ceilval;
164  else
165  newsolval = floorval;
166  }
167  /* choose rounding direction, if possible, or use the only direction guaranteed to be feasible */
168  else if( mayrounddown && mayroundup )
169  {
170  /* we can round in both directions: round in objective function direction */
171  if ( SCIPvarGetObj(var) >= 0.0 )
172  newsolval = floorval;
173  else
174  newsolval = ceilval;
175  }
176  else if( mayrounddown )
177  newsolval = floorval;
178  else
179  {
180  assert(mayroundup);
181  newsolval = ceilval;
182  }
183 
184  assert(SCIPisFeasLE(scip, lb, newsolval));
185  assert(SCIPisFeasGE(scip, ub, newsolval));
186 
187  /* if propagation is enabled, fix the candidate variable to its rounded value and propagate the solution */
188  if( propagate )
189  {
190  SCIP_Bool lbadjust;
191  SCIP_Bool ubadjust;
192 
193  lbadjust = SCIPisGT(scip, newsolval, lb);
194  ubadjust = SCIPisLT(scip, newsolval, ub);
195 
196  assert( lbadjust || ubadjust || SCIPisFeasEQ(scip, lb, ub));
197 
198  /* enter a new probing node if the variable was not already fixed before */
199  if( lbadjust || ubadjust )
200  {
201  if( SCIPisStopped(scip) )
202  break;
203 
204  /* We only want to create a new probing node if we do not exceeed the maximal tree depth,
205  * otherwise we finish at this point.
206  * @todo: Maybe we want to continue with the same node because we do not backtrack.
207  */
208  if( SCIPgetDepth(scip) < SCIPgetDepthLimit(scip) )
209  {
210  SCIP_CALL( SCIPnewProbingNode(scip) );
211  }
212  else
213  break;
214 
215  /* tighten the bounds to fix the variable for the probing node */
216  if( lbadjust )
217  {
218  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newsolval) );
219  }
220  if( ubadjust )
221  {
222  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newsolval) );
223  }
224 
225  /* call propagation routines for the reduced problem */
226  SCIP_CALL( SCIPpropagateProbing(scip, heurdata->maxproprounds, &cutoff, &ndomreds) );
227  }
228  }
229  /* store new solution value */
230  SCIP_CALL( SCIPsetSolVal(scip, sol, var, newsolval) );
231  }
232 
233  /* if no cutoff was detected, the solution is a candidate to be checked for feasibility */
234  if( !cutoff && ! SCIPisStopped(scip) )
235  {
236  if( SCIPallColsInLP(scip) )
237  {
238  /* check solution for feasibility, and add it to solution store if possible
239  * neither integrality nor feasibility of LP rows has to be checked, because all fractional
240  * variables were already moved in feasible direction to the next integer
241  */
242  SCIP_CALL( SCIPtrySol(scip, sol, FALSE, FALSE, FALSE, TRUE, &stored) );
243  }
244  else
245  {
246  /* if there are variables which are not present in the LP, e.g., for
247  * column generation, we need to check their bounds
248  */
249  SCIP_CALL( SCIPtrySol(scip, sol, FALSE, TRUE, FALSE, TRUE, &stored) );
250  }
251 
252  if( stored )
253  {
254 #ifdef SCIP_DEBUG
255  SCIPdebugMessage("found feasible rounded solution:\n");
256  SCIP_CALL( SCIPprintSol(scip, sol, NULL, FALSE) );
257 #endif
258  *result = SCIP_FOUNDSOL;
259  }
260  }
261 
262  assert( !propagate || SCIPinProbing(scip) );
263 
264  /* exit probing mode and free locally allocated memory */
265  if( propagate )
266  {
267  SCIP_CALL( SCIPendProbing(scip) );
268  }
269 
270  SCIPfreeBufferArray(scip, &permutedcands);
271 
272  return SCIP_OKAY;
273 }
274 
275 /** perform randomized LP-rounding */
276 static
278  SCIP* scip, /**< SCIP main data structure */
279  SCIP_HEURDATA* heurdata, /**< heuristic data */
280  SCIP_HEURTIMING heurtiming, /**< heuristic timing mask */
281  SCIP_Bool propagate, /**< should the heuristic apply SCIP's propagation? */
282  SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
283  )
284 {
285  SCIP_SOL* sol;
286  SCIP_VAR** lpcands;
287  SCIP_Longint nlps;
288  int nlpcands;
289 
290  /* only call heuristic, if an optimal LP solution is at hand */
292  return SCIP_OKAY;
293 
294  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
295  if( SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)) )
296  return SCIP_OKAY;
297 
298  /* get fractional variables, that should be integral */
299  SCIP_CALL( SCIPgetLPBranchCands(scip, &lpcands, NULL, NULL, &nlpcands, NULL, NULL) );
300 
301  /* only call heuristic, if LP solution is fractional; except we are called during pricing, in this case we
302  * want to detect a (mixed) integer (LP) solution which is primal feasible */
303  if ( nlpcands == 0 && heurtiming != SCIP_HEURTIMING_DURINGPRICINGLOOP )
304  return SCIP_OKAY;
305 
306  /* get the working solution from heuristic's local data */
307  sol = heurdata->sol;
308  assert( sol != NULL );
309 
310  /* copy the current LP solution to the working solution */
311  SCIP_CALL( SCIPlinkLPSol(scip, sol) );
312 
313  /* don't call heuristic, if we have already processed the current LP solution */
314  nlps = SCIPgetNLPs(scip);
315  if( nlps == heurdata->lastlp )
316  return SCIP_OKAY;
317  heurdata->lastlp = nlps;
318 
319  *result = SCIP_DIDNOTFIND;
320 
321  /* perform random rounding */
322  SCIPdebugMessage("executing rand LP-rounding heuristic: %d fractionals\n", nlpcands);
323  SCIP_CALL( performRandRounding(scip, heurdata, sol, lpcands, nlpcands, propagate, result) );
324 
325  return SCIP_OKAY;
326 }
327 
328 /*
329  * Callback methods
330  */
331 
332 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
333 static
334 SCIP_DECL_HEURCOPY(heurCopyRandrounding)
335 { /*lint --e{715}*/
336  assert(scip != NULL);
337  assert(heur != NULL);
338  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
339 
340  /* call inclusion method of primal heuristic */
342 
343  return SCIP_OKAY;
344 }
345 
346 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
347 static
348 SCIP_DECL_HEURFREE(heurFreeRandrounding) /*lint --e{715}*/
349 { /*lint --e{715}*/
350  SCIP_HEURDATA* heurdata;
351 
352  assert(heur != NULL);
353  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
354  assert(scip != NULL);
355 
356  /* free heuristic data */
357  heurdata = SCIPheurGetData(heur);
358  assert(heurdata != NULL);
359  SCIPfreeMemory(scip, &heurdata);
360  SCIPheurSetData(heur, NULL);
361 
362  return SCIP_OKAY;
363 }
364 
365 /** initialization method of primal heuristic (called after problem was transformed) */
366 static
367 SCIP_DECL_HEURINIT(heurInitRandrounding) /*lint --e{715}*/
368 { /*lint --e{715}*/
369  SCIP_HEURDATA* heurdata;
370 
371  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
372  heurdata = SCIPheurGetData(heur);
373  assert(heurdata != NULL);
374 
375  /* create heuristic data */
376  SCIP_CALL( SCIPcreateSol(scip, &heurdata->sol, heur) );
377  heurdata->lastlp = -1;
378  heurdata->randseed = DEFAULT_RANDSEED;
379 
380  return SCIP_OKAY;
381 }
382 
383 /** deinitialization method of primal heuristic (called before transformed problem is freed) */
384 static
385 SCIP_DECL_HEUREXIT(heurExitRandrounding) /*lint --e{715}*/
386 { /*lint --e{715}*/
387  SCIP_HEURDATA* heurdata;
388 
389  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
390 
391  /* free heuristic data */
392  heurdata = SCIPheurGetData(heur);
393  assert(heurdata != NULL);
394  SCIP_CALL( SCIPfreeSol(scip, &heurdata->sol) );
395 
396  return SCIP_OKAY;
397 }
398 
399 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
400 static
401 SCIP_DECL_HEURINITSOL(heurInitsolRandrounding)
402 {
403  SCIP_HEURDATA* heurdata;
404 
405  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
406 
407  heurdata = SCIPheurGetData(heur);
408  assert(heurdata != NULL);
409  heurdata->lastlp = -1;
410 
411  /* change the heuristic's timingmask, if it should be called only once per node */
412  if( heurdata->oncepernode )
414 
415  return SCIP_OKAY;
416 }
417 
418 
419 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
420 static
421 SCIP_DECL_HEUREXITSOL(heurExitsolRandrounding)
422 {
423  /* reset the timing mask to its default value */
425 
426  return SCIP_OKAY;
427 }
428 
429 /** execution method of primal heuristic */
430 static
431 SCIP_DECL_HEUREXEC(heurExecRandrounding) /*lint --e{715}*/
432 { /*lint --e{715}*/
433  SCIP_HEURDATA* heurdata;
434  SCIP_Bool propagate;
435 
436  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
437  assert(result != NULL);
438  assert(SCIPhasCurrentNodeLP(scip));
439 
440  *result = SCIP_DIDNOTRUN;
441 
442  /* only call heuristic, if an optimal LP solution is at hand or if relaxation solution is available */
444  return SCIP_OKAY;
445 
446  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
447  if( SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)) )
448  return SCIP_OKAY;
449 
450  /* get heuristic data */
451  heurdata = SCIPheurGetData(heur);
452  assert(heurdata != NULL);
453 
454  /* don't call heuristic, if we have already processed the current LP solution but no relaxation solution is available */
455  if ( SCIPgetNLPs(scip) == heurdata->lastlp && ! SCIPisRelaxSolValid(scip) )
456  return SCIP_OKAY;
457 
458  propagate = (!heurdata->propagateonlyroot || SCIPgetDepth(scip) == 0);
459 
460  /* try to round LP solution */
461  SCIP_CALL( performLPRandRounding(scip, heurdata, heurtiming, propagate, result) );
462 
463  return SCIP_OKAY;
464 }
465 
466 /*
467  * heuristic specific interface methods
468  */
469 
470 /** creates the rand rounding heuristic and includes it in SCIP */
472  SCIP* scip /**< SCIP data structure */
473  )
474 {
475  SCIP_HEURDATA* heurdata;
476  SCIP_HEUR* heur;
477 
478  /* create heuristic data */
479  SCIP_CALL( SCIPallocMemory(scip, &heurdata) );
480 
481  /* include primal heuristic */
482  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
484  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecRandrounding, heurdata) );
485  assert(heur != NULL);
486 
487  /* set non-NULL pointers to callback methods */
488  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyRandrounding) );
489  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitRandrounding) );
490  SCIP_CALL( SCIPsetHeurExit(scip, heur, heurExitRandrounding) );
491  SCIP_CALL( SCIPsetHeurInitsol(scip, heur, heurInitsolRandrounding) );
492  SCIP_CALL( SCIPsetHeurExitsol(scip, heur, heurExitsolRandrounding) );
493  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeRandrounding) );
494 
495  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/oncepernode",
496  "should the heuristic only be called once per node?",
497  &heurdata->oncepernode, TRUE, DEFAULT_ONCEPERNODE, NULL, NULL) );
498  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/usesimplerounding", "should the heuristic apply the variable lock strategy of simple rounding, if possible?",
499  &heurdata->usesimplerounding, TRUE, DEFAULT_USESIMPLEROUNDING, NULL, NULL) );
500  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/propagateonlyroot",
501  "should the probing part of the heuristic be applied exclusively at the root node?",
502  &heurdata->propagateonlyroot, TRUE, DEFAULT_PROPAGATEONLYROOT, NULL, NULL) );
503  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/maxproprounds",
504  "limit of rounds for each propagation call",
505  &heurdata->maxproprounds, TRUE, DEFAULT_MAXPROPROUNDS,
506  -1, INT_MAX, NULL, NULL) );
507  return SCIP_OKAY;
508 }
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip.c:7361
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:51
void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
Definition: misc.c:7884
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:33125
#define HEUR_FREQOFS
#define SCIPallocMemory(scip, ptr)
Definition: scip.h:20526
static SCIP_DECL_HEUREXIT(heurExitRandrounding)
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16443
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1147
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:7297
SCIP_Bool SCIPvarMayRoundDown(SCIP_VAR *var)
Definition: var.c:3259
unsigned int SCIP_HEURTIMING
Definition: type_timing.h:95
void SCIPenableVarHistory(SCIP *scip)
Definition: scip.c:23145
#define NULL
Definition: lpi_spx.cpp:130
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17113
static SCIP_RETCODE performRandRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *sol, SCIP_VAR **cands, int ncands, SCIP_Bool propagate, SCIP_RESULT *result)
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1125
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:42032
#define DEFAULT_RANDSEED
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:34843
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:7252
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip.c:32552
#define FALSE
Definition: def.h:56
#define TRUE
Definition: def.h:55
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_CALL(x)
Definition: def.h:266
static SCIP_DECL_HEUREXEC(heurExecRandrounding)
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:42008
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:38561
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:26439
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:34983
#define SCIP_HEURTIMING_DURINGPRICINGLOOP
Definition: type_timing.h:83
#define HEUR_DESC
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:16905
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:26482
SCIP_RETCODE SCIPincludeHeurRandrounding(SCIP *scip)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:42044
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:26829
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:3547
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16562
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:3573
#define SCIPfreeMemory(scip, ptr)
Definition: scip.h:20542
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41585
static SCIP_DECL_HEURCOPY(heurCopyRandrounding)
#define SCIP_HEURTIMING_AFTERLPNODE
Definition: type_timing.h:71
static SCIP_DECL_HEUREXITSOL(heurExitsolRandrounding)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34002
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41907
#define HEUR_USESSUBSCIP
void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
Definition: heur.c:1187
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:26354
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:37435
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:32131
int SCIPgetDepthLimit(SCIP *scip)
Definition: scip.c:38190
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1068
static SCIP_DECL_HEURFREE(heurFreeRandrounding)
#define DEFAULT_USESIMPLEROUNDING
#define HEUR_NAME
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41611
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17123
#define SCIP_Bool
Definition: def.h:53
#define HEUR_PRIORITY
#define DEFAULT_ONCEPERNODE
static SCIP_RETCODE performLPRandRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_HEURTIMING heurtiming, SCIP_Bool propagate, SCIP_RESULT *result)
#define HEUR_TIMING
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:32153
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip.c:7377
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:32285
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:38140
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:34648
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: scip.c:7345
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41624
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:7329
SCIP_Real SCIPgetRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
Definition: misc.c:7719
#define HEUR_MAXDEPTH
#define HEUR_DISPCHAR
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:20593
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:32352
#define DEFAULT_MAXPROPROUNDS
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41933
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:7313
#define SCIP_Real
Definition: def.h:127
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:32190
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:32318
static SCIP_DECL_HEURINIT(heurInitRandrounding)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41959
SCIP_Bool SCIPvarMayRoundUp(SCIP_VAR *var)
Definition: var.c:3267
#define SCIP_Longint
Definition: def.h:112
#define HEUR_FREQ
randomized LP rounding heuristic which also generates conflicts via an auxiliary probing tree ...
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:17841
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1058
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:20597
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36217
static SCIP_DECL_HEURINITSOL(heurInitsolRandrounding)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:35397
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip.c:34607
#define DEFAULT_PROPAGATEONLYROOT