Scippy

SCIP

Solving Constraint Integer Programs

heur_localbranching.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2017 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file heur_localbranching.c
17  * @brief Local branching heuristic according to Fischetti and Lodi
18  * @author Timo Berthold
19  * @author Marc Pfetsch
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <assert.h>
25 #include <string.h>
26 #include "scip/scip.h"
27 #include "scip/cons_linear.h"
28 #include "scip/scipdefplugins.h"
30 #include "scip/pub_misc.h"
31 
32 #define HEUR_NAME "localbranching"
33 #define HEUR_DESC "local branching heuristic by Fischetti and Lodi"
34 #define HEUR_DISPCHAR 'L'
35 #define HEUR_PRIORITY -1102000
36 #define HEUR_FREQ -1
37 #define HEUR_FREQOFS 0
38 #define HEUR_MAXDEPTH -1
39 #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE
40 #define HEUR_USESSUBSCIP TRUE /**< does the heuristic use a secondary SCIP instance? */
41 
42 #define DEFAULT_NEIGHBORHOODSIZE 18 /* radius of the incumbents neighborhood to be searched */
43 #define DEFAULT_NODESOFS 1000 /* number of nodes added to the contingent of the total nodes */
44 #define DEFAULT_MAXNODES 10000 /* maximum number of nodes to regard in the subproblem */
45 #define DEFAULT_MINIMPROVE 0.01 /* factor by which localbranching should at least improve the incumbent */
46 #define DEFAULT_MINNODES 1000 /* minimum number of nodes required to start the subproblem */
47 #define DEFAULT_NODESQUOT 0.05 /* contingent of sub problem nodes in relation to original nodes */
48 #define DEFAULT_LPLIMFAC 1.5 /* factor by which the limit on the number of LP depends on the node limit */
49 #define DEFAULT_NWAITINGNODES 200 /* number of nodes without incumbent change that heuristic should wait */
50 #define DEFAULT_USELPROWS FALSE /* should subproblem be created out of the rows in the LP rows,
51  * otherwise, the copy constructors of the constraints handlers are used */
52 #define DEFAULT_COPYCUTS TRUE /* if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
53  * of the original scip be copied to constraints of the subscip
54  */
55 #define DEFAULT_BESTSOLLIMIT 3 /* limit on number of improving incumbent solutions in sub-CIP */
56 #define DEFAULT_USEUCT FALSE /* should uct node selection be used at the beginning of the search? */
57 
58 /* event handler properties */
59 #define EVENTHDLR_NAME "Localbranching"
60 #define EVENTHDLR_DESC "LP event handler for " HEUR_NAME " heuristic"
61 
62 
63 #define EXECUTE 0
64 #define WAITFORNEWSOL 1
65 
66 
67 /*
68  * Data structures
69  */
70 
71 /** primal heuristic data */
72 struct SCIP_HeurData
73 {
74  int nwaitingnodes; /**< number of nodes without incumbent change that heuristic should wait */
75  int nodesofs; /**< number of nodes added to the contingent of the total nodes */
76  int minnodes; /**< minimum number of nodes required to start the subproblem */
77  int maxnodes; /**< maximum number of nodes to regard in the subproblem */
78  SCIP_Longint usednodes; /**< amount of nodes local branching used during all calls */
79  SCIP_Real nodesquot; /**< contingent of sub problem nodes in relation to original nodes */
80  SCIP_Real minimprove; /**< factor by which localbranching should at least improve the incumbent */
81  SCIP_Real nodelimit; /**< the nodelimit employed in the current sub-SCIP, for the event handler*/
82  SCIP_Real lplimfac; /**< factor by which the limit on the number of LP depends on the node limit */
83  int neighborhoodsize; /**< radius of the incumbent's neighborhood to be searched */
84  int callstatus; /**< current status of localbranching heuristic */
85  SCIP_SOL* lastsol; /**< the last incumbent localbranching used as reference point */
86  int curneighborhoodsize;/**< current neighborhoodsize */
87  int curminnodes; /**< current minimal number of nodes required to start the subproblem */
88  int emptyneighborhoodsize;/**< size of neighborhood that was proven to be empty */
89  SCIP_Bool uselprows; /**< should subproblem be created out of the rows in the LP rows? */
90  SCIP_Bool copycuts; /**< if uselprows == FALSE, should all active cuts from cutpool be copied
91  * to constraints in subproblem?
92  */
93  int bestsollimit; /**< limit on number of improving incumbent solutions in sub-CIP */
94  SCIP_Bool useuct; /**< should uct node selection be used at the beginning of the search? */
95 };
96 
97 
98 /*
99  * Local methods
100  */
101 
102 /** create the extra constraint of local branching and add it to subscip */
103 static
105  SCIP* scip, /**< SCIP data structure of the original problem */
106  SCIP* subscip, /**< SCIP data structure of the subproblem */
107  SCIP_VAR** subvars, /**< variables of the subproblem */
108  SCIP_HEURDATA* heurdata /**< heuristic's data structure */
109  )
110 {
111  SCIP_CONS* cons; /* local branching constraint to create */
112  SCIP_VAR** consvars;
113  SCIP_VAR** vars;
114  SCIP_SOL* bestsol;
115 
116  int nbinvars;
117  int i;
118  SCIP_Real lhs;
119  SCIP_Real rhs;
120  SCIP_Real* consvals;
121  char consname[SCIP_MAXSTRLEN];
122 
123  (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN, "%s_localbranchcons", SCIPgetProbName(scip));
124 
125  /* get the data of the variables and the best solution */
126  SCIP_CALL( SCIPgetVarsData(scip, &vars, NULL, &nbinvars, NULL, NULL, NULL) );
127  bestsol = SCIPgetBestSol(scip);
128  assert( bestsol != NULL );
129 
130  /* memory allocation */
131  SCIP_CALL( SCIPallocBufferArray(scip, &consvars, nbinvars) );
132  SCIP_CALL( SCIPallocBufferArray(scip, &consvals, nbinvars) );
133 
134  /* set initial left and right hand sides of local branching constraint */
135  lhs = (SCIP_Real)heurdata->emptyneighborhoodsize + 1.0;
136  rhs = (SCIP_Real)heurdata->curneighborhoodsize;
137 
138  /* create the distance (to incumbent) function of the binary variables */
139  for( i = 0; i < nbinvars; i++ )
140  {
141  SCIP_Real solval;
142 
143  solval = SCIPgetSolVal(scip, bestsol, vars[i]);
144  assert( SCIPisFeasIntegral(scip,solval) );
145 
146  /* is variable i part of the binary support of bestsol? */
147  if( SCIPisFeasEQ(scip,solval,1.0) )
148  {
149  consvals[i] = -1.0;
150  rhs -= 1.0;
151  lhs -= 1.0;
152  }
153  else
154  consvals[i] = 1.0;
155  consvars[i] = subvars[i];
156  assert( SCIPvarGetType(consvars[i]) == SCIP_VARTYPE_BINARY );
157  }
158 
159  /* creates localbranching constraint and adds it to subscip */
160  SCIP_CALL( SCIPcreateConsLinear(subscip, &cons, consname, nbinvars, consvars, consvals,
161  lhs, rhs, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE) );
162  SCIP_CALL( SCIPaddCons(subscip, cons) );
163  SCIP_CALL( SCIPreleaseCons(subscip, &cons) );
164 
165  /* free local memory */
166  SCIPfreeBufferArray(scip, &consvals);
167  SCIPfreeBufferArray(scip, &consvars);
168 
169  return SCIP_OKAY;
170 }
171 
172 
173 /** creates a new solution for the original problem by copying the solution of the subproblem */
174 static
176  SCIP* scip, /**< SCIP data structure of the original problem */
177  SCIP* subscip, /**< SCIP data structure of the subproblem */
178  SCIP_VAR** subvars, /**< the variables of the subproblem */
179  SCIP_HEUR* heur, /**< the Localbranching heuristic */
180  SCIP_SOL* subsol, /**< solution of the subproblem */
181  SCIP_Bool* success /**< pointer to store, whether new solution was found */
182  )
183 {
184  SCIP_VAR** vars;
185  int nvars;
186  SCIP_SOL* newsol;
187  SCIP_Real* subsolvals;
188 
189  assert( scip != NULL );
190  assert( subscip != NULL );
191  assert( subvars != NULL );
192  assert( subsol != NULL );
193 
194  /* copy the solution */
195  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
196  /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
197  * since constraint copying may have required the copy of variables that are fixed in the main SCIP
198  */
199  assert(nvars <= SCIPgetNOrigVars(subscip));
200 
201  SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
202 
203  /* copy the solution */
204  SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
205 
206  /* create new solution for the original problem */
207  SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
208  SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
209 
210  SCIP_CALL( SCIPtrySolFree(scip, &newsol, FALSE, FALSE, TRUE, TRUE, TRUE, success) );
211 
212  SCIPfreeBufferArray(scip, &subsolvals);
213 
214  return SCIP_OKAY;
215 }
216 
217 
218 /* ---------------- Callback methods of event handler ---------------- */
219 
220 /* exec the event handler
221  *
222  * we interrupt the solution process
223  */
224 static
225 SCIP_DECL_EVENTEXEC(eventExecLocalbranching)
226 {
227  SCIP_HEURDATA* heurdata;
228 
229  assert(eventhdlr != NULL);
230  assert(eventdata != NULL);
231  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
232  assert(event != NULL);
233  assert(SCIPeventGetType(event) & SCIP_EVENTTYPE_LPSOLVED);
234 
235  heurdata = (SCIP_HEURDATA*)eventdata;
236  assert(heurdata != NULL);
237 
238  /* interrupt solution process of sub-SCIP */
239  if( SCIPgetNLPs(scip) > heurdata->lplimfac * heurdata->nodelimit )
240  {
241  SCIPdebugMsg(scip, "interrupt after %" SCIP_LONGINT_FORMAT " LPs\n",SCIPgetNLPs(scip));
243  }
244 
245  return SCIP_OKAY;
246 }
247 
248 
249 /*
250  * Callback methods of primal heuristic
251  */
252 
253 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
254 static
255 SCIP_DECL_HEURCOPY(heurCopyLocalbranching)
256 { /*lint --e{715}*/
257  assert(scip != NULL);
258  assert(heur != NULL);
259  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
260 
261  /* call inclusion method of primal heuristic */
263 
264  return SCIP_OKAY;
265 }
266 
267 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
268 static
269 SCIP_DECL_HEURFREE(heurFreeLocalbranching)
270 { /*lint --e{715}*/
271  SCIP_HEURDATA* heurdata;
272 
273  assert( heur != NULL );
274  assert( scip != NULL );
275 
276  /* get heuristic data */
277  heurdata = SCIPheurGetData(heur);
278  assert( heurdata != NULL );
279 
280  /* free heuristic data */
281  SCIPfreeBlockMemory(scip, &heurdata);
282  SCIPheurSetData(heur, NULL);
283 
284  return SCIP_OKAY;
285 }
286 
287 
288 /** initialization method of primal heuristic (called after problem was transformed) */
289 static
290 SCIP_DECL_HEURINIT(heurInitLocalbranching)
291 { /*lint --e{715}*/
292  SCIP_HEURDATA* heurdata;
293 
294  assert( heur != NULL );
295  assert( scip != NULL );
296 
297  /* get heuristic's data */
298  heurdata = SCIPheurGetData(heur);
299  assert( heurdata != NULL );
300 
301  /* with a little abuse we initialize the heurdata as if localbranching would have finished its last step regularly */
302  heurdata->callstatus = WAITFORNEWSOL;
303  heurdata->lastsol = NULL;
304  heurdata->usednodes = 0;
305  heurdata->curneighborhoodsize = heurdata->neighborhoodsize;
306  heurdata->curminnodes = heurdata->minnodes;
307  heurdata->emptyneighborhoodsize = 0;
308 
309  return SCIP_OKAY;
310 }
311 
312 /** todo setup And Solve Subscip */
313 static
315  SCIP* scip, /**< SCIP data structure */
316  SCIP* subscip, /**< the subproblem created by localbranching */
317  SCIP_HEUR* heur, /**< localbranching heuristic */
318  SCIP_Longint nsubnodes, /**< nodelimit for subscip */
319  SCIP_RESULT* result /**< result pointer */
320  )
321 {
322  SCIP_VAR** subvars; /* subproblem's variables */
323  SCIP_EVENTHDLR* eventhdlr; /* event handler for LP events */
324  SCIP_HEURDATA* heurdata;
325  SCIP_HASHMAP* varmapfw; /* mapping of SCIP variables to sub-SCIP variables */
326  SCIP_VAR** vars;
327 
328  SCIP_Real cutoff; /* objective cutoff for the subproblem */
329  SCIP_Real upperbound;
330 
331  int nvars;
332  int i;
333 
334  SCIP_Bool success;
335 
336  assert(scip != NULL);
337  assert(subscip != NULL);
338  assert(heur != NULL);
339 
340  heurdata = SCIPheurGetData(heur);
341  assert(heurdata != NULL);
342 
343  /* get the data of the variables and the best solution */
344  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
345 
346  /* create the variable mapping hash map */
347  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(subscip), nvars) );
348  success = FALSE;
349 
350  /* create a problem copy as sub SCIP */
351  SCIP_CALL( SCIPcopyLargeNeighborhoodSearch(scip, subscip, varmapfw, "localbranching", NULL, NULL, 0, heurdata->uselprows,
352  heurdata->copycuts, &success, NULL) );
353 
354  SCIPdebugMsg(scip, "Copying SCIP was %ssuccessful.\n", success ? "" : "not ");
355 
356  /* if the subproblem could not be created, free memory and return */
357  if( !success )
358  {
359  *result = SCIP_DIDNOTRUN;
360  goto TERMINATE;
361  }
362 
363  /* create event handler for LP events */
364  eventhdlr = NULL;
365  SCIP_CALL( SCIPincludeEventhdlrBasic(subscip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecLocalbranching, NULL) );
366  if( eventhdlr == NULL )
367  {
368  /* free hash map */
369  SCIPhashmapFree(&varmapfw);
370 
371  SCIPerrorMessage("event handler for " HEUR_NAME " heuristic not found.\n");
372  return SCIP_PLUGINNOTFOUND;
373  }
374 
375  SCIP_CALL( SCIPallocBufferArray(scip, &subvars, nvars) );
376  for (i = 0; i < nvars; ++i)
377  subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
378 
379  /* free hash map */
380  SCIPhashmapFree(&varmapfw);
381 
382  /* do not abort subproblem on CTRL-C */
383  SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
384 
385 #ifdef SCIP_DEBUG
386  /* for debugging, enable full output */
387  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 5) );
388  SCIP_CALL( SCIPsetIntParam(subscip, "display/freq", 100000000) );
389 #else
390  /* disable statistic timing inside sub SCIP and output to console */
391  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
392  SCIP_CALL( SCIPsetBoolParam(subscip, "timing/statistictiming", FALSE) );
393 #endif
394 
395  /* set limits for the subproblem */
396  SCIP_CALL( SCIPcopyLimits(scip, subscip) );
397  heurdata->nodelimit = nsubnodes;
398  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", nsubnodes) );
399  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/stallnodes", MAX(10, nsubnodes/10)) );
400  SCIP_CALL( SCIPsetIntParam(subscip, "limits/bestsol", heurdata->bestsollimit) );
401 
402  /* forbid recursive call of heuristics and separators solving subMIPs */
403  SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
404 
405  /* disable cutting plane separation */
407 
408  /* disable expensive presolving */
410 
411  /* use best estimate node selection */
412  if( SCIPfindNodesel(subscip, "estimate") != NULL && !SCIPisParamFixed(subscip, "nodeselection/estimate/stdpriority") )
413  {
414  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/estimate/stdpriority", INT_MAX/4) );
415  }
416 
417  /* activate uct node selection at the top of the tree */
418  if( heurdata->useuct && SCIPfindNodesel(subscip, "uct") != NULL && !SCIPisParamFixed(subscip, "nodeselection/uct/stdpriority") )
419  {
420  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/uct/stdpriority", INT_MAX/2) );
421  }
422 
423  /* use inference branching */
424  if( SCIPfindBranchrule(subscip, "inference") != NULL && !SCIPisParamFixed(subscip, "branching/inference/priority") )
425  {
426  SCIP_CALL( SCIPsetIntParam(subscip, "branching/inference/priority", INT_MAX/4) );
427  }
428 
429  /* enable conflict analysis, disable analysis of boundexceeding LPs, and restrict conflict pool */
430  if( !SCIPisParamFixed(subscip, "conflict/enable") )
431  {
432  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/enable", TRUE) );
433  }
434  if( !SCIPisParamFixed(subscip, "conflict/useboundlp") )
435  {
436  SCIP_CALL( SCIPsetCharParam(subscip, "conflict/useboundlp", 'o') );
437  }
438  if( !SCIPisParamFixed(subscip, "conflict/maxstoresize") )
439  {
440  SCIP_CALL( SCIPsetIntParam(subscip, "conflict/maxstoresize", 100) );
441  }
442 
443  /* speed up sub-SCIP by not checking dual LP feasibility */
444  SCIP_CALL( SCIPsetBoolParam(subscip, "lp/checkdualfeas", FALSE) );
445 
446  /* employ a limit on the number of enforcement rounds in the quadratic constraint handler; this fixes the issue that
447  * sometimes the quadratic constraint handler needs hundreds or thousands of enforcement rounds to determine the
448  * feasibility status of a single node without fractional branching candidates by separation (namely for uflquad
449  * instances); however, the solution status of the sub-SCIP might get corrupted by this; hence no deductions shall be
450  * made for the original SCIP
451  */
452  if( SCIPfindConshdlr(subscip, "quadratic") != NULL && !SCIPisParamFixed(subscip, "constraints/quadratic/enfolplimit") )
453  {
454  SCIP_CALL( SCIPsetIntParam(subscip, "constraints/quadratic/enfolplimit", 500) );
455  }
456 
457  SCIP_CALL( addLocalBranchingConstraint(scip, subscip, subvars, heurdata) );
458 
459  /* add an objective cutoff */
460  assert( !SCIPisInfinity(scip,SCIPgetUpperbound(scip)) );
461 
462  upperbound = SCIPgetUpperbound(scip) - SCIPsumepsilon(scip);
463  if( !SCIPisInfinity(scip,-1.0*SCIPgetLowerbound(scip)) )
464  {
465  cutoff = (1-heurdata->minimprove)*SCIPgetUpperbound(scip) + heurdata->minimprove*SCIPgetLowerbound(scip);
466  }
467  else
468  {
469  if( SCIPgetUpperbound ( scip ) >= 0 )
470  cutoff = ( 1 - heurdata->minimprove ) * SCIPgetUpperbound ( scip );
471  else
472  cutoff = ( 1 + heurdata->minimprove ) * SCIPgetUpperbound ( scip );
473  }
474  cutoff = MIN(upperbound, cutoff );
475  SCIP_CALL( SCIPsetObjlimit(subscip, cutoff) );
476 
477  /* catch LP events of sub-SCIP */
478  if( !heurdata->uselprows )
479  {
480  assert(eventhdlr != NULL);
481 
482  SCIP_CALL( SCIPtransformProb(subscip) );
483  SCIP_CALL( SCIPcatchEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, NULL) );
484  }
485 
486  /* solve the subproblem */
487  SCIPdebugMsg(scip, "solving local branching subproblem with neighborhoodsize %d and maxnodes %" SCIP_LONGINT_FORMAT "\n",
488  heurdata->curneighborhoodsize, nsubnodes);
489 
490 
491  /* Errors in solving the subproblem should not kill the overall solving process
492  * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
493  */
494  SCIP_CALL_ABORT( SCIPsolve(subscip) );
495 
496  /* drop LP events of sub-SCIP */
497  if( !heurdata->uselprows )
498  {
499  assert(eventhdlr != NULL);
500 
501  SCIP_CALL( SCIPdropEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, -1) );
502  }
503 
504  /* print solving statistics of subproblem if we are in SCIP's debug mode */
505  SCIPdebug( SCIP_CALL( SCIPprintStatistics(subscip, NULL) ) );
506 
507  heurdata->usednodes += SCIPgetNNodes(subscip);
508  SCIPdebugMsg(scip, "local branching used %" SCIP_LONGINT_FORMAT "/%" SCIP_LONGINT_FORMAT " nodes\n",
509  SCIPgetNNodes(subscip), nsubnodes);
510 
511  /* check, whether a solution was found */
512  if( SCIPgetNSols(subscip) > 0 )
513  {
514  SCIP_SOL** subsols;
515  int nsubsols;
516 
517  /* check, whether a solution was found;
518  * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
519  */
520  nsubsols = SCIPgetNSols(subscip);
521  subsols = SCIPgetSols(subscip);
522  success = FALSE;
523  for( i = 0; i < nsubsols && !success; ++i )
524  {
525  SCIP_CALL( createNewSol(scip, subscip, subvars, heur, subsols[i], &success) );
526  }
527  if( success )
528  {
529  SCIPdebugMsg(scip, "-> accepted solution of value %g\n", SCIPgetSolOrigObj(subscip, subsols[i]));
530  *result = SCIP_FOUNDSOL;
531  }
532  }
533 
534  /* check the status of the sub-MIP */
535  switch( SCIPgetStatus(subscip) )
536  {
537  case SCIP_STATUS_OPTIMAL:
539  heurdata->callstatus = WAITFORNEWSOL; /* new solution will immediately be installed at next call */
540  SCIPdebugMsg(scip, " -> found new solution\n");
541  break;
542 
546  heurdata->callstatus = EXECUTE;
547  heurdata->curneighborhoodsize = (heurdata->emptyneighborhoodsize + heurdata->curneighborhoodsize)/2;
548  heurdata->curminnodes *= 2;
549  SCIPdebugMsg(scip, " -> node limit reached: reduced neighborhood to %d, increased minnodes to %d\n",
550  heurdata->curneighborhoodsize, heurdata->curminnodes);
551  if( heurdata->curneighborhoodsize <= heurdata->emptyneighborhoodsize )
552  {
553  heurdata->callstatus = WAITFORNEWSOL;
554  SCIPdebugMsg(scip, " -> new neighborhood was already proven to be empty: wait for new solution\n");
555  }
556  break;
557 
560  heurdata->emptyneighborhoodsize = heurdata->curneighborhoodsize;
561  heurdata->curneighborhoodsize += heurdata->curneighborhoodsize/2;
562  heurdata->curneighborhoodsize = MAX(heurdata->curneighborhoodsize, heurdata->emptyneighborhoodsize + 2);
563  heurdata->callstatus = EXECUTE;
564  SCIPdebugMsg(scip, " -> neighborhood is empty: increased neighborhood to %d\n", heurdata->curneighborhoodsize);
565  break;
566 
567  case SCIP_STATUS_UNKNOWN:
575  default:
576  heurdata->callstatus = WAITFORNEWSOL;
577  SCIPdebugMsg(scip, " -> unexpected sub-MIP status <%d>: waiting for new solution\n", SCIPgetStatus(subscip));
578  break;
579  }
580 
581  TERMINATE:
582  /* free subproblem */
583  SCIPfreeBufferArray(scip, &subvars);
584 
585  return SCIP_OKAY;
586 }
587 
588 
589 /** execution method of primal heuristic */
590 static
591 SCIP_DECL_HEUREXEC(heurExecLocalbranching)
592 { /*lint --e{715}*/
593  SCIP_Longint maxnnodes; /* maximum number of subnodes */
594  SCIP_Longint nsubnodes; /* nodelimit for subscip */
595 
596  SCIP_HEURDATA* heurdata;
597  SCIP* subscip; /* the subproblem created by localbranching */
598 
599  SCIP_SOL* bestsol; /* best solution so far */
600 
601  SCIP_Bool success;
602  SCIP_RETCODE retcode;
603 
604  assert(heur != NULL);
605  assert(scip != NULL);
606  assert(result != NULL);
607 
608  *result = SCIP_DIDNOTRUN;
609 
610  /* get heuristic's data */
611  heurdata = SCIPheurGetData(heur);
612  assert( heurdata != NULL );
613 
614  /* there should be enough binary variables that a local branching constraint makes sense */
615  if( SCIPgetNBinVars(scip) < 2*heurdata->neighborhoodsize )
616  return SCIP_OKAY;
617 
618  *result = SCIP_DELAYED;
619 
620  /* only call heuristic, if an IP solution is at hand */
621  if( SCIPgetNSols(scip) <= 0 )
622  return SCIP_OKAY;
623 
624  bestsol = SCIPgetBestSol(scip);
625  assert(bestsol != NULL);
626 
627  /* only call heuristic, if the best solution comes from transformed problem */
628  if( SCIPsolIsOriginal(bestsol) )
629  return SCIP_OKAY;
630 
631  /* only call heuristic, if enough nodes were processed since last incumbent */
632  if( SCIPgetNNodes(scip) - SCIPgetSolNodenum(scip, bestsol) < heurdata->nwaitingnodes)
633  return SCIP_OKAY;
634 
635  /* only call heuristic, if the best solution does not come from trivial heuristic */
636  if( SCIPsolGetHeur(bestsol) != NULL && strcmp(SCIPheurGetName(SCIPsolGetHeur(bestsol)), "trivial") == 0 )
637  return SCIP_OKAY;
638 
639  /* reset neighborhood and minnodes, if new solution was found */
640  if( heurdata->lastsol != bestsol )
641  {
642  heurdata->curneighborhoodsize = heurdata->neighborhoodsize;
643  heurdata->curminnodes = heurdata->minnodes;
644  heurdata->emptyneighborhoodsize = 0;
645  heurdata->callstatus = EXECUTE;
646  heurdata->lastsol = bestsol;
647  }
648 
649  /* if no new solution was found and local branching also seems to fail, just keep on waiting */
650  if( heurdata->callstatus == WAITFORNEWSOL )
651  return SCIP_OKAY;
652 
653  *result = SCIP_DIDNOTRUN;
654 
655  /* calculate the maximal number of branching nodes until heuristic is aborted */
656  maxnnodes = (SCIP_Longint)(heurdata->nodesquot * SCIPgetNNodes(scip));
657 
658  /* reward local branching if it succeeded often */
659  maxnnodes = (SCIP_Longint)(maxnnodes * (1.0 + 2.0*(SCIPheurGetNBestSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur)+1.0)));
660  maxnnodes -= 100 * SCIPheurGetNCalls(heur); /* count the setup costs for the sub-MIP as 100 nodes */
661  maxnnodes += heurdata->nodesofs;
662 
663  /* determine the node limit for the current process */
664  nsubnodes = maxnnodes - heurdata->usednodes;
665  nsubnodes = MIN(nsubnodes, heurdata->maxnodes);
666 
667  /* check whether we have enough nodes left to call sub problem solving */
668  if( nsubnodes < heurdata->curminnodes )
669  return SCIP_OKAY;
670 
671  if( SCIPisStopped(scip) )
672  return SCIP_OKAY;
673 
674  /* check whether there is enough time and memory left */
675  SCIP_CALL( SCIPcheckCopyLimits(scip, &success) );
676 
677  /* abort if no time is left or not enough memory to create a copy of SCIP */
678  if( !success )
679  return SCIP_OKAY;
680 
681  *result = SCIP_DIDNOTFIND;
682 
683  SCIPdebugMsg(scip, "running localbranching heuristic ...\n");
684 
685  SCIP_CALL( SCIPcreate(&subscip) );
686 
687  retcode = setupAndSolveSubscipLocalbranching(scip, subscip, heur, nsubnodes, result);
688 
689  SCIP_CALL( SCIPfree(&subscip) );
690 
691  return retcode;
692 }
693 
694 
695 /*
696  * primal heuristic specific interface methods
697  */
698 
699 /** creates the localbranching primal heuristic and includes it in SCIP */
701  SCIP* scip /**< SCIP data structure */
702  )
703 {
704  SCIP_HEURDATA* heurdata;
705  SCIP_HEUR* heur;
706 
707  /* create Localbranching primal heuristic data */
708  SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
709 
710  /* include primal heuristic */
711  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
713  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecLocalbranching, heurdata) );
714 
715  assert(heur != NULL);
716 
717  /* set non-NULL pointers to callback methods */
718  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyLocalbranching) );
719  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeLocalbranching) );
720  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitLocalbranching) );
721 
722  /* add localbranching primal heuristic parameters */
723  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/nodesofs",
724  "number of nodes added to the contingent of the total nodes",
725  &heurdata->nodesofs, FALSE, DEFAULT_NODESOFS, 0, INT_MAX, NULL, NULL) );
726 
727  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/neighborhoodsize",
728  "radius (using Manhattan metric) of the incumbent's neighborhood to be searched",
729  &heurdata->neighborhoodsize, FALSE, DEFAULT_NEIGHBORHOODSIZE, 1, INT_MAX, NULL, NULL) );
730 
731  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/nodesquot",
732  "contingent of sub problem nodes in relation to the number of nodes of the original problem",
733  &heurdata->nodesquot, FALSE, DEFAULT_NODESQUOT, 0.0, 1.0, NULL, NULL) );
734 
735  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/lplimfac",
736  "factor by which the limit on the number of LP depends on the node limit",
737  &heurdata->lplimfac, TRUE, DEFAULT_LPLIMFAC, 1.0, SCIP_REAL_MAX, NULL, NULL) );
738 
739  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/minnodes",
740  "minimum number of nodes required to start the subproblem",
741  &heurdata->minnodes, TRUE, DEFAULT_MINNODES, 0, INT_MAX, NULL, NULL) );
742 
743  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/maxnodes",
744  "maximum number of nodes to regard in the subproblem",
745  &heurdata->maxnodes, TRUE, DEFAULT_MAXNODES, 0, INT_MAX, NULL, NULL) );
746 
747  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/nwaitingnodes",
748  "number of nodes without incumbent change that heuristic should wait",
749  &heurdata->nwaitingnodes, TRUE, DEFAULT_NWAITINGNODES, 0, INT_MAX, NULL, NULL) );
750 
751  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/minimprove",
752  "factor by which localbranching should at least improve the incumbent",
753  &heurdata->minimprove, TRUE, DEFAULT_MINIMPROVE, 0.0, 1.0, NULL, NULL) );
754 
755  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/uselprows",
756  "should subproblem be created out of the rows in the LP rows?",
757  &heurdata->uselprows, TRUE, DEFAULT_USELPROWS, NULL, NULL) );
758 
759  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/copycuts",
760  "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
761  &heurdata->copycuts, TRUE, DEFAULT_COPYCUTS, NULL, NULL) );
762 
763  SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/bestsollimit",
764  "limit on number of improving incumbent solutions in sub-CIP",
765  &heurdata->bestsollimit, FALSE, DEFAULT_BESTSOLLIMIT, -1, INT_MAX, NULL, NULL) );
766 
767  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/useuct",
768  "should uct node selection be used at the beginning of the search?",
769  &heurdata->useuct, TRUE, DEFAULT_USEUCT, NULL, NULL) );
770 
771  return SCIP_OKAY;
772 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2465
#define DEFAULT_NODESOFS
#define HEUR_DISPCHAR
#define SCIP_EVENTTYPE_LPSOLVED
Definition: type_event.h:84
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5158
#define DEFAULT_LPLIMFAC
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:47292
#define DEFAULT_NODESQUOT
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:6604
#define SCIP_MAXSTRLEN
Definition: def.h:259
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1344
#define HEUR_FREQ
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:12246
static SCIP_RETCODE addLocalBranchingConstraint(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEURDATA *heurdata)
#define EVENTHDLR_NAME
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:8611
#define WAITFORNEWSOL
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:11680
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:39826
#define FALSE
Definition: def.h:64
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2793
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:278
#define DEFAULT_NWAITINGNODES
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:4192
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
#define TRUE
Definition: def.h:63
#define SCIPdebug(x)
Definition: pub_message.h:74
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5132
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:9269
#define HEUR_FREQOFS
static SCIP_DECL_HEURINIT(heurInitLocalbranching)
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
SCIP_RETCODE SCIPincludeHeurLocalbranching(SCIP *scip)
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip.h:22602
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:8084
#define DEFAULT_BESTSOLLIMIT
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2931
static SCIP_DECL_HEUREXEC(heurExecLocalbranching)
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:22632
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:748
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1119
#define DEFAULT_MAXNODES
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:22585
#define SCIPdebugMsg
Definition: scip.h:455
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:4265
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:45645
#define EXECUTE
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:10885
#define DEFAULT_COPYCUTS
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:16109
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1198
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:4401
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12585
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:8145
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:38942
static SCIP_RETCODE setupAndSolveSubscipLocalbranching(SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_Longint nsubnodes, SCIP_RESULT *result)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:4630
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip.c:928
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:46725
Local branching heuristic according to Fischetti and Lodi.
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:155
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2826
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2548
#define SCIP_CALL(x)
Definition: def.h:350
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:43271
#define DEFAULT_NEIGHBORHOODSIZE
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1324
#define HEUR_TIMING
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:22620
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:61
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:41152
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
Definition: event.c:959
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:11240
#define DEFAULT_MINIMPROVE
#define HEUR_MAXDEPTH
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:40788
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4688
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:41186
#define DEFAULT_USEUCT
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:39777
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38988
Constraint handler for linear constraints in their most general form, .
static SCIP_DECL_HEURFREE(heurFreeLocalbranching)
#define HEUR_NAME
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:47033
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:11851
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip.c:4862
#define SCIP_REAL_MAX
Definition: def.h:150
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)
#define HEUR_PRIORITY
static SCIP_DECL_EVENTEXEC(eventExecLocalbranching)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:39876
#define HEUR_USESSUBSCIP
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:27755
#define HEUR_DESC
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:8161
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:8957
SCIP_RETCODE SCIPcopyLargeNeighborhoodSearch(SCIP *sourcescip, SCIP *subscip, SCIP_HASHMAP *varmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool uselprows, SCIP_Bool copycuts, SCIP_Bool *success, SCIP_Bool *valid)
Definition: heuristics.c:903
#define SCIP_Real
Definition: def.h:149
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1145
#define EVENTHDLR_DESC
#define SCIP_Longint
Definition: def.h:134
static SCIP_DECL_HEURCOPY(heurCopyLocalbranching)
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip.c:4156
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16827
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:38807
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:13929
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:8129
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:47393
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:46423
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:17318
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:43420
#define DEFAULT_USELPROWS
#define SCIP_CALL_ABORT(x)
Definition: def.h:329
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1109
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:42127
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:42308
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:38905
default SCIP plugins
#define DEFAULT_MINNODES
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:4321
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:5083
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4746
SCIP callable library.
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:4239
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:780
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37872
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39201