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-2014 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 };
81 
82 /*
83  * Local methods
84  */
85 
86 /** creates a subproblem for subscip by fixing a number of variables */
87 static
89  SCIP* scip, /**< original SCIP data structure */
90  SCIP* subscip, /**< SCIP data structure for the subproblem */
91  SCIP_VAR** subvars, /**< the variables of the subproblem */
92  SCIP_Real minfixingrate, /**< percentage of integer variables that have to be fixed */
93  SCIP_Bool uselprows, /**< should subproblem be created out of the rows in the LP rows? */
94  SCIP_Bool* success /**< pointer to store whether the problem was created successfully */
95  )
96 {
97  SCIP_SOL* bestsol; /* incumbent solution of the original problem */
98  SCIP_VAR** vars; /* original scip variables */
99  SCIP_ROW** rows; /* original scip rows */
100  SCIP_Real fixingrate;
101 
102  int nrows;
103  int nvars;
104  int nbinvars;
105  int nintvars;
106  int i;
107  int fixingcounter;
108 
109  /* get required data of the original problem */
110  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, NULL, NULL) );
111  bestsol = SCIPgetBestSol(scip);
112  assert(bestsol != NULL);
113 
114  fixingcounter = 0;
115 
116  /* change bounds of variables of the subproblem */
117  for( i = 0; i < nbinvars + nintvars; i++ )
118  {
119  SCIP_Real lpsolval;
120  SCIP_Real solval;
121 
122  /* get the current LP solution and the incumbent solution for each variable */
123  lpsolval = SCIPvarGetLPSol(vars[i]);
124  solval = SCIPgetSolVal(scip, bestsol, vars[i]);
125 
126  /* iff both solutions are equal, variable is fixed to that value in the subproblem, otherwise it is just copied */
127  if( SCIPisFeasEQ(scip, lpsolval, solval) )
128  {
129  /* perform the bound change */
130  SCIP_CALL( SCIPchgVarLbGlobal(subscip, subvars[i], solval) );
131  SCIP_CALL( SCIPchgVarUbGlobal(subscip, subvars[i], solval) );
132  fixingcounter++;
133  }
134  }
135 
136  fixingrate = 0.0;
137 
138  /* abort, if all variables were fixed */
139  if( fixingcounter == nbinvars + nintvars )
140  {
141  *success = FALSE;
142  return SCIP_OKAY;
143  }
144  else
145  fixingrate = (SCIP_Real)fixingcounter / (SCIP_Real)(MAX(nbinvars + nintvars, 1));
146 
147  /* abort, if the amount of fixed variables is insufficient */
148  if( fixingrate < minfixingrate )
149  {
150  *success = FALSE;
151  return SCIP_OKAY;
152  }
153 
154  if( uselprows )
155  {
156  /* get the rows and their number */
157  SCIP_CALL( SCIPgetLPRowsData(scip, &rows, &nrows) );
158 
159  /* copy all rows to linear constraints */
160  for( i = 0; i < nrows; i++ )
161  {
162  SCIP_CONS* cons;
163  SCIP_VAR** consvars;
164  SCIP_COL** cols;
165  SCIP_Real constant;
166  SCIP_Real lhs;
167  SCIP_Real rhs;
168  SCIP_Real* vals;
169  int nnonz;
170  int j;
171 
172  /* ignore rows that are only locally valid */
173  if( SCIProwIsLocal(rows[i]) )
174  continue;
175 
176  /* get the row's data */
177  constant = SCIProwGetConstant(rows[i]);
178  lhs = SCIProwGetLhs(rows[i]) - constant;
179  rhs = SCIProwGetRhs(rows[i]) - constant;
180  vals = SCIProwGetVals(rows[i]);
181  nnonz = SCIProwGetNNonz(rows[i]);
182  cols = SCIProwGetCols(rows[i]);
183 
184  assert( lhs <= rhs );
185 
186  /* allocate memory array to be filled with the corresponding subproblem variables */
187  SCIP_CALL( SCIPallocBufferArray(scip, &consvars, nnonz) );
188  for( j = 0; j < nnonz; j++ )
189  consvars[j] = subvars[SCIPvarGetProbindex(SCIPcolGetVar(cols[j]))];
190 
191  /* create a new linear constraint and add it to the subproblem */
192  SCIP_CALL( SCIPcreateConsLinear(subscip, &cons, SCIProwGetName(rows[i]), nnonz, consvars, vals, lhs, rhs,
193  TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE) );
194  SCIP_CALL( SCIPaddCons(subscip, cons) );
195  SCIP_CALL( SCIPreleaseCons(subscip, &cons) );
196 
197  /* free temporary memory */
198  SCIPfreeBufferArray(scip, &consvars);
199  }
200  }
201 
202  *success = TRUE;
203  return SCIP_OKAY;
204 }
205 
206 
207 /** creates a new solution for the original problem by copying the solution of the subproblem */
208 static
210  SCIP* scip, /**< original SCIP data structure */
211  SCIP* subscip, /**< SCIP structure of the subproblem */
212  SCIP_VAR** subvars, /**< the variables of the subproblem */
213  SCIP_HEUR* heur, /**< RINS heuristic structure */
214  SCIP_SOL* subsol, /**< solution of the subproblem */
215  SCIP_Bool* success /**< used to store whether new solution was found or not */
216 )
217 {
218  SCIP_VAR** vars; /* the original problem's variables */
219  int nvars;
220  SCIP_Real* subsolvals; /* solution values of the subproblem */
221  SCIP_SOL* newsol; /* solution to be created for the original problem */
222 
223  assert( scip != NULL );
224  assert( subscip != NULL );
225  assert( subvars != NULL );
226  assert( subsol != NULL );
227 
228  /* get variables' data */
229  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
230  /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
231  * since constraint copying may have required the copy of variables that are fixed in the main SCIP
232  */
233  assert(nvars <= SCIPgetNOrigVars(subscip));
234 
235  SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
236 
237  /* copy the solution */
238  SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
239 
240  /* create new solution for the original problem */
241  SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
242  SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
243 
244  /* try to add new solution to scip and free it immediately */
245  SCIP_CALL( SCIPtrySolFree(scip, &newsol, FALSE, TRUE, TRUE, TRUE, success) );
246 
247  SCIPfreeBufferArray(scip, &subsolvals);
248 
249  return SCIP_OKAY;
250 }
251 
252 /* ---------------- Callback methods of event handler ---------------- */
253 
254 /* exec the event handler
255  *
256  * we interrupt the solution process
257  */
258 static
259 SCIP_DECL_EVENTEXEC(eventExecRins)
260 {
261  SCIP_HEURDATA* heurdata;
262 
263  assert(eventhdlr != NULL);
264  assert(eventdata != NULL);
265  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
266  assert(event != NULL);
267  assert(SCIPeventGetType(event) & SCIP_EVENTTYPE_LPSOLVED);
268 
269  heurdata = (SCIP_HEURDATA*)eventdata;
270  assert(heurdata != NULL);
271 
272  /* interrupt solution process of sub-SCIP */
273  if( SCIPgetNLPs(scip) > heurdata->lplimfac * heurdata->nodelimit )
274  {
275  SCIPdebugMessage("interrupt after %"SCIP_LONGINT_FORMAT" LPs\n",SCIPgetNLPs(scip));
276  SCIP_CALL( SCIPinterruptSolve(scip) );
277  }
278 
279  return SCIP_OKAY;
280 }
281 
282 
283 /*
284  * Callback methods of primal heuristic
285  */
286 
287 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
288 static
289 SCIP_DECL_HEURCOPY(heurCopyRins)
290 { /*lint --e{715}*/
291  assert(scip != NULL);
292  assert(heur != NULL);
293  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
294 
295  /* call inclusion method of primal heuristic */
297 
298  return SCIP_OKAY;
299 }
300 
301 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
302 static
303 SCIP_DECL_HEURFREE(heurFreeRins)
304 { /*lint --e{715}*/
305  SCIP_HEURDATA* heurdata;
306 
307  assert( heur != NULL );
308  assert( scip != NULL );
309 
310  /* get heuristic data */
311  heurdata = SCIPheurGetData(heur);
312  assert( heurdata != NULL );
313 
314  /* free heuristic data */
315  SCIPfreeMemory(scip, &heurdata);
316  SCIPheurSetData(heur, NULL);
317 
318  return SCIP_OKAY;
319 }
320 
321 
322 /** initialization method of primal heuristic (called after problem was transformed) */
323 static
324 SCIP_DECL_HEURINIT(heurInitRins)
325 { /*lint --e{715}*/
326  SCIP_HEURDATA* heurdata;
327 
328  assert( heur != NULL );
329  assert( scip != NULL );
330 
331  /* get heuristic's data */
332  heurdata = SCIPheurGetData(heur);
333  assert( heurdata != NULL );
334 
335  /* initialize data */
336  heurdata->usednodes = 0;
337 
338  return SCIP_OKAY;
339 }
340 
341 
342 /** execution method of primal heuristic */
343 static
344 SCIP_DECL_HEUREXEC(heurExecRins)
345 { /*lint --e{715}*/
346  SCIP_Longint nnodes;
347 
348  SCIP_HEURDATA* heurdata; /* heuristic's data */
349  SCIP* subscip; /* the subproblem created by RINS */
350  SCIP_VAR** vars; /* original problem's variables */
351  SCIP_VAR** subvars; /* subproblem's variables */
352  SCIP_HASHMAP* varmapfw; /* mapping of SCIP variables to sub-SCIP variables */
353  SCIP_EVENTHDLR* eventhdlr; /* event handler for LP events */
354 
355  SCIP_Real timelimit; /* timelimit for the subproblem */
356  SCIP_Real memorylimit;
357  SCIP_Real cutoff; /* objective cutoff for the subproblem */
358  SCIP_Real upperbound;
359 
360  int nvars;
361  int nbinvars;
362  int nintvars;
363  int i;
364 
365  SCIP_Bool success;
366  SCIP_RETCODE retcode;
367 
368  assert( heur != NULL );
369  assert( scip != NULL );
370  assert( result != NULL );
371  assert( SCIPhasCurrentNodeLP(scip) );
372 
373  *result = SCIP_DELAYED;
374 
375  /* do not call heuristic of node was already detected to be infeasible */
376  if( nodeinfeasible )
377  return SCIP_OKAY;
378 
379  /* get heuristic's data */
380  heurdata = SCIPheurGetData(heur);
381  assert( heurdata != NULL );
382 
383  /* only call heuristic, if an optimal LP solution and a feasible solution are at hand */
384  if( SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL || SCIPgetNSols(scip) <= 0 )
385  return SCIP_OKAY;
386 
387  /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
388  if( SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)) )
389  return SCIP_OKAY;
390 
391  /* only call heuristic, if the best solution comes from transformed problem */
392  assert( SCIPgetBestSol(scip) != NULL );
393  if( SCIPsolIsOriginal(SCIPgetBestSol(scip)) )
394  return SCIP_OKAY;
395 
396  /* only call heuristic, if enough nodes were processed since last incumbent */
397  if( SCIPgetNNodes(scip) - SCIPgetSolNodenum(scip,SCIPgetBestSol(scip)) < heurdata->nwaitingnodes)
398  return SCIP_OKAY;
399 
400  *result = SCIP_DIDNOTRUN;
401 
402  /* calculate the maximal number of branching nodes until heuristic is aborted */
403  nnodes = (SCIP_Longint)(heurdata->nodesquot * SCIPgetNNodes(scip));
404 
405  /* reward RINS if it succeeded often */
406  nnodes = (SCIP_Longint)(nnodes * 3.0 * (SCIPheurGetNBestSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur) + 1.0));
407  nnodes -= 100 * SCIPheurGetNCalls(heur); /* count the setup costs for the sub-MIP as 100 nodes */
408  nnodes += heurdata->nodesofs;
409 
410  /* determine the node limit for the current process */
411  nnodes -= heurdata->usednodes;
412  nnodes = MIN(nnodes, heurdata->maxnodes);
413 
414  /* check whether we have enough nodes left to call subproblem solving */
415  if( nnodes < heurdata->minnodes )
416  return SCIP_OKAY;
417 
418  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, NULL, NULL) );
419 
420  /* check whether discrete variables are available */
421  if( nbinvars == 0 && nintvars == 0 )
422  return SCIP_OKAY;
423 
424  if( SCIPisStopped(scip) )
425  return SCIP_OKAY;
426 
427  *result = SCIP_DIDNOTFIND;
428 
429  /* initializing the subproblem */
430  SCIP_CALL( SCIPallocBufferArray(scip, &subvars, nvars) );
431  SCIP_CALL( SCIPcreate(&subscip) );
432 
433  /* create the variable mapping hash map */
434  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(subscip), SCIPcalcHashtableSize(5 * nvars)) );
435 
436  eventhdlr = NULL;
437 
438  if( heurdata->uselprows )
439  {
440  char probname[SCIP_MAXSTRLEN];
441 
442  /* copy all plugins */
444 
445  /* get name of the original problem and add the string "_rinssub" */
446  (void) SCIPsnprintf(probname, SCIP_MAXSTRLEN, "%s_rinssub", SCIPgetProbName(scip));
447 
448  /* do not abort subproblem on CTRL-C */
449  SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
450 
451  /* create the subproblem */
452  SCIP_CALL( SCIPcreateProb(subscip, probname, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
453 
454  /* copy all variables */
455  SCIP_CALL( SCIPcopyVars(scip, subscip, varmapfw, NULL, TRUE) );
456  }
457  else
458  {
459  SCIP_Bool valid;
460  valid = FALSE;
461 
462  SCIP_CALL( SCIPcopy(scip, subscip, varmapfw, NULL, "rins", TRUE, FALSE, TRUE, &valid) );
463 
464  if( heurdata->copycuts )
465  {
466  /* copies all active cuts from cutpool of sourcescip to linear constraints in targetscip */
467  SCIP_CALL( SCIPcopyCuts(scip, subscip, varmapfw, NULL, TRUE, NULL) );
468  }
469 
470  SCIPdebugMessage("Copying the SCIP instance was %s complete.\n", valid ? "" : "not ");
471 
472  /* create event handler for LP events */
473  SCIP_CALL( SCIPincludeEventhdlrBasic(subscip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecRins, NULL) );
474  if( eventhdlr == NULL )
475  {
476  SCIPerrorMessage("event handler for "HEUR_NAME" heuristic not found.\n");
477  return SCIP_PLUGINNOTFOUND;
478  }
479  }
480 
481  for( i = 0; i < nvars; i++ )
482  subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
483 
484  /* free hash map */
485  SCIPhashmapFree(&varmapfw);
486 
487  success = FALSE;
488 
489  /* create a new problem, which fixes variables with same value in bestsol and LP relaxation */
490  SCIP_CALL( createSubproblem(scip, subscip, subvars, heurdata->minfixingrate, heurdata->uselprows, &success) );
491 
492  if( !success )
493  {
494  *result = SCIP_DIDNOTRUN;
495  goto TERMINATE;
496  }
497 
498  /* disable output to console */
499  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
500 
501 #ifdef SCIP_DEBUG
502  /* for debugging RINS, enable MIP output */
503  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 5) );
504  SCIP_CALL( SCIPsetIntParam(subscip, "display/freq", 100000000) );
505 #endif
506 
507  /* check whether there is enough time and memory left */
508  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
509  if( !SCIPisInfinity(scip, timelimit) )
510  timelimit -= SCIPgetSolvingTime(scip);
511  SCIP_CALL( SCIPgetRealParam(scip, "limits/memory", &memorylimit) );
512 
513  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
514  if( !SCIPisInfinity(scip, memorylimit) )
515  {
516  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
517  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
518  }
519 
520  /* abort if no time is left or not enough memory to create a copy of SCIP, including external memory usage */
521  if( timelimit <= 0.0 || memorylimit <= 2.0*SCIPgetMemExternEstim(scip)/1048576.0 )
522  goto TERMINATE;
523 
524  /* disable statistic timing inside sub SCIP */
525  SCIP_CALL( SCIPsetBoolParam(subscip, "timing/statistictiming", FALSE) );
526 
527  /* set limits for the subproblem */
528  heurdata->nodelimit = nnodes;
529  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", nnodes) );
530  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/stallnodes", MAX(10, nnodes/10)) );
531  SCIP_CALL( SCIPsetIntParam(subscip, "limits/bestsol", 3) );
532  SCIP_CALL( SCIPsetRealParam(subscip, "limits/time", timelimit) );
533  SCIP_CALL( SCIPsetRealParam(subscip, "limits/memory", memorylimit) );
534 
535  /* forbid recursive call of heuristics and separators solving subMIPs */
536  SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
537 
538  /* disable cutting plane separation */
540 
541  /* disable expensive presolving */
543 
544  /* use best estimate node selection */
545  if( SCIPfindNodesel(subscip, "estimate") != NULL && !SCIPisParamFixed(subscip, "nodeselection/estimate/stdpriority") )
546  {
547  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/estimate/stdpriority", INT_MAX/4) );
548  }
549 
550  /* use inference branching */
551  if( SCIPfindBranchrule(subscip, "inference") != NULL && !SCIPisParamFixed(subscip, "branching/inference/priority") )
552  {
553  SCIP_CALL( SCIPsetIntParam(subscip, "branching/inference/priority", INT_MAX/4) );
554  }
555 
556  /* disable conflict analysis */
557  if( !SCIPisParamFixed(subscip, "conflict/useprop") )
558  {
559  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useprop", FALSE) );
560  }
561  if( !SCIPisParamFixed(subscip, "conflict/useinflp") )
562  {
563  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useinflp", FALSE) );
564  }
565  if( !SCIPisParamFixed(subscip, "conflict/useboundlp") )
566  {
567  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/useboundlp", FALSE) );
568  }
569  if( !SCIPisParamFixed(subscip, "conflict/usesb") )
570  {
571  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/usesb", FALSE) );
572  }
573  if( !SCIPisParamFixed(subscip, "conflict/usepseudo") )
574  {
575  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/usepseudo", FALSE) );
576  }
577 
578  /* employ a limit on the number of enforcement rounds in the quadratic constraint handler; this fixes the issue that
579  * sometimes the quadratic constraint handler needs hundreds or thousands of enforcement rounds to determine the
580  * feasibility status of a single node without fractional branching candidates by separation (namely for uflquad
581  * instances); however, the solution status of the sub-SCIP might get corrupted by this; hence no deductions shall be
582  * made for the original SCIP
583  */
584  if( SCIPfindConshdlr(subscip, "quadratic") != NULL && !SCIPisParamFixed(subscip, "constraints/quadratic/enfolplimit") )
585  {
586  SCIP_CALL( SCIPsetIntParam(subscip, "constraints/quadratic/enfolplimit", 500) );
587  }
588 
589  /* add an objective cutoff */
590  cutoff = SCIPinfinity(scip);
591  assert( !SCIPisInfinity(scip,SCIPgetUpperbound(scip)) );
592 
593  upperbound = SCIPgetUpperbound(scip) - SCIPsumepsilon(scip);
594  if( !SCIPisInfinity(scip,-1.0*SCIPgetLowerbound(scip)) )
595  {
596  cutoff = (1-heurdata->minimprove)*SCIPgetUpperbound(scip) + heurdata->minimprove*SCIPgetLowerbound(scip);
597  }
598  else
599  {
600  if( SCIPgetUpperbound ( scip ) >= 0 )
601  cutoff = ( 1 - heurdata->minimprove ) * SCIPgetUpperbound ( scip );
602  else
603  cutoff = ( 1 + heurdata->minimprove ) * SCIPgetUpperbound ( scip );
604  }
605  cutoff = MIN(upperbound, cutoff );
606  SCIP_CALL( SCIPsetObjlimit(subscip, cutoff) );
607 
608  /* catch LP events of sub-SCIP */
609  if( !heurdata->uselprows )
610  {
611  assert(eventhdlr != NULL);
612 
613  SCIP_CALL( SCIPtransformProb(subscip) );
614  SCIP_CALL( SCIPcatchEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, NULL) );
615  }
616 
617  /* solve the subproblem */
618  retcode = SCIPsolve(subscip);
619 
620  /* drop LP events of sub-SCIP */
621  if( !heurdata->uselprows )
622  {
623  assert(eventhdlr != NULL);
624 
625  SCIP_CALL( SCIPdropEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, -1) );
626  }
627 
628  /* Errors in solving the subproblem should not kill the overall solving process
629  * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
630  */
631  if( retcode != SCIP_OKAY )
632  {
633 #ifndef NDEBUG
634  SCIP_CALL( retcode );
635 #endif
636  SCIPwarningMessage(scip, "Error while solving subproblem in RINS heuristic; sub-SCIP terminated with code <%d>\n",retcode);
637  }
638 
639  /* print solving statistics of subproblem if we are in SCIP's debug mode */
641 
642  heurdata->usednodes += SCIPgetNNodes(subscip);
643 
644  /* check, whether a solution was found */
645  if( SCIPgetNSols(subscip) > 0 )
646  {
647  SCIP_SOL** subsols;
648  int nsubsols;
649 
650  /* check, whether a solution was found;
651  * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
652  */
653  nsubsols = SCIPgetNSols(subscip);
654  subsols = SCIPgetSols(subscip);
655  success = FALSE;
656  for( i = 0; i < nsubsols && !success; ++i )
657  {
658  SCIP_CALL( createNewSol(scip, subscip, subvars, heur, subsols[i], &success) );
659  }
660  if( success )
661  *result = SCIP_FOUNDSOL;
662  }
663 
664  TERMINATE:
665  /* free subproblem */
666  SCIPfreeBufferArray(scip, &subvars);
667  SCIP_CALL( SCIPfree(&subscip) );
668 
669  return SCIP_OKAY;
670 }
671 
672 /*
673  * primal heuristic specific interface methods
674  */
675 
676 /** creates the RINS primal heuristic and includes it in SCIP */
678  SCIP* scip /**< SCIP data structure */
679  )
680 {
681  SCIP_HEURDATA* heurdata;
682  SCIP_HEUR* heur;
683 
684  /* create Rins primal heuristic data */
685  SCIP_CALL( SCIPallocMemory(scip, &heurdata) );
686 
687  /* include primal heuristic */
688  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
690  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecRins, heurdata) );
691 
692  assert(heur != NULL);
693 
694  /* set non-NULL pointers to callback methods */
695  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyRins) );
696  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeRins) );
697  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitRins) );
698 
699  /* add RINS primal heuristic parameters */
700  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/nodesofs",
701  "number of nodes added to the contingent of the total nodes",
702  &heurdata->nodesofs, FALSE, DEFAULT_NODESOFS, 0, INT_MAX, NULL, NULL) );
703 
704  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/maxnodes",
705  "maximum number of nodes to regard in the subproblem",
706  &heurdata->maxnodes, TRUE, DEFAULT_MAXNODES, 0, INT_MAX, NULL, NULL) );
707 
708  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/minnodes",
709  "minimum number of nodes required to start the subproblem",
710  &heurdata->minnodes, TRUE, DEFAULT_MINNODES, 0, INT_MAX, NULL, NULL) );
711 
712  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/nodesquot",
713  "contingent of sub problem nodes in relation to the number of nodes of the original problem",
714  &heurdata->nodesquot, FALSE, DEFAULT_NODESQUOT, 0.0, 1.0, NULL, NULL) );
715 
716  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/"HEUR_NAME"/nwaitingnodes",
717  "number of nodes without incumbent change that heuristic should wait",
718  &heurdata->nwaitingnodes, TRUE, DEFAULT_NWAITINGNODES, 0, INT_MAX, NULL, NULL) );
719 
720  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/minimprove",
721  "factor by which "HEUR_NAME" should at least improve the incumbent",
722  &heurdata->minimprove, TRUE, DEFAULT_MINIMPROVE, 0.0, 1.0, NULL, NULL) );
723 
724  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/minfixingrate",
725  "minimum percentage of integer variables that have to be fixed",
726  &heurdata->minfixingrate, FALSE, DEFAULT_MINFIXINGRATE, 0.0, 1.0, NULL, NULL) );
727 
728  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/"HEUR_NAME"/lplimfac",
729  "factor by which the limit on the number of LP depends on the node limit",
730  &heurdata->lplimfac, TRUE, DEFAULT_LPLIMFAC, 1.0, SCIP_REAL_MAX, NULL, NULL) );
731 
732  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/uselprows",
733  "should subproblem be created out of the rows in the LP rows?",
734  &heurdata->uselprows, TRUE, DEFAULT_USELPROWS, NULL, NULL) );
735 
736  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/"HEUR_NAME"/copycuts",
737  "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
738  &heurdata->copycuts, TRUE, DEFAULT_COPYCUTS, NULL, NULL) );
739 
740  return SCIP_OKAY;
741 }
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:36923
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:5600
#define SCIP_EVENTTYPE_LPSOLVED
Definition: type_event.h:78
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:38360
static SCIP_DECL_HEUREXEC(heurExecRins)
Definition: heur_rins.c:344
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:591
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:717
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:7014
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1206
#define SCIP_MAXSTRLEN
Definition: def.h:196
#define HEUR_PRIORITY
Definition: heur_rins.c:34
#define NULL
Definition: lpi_spx.cpp:129
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1111
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
Definition: lp.c:18637
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
Definition: lp.c:18583
#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:6969
#define FALSE
Definition: def.h:52
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:37596
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:1864
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:3869
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:7209
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:7579
#define TRUE
Definition: def.h:51
#define SCIPdebug(x)
Definition: pub_message.h:74
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
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:33058
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:3914
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:44
#define HEUR_FREQ
Definition: heur_rins.c:35
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:35229
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:24136
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:31775
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:19214
SCIP_RETCODE SCIPincludeHeurRins(SCIP *scip)
Definition: heur_rins.c:677
#define EVENTHDLR_NAME
Definition: heur_rins.c:56
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:1923
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:18603
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:22651
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:24179
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:35061
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2726
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:32432
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:3388
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:3414
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:10511
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
Definition: heur_rins.c:209
#define DEFAULT_MINIMPROVE
Definition: heur_rins.c:44
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:13896
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:3095
#define SCIPallocMemory(scip, ptr)
Definition: scip.h:19159
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:18227
#define SCIPerrorMessage
Definition: pub_message.h:45
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:19221
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
Definition: lp.c:18647
#define HEUR_USESSUBSCIP
Definition: heur_rins.c:39
#define DEFAULT_USELPROWS
Definition: heur_rins.c:49
static SCIP_RETCODE createSubproblem(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_Real minfixingrate, SCIP_Bool uselprows, SCIP_Bool *success)
Definition: heur_rins.c:88
int SCIPcalcHashtableSize(int minsize)
Definition: misc.c:964
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:30856
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:37940
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:38648
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:18746
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:1882
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4199
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:8453
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:24447
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:31809
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:38349
#define DEFAULT_LPLIMFAC
Definition: heur_rins.c:47
#define SCIP_CALL(x)
Definition: def.h:258
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:24051
static SCIP_DECL_HEURCOPY(heurCopyRins)
Definition: heur_rins.c:289
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:755
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:32481
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:34128
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:18696
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:11993
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:512
#define DEFAULT_MINFIXINGRATE
Definition: heur_rins.c:45
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:35202
#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:49
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:32043
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:3824
#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:3550
LNS heuristic that combines the incumbent with the LP optimum.
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:4124
SCIP_RETCODE SCIPcopyVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global)
Definition: scip.c:2087
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:37975
static SCIP_DECL_EVENTEXEC(eventExecRins)
Definition: heur_rins.c:259
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4173
Constraint handler for linear constraints in their most general form, .
static SCIP_DECL_HEURINIT(heurInitRins)
Definition: heur_rins.c:324
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2119
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:38330
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:7046
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:16760
#define SCIP_REAL_MAX
Definition: def.h:124
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:10850
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:13596
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:737
#define SCIPfreeMemory(scip, ptr)
Definition: scip.h:19176
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:682
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:33344
#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:18593
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:7030
int SCIPvarGetProbindex(SCIP_VAR *var)
Definition: var.c:16072
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:7867
#define SCIP_Real
Definition: def.h:123
#define HEUR_FREQOFS
Definition: heur_rins.c:36
#define MIN(x, y)
Definition: memory.c:59
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:18150
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:9567
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:9314
#define SCIP_Longint
Definition: def.h:107
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:31679
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:3779
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:18558
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:502
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:9945
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:3638
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:7555
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:18407
#define DEFAULT_COPYCUTS
Definition: heur_rins.c:51
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:32531
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:3470
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:37719
static SCIP_DECL_HEURFREE(heurFreeRins)
Definition: heur_rins.c:303
default SCIP plugins
#define DEFAULT_NODESQUOT
Definition: heur_rins.c:46
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:34065
SCIP callable library.
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:33310
#define EVENTHDLR_DESC
Definition: heur_rins.c:57
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:37988