Scippy

SCIP

Solving Constraint Integer Programs

heur.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.c
17  * @brief methods for primal heuristics
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <assert.h>
25 #include <string.h>
26 
27 #include "scip/def.h"
28 #include "scip/set.h"
29 #include "scip/clock.h"
30 #include "scip/paramset.h"
31 #include "scip/primal.h"
32 #include "scip/scip.h"
33 #include "scip/heur.h"
34 #include "scip/pub_message.h"
35 #include "scip/pub_misc.h"
36 
37 #include "scip/struct_heur.h"
38 
39 /** compares two heuristics w. r. to their delay positions and their priority */
40 SCIP_DECL_SORTPTRCOMP(SCIPheurComp)
41 { /*lint --e{715}*/
42  SCIP_HEUR* heur1 = (SCIP_HEUR*)elem1;
43  SCIP_HEUR* heur2 = (SCIP_HEUR*)elem2;
44 
45  assert(heur1 != NULL);
46  assert(heur2 != NULL);
47 
48  if( heur1->delaypos == heur2->delaypos )
49  return heur2->priority - heur1->priority; /* prefer higher priorities */
50  else if( heur1->delaypos == -1 )
51  return +1; /* prefer delayed heuristics */
52  else if( heur2->delaypos == -1 )
53  return -1; /* prefer delayed heuristics */
54  else if( heur1->ncalls * heur1->freq > heur2->ncalls * heur2->freq )
55  return +1;
56  else if( heur1->ncalls * heur1->freq < heur2->ncalls * heur2->freq )
57  return -1;
58  else
59  return heur1->delaypos - heur2->delaypos; /* prefer lower delay positions */
60 }
61 
62 
63 /** comparison method for sorting heuristics w.r.t. to their name */
64 SCIP_DECL_SORTPTRCOMP(SCIPheurCompName)
65 {
66  return strcmp(SCIPheurGetName((SCIP_HEUR*)elem1), SCIPheurGetName((SCIP_HEUR*)elem2));
67 }
68 
69 /** method to call, when the priority of a heuristic was changed */
70 static
71 SCIP_DECL_PARAMCHGD(paramChgdHeurPriority)
72 { /*lint --e{715}*/
73  SCIP_PARAMDATA* paramdata;
74 
75  paramdata = SCIPparamGetData(param);
76  assert(paramdata != NULL);
77 
78  /* use SCIPsetHeurPriority() to mark the heuristics unsorted */
79  SCIP_CALL( SCIPsetHeurPriority(scip, (SCIP_HEUR*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
80 
81  return SCIP_OKAY;
82 }
83 
84 /* resets diving settings counters */
86  SCIP_DIVESET* diveset, /**< diveset to be reset */
87  SCIP_SET* set /**< global SCIP settings */
88  )
89 {
90  assert(diveset != NULL);
91 
92  diveset->nlpiterations = 0L;
93  diveset->totaldepth = 0L;
94  diveset->totalsoldepth = 0L;
95  diveset->totalnnodes = 0L;
96  diveset->totalnbacktracks = 0L;
97  diveset->minsoldepth = INT_MAX;
98  diveset->maxsoldepth = -1;
99  diveset->mindepth = INT_MAX;
100  diveset->maxdepth = -1;
101  diveset->nlps = 0;
102  diveset->nsolsfound = 0;
103  diveset->nbestsolsfound = 0;
104  diveset->ncalls = 0;
105  diveset->nsolcalls = 0;
106 
107  /* create a new random number generator after freeing any previous random number generator */
108  if( diveset->randnumgen != NULL )
109  SCIPrandomFree(&diveset->randnumgen);
110 
111  SCIP_CALL( SCIPrandomCreate(&diveset->randnumgen, diveset->blkmem, (unsigned int) SCIPsetInitializeRandomSeed(set, diveset->initialseed)) );
112 
113  return SCIP_OKAY;
114 }
115 
116 /** update diveset statistics and global diveset statistics */
118  SCIP_DIVESET* diveset, /**< diveset to be reset */
119  SCIP_STAT* stat, /**< global SCIP statistics */
120  int depth, /**< the depth reached this time */
121  int nprobingnodes, /**< the number of probing nodes explored this time */
122  int nbacktracks, /**< the number of backtracks during probing this time */
123  SCIP_Longint nsolsfound, /**< number of new solutions found this time */
124  SCIP_Longint nbestsolsfound, /**< number of new best solutions found this time */
125  SCIP_Bool leavesol /**< has the diving heuristic reached a feasible leaf */
126  )
127 {
128  assert(diveset != NULL);
129 
130  diveset->totaldepth += depth;
131  diveset->mindepth = MIN(diveset->mindepth, depth);
132  diveset->maxdepth = MAX(diveset->maxdepth, depth);
133  diveset->totalnnodes += nprobingnodes;
134  diveset->totalnbacktracks += nbacktracks;
135  diveset->ncalls++;
136 
137  /* update solution statistics only if a solution was found */
138  if( leavesol )
139  {
140  diveset->totalsoldepth += depth;
141  diveset->minsoldepth = MIN(diveset->minsoldepth, depth);
142  diveset->maxsoldepth = MAX(diveset->maxsoldepth, depth);
143  diveset->nsolcalls++;
144  }
145 
146  diveset->nsolsfound += nsolsfound;
147  diveset->nbestsolsfound += nbestsolsfound;
148 
149  stat->totaldivesetdepth += depth;
150  stat->ndivesetcalls++;
151 }
152 
153 /** append diveset to heuristic array of divesets */
154 static
156  SCIP_HEUR* heur, /**< the heuristic to which this dive setting belongs */
157  SCIP_DIVESET* diveset /**< pointer to the freshly created diveset */
158  )
159 {
160  assert(heur != NULL);
161  assert(diveset != NULL);
162  assert(diveset->heur == NULL);
163 
164  diveset->heur = heur;
165 
166  if( heur->divesets == NULL )
167  {
168  assert(heur->ndivesets == 0);
170  }
171  else
172  {
173  assert(heur->ndivesets > 0);
174  SCIP_ALLOC( BMSreallocMemoryArray(&heur->divesets, heur->ndivesets + 1) ); /*lint !e776 I expect no overflow here */
175  }
176 
177  /* append diveset to the end of the array */
178  heur->divesets[heur->ndivesets] = diveset;
179  heur->ndivesets++;
180 
181  return SCIP_OKAY;
182 }
183 
184 /** create a set of diving heuristic settings */
186  SCIP_DIVESET** diveset, /**< pointer to the freshly created diveset */
187  SCIP_HEUR* heur, /**< the heuristic to which this dive setting belongs */
188  const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */
189  SCIP_SET* set, /**< global SCIP settings */
190  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
191  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
192  SCIP_Real minreldepth, /**< minimal relative depth to start diving */
193  SCIP_Real maxreldepth, /**< maximal relative depth to start diving */
194  SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */
195  SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
196  * where diving is performed (0.0: no limit) */
197  SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
198  * where diving is performed (0.0: no limit) */
199  SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
200  SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
201  SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */
202  int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/
203  int maxlpiterofs, /**< additional number of allowed LP iterations */
204  unsigned int initialseed, /**< initial seed for random number generation */
205  SCIP_Bool backtrack, /**< use one level of backtracking if infeasibility is encountered? */
206  SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but
207  * more general constraint handler diving variable selection? */
208  SCIP_DIVETYPE divetypemask, /**< bit mask that represents the supported dive types by this dive set */
209  SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)) /**< method for candidate score and rounding direction */
210  )
211 {
213  const char* divesetname;
214 
215  assert(diveset != NULL);
216  assert(set != NULL);
217  assert(divesetgetscore != NULL);
218  assert(heur != NULL);
219  assert(blkmem != NULL);
220 
221  SCIP_ALLOC( BMSallocBlockMemory(blkmem, diveset) );
222  (*diveset)->blkmem = blkmem;
223 
224  /* do not allocate random number generator here; we do this in SCIPdivesetReset() */
225  (*diveset)->initialseed = initialseed;
226  (*diveset)->randnumgen = NULL;
227 
228 
229  /* for convenience, the name gets inferred from the heuristic to which the diveset is added if no name is provided */
230  divesetname = (name == NULL ? SCIPheurGetName(heur) : name);
231  SCIP_ALLOC( BMSduplicateMemoryArray(&(*diveset)->name, divesetname, strlen(divesetname)+1) );
232  (*diveset)->heur = NULL;
233 
234  /* copy callbacks */
235  (*diveset)->divesetgetscore = divesetgetscore;
236 
237  SCIP_CALL( heurAddDiveset(heur, *diveset) );
238  (*diveset)->sol = NULL;
239  (*diveset)->divetypemask = divetypemask;
240 
241  /* add collection of diving heuristic specific parameters */
242  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/minreldepth", (*diveset)->name);
243  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
244  paramname, "minimal relative depth to start diving",
245  &(*diveset)->minreldepth, TRUE, minreldepth, 0.0, 1.0, NULL, NULL) );
246 
247  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxreldepth", (*diveset)->name);
248  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem, paramname,
249  "maximal relative depth to start diving",
250  &(*diveset)->maxreldepth, TRUE, maxreldepth, 0.0, 1.0, NULL, NULL) );
251 
252  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", (*diveset)->name);
253  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
254  paramname,
255  "maximal fraction of diving LP iterations compared to node LP iterations",
256  &(*diveset)->maxlpiterquot, FALSE, maxlpiterquot, 0.0, SCIP_REAL_MAX, NULL, NULL) );
257 
258  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterofs", (*diveset)->name);
259  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem,
260  paramname,
261  "additional number of allowed LP iterations",
262  &(*diveset)->maxlpiterofs, FALSE, maxlpiterofs, 0, INT_MAX, NULL, NULL) );
263 
264  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveubquot", (*diveset)->name);
265  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
266  paramname,
267  "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)",
268  &(*diveset)->maxdiveubquot, TRUE, maxdiveubquot, 0.0, 1.0, NULL, NULL) );
269 
270  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveavgquot", (*diveset)->name);
271  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
272  paramname,
273  "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)",
274  &(*diveset)->maxdiveavgquot, TRUE, maxdiveavgquot, 0.0, SCIP_REAL_MAX, NULL, NULL) );
275 
276  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveubquotnosol", (*diveset)->name);
277  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
278  paramname,
279  "maximal UBQUOT when no solution was found yet (0.0: no limit)",
280  &(*diveset)->maxdiveubquotnosol, TRUE, maxdiveubquotnosol, 0.0, 1.0, NULL, NULL) );
281 
282  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveavgquotnosol", (*diveset)->name);
283  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem,
284  paramname,
285  "maximal AVGQUOT when no solution was found yet (0.0: no limit)",
286  &(*diveset)->maxdiveavgquotnosol, TRUE, maxdiveavgquotnosol, 0.0, SCIP_REAL_MAX, NULL, NULL) );
287 
288  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/backtrack", (*diveset)->name);
289  SCIP_CALL( SCIPsetAddBoolParam(set, messagehdlr, blkmem,
290  paramname,
291  "use one level of backtracking if infeasibility is encountered?",
292  &(*diveset)->backtrack, FALSE, backtrack, NULL, NULL) );
293 
294  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/lpresolvedomchgquot", (*diveset)->name);
295  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem, paramname,
296  "percentage of immediate domain changes during probing to trigger LP resolve",
297  &(*diveset)->lpresolvedomchgquot, FALSE, lpresolvedomchgquot, 0.0, SCIP_REAL_MAX, NULL, NULL) );
298 
299  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/lpsolvefreq", (*diveset)->name);
300  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem,
301  paramname,
302  "LP solve frequency for diving heuristics (0: only after enough domain changes have been found)",
303  &(*diveset)->lpsolvefreq, FALSE, lpsolvefreq, 0, INT_MAX,
304  NULL, NULL) );
305 
306  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/onlylpbranchcands", (*diveset)->name);
307  SCIP_CALL( SCIPsetAddBoolParam(set, messagehdlr, blkmem,
308  paramname,
309  "should only LP branching candidates be considered instead of the slower but "
310  "more general constraint handler diving variable selection?",
311  &(*diveset)->onlylpbranchcands, FALSE, onlylpbranchcands, NULL, NULL) );
312 
313  SCIP_CALL( SCIPdivesetReset(*diveset, set) );
314 
315  return SCIP_OKAY;
316 }
317 
318 /** get the heuristic to which this diving setting belongs */
320  SCIP_DIVESET* diveset /**< diving settings */
321  )
322 {
323  return diveset->heur;
324 }
325 
326 /** get the working solution of this dive set */
328  SCIP_DIVESET* diveset /**< diving settings */
329  )
330 {
331  assert(diveset != NULL);
332 
333  return diveset->sol;
334 }
335 
336 /** set the working solution for this dive set */
338  SCIP_DIVESET* diveset, /**< diving settings */
339  SCIP_SOL* sol /**< new working solution for this dive set, or NULL */
340  )
341 {
342  assert(diveset != NULL);
343 
344  diveset->sol = sol;
345 }
346 
347 /** get the name of the dive set */
348 const char* SCIPdivesetGetName(
349  SCIP_DIVESET* diveset /**< diving settings */
350  )
351 {
352  assert(diveset != NULL);
353 
354  return diveset->name;
355 }
356 
357 /** get the minimum relative depth of the diving settings */
359  SCIP_DIVESET* diveset /**< diving settings */
360  )
361 {
362  return diveset->minreldepth;
363 }
364 
365 /** get the maximum relative depth of the diving settings */
367  SCIP_DIVESET* diveset /**< diving settings */
368  )
369 {
370  return diveset->maxreldepth;
371 }
372 
373 /** get the number of successful runs of the diving settings */
375  SCIP_DIVESET* diveset /**< diving settings */
376  )
377 {
378  return 10 * diveset->nbestsolsfound + diveset->nsolsfound;
379 }
380 
381 /** get the number of calls to this dive set */
383  SCIP_DIVESET* diveset /**< diving settings */
384  )
385 {
386  assert(diveset != NULL);
387 
388  return diveset->ncalls;
389 }
390 
391 /** get the number of calls successfully terminated at a feasible leaf node */
393  SCIP_DIVESET* diveset /**< diving settings */
394  )
395 {
396  assert(diveset != NULL);
397 
398  return diveset->nsolcalls;
399 }
400 
401 /** get the minimum depth reached by this dive set */
403  SCIP_DIVESET* diveset /**< diving settings */
404  )
405 {
406  assert(diveset != NULL);
407 
408  return diveset->mindepth;
409 }
410 
411 /** get the maximum depth reached by this dive set */
413  SCIP_DIVESET* diveset /**< diving settings */
414  )
415 {
416  assert(diveset != NULL);
417 
418  return diveset->maxdepth;
419 }
420 
421 /** get the average depth this dive set reached during execution */
423  SCIP_DIVESET* diveset /**< diving settings */
424  )
425 {
426  assert(diveset != NULL);
427 
428  return (diveset->ncalls == 0 ? 0.0 : diveset->totaldepth / (SCIP_Real)diveset->ncalls);
429 }
430 
431 /** get the minimum depth at which this dive set found a solution */
433  SCIP_DIVESET* diveset /**< diving settings */
434  )
435 {
436  assert(diveset != NULL);
437 
438  return diveset->minsoldepth;
439 }
440 
441 /** get the maximum depth at which this dive set found a solution */
443  SCIP_DIVESET* diveset /**< diving settings */
444  )
445 {
446  assert(diveset != NULL);
447 
448  return diveset->maxsoldepth;
449 }
450 
451 /** get the average depth at which this dive set found a solution */
453  SCIP_DIVESET* diveset /**< diving settings */
454  )
455 {
456  assert(diveset != NULL);
457 
458  return (diveset->nsolcalls == 0 ? 0.0 : diveset->totalsoldepth / (SCIP_Real)diveset->nsolcalls);
459 }
460 
461 /** get the total number of LP iterations used by this dive set */
463  SCIP_DIVESET* diveset /**< diving settings */
464  )
465 {
466  assert(diveset != NULL);
467 
468  return diveset->nlpiterations;
469 }
470 
471 /** get the total number of probing nodes used by this dive set */
473  SCIP_DIVESET* diveset /**< diving settings */
474  )
475 {
476  assert(diveset != NULL);
477 
478  return diveset->totalnnodes;
479 }
480 
481 /** get the total number of backtracks performed by this dive set */
483  SCIP_DIVESET* diveset /**< diving settings */
484  )
485 {
486  assert(diveset != NULL);
487 
488  return diveset->totalnbacktracks;
489 }
490 
491 /** get the maximum LP iterations quotient of the diving settings */
493  SCIP_DIVESET* diveset /**< diving settings */
494  )
495 {
496  return diveset->maxlpiterquot;
497 }
498 
499 /** get the maximum LP iterations offset of the diving settings */
501  SCIP_DIVESET* diveset /**< diving settings */
502  )
503 {
504  return diveset->maxlpiterofs;
505 }
506 
507 /** get the maximum upper bound quotient parameter of the diving settings if no solution is available */
509  SCIP_DIVESET* diveset /**< diving settings */
510  )
511 {
512  return diveset->maxdiveubquotnosol;
513 }
514 
515 /** get the average quotient parameter of the diving settings if no solution is available */
517  SCIP_DIVESET* diveset /**< diving settings */
518  )
519 {
520  return diveset->maxdiveavgquotnosol;
521 }
522 /** get the maximum upper bound quotient parameter of the diving settings if an incumbent solution exists */
524  SCIP_DIVESET* diveset /**< diving settings */
525  )
526 {
527  return diveset->maxdiveubquot;
528 }
529 
530 /** get the average upper bound quotient parameter of the diving settings if an incumbent solution exists */
532  SCIP_DIVESET* diveset /**< diving settings */
533  )
534 {
535  return diveset->maxdiveavgquot;
536 }
537 
538 /** should backtracking be applied? */
540  SCIP_DIVESET* diveset /**< diving settings */
541  )
542 {
543  return diveset->backtrack;
544 }
545 
546 /** returns the LP solve frequency for diving LPs (0: dynamically based on number of intermediate domain reductions) */
548  SCIP_DIVESET* diveset /**< diving settings */
549  )
550 {
551  assert(diveset != NULL);
552 
553  return diveset->lpsolvefreq;
554 }
555 
556 /** returns the random number generator of this \p diveset for tie-breaking */
558  SCIP_DIVESET* diveset /**< diving settings */
559  )
560 {
561  assert(diveset != NULL);
562  assert(diveset->randnumgen != NULL);
563 
564  return diveset->randnumgen;
565 }
566 
567 /** returns the domain reduction quotient for triggering an immediate resolve of the diving LP (0.0: always resolve)*/
569  SCIP_DIVESET* diveset /**< diving settings */
570  )
571 {
572  assert(diveset != NULL);
573 
574  return diveset->lpresolvedomchgquot;
575 }
576 
577 /** should only LP branching candidates be considered instead of the slower but
578  * more general constraint handler diving variable selection?
579  */
581  SCIP_DIVESET* diveset /**< diving settings */
582  )
583 {
584  assert(diveset != NULL);
585 
586  return diveset->onlylpbranchcands;
587 }
588 
589 /** returns TRUE if dive set supports diving of the specified type */
591  SCIP_DIVESET* diveset, /**< diving settings */
592  SCIP_DIVETYPE divetype /**< bit mask that represents the supported dive types by this dive set */
593  )
594 {
595  assert(diveset != NULL);
596 
597  return (divetype & diveset->divetypemask);
598 }
599 
600 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
602  SCIP_DIVESET* diveset, /**< diving settings */
603  SCIP_STAT* stat, /**< global SCIP statistics */
604  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
605  )
606 {
607  diveset->nlpiterations += niterstoadd;
608  stat->ndivesetlpiterations += niterstoadd;
609  diveset->nlps++;
610  stat->ndivesetlps++;
611 }
612 
613 /** frees memory of a diveset */
614 static
616  SCIP_DIVESET** diveset /**< general diving settings */
617  )
618 {
619  assert(*diveset != NULL);
620  assert((*diveset)->name != NULL);
621  assert((*diveset)->blkmem != NULL);
622  assert((*diveset)->randnumgen != NULL);
623 
624  SCIPrandomFree(&(*diveset)->randnumgen);
625 
626  BMSfreeMemoryArray(&(*diveset)->name);
627  BMSfreeBlockMemory((*diveset)->blkmem, diveset);
628 }
629 
630 /** get the candidate score and preferred rounding direction for a candidate variable */
632  SCIP_DIVESET* diveset, /**< general diving settings */
633  SCIP_SET* set, /**< SCIP settings */
634  SCIP_DIVETYPE divetype, /**< the type of diving that should be applied */
635  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
636  SCIP_Real divecandsol, /**< LP solution value of the candidate */
637  SCIP_Real divecandfrac, /**< fractionality of the candidate */
638  SCIP_Real* candscore, /**< pointer to store the candidate score */
639  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
640  )
641 {
642  assert(diveset->divesetgetscore != NULL);
643  assert(candscore != NULL);
644  assert(roundup != NULL);
645  assert(divecand != NULL);
646  assert(divetype & diveset->divetypemask);
647 
648  SCIP_CALL( diveset->divesetgetscore(set->scip, diveset, divetype, divecand, divecandsol, divecandfrac,
649  candscore, roundup) );
650 
651  return SCIP_OKAY;
652 }
653 
654 
655 
656 /** copies the given primal heuristic to a new scip */
658  SCIP_HEUR* heur, /**< primal heuristic */
659  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
660  )
661 {
662  assert(heur != NULL);
663  assert(set != NULL);
664  assert(set->scip != NULL);
665 
666  if( heur->heurcopy != NULL )
667  {
668  SCIPsetDebugMsg(set, "including heur %s in subscip %p\n", SCIPheurGetName(heur), (void*)set->scip);
669  SCIP_CALL( heur->heurcopy(set->scip, heur) );
670  }
671 
672  return SCIP_OKAY;
673 }
674 
675 /** creates a primal heuristic */
677  SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
678  SCIP_SET* set, /**< global SCIP settings */
679  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
680  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
681  const char* name, /**< name of primal heuristic */
682  const char* desc, /**< description of primal heuristic */
683  char dispchar, /**< display character of primal heuristic */
684  int priority, /**< priority of the primal heuristic */
685  int freq, /**< frequency for calling primal heuristic */
686  int freqofs, /**< frequency offset for calling primal heuristic */
687  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
688  SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed */
689  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
690  SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
691  SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
692  SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
693  SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
694  SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
695  SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
696  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
697  SCIP_HEURDATA* heurdata /**< primal heuristic data */
698  )
699 {
701  char paramdesc[SCIP_MAXSTRLEN];
702 
703  assert(heur != NULL);
704  assert(name != NULL);
705  assert(desc != NULL);
706  assert(freq >= -1);
707  assert(freqofs >= 0);
708  assert(heurexec != NULL);
709 
710  SCIP_ALLOC( BMSallocMemory(heur) );
711  SCIP_ALLOC( BMSduplicateMemoryArray(&(*heur)->name, name, strlen(name)+1) );
712  SCIP_ALLOC( BMSduplicateMemoryArray(&(*heur)->desc, desc, strlen(desc)+1) );
713  (*heur)->dispchar = dispchar;
714  (*heur)->priority = priority;
715  (*heur)->freq = freq;
716  (*heur)->freqofs = freqofs;
717  (*heur)->maxdepth = maxdepth;
718  (*heur)->delaypos = -1;
719  (*heur)->timingmask = timingmask;
720  (*heur)->usessubscip = usessubscip;
721  (*heur)->heurcopy = heurcopy;
722  (*heur)->heurfree = heurfree;
723  (*heur)->heurinit = heurinit;
724  (*heur)->heurexit = heurexit;
725  (*heur)->heurinitsol = heurinitsol;
726  (*heur)->heurexitsol = heurexitsol;
727  (*heur)->heurexec = heurexec;
728  (*heur)->heurdata = heurdata;
729  SCIP_CALL( SCIPclockCreate(&(*heur)->setuptime, SCIP_CLOCKTYPE_DEFAULT) );
730  SCIP_CALL( SCIPclockCreate(&(*heur)->heurclock, SCIP_CLOCKTYPE_DEFAULT) );
731  (*heur)->ncalls = 0;
732  (*heur)->nsolsfound = 0;
733  (*heur)->nbestsolsfound = 0;
734  (*heur)->initialized = FALSE;
735  (*heur)->divesets = NULL;
736  (*heur)->ndivesets = 0;
737 
738  /* add parameters */
739  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/priority", name);
740  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of heuristic <%s>", name);
741  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
742  &(*heur)->priority, TRUE, priority, INT_MIN/4, INT_MAX/4,
743  paramChgdHeurPriority, (SCIP_PARAMDATA*)(*heur)) ); /*lint !e740*/
744  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freq", name);
745  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency for calling primal heuristic <%s> (-1: never, 0: only at depth freqofs)", name);
746  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
747  &(*heur)->freq, FALSE, freq, -1, SCIP_MAXTREEDEPTH, NULL, NULL) );
748  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/freqofs", name);
749  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency offset for calling primal heuristic <%s>", name);
750  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
751  &(*heur)->freqofs, FALSE, freqofs, 0, SCIP_MAXTREEDEPTH, NULL, NULL) );
752  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdepth", name);
753  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "maximal depth level to call primal heuristic <%s> (-1: no limit)", name);
754  SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
755  &(*heur)->maxdepth, TRUE, maxdepth, -1, SCIP_MAXTREEDEPTH, NULL, NULL) );
756 
757  return SCIP_OKAY;
758 }
759 
760 /** calls destructor and frees memory of primal heuristic */
762  SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
763  SCIP_SET* set /**< global SCIP settings */
764  )
765 {
766  int d;
767  assert(heur != NULL);
768  assert(*heur != NULL);
769  assert(!(*heur)->initialized);
770  assert(set != NULL);
771  assert((*heur)->divesets != NULL || (*heur)->ndivesets == 0);
772 
773  /* call destructor of primal heuristic */
774  if( (*heur)->heurfree != NULL )
775  {
776  SCIP_CALL( (*heur)->heurfree(set->scip, *heur) );
777  }
778 
779  for( d = 0; d < (*heur)->ndivesets; ++d )
780  {
781  assert((*heur)->divesets[d] != NULL);
782  divesetFree(&((*heur)->divesets[d]));
783  }
784  BMSfreeMemoryArrayNull(&(*heur)->divesets);
785  SCIPclockFree(&(*heur)->heurclock);
786  SCIPclockFree(&(*heur)->setuptime);
787  BMSfreeMemoryArray(&(*heur)->name);
788  BMSfreeMemoryArray(&(*heur)->desc);
789  BMSfreeMemory(heur);
790 
791  return SCIP_OKAY;
792 }
793 
794 /** initializes primal heuristic */
796  SCIP_HEUR* heur, /**< primal heuristic */
797  SCIP_SET* set /**< global SCIP settings */
798  )
799 {
800  int d;
801  assert(heur != NULL);
802  assert(set != NULL);
803 
804  if( heur->initialized )
805  {
806  SCIPerrorMessage("primal heuristic <%s> already initialized\n", heur->name);
807  return SCIP_INVALIDCALL;
808  }
809 
810  if( set->misc_resetstat )
811  {
812  SCIPclockReset(heur->setuptime);
813  SCIPclockReset(heur->heurclock);
814 
815  heur->delaypos = -1;
816  heur->ncalls = 0;
817  heur->nsolsfound = 0;
818  heur->nbestsolsfound = 0;
819  }
820 
821  if( heur->heurinit != NULL )
822  {
823  /* start timing */
824  SCIPclockStart(heur->setuptime, set);
825 
826  SCIP_CALL( heur->heurinit(set->scip, heur) );
827 
828  /* stop timing */
829  SCIPclockStop(heur->setuptime, set);
830  }
831 
832  /* reset dive sets */
833  for( d = 0; d < heur->ndivesets; ++d )
834  {
835  assert(heur->divesets[d] != NULL);
836  SCIP_CALL( SCIPdivesetReset(heur->divesets[d], set) );
837  }
838 
839  heur->initialized = TRUE;
840 
841  return SCIP_OKAY;
842 }
843 
844 /** calls exit method of primal heuristic */
846  SCIP_HEUR* heur, /**< primal heuristic */
847  SCIP_SET* set /**< global SCIP settings */
848  )
849 {
850  assert(heur != NULL);
851  assert(set != NULL);
852 
853  if( !heur->initialized )
854  {
855  SCIPerrorMessage("primal heuristic <%s> not initialized\n", heur->name);
856  return SCIP_INVALIDCALL;
857  }
858 
859  if( heur->heurexit != NULL )
860  {
861  /* start timing */
862  SCIPclockStart(heur->setuptime, set);
863 
864  SCIP_CALL( heur->heurexit(set->scip, heur) );
865 
866  /* stop timing */
867  SCIPclockStop(heur->setuptime, set);
868  }
869  heur->initialized = FALSE;
870 
871  return SCIP_OKAY;
872 }
873 
874 /** informs primal heuristic that the branch and bound process is being started */
876  SCIP_HEUR* heur, /**< primal heuristic */
877  SCIP_SET* set /**< global SCIP settings */
878  )
879 {
880  assert(heur != NULL);
881  assert(set != NULL);
882 
883  if( heur->delaypos != -1 )
884  {
885  heur->delaypos = -1;
886  set->heurssorted = FALSE;
887  }
888 
889  /* call solving process initialization method of primal heuristic */
890  if( heur->heurinitsol != NULL )
891  {
892  /* start timing */
893  SCIPclockStart(heur->setuptime, set);
894 
895  SCIP_CALL( heur->heurinitsol(set->scip, heur) );
896 
897  /* stop timing */
898  SCIPclockStop(heur->setuptime, set);
899  }
900 
901  return SCIP_OKAY;
902 }
903 
904 /** informs primal heuristic that the branch and bound process data is being freed */
906  SCIP_HEUR* heur, /**< primal heuristic */
907  SCIP_SET* set /**< global SCIP settings */
908  )
909 {
910  assert(heur != NULL);
911  assert(set != NULL);
912 
913  /* call solving process deinitialization method of primal heuristic */
914  if( heur->heurexitsol != NULL )
915  {
916  /* start timing */
917  SCIPclockStart(heur->setuptime, set);
918 
919  SCIP_CALL( heur->heurexitsol(set->scip, heur) );
920 
921  /* stop timing */
922  SCIPclockStop(heur->setuptime, set);
923  }
924 
925  return SCIP_OKAY;
926 }
927 
928 /** should the heuristic be executed at the given depth, frequency, timing, ... */
930  SCIP_HEUR* heur, /**< primal heuristic */
931  int depth, /**< depth of current node */
932  int lpstateforkdepth, /**< depth of the last node with solved LP */
933  SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
934  SCIP_Bool* delayed /**< pointer to store whether the heuristic should be delayed */
935  )
936 {
937  SCIP_Bool execute;
938 
941  {
942  /* heuristic may be executed before/during presolving. Do so, if it was not disabled by setting the frequency to -1 */
943  execute = heur->freq >= 0;
944  }
945  else if( (heur->timingmask & SCIP_HEURTIMING_AFTERPSEUDONODE) == 0
946  && (heurtiming == SCIP_HEURTIMING_AFTERLPNODE || heurtiming == SCIP_HEURTIMING_AFTERLPPLUNGE) )
947  {
948  /* heuristic was skipped on intermediate pseudo nodes: check, if a node matching the execution frequency lies
949  * between the current node and the last LP node of the path
950  */
951  execute = (heur->freq > 0 && depth >= heur->freqofs
952  && ((depth + heur->freq - heur->freqofs) / heur->freq
953  != (lpstateforkdepth + heur->freq - heur->freqofs) / heur->freq));
954  }
955  else
956  {
957  /* heuristic may be executed on every node: check, if the current depth matches the execution frequency and offset */
958  execute = (heur->freq > 0 && depth >= heur->freqofs && (depth - heur->freqofs) % heur->freq == 0);
959  }
960 
961  /* if frequency is zero, execute heuristic only at the depth level of the frequency offset */
962  execute = execute || (depth == heur->freqofs && heur->freq == 0);
963 
964  /* compare current depth against heuristic's maximal depth level */
965  execute = execute && (heur->maxdepth == -1 || depth <= heur->maxdepth);
966 
967  /* if the heuristic was delayed, execute it anyway */
968  execute = execute || (heur->delaypos >= 0);
969 
970  /* if the heuristic should be called after plunging but not during plunging, delay it if we are in plunging */
971  if( execute
972  && ((heurtiming == SCIP_HEURTIMING_AFTERLPNODE
973  && (heur->timingmask & SCIP_HEURTIMING_AFTERLPNODE) == 0
974  && (heur->timingmask & SCIP_HEURTIMING_AFTERLPPLUNGE) > 0)
975  || (heurtiming == SCIP_HEURTIMING_AFTERPSEUDONODE
977  && (heur->timingmask & SCIP_HEURTIMING_AFTERPSEUDOPLUNGE) > 0)) )
978  {
979  /* the heuristic should be delayed until plunging is finished */
980  execute = FALSE;
981  *delayed = TRUE;
982  }
983 
984  /* execute heuristic only if its timing mask fits the current point in the node solving process */
985  execute = execute && (heur->timingmask & heurtiming) > 0;
986 
987  return execute;
988 }
989 
990 /** calls execution method of primal heuristic */
992  SCIP_HEUR* heur, /**< primal heuristic */
993  SCIP_SET* set, /**< global SCIP settings */
994  SCIP_PRIMAL* primal, /**< primal data */
995  int depth, /**< depth of current node */
996  int lpstateforkdepth, /**< depth of the last node with solved LP */
997  SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
998  SCIP_Bool nodeinfeasible, /**< was the current node already detected to be infeasible? */
999  int* ndelayedheurs, /**< pointer to count the number of delayed heuristics */
1000  SCIP_RESULT* result /**< pointer to store the result of the callback method */
1001  )
1002 {
1003  SCIP_Bool execute;
1004  SCIP_Bool delayed;
1005 
1006  assert(heur != NULL);
1007  assert(heur->heurexec != NULL);
1008  assert(heur->freq >= -1);
1009  assert(heur->freqofs >= 0);
1010  assert(heur->maxdepth >= -1);
1011  assert(set != NULL);
1012  assert(set->scip != NULL);
1013  assert(primal != NULL);
1014  assert(depth >= 0 || heurtiming == SCIP_HEURTIMING_BEFOREPRESOL || heurtiming == SCIP_HEURTIMING_DURINGPRESOLLOOP);
1015  assert(ndelayedheurs != NULL);
1016  assert(result != NULL);
1017 
1018  *result = SCIP_DIDNOTRUN;
1019 
1020  delayed = FALSE;
1021  execute = SCIPheurShouldBeExecuted(heur, depth, lpstateforkdepth, heurtiming, &delayed);
1022 
1023  if( delayed )
1024  {
1025  assert(!execute);
1026  *result = SCIP_DELAYED;
1027  }
1028 
1029  if( execute )
1030  {
1031  SCIP_Longint oldnsolsfound;
1032  SCIP_Longint oldnbestsolsfound;
1033 
1034  SCIPsetDebugMsg(set, "executing primal heuristic <%s> in depth %d (delaypos: %d)\n", heur->name, depth, heur->delaypos);
1035 
1036  oldnsolsfound = primal->nsolsfound;
1037  oldnbestsolsfound = primal->nbestsolsfound;
1038 
1039  /* start timing */
1040  SCIPclockStart(heur->heurclock, set);
1041 
1042  /* call external method */
1043  SCIP_CALL( heur->heurexec(set->scip, heur, heurtiming, nodeinfeasible, result) );
1044 
1045  /* stop timing */
1046  SCIPclockStop(heur->heurclock, set);
1047 
1048  /* evaluate result */
1049  if( *result != SCIP_FOUNDSOL
1050  && *result != SCIP_DIDNOTFIND
1051  && *result != SCIP_DIDNOTRUN
1052  && *result != SCIP_DELAYED
1053  && *result != SCIP_UNBOUNDED )
1054  {
1055  SCIPerrorMessage("execution method of primal heuristic <%s> returned invalid result <%d>\n",
1056  heur->name, *result);
1057  return SCIP_INVALIDRESULT;
1058  }
1059  if( *result != SCIP_DIDNOTRUN && *result != SCIP_DELAYED )
1060  heur->ncalls++;
1061  heur->nsolsfound += primal->nsolsfound - oldnsolsfound;
1062  heur->nbestsolsfound += primal->nbestsolsfound - oldnbestsolsfound;
1063 
1064  /* update delay position of heuristic */
1065  if( *result != SCIP_DELAYED && heur->delaypos != -1 )
1066  {
1067  heur->delaypos = -1;
1068  set->heurssorted = FALSE;
1069  }
1070  }
1071  assert(*result == SCIP_DIDNOTRUN || *result == SCIP_DELAYED || *result == SCIP_UNBOUNDED || heur->delaypos == -1);
1072 
1073  /* check if the heuristic was (still) delayed */
1074  if( *result == SCIP_DELAYED || heur->delaypos >= 0 )
1075  {
1076  SCIPsetDebugMsg(set, "delaying execution of primal heuristic <%s> in depth %d (delaypos: %d), heur was%s delayed before, had delaypos %d\n",
1077  heur->name, depth, *ndelayedheurs, heur->delaypos >= 0 ? "" : " not", heur->delaypos);
1078 
1079  /* mark the heuristic delayed */
1080  if( heur->delaypos != *ndelayedheurs )
1081  {
1082  heur->delaypos = *ndelayedheurs;
1083  set->heurssorted = FALSE;
1084  }
1085  (*ndelayedheurs)++;
1086  }
1087 
1088  return SCIP_OKAY;
1089 }
1090 
1091 /** gets user data of primal heuristic */
1093  SCIP_HEUR* heur /**< primal heuristic */
1094  )
1095 {
1096  assert(heur != NULL);
1097 
1098  return heur->heurdata;
1099 }
1100 
1101 /** sets user data of primal heuristic; user has to free old data in advance! */
1103  SCIP_HEUR* heur, /**< primal heuristic */
1104  SCIP_HEURDATA* heurdata /**< new primal heuristic user data */
1105  )
1106 {
1107  assert(heur != NULL);
1108 
1109  heur->heurdata = heurdata;
1110 }
1111 
1112 /* new callback setter methods */
1113 
1114 /** sets copy callback of primal heuristic */
1116  SCIP_HEUR* heur, /**< primal heuristic */
1117  SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy callback of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
1118  )
1119 {
1120  assert(heur != NULL);
1121 
1122  heur->heurcopy = heurcopy;
1123 }
1124 
1125 /** sets destructor callback of primal heuristic */
1127  SCIP_HEUR* heur, /**< primal heuristic */
1128  SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
1129  )
1130 {
1131  assert(heur != NULL);
1132 
1133  heur->heurfree = heurfree;
1134 }
1135 
1136 /** sets initialization callback of primal heuristic */
1138  SCIP_HEUR* heur, /**< primal heuristic */
1139  SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
1140  )
1141 {
1142  assert(heur != NULL);
1143 
1144  heur->heurinit = heurinit;
1145 }
1146 
1147 /** sets deinitialization callback of primal heuristic */
1149  SCIP_HEUR* heur, /**< primal heuristic */
1150  SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
1151  )
1152 {
1153  assert(heur != NULL);
1154 
1155  heur->heurexit = heurexit;
1156 }
1157 
1158 /** sets solving process initialization callback of primal heuristic */
1160  SCIP_HEUR* heur, /**< primal heuristic */
1161  SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization callback of primal heuristic */
1162  )
1163 {
1164  assert(heur != NULL);
1165 
1166  heur->heurinitsol = heurinitsol;
1167 }
1168 
1169 /** sets solving process deinitialization callback of primal heuristic */
1171  SCIP_HEUR* heur, /**< primal heuristic */
1172  SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization callback of primal heuristic */
1173  )
1174 {
1175  assert(heur != NULL);
1176 
1177  heur->heurexitsol = heurexitsol;
1178 }
1179 
1180 /** gets name of primal heuristic */
1181 const char* SCIPheurGetName(
1182  SCIP_HEUR* heur /**< primal heuristic */
1183  )
1184 {
1185  assert(heur != NULL);
1186 
1187  return heur->name;
1188 }
1189 
1190 /** gets description of primal heuristic */
1191 const char* SCIPheurGetDesc(
1192  SCIP_HEUR* heur /**< primal heuristic */
1193  )
1194 {
1195  assert(heur != NULL);
1196 
1197  return heur->desc;
1198 }
1199 
1200 /** gets display character of primal heuristic */
1202  SCIP_HEUR* heur /**< primal heuristic */
1203  )
1204 {
1205  assert(heur != NULL);
1206 
1207  return heur->dispchar;
1208 }
1209 
1210 /** returns the timing mask of the heuristic */
1212  SCIP_HEUR* heur /**< primal heuristic */
1213  )
1214 {
1215  assert(heur != NULL);
1216 
1217  return heur->timingmask;
1218 }
1219 
1220 /** sets new timing mask for heuristic */
1222  SCIP_HEUR* heur, /**< primal heuristic */
1223  SCIP_HEURTIMING timingmask /**< new timing mask of heuristic */
1224  )
1225 {
1226  assert(heur != NULL);
1227 
1228  heur->timingmask = timingmask;
1229 }
1230 
1231 /** does the heuristic use a secondary SCIP instance? */
1233  SCIP_HEUR* heur /**< primal heuristic */
1234  )
1235 {
1236  assert(heur != NULL);
1237 
1238  return heur->usessubscip;
1239 }
1240 
1241 /** gets priority of primal heuristic */
1243  SCIP_HEUR* heur /**< primal heuristic */
1244  )
1245 {
1246  assert(heur != NULL);
1247 
1248  return heur->priority;
1249 }
1250 
1251 /** sets priority of primal heuristic */
1253  SCIP_HEUR* heur, /**< primal heuristic */
1254  SCIP_SET* set, /**< global SCIP settings */
1255  int priority /**< new priority of the primal heuristic */
1256  )
1257 {
1258  assert(heur != NULL);
1259  assert(set != NULL);
1260 
1261  heur->priority = priority;
1262  set->heurssorted = FALSE;
1263 }
1264 
1265 /** gets frequency of primal heuristic */
1267  SCIP_HEUR* heur /**< primal heuristic */
1268  )
1269 {
1270  assert(heur != NULL);
1271 
1272  return heur->freq;
1273 }
1274 
1275 /** sets frequency of primal heuristic */
1277  SCIP_HEUR* heur, /**< primal heuristic */
1278  int freq /**< new frequency of heuristic */
1279  )
1280 {
1281  assert(heur != NULL);
1282 
1283  heur->freq = freq;
1284 }
1285 
1286 /** gets frequency offset of primal heuristic */
1288  SCIP_HEUR* heur /**< primal heuristic */
1289  )
1290 {
1291  assert(heur != NULL);
1292 
1293  return heur->freqofs;
1294 }
1295 
1296 /** gets maximal depth level for calling primal heuristic (returns -1, if no depth limit exists) */
1298  SCIP_HEUR* heur /**< primal heuristic */
1299  )
1300 {
1301  assert(heur != NULL);
1302 
1303  return heur->maxdepth;
1304 }
1305 
1306 /** gets the number of times, the heuristic was called and tried to find a solution */
1308  SCIP_HEUR* heur /**< primal heuristic */
1309  )
1310 {
1311  assert(heur != NULL);
1312 
1313  return heur->ncalls;
1314 }
1315 
1316 /** gets the number of primal feasible solutions found by this heuristic */
1318  SCIP_HEUR* heur /**< primal heuristic */
1319  )
1320 {
1321  assert(heur != NULL);
1322 
1323  return heur->nsolsfound;
1324 }
1325 
1326 /** gets the number of new best primal feasible solutions found by this heuristic */
1328  SCIP_HEUR* heur /**< primal heuristic */
1329  )
1330 {
1331  assert(heur != NULL);
1332 
1333  return heur->nbestsolsfound;
1334 }
1335 
1336 /** is primal heuristic initialized? */
1338  SCIP_HEUR* heur /**< primal heuristic */
1339  )
1340 {
1341  assert(heur != NULL);
1342 
1343  return heur->initialized;
1344 }
1345 
1346 /** enables or disables all clocks of \p heur, depending on the value of the flag */
1348  SCIP_HEUR* heur, /**< the heuristic for which all clocks should be enabled or disabled */
1349  SCIP_Bool enable /**< should the clocks of the heuristic be enabled? */
1350  )
1351 {
1352  assert(heur != NULL);
1353 
1354  SCIPclockEnableOrDisable(heur->setuptime, enable);
1355  SCIPclockEnableOrDisable(heur->heurclock, enable);
1356 }
1357 
1358 /** gets time in seconds used in this heuristic for setting up for next stages */
1360  SCIP_HEUR* heur /**< primal heuristic */
1361  )
1362 {
1363  assert(heur != NULL);
1364 
1365  return SCIPclockGetTime(heur->setuptime);
1366 }
1367 
1368 /** gets time in seconds used in this heuristic */
1370  SCIP_HEUR* heur /**< primal heuristic */
1371  )
1372 {
1373  assert(heur != NULL);
1374 
1375  return SCIPclockGetTime(heur->heurclock);
1376 }
1377 
1378 /** returns array of divesets of this primal heuristic, or NULL if it has no divesets */
1380  SCIP_HEUR* heur /**< primal heuristic */
1381  )
1382 {
1383  assert(heur != NULL);
1384 
1385  return heur->divesets;
1386 }
1387 
1388 /** returns the number of divesets of this primal heuristic */
1390  SCIP_HEUR* heur /**< primal heuristic */
1391  )
1392 {
1393  assert(heur != NULL);
1394 
1395  return heur->ndivesets;
1396 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_Bool onlylpbranchcands
Definition: struct_heur.h:72
SCIP_HEURTIMING SCIPheurGetTimingmask(SCIP_HEUR *heur)
Definition: heur.c:1211
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition: misc.c:8693
void SCIPheurSetInitsol(SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: heur.c:1159
static SCIP_DECL_PARAMCHGD(paramChgdHeurPriority)
Definition: heur.c:71
SCIP_Longint totalnnodes
Definition: struct_heur.h:58
#define SCIP_DECL_HEURINITSOL(x)
Definition: type_heur.h:95
int SCIPdivesetGetMinSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:432
int SCIPheurGetPriority(SCIP_HEUR *heur)
Definition: heur.c:1242
SCIP_Real SCIPheurGetSetupTime(SCIP_HEUR *heur)
Definition: heur.c:1359
SCIP_RETCODE SCIPheurFree(SCIP_HEUR **heur, SCIP_SET *set)
Definition: heur.c:761
#define BMSfreeMemoryArrayNull(ptr)
Definition: memory.h:103
SCIP_RETCODE SCIPdivesetGetScore(SCIP_DIVESET *diveset, SCIP_SET *set, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup)
Definition: heur.c:631
SCIP_Longint SCIPdivesetGetNBacktracks(SCIP_DIVESET *diveset)
Definition: heur.c:482
SCIP_HEUR * heur
Definition: struct_heur.h:39
SCIP_Longint totalnbacktracks
Definition: struct_heur.h:59
SCIP_DIVESET ** divesets
Definition: struct_heur.h:94
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:661
static void divesetFree(SCIP_DIVESET **diveset)
Definition: heur.c:615
#define SCIP_MAXSTRLEN
Definition: def.h:215
int ndivesets
Definition: struct_heur.h:102
SCIP_Bool SCIPdivesetUseBacktrack(SCIP_DIVESET *diveset)
Definition: heur.c:539
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1327
internal methods for clocks and timing issues
unsigned int SCIP_HEURTIMING
Definition: type_timing.h:97
void SCIPheurSetExitsol(SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: heur.c:1170
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
SCIP_Real SCIPdivesetGetUbQuot(SCIP_DIVESET *diveset)
Definition: heur.c:523
int delaypos
Definition: struct_heur.h:101
int SCIPdivesetGetMaxLPIterOffset(SCIP_DIVESET *diveset)
Definition: heur.c:500
SCIP_Real maxreldepth
Definition: struct_heur.h:45
SCIP_Bool backtrack
Definition: struct_heur.h:71
SCIP_DIVESET ** SCIPheurGetDivesets(SCIP_HEUR *heur)
Definition: heur.c:1379
SCIP_Real SCIPdivesetGetAvgQuotNoSol(SCIP_DIVESET *diveset)
Definition: heur.c:516
static SCIP_RETCODE heurAddDiveset(SCIP_HEUR *heur, SCIP_DIVESET *diveset)
Definition: heur.c:155
SCIP_Real maxlpiterquot
Definition: struct_heur.h:46
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
#define FALSE
Definition: def.h:64
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
SCIP_Longint nsolsfound
Definition: struct_heur.h:82
SCIP_CLOCK * heurclock
Definition: struct_heur.h:96
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:9340
SCIP_RETCODE SCIPheurExec(SCIP_HEUR *heur, SCIP_SET *set, SCIP_PRIMAL *primal, int depth, int lpstateforkdepth, SCIP_HEURTIMING heurtiming, SCIP_Bool nodeinfeasible, int *ndelayedheurs, SCIP_RESULT *result)
Definition: heur.c:991
SCIP_Longint totaldepth
Definition: struct_heur.h:56
#define TRUE
Definition: def.h:63
char * name
Definition: struct_heur.h:40
#define SCIP_DECL_HEURCOPY(x)
Definition: type_heur.h:60
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_DECL_HEUREXEC(x)
Definition: type_heur.h:126
SCIP_Real SCIPdivesetGetMaxRelDepth(SCIP_DIVESET *diveset)
Definition: heur.c:366
SCIP_RETCODE SCIPheurInitsol(SCIP_HEUR *heur, SCIP_SET *set)
Definition: heur.c:875
int SCIPheurGetFreqofs(SCIP_HEUR *heur)
Definition: heur.c:1287
void SCIPheurSetPriority(SCIP_HEUR *heur, SCIP_SET *set, int priority)
Definition: heur.c:1252
SCIP_CLOCK * setuptime
Definition: struct_heur.h:95
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset)
Definition: heur.c:462
#define BMSallocMemoryArray(ptr, num)
Definition: memory.h:78
char dispchar
Definition: struct_heur.h:106
SCIP_Longint nsolsfound
Definition: struct_primal.h:39
SCIP_Bool SCIPheurUsesSubscip(SCIP_HEUR *heur)
Definition: heur.c:1232
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
SCIP_Real SCIPdivesetGetMinRelDepth(SCIP_DIVESET *diveset)
Definition: heur.c:358
internal methods for handling parameter settings
SCIP_RETCODE SCIPheurCopyInclude(SCIP_HEUR *heur, SCIP_SET *set)
Definition: heur.c:657
int SCIPdivesetGetNSolutionCalls(SCIP_DIVESET *diveset)
Definition: heur.c:392
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:250
SCIP_Real SCIPdivesetGetAvgSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:452
SCIP_RETCODE SCIPheurCreate(SCIP_HEUR **heur, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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)
Definition: heur.c:676
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1102
#define BMSfreeMemory(ptr)
Definition: memory.h:100
SCIP_Bool usessubscip
Definition: struct_heur.h:104
#define SCIP_DECL_DIVESETGETSCORE(x)
Definition: type_heur.h:147
void SCIPheurSetFreq(SCIP_HEUR *heur, int freq)
Definition: heur.c:1276
SCIP_Bool SCIPdivesetUseOnlyLPBranchcands(SCIP_DIVESET *diveset)
Definition: heur.c:580
SCIP_RETCODE SCIPdivesetReset(SCIP_DIVESET *diveset, SCIP_SET *set)
Definition: heur.c:85
internal methods for collecting primal CIP solutions and primal informations
#define SCIP_HEURTIMING_AFTERPSEUDOPLUNGE
Definition: type_timing.h:82
SCIP_Real SCIPdivesetGetMaxLPIterQuot(SCIP_DIVESET *diveset)
Definition: heur.c:492
SCIP_Real maxdiveavgquotnosol
Definition: struct_heur.h:52
void SCIPdivesetUpdateLPStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, SCIP_Longint niterstoadd)
Definition: heur.c:601
SCIP_RETCODE SCIPsetHeurPriority(SCIP *scip, SCIP_HEUR *heur, int priority)
Definition: scip.c:8177
SCIP_HEUR * SCIPdivesetGetHeur(SCIP_DIVESET *diveset)
Definition: heur.c:319
int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:442
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
Definition: misc.c:8710
SCIP_HEURTIMING timingmask
Definition: struct_heur.h:103
char * name
Definition: struct_heur.h:84
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1181
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
int SCIPheurGetMaxdepth(SCIP_HEUR *heur)
Definition: heur.c:1297
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Longint nbestsolsfound
Definition: struct_primal.h:42
int ndivesetcalls
Definition: struct_stat.h:194
#define SCIP_HEURTIMING_AFTERLPNODE
Definition: type_timing.h:73
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
int SCIPdivesetGetMaxDepth(SCIP_DIVESET *diveset)
Definition: heur.c:412
SCIP_Real SCIPdivesetGetAvgQuot(SCIP_DIVESET *diveset)
Definition: heur.c:531
SCIP_Real SCIPdivesetGetAvgDepth(SCIP_DIVESET *diveset)
Definition: heur.c:422
SCIP_SOL * sol
Definition: struct_heur.h:41
const char * SCIPheurGetDesc(SCIP_HEUR *heur)
Definition: heur.c:1191
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
void SCIPheurSetCopy(SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: heur.c:1115
#define NULL
Definition: lpi_spx1.cpp:137
SCIP_Real lpresolvedomchgquot
Definition: struct_heur.h:53
SCIP_RANDNUMGEN * randnumgen
Definition: struct_heur.h:43
SCIP_Real maxdiveubquot
Definition: struct_heur.h:47
int SCIPheurGetFreq(SCIP_HEUR *heur)
Definition: heur.c:1266
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:306
#define SCIP_HEURTIMING_DURINGPRESOLLOOP
Definition: type_timing.h:87
SCIP_Bool initialized
Definition: struct_heur.h:105
#define SCIP_HEURTIMING_BEFOREPRESOL
Definition: type_timing.h:86
SCIP_RETCODE SCIPsetAddIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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: set.c:2701
SCIP_Real SCIPdivesetGetLPResolveDomChgQuot(SCIP_DIVESET *diveset)
Definition: heur.c:568
int SCIPheurGetNDivesets(SCIP_HEUR *heur)
Definition: heur.c:1389
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1307
SCIP_Bool SCIPdivesetSupportsType(SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype)
Definition: heur.c:590
SCIP_Longint nlpiterations
Definition: struct_heur.h:54
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:98
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
#define BMSfreeBlockMemory(mem, ptr)
Definition: memory.h:419
SCIP_Longint totalsoldepth
Definition: struct_heur.h:57
datastructures for primal heuristics
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:61
SCIP_Longint ndivesetlpiterations
Definition: struct_stat.h:66
SCIP_Longint ndivesetlps
Definition: struct_stat.h:185
void SCIPdivesetUpdateStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, int depth, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavesol)
Definition: heur.c:117
SCIP_Real SCIPdivesetGetUbQuotNoSol(SCIP_DIVESET *diveset)
Definition: heur.c:508
static const char * paramname[]
Definition: lpi_msk.c:4268
SCIP_RANDNUMGEN * SCIPdivesetGetRandnumgen(SCIP_DIVESET *diveset)
Definition: heur.c:557
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
SCIP_Bool SCIPheurShouldBeExecuted(SCIP_HEUR *heur, int depth, int lpstateforkdepth, SCIP_HEURTIMING heurtiming, SCIP_Bool *delayed)
Definition: heur.c:929
SCIP_RETCODE SCIPheurInit(SCIP_HEUR *heur, SCIP_SET *set)
Definition: heur.c:795
#define MAX(x, y)
Definition: tclique_def.h:75
char * desc
Definition: struct_heur.h:85
void SCIPheurSetFree(SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: heur.c:1126
#define SCIPsetDebugMsg
Definition: set.h:1870
int priority
Definition: struct_heur.h:97
void SCIPheurEnableOrDisableClocks(SCIP_HEUR *heur, SCIP_Bool enable)
Definition: heur.c:1347
SCIP_DIVETYPE divetypemask
Definition: struct_heur.h:74
SCIP_HEURDATA * heurdata
Definition: struct_heur.h:93
unsigned int initialseed
Definition: struct_heur.h:70
#define SCIP_MAXTREEDEPTH
Definition: def.h:242
#define SCIP_REAL_MAX
Definition: def.h:136
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:716
void SCIPdivesetSetWorkSolution(SCIP_DIVESET *diveset, SCIP_SOL *sol)
Definition: heur.c:337
SCIP_Real maxdiveavgquot
Definition: struct_heur.h:49
SCIP_DECL_SORTPTRCOMP(SCIPheurComp)
Definition: heur.c:40
SCIP_Longint ncalls
Definition: struct_heur.h:81
void SCIPheurSetExit(SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: heur.c:1148
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:84
SCIP_RETCODE SCIPheurExit(SCIP_HEUR *heur, SCIP_SET *set)
Definition: heur.c:845
public methods for message output
SCIP_Longint nsolsfound
Definition: struct_heur.h:60
#define SCIP_DECL_HEURINIT(x)
Definition: type_heur.h:76
#define SCIP_HEURTIMING_AFTERPSEUDONODE
Definition: type_timing.h:76
SCIP_Longint nbestsolsfound
Definition: struct_heur.h:83
#define SCIP_Real
Definition: def.h:135
void SCIPheurSetInit(SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: heur.c:1137
#define MIN(x, y)
Definition: memory.c:75
char SCIPheurGetDispchar(SCIP_HEUR *heur)
Definition: heur.c:1201
SCIP_Longint nbestsolsfound
Definition: struct_heur.h:61
void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
Definition: heur.c:1221
#define SCIP_DECL_HEURFREE(x)
Definition: type_heur.h:68
#define BMSallocMemory(ptr)
Definition: memory.h:74
#define BMSreallocMemoryArray(ptr, num)
Definition: memory.h:82
#define SCIP_Longint
Definition: def.h:120
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1317
SCIP_Longint SCIPdivesetGetSolSuccess(SCIP_DIVESET *diveset)
Definition: heur.c:374
SCIP_Real minreldepth
Definition: struct_heur.h:44
int SCIPsetInitializeRandomSeed(SCIP_SET *set, int initialseedvalue)
Definition: set.c:6702
#define SCIP_HEURTIMING_AFTERLPPLUNGE
Definition: type_timing.h:79
int maxlpiterofs
Definition: struct_heur.h:62
#define BMSallocBlockMemory(mem, ptr)
Definition: memory.h:406
SCIP_Longint nlps
Definition: struct_heur.h:55
SCIP_Bool SCIPheurIsInitialized(SCIP_HEUR *heur)
Definition: heur.c:1337
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
SCIP_RETCODE SCIPsetAddRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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)
Definition: set.c:2749
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1092
internal methods for primal heuristics
SCIP_RETCODE SCIPheurExitsol(SCIP_HEUR *heur, SCIP_SET *set)
Definition: heur.c:905
SCIP_RETCODE SCIPdivesetCreate(SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, unsigned int initialseed, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_DIVETYPE divetypemask, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: heur.c:185
SCIP_Real SCIPheurGetTime(SCIP_HEUR *heur)
Definition: heur.c:1369
#define SCIP_ALLOC(x)
Definition: def.h:317
SCIP_RETCODE SCIPsetAddBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2679
#define SCIP_DECL_HEUREXITSOL(x)
Definition: type_heur.h:106
int SCIPdivesetGetNCalls(SCIP_DIVESET *diveset)
Definition: heur.c:382
SCIP_SOL * SCIPdivesetGetWorkSolution(SCIP_DIVESET *diveset)
Definition: heur.c:327
BMS_BLKMEM * blkmem
Definition: struct_heur.h:42
SCIP_Real maxdiveubquotnosol
Definition: struct_heur.h:51
SCIP_Longint SCIPdivesetGetNProbingNodes(SCIP_DIVESET *diveset)
Definition: heur.c:472
SCIP callable library.
int SCIPdivesetGetLPSolveFreq(SCIP_DIVESET *diveset)
Definition: heur.c:547
int maxdepth
Definition: struct_heur.h:100
SCIP_Longint totaldivesetdepth
Definition: struct_stat.h:192
const char * SCIPdivesetGetName(SCIP_DIVESET *diveset)
Definition: heur.c:348
int SCIPdivesetGetMinDepth(SCIP_DIVESET *diveset)
Definition: heur.c:402
int freqofs
Definition: struct_heur.h:99