Scippy

SCIP

Solving Constraint Integer Programs

heur_rins.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_rins.c
17  * @brief LNS heuristic that combines the incumbent with the LP optimum
18  * @author Timo Berthold
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include <assert.h>
24 #include <string.h>
25 #include "scip/scip.h"
26 #include "scip/scipdefplugins.h"
27 #include "scip/cons_linear.h"
28 #include "scip/heur_rins.h"
29 #include "scip/pub_misc.h"
30 
31 #define HEUR_NAME "rins"
32 #define HEUR_DESC "relaxation induced neighborhood search by Danna, Rothberg, and Le Pape"
33 #define HEUR_DISPCHAR 'N'
34 #define HEUR_PRIORITY -1101000
35 #define HEUR_FREQ 25
36 #define HEUR_FREQOFS 0
37 #define HEUR_MAXDEPTH -1
38 #define HEUR_TIMING SCIP_HEURTIMING_AFTERLPNODE
39 #define HEUR_USESSUBSCIP TRUE /**< does the heuristic use a secondary SCIP instance? */
40 
41 #define DEFAULT_NODESOFS 500 /* number of nodes added to the contingent of the total nodes */
42 #define DEFAULT_MAXNODES 5000 /* maximum number of nodes to regard in the subproblem */
43 #define DEFAULT_MINNODES 50 /* minimum number of nodes to regard in the subproblem */
44 #define DEFAULT_MINIMPROVE 0.01 /* factor by which RINS should at least improve the incumbent */
45 #define DEFAULT_MINFIXINGRATE 0.3 /* minimum percentage of integer variables that have to be fixed */
46 #define DEFAULT_NODESQUOT 0.1 /* subproblem nodes in relation to nodes of the original problem */
47 #define DEFAULT_LPLIMFAC 2.0 /* factor by which the limit on the number of LP depends on the node limit */
48 #define DEFAULT_NWAITINGNODES 200 /* number of nodes without incumbent change that heuristic should wait */
49 #define DEFAULT_USELPROWS FALSE /* should subproblem be created out of the rows in the LP rows,
50  * otherwise, the copy constructors of the constraints handlers are used */
51 #define DEFAULT_COPYCUTS TRUE /* if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
52  * of the original scip be copied to constraints of the subscip
53  */
54 
55 /* event handler properties */
56 #define EVENTHDLR_NAME "Rins"
57 #define EVENTHDLR_DESC "LP event handler for " HEUR_NAME " heuristic"
58 
59 /*
60  * Data structures
61  */
62 
63 /** primal heuristic data */
64 struct SCIP_HeurData
65 {
66  int nodesofs; /**< number of nodes added to the contingent of the total nodes */
67  int maxnodes; /**< maximum number of nodes to regard in the subproblem */
68  int minnodes; /**< minimum number of nodes to regard in the subproblem */
69  SCIP_Real minfixingrate; /**< minimum percentage of integer variables that have to be fixed */
70  int nwaitingnodes; /**< number of nodes without incumbent change that heuristic should wait */
71  SCIP_Real minimprove; /**< factor by which RINS should at least improve the incumbent */
72  SCIP_Real nodelimit; /**< the nodelimit employed in the current sub-SCIP, for the event handler*/
73  SCIP_Real lplimfac; /**< factor by which the limit on the number of LP depends on the node limit */
74  SCIP_Longint usednodes; /**< nodes already used by RINS in earlier calls */
75  SCIP_Real nodesquot; /**< subproblem nodes in relation to nodes of the original problem */
76  SCIP_Bool uselprows; /**< should subproblem be created out of the rows in the LP rows? */
77  SCIP_Bool copycuts; /**< if uselprows == FALSE, should all active cuts from cutpool be copied
78  * to constraints in subproblem?
79  */
80  int ncreatedsubmips; /**< counter for the number of created sub-MIPs */
81 };
82 
83 /*
84  * Local methods
85  */
86 
87 /** creates a subproblem for subscip by fixing a number of variables */
88 static
90  SCIP* scip, /**< original SCIP data structure */
91  SCIP* subscip, /**< SCIP data structure for the subproblem */
92  SCIP_VAR** subvars, /**< the variables of the subproblem */
93  SCIP_Real minfixingrate, /**< percentage of integer variables that have to be fixed */
94  SCIP_Bool uselprows, /**< should subproblem be created out of the rows in the LP rows? */
95  SCIP_Bool* success /**< pointer to store whether the problem was created successfully */
96  )
97 {
98  SCIP_SOL* bestsol; /* incumbent solution of the original problem */
99  SCIP_VAR** vars; /* original scip variables */
100  SCIP_ROW** rows; /* original scip rows */
101  SCIP_Real fixingrate;
102 
103  int nrows;
104  int nvars;
105  int nbinvars;
106  int nintvars;
107  int i;
108  int fixingcounter;
109 
110  /* get required data of the original problem */
111  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, NULL, NULL) );
112  bestsol = SCIPgetBestSol(scip);
113  assert(bestsol != NULL);
114 
115  fixingcounter = 0;
116 
117  /* change bounds of variables of the subproblem */
118  for( i = 0; i < nbinvars + nintvars; i++ )
119  {
120  SCIP_Real lpsolval;
121  SCIP_Real solval;
122 
123  /* get the current LP solution and the incumbent solution for each variable */
124  lpsolval = SCIPvarGetLPSol(vars[i]);
125  solval = SCIPgetSolVal(scip, bestsol, vars[i]);
126 
127  /* iff both solutions are equal, variable is fixed to that value in the subproblem, otherwise it is just copied */
128  if( SCIPisFeasEQ(scip, lpsolval, solval) )
129  {
130  /* perform the bound change */
131  SCIP_CALL( SCIPchgVarLbGlobal(subscip, subvars[i], solval) );
132  SCIP_CALL( SCIPchgVarUbGlobal(subscip, subvars[i], solval) );
133  fixingcounter++;
134  }
135  }
136 
137  fixingrate = 0.0;
138 
139  /* abort, if all variables were fixed */
140  if( fixingcounter == nbinvars + nintvars )
141  {
142  *success = FALSE;
143  return SCIP_OKAY;
144  }
145  else
146  fixingrate = (SCIP_Real)fixingcounter / (SCIP_Real)(MAX(nbinvars + nintvars, 1));
147 
148  /* abort, if the amount of fixed variables is insufficient */
149  if( fixingrate < minfixingrate )
150  {
151  *success = FALSE;
152  return SCIP_OKAY;
153  }
154 
155  if( uselprows )
156  {
157  /* get the rows and their number */
158  SCIP_CALL( SCIPgetLPRowsData(scip, &rows, &nrows) );
159 
160  /* copy all rows to linear constraints */
161  for( i = 0; i < nrows; i++ )
162  {
163  SCIP_CONS* cons;
164  SCIP_VAR** consvars;
165  SCIP_COL** cols;
166  SCIP_Real constant;
167  SCIP_Real lhs;
168  SCIP_Real rhs;
169  SCIP_Real* vals;
170  int nnonz;
171  int j;
172 
173  /* ignore rows that are only locally valid */
174  if( SCIProwIsLocal(rows[i]) )
175  continue;
176 
177  /* get the row's data */
178  constant = SCIProwGetConstant(rows[i]);
179  lhs = SCIProwGetLhs(rows[i]) - constant;
180  rhs = SCIProwGetRhs(rows[i]) - constant;
181  vals = SCIProwGetVals(rows[i]);
182  nnonz = SCIProwGetNNonz(rows[i]);
183  cols = SCIProwGetCols(rows[i]);
184 
185  assert( lhs <= rhs );
186 
187  /* allocate memory array to be filled with the corresponding subproblem variables */
188  SCIP_CALL( SCIPallocBufferArray(scip, &consvars, nnonz) );
189  for( j = 0; j < nnonz; j++ )
190  consvars[j] = subvars[SCIPvarGetProbindex(SCIPcolGetVar(cols[j]))];
191 
192  /* create a new linear constraint and add it to the subproblem */
193  SCIP_CALL( SCIPcreateConsLinear(subscip, &cons, SCIProwGetName(rows[i]), nnonz, consvars, vals, lhs, rhs,
194  TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE) );
195  SCIP_CALL( SCIPaddCons(subscip, cons) );
196  SCIP_CALL( SCIPreleaseCons(subscip, &cons) );
197 
198  /* free temporary memory */
199  SCIPfreeBufferArray(scip, &consvars);
200  }
201  }
202 
203  *success = TRUE;
204  return SCIP_OKAY;
205 }
206 
207 
208 /** creates a new solution for the original problem by copying the solution of the subproblem */
209 static
211  SCIP* scip, /**< original SCIP data structure */
212  SCIP* subscip, /**< SCIP structure of the subproblem */
213  SCIP_VAR** subvars, /**< the variables of the subproblem */
214  SCIP_HEUR* heur, /**< RINS heuristic structure */
215  SCIP_SOL* subsol, /**< solution of the subproblem */
216  SCIP_Bool* success /**< used to store whether new solution was found or not */
217  )
218 {
219  SCIP_VAR** vars; /* the original problem's variables */
220  int nvars;
221  SCIP_Real* subsolvals; /* solution values of the subproblem */
222  SCIP_SOL* newsol; /* solution to be created for the original problem */
223 
224  assert( scip != NULL );
225  assert( subscip != NULL );
226  assert( subvars != NULL );
227  assert( subsol != NULL );
228 
229  /* get variables' data */
230  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
231  /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
232  * since constraint copying may have required the copy of variables that are fixed in the main SCIP
233  */
234  assert(nvars <= SCIPgetNOrigVars(subscip));
235 
236  SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
237 
238  /* copy the solution */
239  SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
240 
241  /* create new solution for the original problem */
242  SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
243  SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
244 
245  /* try to add new solution to scip and free it immediately */
246  SCIP_CALL( SCIPtrySolFree(scip, &newsol, FALSE, TRUE, TRUE, TRUE, success) );
247 
248  SCIPfreeBufferArray(scip, &subsolvals);
249 
250  return SCIP_OKAY;
251 }
252 
253 /* ---------------- Callback methods of event handler ---------------- */
254 
255 /* exec the event handler
256  *
257  * we interrupt the solution process
258  */
259 static
260 SCIP_DECL_EVENTEXEC(eventExecRins)
261 {
262  SCIP_HEURDATA* heurdata;
263 
264  assert(eventhdlr != NULL);
265  assert(eventdata != NULL);
266  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
267  assert(event != NULL);
268  assert(SCIPeventGetType(event) & SCIP_EVENTTYPE_LPSOLVED);
269 
270  heurdata = (SCIP_HEURDATA*)eventdata;
271  assert(heurdata != NULL);
272 
273  /* interrupt solution process of sub-SCIP */
274  if( SCIPgetNLPs(scip) > heurdata->lplimfac * heurdata->nodelimit )
275  {
276  SCIPdebugMessage("interrupt after %" SCIP_LONGINT_FORMAT " LPs\n",SCIPgetNLPs(scip));
278  }
279 
280  return SCIP_OKAY;
281 }
282 
283 
284 /*
285  * Callback methods of primal heuristic
286  */
287 
288 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
289 static
290 SCIP_DECL_HEURCOPY(heurCopyRins)
291 { /*lint --e{715}*/
292  assert(scip != NULL);
293  assert(heur != NULL);
294  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
295 
296  /* call inclusion method of primal heuristic */
298 
299  return SCIP_OKAY;
300 }
301 
302 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
303 static
304 SCIP_DECL_HEURFREE(heurFreeRins)
305 { /*lint --e{715}*/
306  SCIP_HEURDATA* heurdata;
307 
308  assert( heur != NULL );
309  assert( scip != NULL );
310 
311  /* get heuristic data */
312  heurdata = SCIPheurGetData(heur);
313  assert( heurdata != NULL );
314 
315  /* free heuristic data */
316  SCIPfreeMemory(scip, &heurdata);
317  SCIPheurSetData(heur, NULL);
318 
319  return SCIP_OKAY;
320 }
321 
322 
323 /** initialization method of primal heuristic (called after problem was transformed) */
324 static
325 SCIP_DECL_HEURINIT(heurInitRins)
326 { /*lint --e{715}*/
327  SCIP_HEURDATA* heurdata;
328 
329  assert( heur != NULL );
330  assert( scip != NULL );
331 
332  /* get heuristic's data */
333  heurdata = SCIPheurGetData(heur);
334  assert( heurdata != NULL );
335 
336  /* initialize data */
337  heurdata->usednodes = 0;
338  heurdata->ncreatedsubmips = 0;
339 
340  return SCIP_OKAY;
341 }
342 
343 
344 /** execution method of primal heuristic */
345 static
346 SCIP_DECL_HEUREXEC(heurExecRins)
347 { /*lint --e{715}*/
348  SCIP_Longint nnodes;
349 
350  SCIP_HEURDATA* heurdata; /* heuristic's data */
351  SCIP* subscip; /* the subproblem created by RINS */
352  SCIP_VAR** vars; /* original problem's variables */
353  SCIP_VAR** subvars; /* subproblem's variables */
354  SCIP_HASHMAP* varmapfw; /* mapping of SCIP variables to sub-SCIP variables */
355  SCIP_EVENTHDLR* eventhdlr; /* event handler for LP events */
356 
357  SCIP_Real timelimit; /* timelimit for the subproblem */
358  SCIP_Real memorylimit;
359  SCIP_Real cutoff; /* objective cutoff for the subproblem */
360  SCIP_Real upperbound;
361 
362  int nvars;
363  int nbinvars;
364  int nintvars;
365  int i;
366 
367  SCIP_Bool success;
368  SCIP_RETCODE retcode;
369 
370  assert( heur != NULL );
371  assert( scip != NULL );
372  assert( result != NULL );
373  assert( SCIPhasCurrentNodeLP(scip) );
374 
375  *result = SCIP_DELAYED;
376 
377  /* do not call heuristic of node was already detected to be infeasible */
378  if( nodeinfeasible )
379  return SCIP_OKAY;
380 
381  /* get heuristic's data */
382  heurdata = SCIPheurGetData(heur);
383  assert( heurdata != NULL );
384 
385  /* only call heuristic, if an optimal LP solution and a feasible solution are at hand */
387  return SCIP_OKAY;
388 
389  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
391  return SCIP_OKAY;
392 
393  /* only call heuristic, if the best solution comes from transformed problem */
394  assert( SCIPgetBestSol(scip) != NULL );
396  return SCIP_OKAY;
397 
398  /* only call heuristic, if enough nodes were processed since last incumbent */
399  if( SCIPgetNNodes(scip) - SCIPgetSolNodenum(scip,SCIPgetBestSol(scip)) < heurdata->nwaitingnodes)
400  return SCIP_OKAY;
401 
402  *result = SCIP_DIDNOTRUN;
403 
404  /* calculate the maximal number of branching nodes until heuristic is aborted */
405  nnodes = (SCIP_Longint)(heurdata->nodesquot * SCIPgetNNodes(scip));
406 
407  /* reward RINS if it succeeded often */
408  nnodes = (SCIP_Longint)(nnodes * 3.0 * (SCIPheurGetNBestSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur) + 1.0));
409  nnodes -= (SCIP_Longint)(100.0 * heurdata->ncreatedsubmips); /* count the setup costs for the sub-MIP as 100 nodes */
410  nnodes += heurdata->nodesofs;
411 
412  /* determine the node limit for the current process */
413  nnodes -= heurdata->usednodes;
414  nnodes = MIN(nnodes, heurdata->maxnodes);
415 
416  /* check whether we have enough nodes left to call subproblem solving */
417  if( nnodes < heurdata->minnodes )
418  return SCIP_OKAY;
419 
420  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, NULL, NULL) );
421 
422  /* check whether discrete variables are available */
423  if( nbinvars == 0 && nintvars == 0 )
424  return SCIP_OKAY;
425 
426  if( SCIPisStopped(scip) )
427  return SCIP_OKAY;
428 
429  *result = SCIP_DIDNOTFIND;
430 
431  /* initializing the subproblem */
432  SCIP_CALL( SCIPallocBufferArray(scip, &subvars, nvars) );
433  SCIP_CALL( SCIPcreate(&subscip) );
434  ++heurdata->ncreatedsubmips;
435 
436  /* create the variable mapping hash map */
437  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(subscip), SCIPcalcHashtableSize(5 * nvars)) );
438 
439  eventhdlr = NULL;
440 
441  if( heurdata->uselprows )
442  {
443  char probname[SCIP_MAXSTRLEN];
444 
445  /* copy all plugins */
447 
448  /* get name of the original problem and add the string "_rinssub" */
449  (void) SCIPsnprintf(probname, SCIP_MAXSTRLEN, "%s_rinssub", SCIPgetProbName(scip));
450 
451  /* do not abort subproblem on CTRL-C */
452  SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
453 
454  /* create the subproblem */
455  SCIP_CALL( SCIPcreateProb(subscip, probname, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
456 
457  /* copy all variables */
458  SCIP_CALL( SCIPcopyVars(scip, subscip, varmapfw, NULL, TRUE) );
459  }
460  else
461  {
462  SCIP_Bool valid;
463  valid = FALSE;
464 
465  SCIP_CALL( SCIPcopy(scip, subscip, varmapfw, NULL, "rins", TRUE, FALSE, TRUE, &valid) );
466 
467  if( heurdata->copycuts )
468  {
469  /* copies all active cuts from cutpool of sourcescip to linear constraints in targetscip */
470  SCIP_CALL( SCIPcopyCuts(scip, subscip, varmapfw, NULL, TRUE, NULL) );
471  }
472 
473  SCIPdebugMessage("Copying the SCIP instance was %s complete.\n", valid ? "" : "not ");
474 
475  /* create event handler for LP events */
476  SCIP_CALL( SCIPincludeEventhdlrBasic(subscip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecRins, NULL) );
477  if( eventhdlr == NULL )
478  {
479  SCIPerrorMessage("event handler for " HEUR_NAME " heuristic not found.\n");
480  return SCIP_PLUGINNOTFOUND;
481  }
482  }
483 
484  for( i = 0; i < nvars; i++ )
485  subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
486 
487  /* free hash map */
488  SCIPhashmapFree(&varmapfw);
489 
490  success = FALSE;
491 
492  /* create a new problem, which fixes variables with same value in bestsol and LP relaxation */
493  SCIP_CALL( createSubproblem(scip, subscip, subvars, heurdata->minfixingrate, heurdata->uselprows, &success) );
494 
495  if( !success )
496  {
497  *result = SCIP_DIDNOTRUN;
498  goto TERMINATE;
499  }
500 
501  /* disable output to console */
502  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
503 
504 #ifdef SCIP_DEBUG
505  /* for debugging RINS, enable MIP output */
506  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 5) );
507  SCIP_CALL( SCIPsetIntParam(subscip, "display/freq", 100000000) );
508 #endif
509 
510  /* check whether there is enough time and memory left */
511  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
512  if( !SCIPisInfinity(scip, timelimit) )
513  timelimit -= SCIPgetSolvingTime(scip);
514  SCIP_CALL( SCIPgetRealParam(scip, "limits/memory", &memorylimit) );
515 
516  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
517  if( !SCIPisInfinity(scip, memorylimit) )
518  {
519  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
520  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
521  }
522 
523  /* abort if no time is left or not enough memory to create a copy of SCIP, including external memory usage */
524  if( timelimit <= 0.0 || memorylimit <= 2.0*SCIPgetMemExternEstim(scip)/1048576.0 )
525  goto TERMINATE;
526 
527  /* disable statistic timing inside sub SCIP */
528  SCIP_CALL( SCIPsetBoolParam(subscip, "timing/statistictiming", FALSE) );
529 
530  /* set limits for the subproblem */
531  heurdata->nodelimit = nnodes;
532  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", nnodes) );
533  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/stallnodes", MAX(10, nnodes/10)) );
534  SCIP_CALL( SCIPsetIntParam(subscip, "limits/bestsol", 3) );
535  SCIP_CALL( SCIPsetRealParam(subscip, "limits/time", timelimit) );
536  SCIP_CALL( SCIPsetRealParam(subscip, "limits/memory", memorylimit) );
537 
538  /* forbid recursive call of heuristics and separators solving subMIPs */
539  SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
540 
541  /* disable cutting plane separation */
543 
544  /* disable expensive presolving */
546 
547  /* use best estimate node selection */
548  if( SCIPfindNodesel(subscip, "estimate") != NULL && !SCIPisParamFixed(subscip, "nodeselection/estimate/stdpriority") )
549  {
550  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/estimate/stdpriority", INT_MAX/4) );
551  }
552 
553  /* use inference branching */
554  if( SCIPfindBranchrule(subscip, "inference") != NULL && !SCIPisParamFixed(subscip, "branching/inference/priority") )
555  {
556  SCIP_CALL( SCIPsetIntParam(subscip, "branching/inference/priority", INT_MAX/4) );
557  }
558 
559  /* disable conflict analysis */
560  if( !SCIPisParamFixed(subscip, "conflict/useprop") )
561  {
562  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useprop", FALSE) );
563  }
564  if( !SCIPisParamFixed(subscip, "conflict/useinflp") )
565  {
566  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useinflp", FALSE) );
567  }
568  if( !SCIPisParamFixed(subscip, "conflict/useboundlp") )
569  {
570  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useboundlp", FALSE) );
571  }
572  if( !SCIPisParamFixed(subscip, "conflict/usesb") )
573  {
574  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/usesb", FALSE) );
575  }
576  if( !SCIPisParamFixed(subscip, "conflict/usepseudo") )
577  {
578  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/usepseudo", FALSE) );
579  }
580 
581  /* employ a limit on the number of enforcement rounds in the quadratic constraint handler; this fixes the issue that
582  * sometimes the quadratic constraint handler needs hundreds or thousands of enforcement rounds to determine the
583  * feasibility status of a single node without fractional branching candidates by separation (namely for uflquad
584  * instances); however, the solution status of the sub-SCIP might get corrupted by this; hence no deductions shall be
585  * made for the original SCIP
586  */
587  if( SCIPfindConshdlr(subscip, "quadratic") != NULL && !SCIPisParamFixed(subscip, "constraints/quadratic/enfolplimit") )
588  {
589  SCIP_CALL( SCIPsetIntParam(subscip, "constraints/quadratic/enfolplimit", 500) );
590  }
591 
592  /* add an objective cutoff */
593  cutoff = SCIPinfinity(scip);
595 
596  upperbound = SCIPgetUpperbound(scip) - SCIPsumepsilon(scip);
597  if( !SCIPisInfinity(scip, -1.0 * SCIPgetLowerbound(scip)) )
598  {
599  cutoff = (1 - heurdata->minimprove) * SCIPgetUpperbound(scip) + heurdata->minimprove * SCIPgetLowerbound(scip);
600  }
601  else
602  {
603  if( SCIPgetUpperbound(scip) >= 0 )
604  cutoff = (1 - heurdata->minimprove) * SCIPgetUpperbound(scip);
605  else
606  cutoff = (1 + heurdata->minimprove) * SCIPgetUpperbound(scip);
607  }
608  cutoff = MIN(upperbound, cutoff);
609  SCIP_CALL( SCIPsetObjlimit(subscip, cutoff) );
610 
611  /* catch LP events of sub-SCIP */
612  if( !heurdata->uselprows )
613  {
614  assert(eventhdlr != NULL);
615 
616  SCIP_CALL( SCIPtransformProb(subscip) );
617  SCIP_CALL( SCIPcatchEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, NULL) );
618  }
619 
620  /* solve the subproblem */
621  retcode = SCIPsolve(subscip);
622 
623  /* drop LP events of sub-SCIP */
624  if( !heurdata->uselprows )
625  {
626  assert(eventhdlr != NULL);
627 
628  SCIP_CALL( SCIPdropEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, -1) );
629  }
630 
631  /* Errors in solving the subproblem should not kill the overall solving process
632  * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
633  */
634  if( retcode != SCIP_OKAY )
635  {
636 #ifndef NDEBUG
637  SCIP_CALL( retcode );
638 #endif
639  SCIPwarningMessage(scip, "Error while solving subproblem in RINS heuristic; sub-SCIP terminated with code <%d>\n",retcode);
640  }
641  else
642  {
643  /* we try to merge variable statistics with those of our main SCIP */
644  SCIP_CALL( SCIPmergeVariableStatistics(subscip, scip, subvars, vars, nvars) );
645  }
646 
647  /* print solving statistics of subproblem if we are in SCIP's debug mode */
649 
650  heurdata->usednodes += SCIPgetNNodes(subscip);
651 
652  /* check, whether a solution was found */
653  if( SCIPgetNSols(subscip) > 0 )
654  {
655  SCIP_SOL** subsols;
656  int nsubsols;
657 
658  /* check, whether a solution was found;
659  * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
660  */
661  nsubsols = SCIPgetNSols(subscip);
662  subsols = SCIPgetSols(subscip);
663  success = FALSE;
664  for( i = 0; i < nsubsols && !success; ++i )
665  {
666  SCIP_CALL( createNewSol(scip, subscip, subvars, heur, subsols[i], &success) );
667  }
668  if( success )
669  *result = SCIP_FOUNDSOL;
670  }
671 
672  TERMINATE:
673  /* free subproblem */
674  SCIPfreeBufferArray(scip, &subvars);
675  SCIP_CALL( SCIPfree(&subscip) );
676 
677  return SCIP_OKAY;
678 }
679 
680 /*
681  * primal heuristic specific interface methods
682  */
683 
684 /** creates the RINS primal heuristic and includes it in SCIP */
686  SCIP* scip /**< SCIP data structure */
687  )
688 {
689  SCIP_HEURDATA* heurdata;
690  SCIP_HEUR* heur;
691 
692  /* create Rins primal heuristic data */
693  SCIP_CALL( SCIPallocMemory(scip, &heurdata) );
694 
695  /* include primal heuristic */
696  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
698  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecRins, heurdata) );
699 
700  assert(heur != NULL);
701 
702  /* set non-NULL pointers to callback methods */
703  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyRins) );
704  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeRins) );
705  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitRins) );
706 
707  /* add RINS primal heuristic parameters */
708  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/nodesofs",
709  "number of nodes added to the contingent of the total nodes",
710  &heurdata->nodesofs, FALSE, DEFAULT_NODESOFS, 0, INT_MAX, NULL, NULL) );
711 
712  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/maxnodes",
713  "maximum number of nodes to regard in the subproblem",
714  &heurdata->maxnodes, TRUE, DEFAULT_MAXNODES, 0, INT_MAX, NULL, NULL) );
715 
716  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/minnodes",
717  "minimum number of nodes required to start the subproblem",
718  &heurdata->minnodes, TRUE, DEFAULT_MINNODES, 0, INT_MAX, NULL, NULL) );
719 
720  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/nodesquot",
721  "contingent of sub problem nodes in relation to the number of nodes of the original problem",
722  &heurdata->nodesquot, FALSE, DEFAULT_NODESQUOT, 0.0, 1.0, NULL, NULL) );
723 
724  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/nwaitingnodes",
725  "number of nodes without incumbent change that heuristic should wait",
726  &heurdata->nwaitingnodes, TRUE, DEFAULT_NWAITINGNODES, 0, INT_MAX, NULL, NULL) );
727 
728  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/minimprove",
729  "factor by which " HEUR_NAME " should at least improve the incumbent",
730  &heurdata->minimprove, TRUE, DEFAULT_MINIMPROVE, 0.0, 1.0, NULL, NULL) );
731 
732  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/minfixingrate",
733  "minimum percentage of integer variables that have to be fixed",
734  &heurdata->minfixingrate, FALSE, DEFAULT_MINFIXINGRATE, 0.0, 1.0, NULL, NULL) );
735 
736  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/lplimfac",
737  "factor by which the limit on the number of LP depends on the node limit",
738  &heurdata->lplimfac, TRUE, DEFAULT_LPLIMFAC, 1.0, SCIP_REAL_MAX, NULL, NULL) );
739 
740  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/uselprows",
741  "should subproblem be created out of the rows in the LP rows?",
742  &heurdata->uselprows, TRUE, DEFAULT_USELPROWS, NULL, NULL) );
743 
744  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/copycuts",
745  "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
746  &heurdata->copycuts, TRUE, DEFAULT_COPYCUTS, NULL, NULL) );
747 
748  return SCIP_OKAY;
749 }
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40329
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:5878
#define SCIPallocMemory(scip, ptr)
Definition: scip.h:20526
#define SCIP_EVENTTYPE_LPSOLVED
Definition: type_event.h:78
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:41648
static SCIP_DECL_HEUREXEC(heurExecRins)
Definition: heur_rins.c:346
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1147
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1273
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:7297
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1248
#define SCIP_MAXSTRLEN
Definition: def.h:201
#define HEUR_PRIORITY
Definition: heur_rins.c:34
#define NULL
Definition: lpi_spx.cpp:130
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1125
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
Definition: lp.c:18915
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
Definition: lp.c:18861
#define DEFAULT_MINNODES
Definition: heur_rins.c:43
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
#define FALSE
Definition: def.h:56
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:41009
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2057
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4046
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:7778
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:8174
#define TRUE
Definition: def.h:55
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_CALL(x)
Definition: def.h:266
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36299
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:4109
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
#define HEUR_FREQ
Definition: heur_rins.c:35
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
SCIP_RETCODE SCIPincludeHeurRins(SCIP *scip)
Definition: heur_rins.c:685
#define EVENTHDLR_NAME
Definition: heur_rins.c:56
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2116
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:18881
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:24949
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:26482
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:38393
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2883
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:35668
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_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
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:11138
#define SCIPfreeMemory(scip, ptr)
Definition: scip.h:20542
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
Definition: heur_rins.c:210
#define DEFAULT_MINIMPROVE
Definition: heur_rins.c:44
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:15442
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3254
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:20049
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
Definition: lp.c:18925
#define HEUR_USESSUBSCIP
Definition: heur_rins.c:39
#define DEFAULT_USELPROWS
Definition: heur_rins.c:49
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip.c:2260
static SCIP_RETCODE createSubproblem(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_Real minfixingrate, SCIP_Bool uselprows, SCIP_Bool *success)
Definition: heur_rins.c:89
int SCIPcalcHashtableSize(int minsize)
Definition: misc.c:1157
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34002
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:41353
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41907
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:19024
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:146
#define DEFAULT_MAXNODES
Definition: heur_rins.c:42
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2075
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4457
SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
Definition: scip.c:9019
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:26750
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:35020
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:41637
#define DEFAULT_LPLIMFAC
Definition: heur_rins.c:47
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:26354
static SCIP_DECL_HEURCOPY(heurCopyRins)
Definition: heur_rins.c:290
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:766
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:35717
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:37435
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:18974
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:12623
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1068
#define DEFAULT_MINFIXINGRATE
Definition: heur_rins.c:45
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:38534
#define HEUR_TIMING
Definition: heur_rins.c:38
#define HEUR_MAXDEPTH
Definition: heur_rins.c:37
public data structures and miscellaneous methods
#define DEFAULT_NODESOFS
Definition: heur_rins.c:41
#define SCIP_Bool
Definition: def.h:53
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35279
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4001
#define HEUR_DESC
Definition: heur_rins.c:32
#define HEUR_NAME
Definition: heur_rins.c:31
#define DEFAULT_NWAITINGNODES
Definition: heur_rins.c:48
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:3709
LNS heuristic that combines the incumbent with the LP optimum.
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:4382
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global)
Definition: scip.c:2179
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:41396
static SCIP_DECL_EVENTEXEC(eventExecRins)
Definition: heur_rins.c:260
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4431
Constraint handler for linear constraints in their most general form, .
static SCIP_DECL_HEURINIT(heurInitRins)
Definition: heur_rins.c:325
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2179
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 SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:17431
#define SCIP_REAL_MAX
Definition: def.h:128
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:11477
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:14503
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1293
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:20585
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:692
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:36588
#define HEUR_DISPCHAR
Definition: heur_rins.c:33
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
Definition: lp.c:18871
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:278
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:7313
int SCIPvarGetProbindex(SCIP_VAR *var)
Definition: var.c:16750
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:8436
#define SCIP_Real
Definition: def.h:127
#define HEUR_FREQOFS
Definition: heur_rins.c:36
#define MIN(x, y)
Definition: memory.c:67
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:19972
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:10194
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:9941
#define SCIP_Longint
Definition: def.h:112
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
Definition: event.c:917
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:34885
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:3938
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:18836
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1058
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:10572
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:20597
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:3797
#define SCIPdebug(x)
Definition: pub_message.h:74
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:8124
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:18685
#define DEFAULT_COPYCUTS
Definition: heur_rins.c:51
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:35767
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.c:3629
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:41132
static SCIP_DECL_HEURFREE(heurFreeRins)
Definition: heur_rins.c:304
default SCIP plugins
#define DEFAULT_NODESQUOT
Definition: heur_rins.c:46
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:37372
SCIP callable library.
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:36554
#define EVENTHDLR_DESC
Definition: heur_rins.c:57
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:41409