Scippy

SCIP

Solving Constraint Integer Programs

cutsel_hybrid.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-2023 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file cutsel_hybrid.c
26  * @ingroup DEFPLUGINS_CUTSEL
27  * @brief hybrid cut selector
28  * @author Leona Gottwald
29  * @author Felipe Serrano
30  * @author Mark Turner
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <assert.h>
36 
37 #include "scip/scip_cutsel.h"
38 #include "scip/scip_cut.h"
39 #include "scip/scip_lp.h"
40 #include "scip/scip_randnumgen.h"
41 #include "scip/cutsel_hybrid.h"
42 
43 
44 #define CUTSEL_NAME "hybrid"
45 #define CUTSEL_DESC "weighted sum of efficacy, dircutoffdist, objparal, and intsupport"
46 #define CUTSEL_PRIORITY 8000
47 
48 #define RANDSEED 0x5EED
49 #define GOODSCORE 0.9
50 #define BADSCORE 0.0
51 
52 #define DEFAULT_EFFICACYWEIGHT 1.0 /**< weight of efficacy in score calculation */
53 #define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0 /**< weight of directed cutoff distance in score calculation */
54 #define DEFAULT_OBJPARALWEIGHT 0.1 /**< weight of objective parallelism in score calculation */
55 #define DEFAULT_INTSUPPORTWEIGHT 0.1 /**< weight of integral support in cut score calculation */
56 #define DEFAULT_MINORTHO 0.90 /**< minimal orthogonality for a cut to enter the LP */
57 #define DEFAULT_MINORTHOROOT 0.90 /**< minimal orthogonality for a cut to enter the LP in the root node */
58 
59 /*
60  * Data structures
61  */
62 
63 /** cut selector data */
64 struct SCIP_CutselData
65 {
66  SCIP_RANDNUMGEN* randnumgen; /**< random generator for tiebreaking */
67  SCIP_Real goodscore; /**< threshold for score of cut relative to best score to be considered good,
68  * so that less strict filtering is applied */
69  SCIP_Real badscore; /**< threshold for score of cut relative to best score to be discarded */
70  SCIP_Real objparalweight; /**< weight of objective parallelism in cut score calculation */
71  SCIP_Real efficacyweight; /**< weight of efficacy in cut score calculation */
72  SCIP_Real dircutoffdistweight;/**< weight of directed cutoff distance in cut score calculation */
73  SCIP_Real intsupportweight; /**< weight of integral support in cut score calculation */
74  SCIP_Real minortho; /**< minimal orthogonality for a cut to enter the LP */
75  SCIP_Real minorthoroot; /**< minimal orthogonality for a cut to enter the LP in the root node */
76 };
77 
78 
79 /*
80  * Local methods
81  */
82 
83 /** returns the maximum score of cuts; if scores is not NULL, then stores the individual score of each cut in scores */
84 static
86  SCIP* scip, /**< SCIP data structure */
87  SCIP_ROW** cuts, /**< array with cuts to score */
88  SCIP_RANDNUMGEN* randnumgen, /**< random number generator for tie-breaking, or NULL */
89  SCIP_Real dircutoffdistweight,/**< weight of directed cutoff distance in cut score calculation */
90  SCIP_Real efficacyweight, /**< weight of efficacy in cut score calculation */
91  SCIP_Real objparalweight, /**< weight of objective parallelism in cut score calculation */
92  SCIP_Real intsupportweight, /**< weight of integral support in cut score calculation */
93  int ncuts, /**< number of cuts in cuts array */
94  SCIP_Real* scores /**< array to store the score of cuts or NULL */
95  )
96 {
97  SCIP_Real maxscore = 0.0;
98  SCIP_SOL* sol;
99  int i;
100 
101  sol = SCIPgetBestSol(scip);
102 
103  /* if there is an incumbent and the factor is not 0.0, compute directed cutoff distances for the incumbent */
104  if( sol != NULL && dircutoffdistweight > 0.0 )
105  {
106  for( i = 0; i < ncuts; ++i )
107  {
108  SCIP_Real score;
109  SCIP_Real objparallelism;
110  SCIP_Real intsupport;
111  SCIP_Real efficacy;
112 
113  if( intsupportweight > 0.0 )
114  intsupport = intsupportweight * SCIPgetRowNumIntCols(scip, cuts[i]) / (SCIP_Real) SCIProwGetNNonz(cuts[i]);
115  else
116  intsupport = 0.0;
117 
118  if( objparalweight > 0.0 )
119  objparallelism = objparalweight * SCIPgetRowObjParallelism(scip, cuts[i]);
120  else
121  objparallelism = 0.0;
122 
123  efficacy = SCIPgetCutEfficacy(scip, NULL, cuts[i]);
124 
125  if( SCIProwIsLocal(cuts[i]) )
126  {
127  score = dircutoffdistweight * efficacy;
128  }
129  else
130  {
131  score = SCIPgetCutLPSolCutoffDistance(scip, sol, cuts[i]);
132  score = dircutoffdistweight * MAX(score, efficacy);
133  }
134 
135  efficacy *= efficacyweight;
136  score += objparallelism + intsupport + efficacy;
137 
138  /* add small term to prefer global pool cuts */
139  if( SCIProwIsInGlobalCutpool(cuts[i]) )
140  score += 1e-4;
141 
142  if( randnumgen != NULL )
143  {
144  score += SCIPrandomGetReal(randnumgen, 0.0, 1e-6);
145  }
146 
147  maxscore = MAX(maxscore, score);
148 
149  if( scores != NULL )
150  scores[i] = score;
151  }
152  }
153  else
154  {
155  /* in case there is no solution add the directed cutoff distance weight to the efficacy weight
156  * since the efficacy underestimates the directed cuttoff distance
157  */
158  efficacyweight += dircutoffdistweight;
159  for( i = 0; i < ncuts; ++i )
160  {
161  SCIP_Real score;
162  SCIP_Real objparallelism;
163  SCIP_Real intsupport;
164  SCIP_Real efficacy;
165 
166  if( intsupportweight > 0.0 )
167  intsupport = intsupportweight * SCIPgetRowNumIntCols(scip, cuts[i]) / (SCIP_Real) SCIProwGetNNonz(cuts[i]);
168  else
169  intsupport = 0.0;
170 
171  if( objparalweight > 0.0 )
172  objparallelism = objparalweight * SCIPgetRowObjParallelism(scip, cuts[i]);
173  else
174  objparallelism = 0.0;
175 
176  efficacy = efficacyweight > 0.0 ? efficacyweight * SCIPgetCutEfficacy(scip, NULL, cuts[i]) : 0.0;
177 
178  score = objparallelism + intsupport + efficacy;
179 
180  /* add small term to prefer global pool cuts */
181  if( SCIProwIsInGlobalCutpool(cuts[i]) )
182  score += 1e-4;
183 
184  if( randnumgen != NULL )
185  {
186  score += SCIPrandomGetReal(randnumgen, 0.0, 1e-6);
187  }
188 
189  maxscore = MAX(maxscore, score);
190 
191  if( scores != NULL )
192  scores[i] = score;
193  }
194  }
195  return maxscore;
196 }
197 
198 
199 /** move the cut with the highest score to the first position in the array; there must be at least one cut */
200 static
202  SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
203  SCIP_Real* scores, /**< array with scores of cuts to perform selection algorithm */
204  int ncuts /**< number of cuts in given array */
205  )
206 {
207  int i;
208  int bestpos;
209  SCIP_Real bestscore;
210 
211  assert(ncuts > 0);
212  assert(cuts != NULL);
213  assert(scores != NULL);
214 
215  bestscore = scores[0];
216  bestpos = 0;
217 
218  for( i = 1; i < ncuts; ++i )
219  {
220  if( scores[i] > bestscore )
221  {
222  bestpos = i;
223  bestscore = scores[i];
224  }
225  }
226 
227  SCIPswapPointers((void**) &cuts[bestpos], (void**) &cuts[0]);
228  SCIPswapReals(&scores[bestpos], &scores[0]);
229 }
230 
231 /** filters the given array of cuts to enforce a maximum parallelism constraint
232  * w.r.t the given cut; moves filtered cuts to the end of the array and returns number of selected cuts */
233 static
235  SCIP_ROW* cut, /**< cut to filter orthogonality with */
236  SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
237  SCIP_Real* scores, /**< array with scores of cuts to perform selection algorithm */
238  int ncuts, /**< number of cuts in given array */
239  SCIP_Real goodscore, /**< threshold for the score to be considered a good cut */
240  SCIP_Real goodmaxparall, /**< maximal parallelism for good cuts */
241  SCIP_Real maxparall /**< maximal parallelism for all cuts that are not good */
242  )
243 {
244  int i;
245 
246  assert( cut != NULL );
247  assert( ncuts == 0 || cuts != NULL );
248  assert( ncuts == 0 || scores != NULL );
249 
250  for( i = ncuts - 1; i >= 0; --i )
251  {
252  SCIP_Real thisparall;
253  SCIP_Real thismaxparall;
254 
255  thisparall = SCIProwGetParallelism(cut, cuts[i], 'e');
256  thismaxparall = scores[i] >= goodscore ? goodmaxparall : maxparall;
257 
258  if( thisparall > thismaxparall )
259  {
260  --ncuts;
261  SCIPswapPointers((void**) &cuts[i], (void**) &cuts[ncuts]);
262  SCIPswapReals(&scores[i], &scores[ncuts]);
263  }
264  }
265 
266  return ncuts;
267 }
268 
269 
270 /*
271  * Callback methods of cut selector
272  */
273 
274 
275 /** copy method for cut selector plugin (called when SCIP copies plugins) */
276 static
277 SCIP_DECL_CUTSELCOPY(cutselCopyHybrid)
278 { /*lint --e{715}*/
279  assert(scip != NULL);
280  assert(cutsel != NULL);
281  assert(strcmp(SCIPcutselGetName(cutsel), CUTSEL_NAME) == 0);
282 
283  /* call inclusion method of cut selector */
285 
286  return SCIP_OKAY;
287 }
288 
289 /** destructor of cut selector to free user data (called when SCIP is exiting) */
290 /**! [SnippetCutselFreeHybrid] */
291 static
292 SCIP_DECL_CUTSELFREE(cutselFreeHybrid)
293 { /*lint --e{715}*/
294  SCIP_CUTSELDATA* cutseldata;
295 
296  cutseldata = SCIPcutselGetData(cutsel);
297 
298  SCIPfreeBlockMemory(scip, &cutseldata);
299 
300  SCIPcutselSetData(cutsel, NULL);
301 
302  return SCIP_OKAY;
303 }
304 /**! [SnippetCutselFreeHybrid] */
305 
306 /** initialization method of cut selector (called after problem was transformed) */
307 static
308 SCIP_DECL_CUTSELINIT(cutselInitHybrid)
309 { /*lint --e{715}*/
310  SCIP_CUTSELDATA* cutseldata;
311 
312  cutseldata = SCIPcutselGetData(cutsel);
313  assert(cutseldata != NULL);
314 
315  SCIP_CALL( SCIPcreateRandom(scip, &(cutseldata)->randnumgen, RANDSEED, TRUE) );
316 
317  return SCIP_OKAY;
318 }
319 
320 /** deinitialization method of cut selector (called before transformed problem is freed) */
321 static
322 SCIP_DECL_CUTSELEXIT(cutselExitHybrid)
323 { /*lint --e{715}*/
324  SCIP_CUTSELDATA* cutseldata;
325 
326  cutseldata = SCIPcutselGetData(cutsel);
327  assert(cutseldata != NULL);
328  assert(cutseldata->randnumgen != NULL);
329 
330  SCIPfreeRandom(scip, &cutseldata->randnumgen);
331 
332  return SCIP_OKAY;
333 }
334 
335 /** cut selection method of cut selector */
336 static
337 SCIP_DECL_CUTSELSELECT(cutselSelectHybrid)
338 { /*lint --e{715}*/
339  SCIP_CUTSELDATA* cutseldata;
340  SCIP_Real goodmaxparall;
341  SCIP_Real maxparall;
342 
343  assert(cutsel != NULL);
344  assert(result != NULL);
345 
346  *result = SCIP_SUCCESS;
347 
348  cutseldata = SCIPcutselGetData(cutsel);
349  assert(cutseldata != NULL);
350 
351  if( root )
352  {
353  maxparall = 1.0 - cutseldata->minorthoroot;
354  goodmaxparall = MAX(0.5, 1.0 - cutseldata->minorthoroot);
355  }
356  else
357  {
358  maxparall = 1.0 - cutseldata->minortho;
359  goodmaxparall = MAX(0.5, 1.0 - cutseldata->minortho);
360  }
361 
362  SCIP_CALL( SCIPselectCutsHybrid(scip, cuts, forcedcuts, cutseldata->randnumgen, cutseldata->goodscore, cutseldata->badscore,
363  goodmaxparall, maxparall, cutseldata->dircutoffdistweight, cutseldata->efficacyweight,
364  cutseldata->objparalweight, cutseldata->intsupportweight, ncuts, nforcedcuts, maxnselectedcuts, nselectedcuts) );
365 
366  return SCIP_OKAY;
367 }
368 
369 
370 /*
371  * cut selector specific interface methods
372  */
373 
374 /** creates the hybrid cut selector and includes it in SCIP */
376  SCIP* scip /**< SCIP data structure */
377  )
378 {
379  SCIP_CUTSELDATA* cutseldata;
380  SCIP_CUTSEL* cutsel;
381 
382  /* create hybrid cut selector data */
383  SCIP_CALL( SCIPallocBlockMemory(scip, &cutseldata) );
384  BMSclearMemory(cutseldata);
385  cutseldata->goodscore = GOODSCORE;
386  cutseldata->badscore = BADSCORE;
387 
388  SCIP_CALL( SCIPincludeCutselBasic(scip, &cutsel, CUTSEL_NAME, CUTSEL_DESC, CUTSEL_PRIORITY, cutselSelectHybrid,
389  cutseldata) );
390 
391  assert(cutsel != NULL);
392 
393  /* set non fundamental callbacks via setter functions */
394  SCIP_CALL( SCIPsetCutselCopy(scip, cutsel, cutselCopyHybrid) );
395 
396  SCIP_CALL( SCIPsetCutselFree(scip, cutsel, cutselFreeHybrid) );
397  SCIP_CALL( SCIPsetCutselInit(scip, cutsel, cutselInitHybrid) );
398  SCIP_CALL( SCIPsetCutselExit(scip, cutsel, cutselExitHybrid) );
399 
400  /* add hybrid cut selector parameters */
402  "cutselection/" CUTSEL_NAME "/efficacyweight",
403  "weight of efficacy in cut score calculation",
404  &cutseldata->efficacyweight, FALSE, DEFAULT_EFFICACYWEIGHT, 0.0, SCIP_INVALID/10.0, NULL, NULL) );
405 
407  "cutselection/" CUTSEL_NAME "/dircutoffdistweight",
408  "weight of directed cutoff distance in cut score calculation",
409  &cutseldata->dircutoffdistweight, FALSE, DEFAULT_DIRCUTOFFDISTWEIGHT, 0.0, SCIP_INVALID/10.0, NULL, NULL) );
410 
412  "cutselection/" CUTSEL_NAME "/objparalweight",
413  "weight of objective parallelism in cut score calculation",
414  &cutseldata->objparalweight, FALSE, DEFAULT_OBJPARALWEIGHT, 0.0, SCIP_INVALID/10.0, NULL, NULL) );
415 
417  "cutselection/" CUTSEL_NAME "/intsupportweight",
418  "weight of integral support in cut score calculation",
419  &cutseldata->intsupportweight, FALSE, DEFAULT_INTSUPPORTWEIGHT, 0.0, SCIP_INVALID/10.0, NULL, NULL) );
420 
422  "cutselection/" CUTSEL_NAME "/minortho",
423  "minimal orthogonality for a cut to enter the LP",
424  &cutseldata->minortho, FALSE, DEFAULT_MINORTHO, 0.0, 1.0, NULL, NULL) );
425 
427  "cutselection/" CUTSEL_NAME "/minorthoroot",
428  "minimal orthogonality for a cut to enter the LP in the root node",
429  &cutseldata->minorthoroot, FALSE, DEFAULT_MINORTHOROOT, 0.0, 1.0, NULL, NULL) );
430 
431  return SCIP_OKAY;
432 }
433 
434 
435 /** perform a cut selection algorithm for the given array of cuts
436  *
437  * This is the selection method of the hybrid cut selector which uses a weighted sum of the
438  * efficacy, parallelism, directed cutoff distance, and the integral support.
439  * The input cuts array gets resorted s.t the selected cuts come first and the remaining
440  * ones are the end.
441  */
443  SCIP* scip, /**< SCIP data structure */
444  SCIP_ROW** cuts, /**< array with cuts to perform selection algorithm */
445  SCIP_ROW** forcedcuts, /**< array with forced cuts */
446  SCIP_RANDNUMGEN* randnumgen, /**< random number generator for tie-breaking, or NULL */
447  SCIP_Real goodscorefac, /**< factor of best score among the given cuts to consider a cut good
448  * and filter with less strict settings of the maximum parallelism */
449  SCIP_Real badscorefac, /**< factor of best score among the given cuts to consider a cut bad
450  * and discard it regardless of its parallelism to other cuts */
451  SCIP_Real goodmaxparall, /**< maximum parallelism for good cuts */
452  SCIP_Real maxparall, /**< maximum parallelism for non-good cuts */
453  SCIP_Real dircutoffdistweight,/**< weight of directed cutoff distance in cut score calculation */
454  SCIP_Real efficacyweight, /**< weight of efficacy in cut score calculation */
455  SCIP_Real objparalweight, /**< weight of objective parallelism in cut score calculation */
456  SCIP_Real intsupportweight, /**< weight of integral support in cut score calculation */
457  int ncuts, /**< number of cuts in cuts array */
458  int nforcedcuts, /**< number of forced cuts */
459  int maxselectedcuts, /**< maximal number of cuts from cuts array to select */
460  int* nselectedcuts /**< pointer to return number of selected cuts from cuts array */
461  )
462 {
463  SCIP_Real* scores;
464  SCIP_Real* scoresptr;
465  SCIP_Real maxforcedscores;
466  SCIP_Real maxnonforcedscores;
467  SCIP_Real goodscore;
468  SCIP_Real badscore;
469  int i;
470 
471  assert(cuts != NULL && ncuts > 0);
472  assert(forcedcuts != NULL || nforcedcuts == 0);
473  assert(nselectedcuts != NULL);
474 
475  *nselectedcuts = 0;
476 
477  SCIP_CALL( SCIPallocBufferArray(scip, &scores, ncuts) );
478 
479  /* compute scores of cuts and max score of cuts and forced cuts (used to define goodscore) */
480  maxforcedscores = scoring(scip, forcedcuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, nforcedcuts, NULL);
481  maxnonforcedscores = scoring(scip, cuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, ncuts, scores);
482 
483  goodscore = MAX(maxforcedscores, maxnonforcedscores);
484 
485  /* compute values for filtering cuts */
486  badscore = goodscore * badscorefac;
487  goodscore *= goodscorefac;
488 
489  /* perform cut selection algorithm for the cuts */
490 
491  /* forced cuts are going to be selected so use them to filter cuts */
492  for( i = 0; i < nforcedcuts && ncuts > 0; ++i )
493  {
494  ncuts = filterWithParallelism(forcedcuts[i], cuts, scores, ncuts, goodscore, goodmaxparall, maxparall);
495  }
496 
497  /* now greedily select the remaining cuts */
498  scoresptr = scores;
499  while( ncuts > 0 )
500  {
501  SCIP_ROW* selectedcut;
502 
503  selectBestCut(cuts, scores, ncuts);
504  selectedcut = cuts[0];
505 
506  /* if the best cut of the remaining cuts is considered bad, we discard it and all remaining cuts */
507  if( scores[0] < badscore )
508  break;
509 
510  ++(*nselectedcuts);
511 
512  /* if the maximal number of cuts was selected, we can stop here */
513  if( *nselectedcuts == maxselectedcuts )
514  break;
515 
516  /* move the pointers to the next position and filter the remaining cuts to enforce the maximum parallelism constraint */
517  ++cuts;
518  ++scores;
519  --ncuts;
520 
521  ncuts = filterWithParallelism(selectedcut, cuts, scores, ncuts, goodscore, goodmaxparall, maxparall);
522  }
523 
524  SCIPfreeBufferArray(scip, &scoresptr);
525 
526  return SCIP_OKAY;
527 }
SCIP_RETCODE SCIPsetCutselExit(SCIP *scip, SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELEXIT((*cutselexit)))
Definition: scip_cutsel.c:173
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
const char * SCIPcutselGetName(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:159
#define DEFAULT_EFFICACYWEIGHT
Definition: cutsel_hybrid.c:52
SCIP_CUTSELDATA * SCIPcutselGetData(SCIP_CUTSEL *cutsel)
Definition: cutsel.c:418
struct SCIP_CutselData SCIP_CUTSELDATA
Definition: type_cutsel.h:53
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:17216
#define CUTSEL_NAME
Definition: cutsel_hybrid.c:44
hybrid cut selector
void SCIPswapPointers(void **pointer1, void **pointer2)
Definition: misc.c:10307
#define DEFAULT_MINORTHO
Definition: cutsel_hybrid.c:56
#define FALSE
Definition: def.h:96
#define TRUE
Definition: def.h:95
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
static SCIP_DECL_CUTSELINIT(cutselInitHybrid)
SCIP_Real SCIPgetCutLPSolCutoffDistance(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip_cut.c:72
static void selectBestCut(SCIP_ROW **cuts, SCIP_Real *scores, int ncuts)
void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
Definition: misc.c:10294
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:108
#define RANDSEED
Definition: cutsel_hybrid.c:48
void SCIPcutselSetData(SCIP_CUTSEL *cutsel, SCIP_CUTSELDATA *cutseldata)
Definition: cutsel.c:428
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:136
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:89
#define BADSCORE
Definition: cutsel_hybrid.c:50
static SCIP_DECL_CUTSELCOPY(cutselCopyHybrid)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:17404
SCIP_RETCODE SCIPsetCutselCopy(SCIP *scip, SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELCOPY((*cutselcopy)))
Definition: scip_cutsel.c:125
static SCIP_DECL_CUTSELFREE(cutselFreeHybrid)
static int filterWithParallelism(SCIP_ROW *cut, SCIP_ROW **cuts, SCIP_Real *scores, int ncuts, SCIP_Real goodscore, SCIP_Real goodmaxparall, SCIP_Real maxparall)
#define NULL
Definition: lpi_spx1.cpp:164
static SCIP_DECL_CUTSELEXIT(cutselExitHybrid)
SCIP_RETCODE SCIPincludeCutselHybrid(SCIP *scip)
#define SCIP_CALL(x)
Definition: def.h:394
static SCIP_Real scoring(SCIP *scip, SCIP_ROW **cuts, SCIP_RANDNUMGEN *randnumgen, SCIP_Real dircutoffdistweight, SCIP_Real efficacyweight, SCIP_Real objparalweight, SCIP_Real intsupportweight, int ncuts, SCIP_Real *scores)
Definition: cutsel_hybrid.c:85
#define DEFAULT_INTSUPPORTWEIGHT
Definition: cutsel_hybrid.c:55
#define CUTSEL_PRIORITY
Definition: cutsel_hybrid.c:46
static SCIP_DECL_CUTSELSELECT(cutselSelectHybrid)
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
SCIP_RETCODE SCIPsetCutselInit(SCIP *scip, SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELINIT((*cutselinit)))
Definition: scip_cutsel.c:157
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:124
SCIP_Real SCIPgetRowObjParallelism(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:2187
#define DEFAULT_MINORTHOROOT
Definition: cutsel_hybrid.c:57
public methods for cut selector plugins
SCIP_RETCODE SCIPselectCutsHybrid(SCIP *scip, SCIP_ROW **cuts, SCIP_ROW **forcedcuts, SCIP_RANDNUMGEN *randnumgen, SCIP_Real goodscorefac, SCIP_Real badscorefac, SCIP_Real goodmaxparall, SCIP_Real maxparall, SCIP_Real dircutoffdistweight, SCIP_Real efficacyweight, SCIP_Real objparalweight, SCIP_Real intsupportweight, int ncuts, int nforcedcuts, int maxselectedcuts, int *nselectedcuts)
#define CUTSEL_DESC
Definition: cutsel_hybrid.c:45
int SCIPgetRowNumIntCols(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1883
#define MAX(x, y)
Definition: tclique_def.h:92
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip_cut.c:94
public methods for cuts and aggregation rows
#define BMSclearMemory(ptr)
Definition: memory.h:131
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:10041
public methods for the LP relaxation, rows and columns
SCIP_Real SCIProwGetParallelism(SCIP_ROW *row1, SCIP_ROW *row2, char orthofunc)
Definition: lp.c:7728
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip_sol.c:2313
#define GOODSCORE
Definition: cutsel_hybrid.c:49
public methods for random numbers
#define SCIP_Real
Definition: def.h:186
#define SCIP_INVALID
Definition: def.h:206
SCIP_RETCODE SCIPsetCutselFree(SCIP *scip, SCIP_CUTSEL *cutsel, SCIP_DECL_CUTSELFREE((*cutselfree)))
Definition: scip_cutsel.c:141
#define DEFAULT_DIRCUTOFFDISTWEIGHT
Definition: cutsel_hybrid.c:53
#define DEFAULT_OBJPARALWEIGHT
Definition: cutsel_hybrid.c:54
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:139
SCIP_Bool SCIProwIsInGlobalCutpool(SCIP_ROW *row)
Definition: lp.c:17494
SCIP_RETCODE SCIPincludeCutselBasic(SCIP *scip, SCIP_CUTSEL **cutsel, const char *name, const char *desc, int priority, SCIP_DECL_CUTSELSELECT((*cutselselect)), SCIP_CUTSELDATA *cutseldata)
Definition: scip_cutsel.c:92