Scippy

SCIP

Solving Constraint Integer Programs

heur_ofins.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-2019 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 visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file heur_ofins.c
17  * @brief OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization
18  * @author Jakob Witzig
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include "blockmemshell/memory.h"
24 #include "scip/heuristics.h"
25 #include "scip/heur_ofins.h"
26 #include "scip/pub_event.h"
27 #include "scip/pub_heur.h"
28 #include "scip/pub_message.h"
29 #include "scip/pub_misc.h"
30 #include "scip/pub_sol.h"
31 #include "scip/pub_var.h"
32 #include "scip/scip_branch.h"
33 #include "scip/scip_copy.h"
34 #include "scip/scip_event.h"
35 #include "scip/scip_general.h"
36 #include "scip/scip_heur.h"
37 #include "scip/scip_mem.h"
38 #include "scip/scip_message.h"
39 #include "scip/scip_nodesel.h"
40 #include "scip/scip_numerics.h"
41 #include "scip/scip_param.h"
42 #include "scip/scip_prob.h"
43 #include "scip/scip_sol.h"
44 #include "scip/scip_solve.h"
45 #include "scip/scip_solvingstats.h"
46 #include "scip/scip_timing.h"
47 #include <string.h>
48 
49 #define HEUR_NAME "ofins"
50 #define HEUR_DESC "primal heuristic for reoptimization, objective function induced neighborhood search"
51 #define HEUR_DISPCHAR 'A'
52 #define HEUR_PRIORITY 60000
53 #define HEUR_FREQ 0
54 #define HEUR_FREQOFS 0
55 #define HEUR_MAXDEPTH 0
56 #define HEUR_TIMING SCIP_HEURTIMING_BEFORENODE
57 #define HEUR_USESSUBSCIP TRUE /**< does the heuristic use a secondary SCIP instance? */
58 
59 /* default values for OFINS-specific plugins */
60 #define DEFAULT_MAXNODES 5000LL /**< maximum number of nodes to regard in the subproblem */
61 #define DEFAULT_MAXCHGRATE 0.50 /**< maximum percentage of changed objective coefficients */
62 #define DEFAULT_COPYCUTS TRUE /**< if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
63  * of the original scip be copied to constraints of the subscip */
64 #define DEFAULT_MAXCHANGE 0.04 /**< maximal rate of change per coefficient to get fixed */
65 #define DEFAULT_MINIMPROVE 0.01 /**< factor by which OFINS should at least improve the incumbent */
66 #define DEFAULT_ADDALLSOLS FALSE /**< should all subproblem solutions be added to the original SCIP? */
67 #define DEFAULT_MINNODES 50LL /**< minimum number of nodes to regard in the subproblem */
68 #define DEFAULT_NODESOFS 500LL /**< number of nodes added to the contingent of the total nodes */
69 #define DEFAULT_NODESQUOT 0.1 /**< subproblem nodes in relation to nodes of the original problem */
70 #define DEFAULT_LPLIMFAC 2.0 /**< factor by which the limit on the number of LP depends on the node limit */
71 
72 /* event handler properties */
73 #define EVENTHDLR_NAME "Ofins"
74 #define EVENTHDLR_DESC "LP event handler for " HEUR_NAME " heuristic"
75 
76 
77 /** primal heuristic data */
78 struct SCIP_HeurData
79 {
80  SCIP_Real maxchangerate; /**< maximal rate of changed coefficients in the objective function */
81  SCIP_Longint maxnodes; /**< maximum number of nodes to regard in the subproblem */
82  SCIP_Bool copycuts; /**< should all active cuts from cutpool be copied to constraints in subproblem? */
83  SCIP_Bool addallsols; /**< should all subproblem solutions be added to the original SCIP? */
84  SCIP_Longint minnodes; /**< minimum number of nodes to regard in the subproblem */
85  SCIP_Longint nodesofs; /**< number of nodes added to the contingent of the total nodes */
86  SCIP_Real maxchange; /**< maximal rate of change per coefficient to get fixed */
87  SCIP_Real minimprove; /**< factor by which OFINS should at least improve the incumbent */
88  SCIP_Real nodesquot; /**< subproblem nodes in relation to nodes of the original problem */
89  SCIP_Real nodelimit; /**< the nodelimit employed in the current sub-SCIP, for the event handler*/
90  SCIP_Real lplimfac; /**< factor by which the limit on the number of LP depends on the node limit */
91 };
92 
93 /* ---------------- Callback methods of event handler ---------------- */
94 
95 /* exec the event handler
96  *
97  * we interrupt the solution process
98  */
99 static
100 SCIP_DECL_EVENTEXEC(eventExecOfins)
101 {
102  SCIP_HEURDATA* heurdata;
103 
104  assert(eventhdlr != NULL);
105  assert(eventdata != NULL);
106  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
107  assert(event != NULL);
108  assert(SCIPeventGetType(event) & SCIP_EVENTTYPE_LPSOLVED);
109 
110  heurdata = (SCIP_HEURDATA*)eventdata;
111  assert(heurdata != NULL);
112 
113  /* interrupt solution process of sub-SCIP */
114  if( SCIPgetNLPs(scip) > heurdata->lplimfac * heurdata->nodelimit )
115  {
116  SCIPdebugMsg(scip, "interrupt after %" SCIP_LONGINT_FORMAT " LPs\n",SCIPgetNLPs(scip));
118  }
119 
120  return SCIP_OKAY;
121 }
122 
123 /** creates a new solution for the original problem by copying the solution of the subproblem */
124 static
126  SCIP* scip, /**< original SCIP data structure */
127  SCIP* subscip, /**< SCIP structure of the subproblem */
128  SCIP_VAR** subvars, /**< the variables of the subproblem */
129  SCIP_HEUR* heur, /**< RENS heuristic structure */
130  SCIP_SOL* subsol, /**< solution of the subproblem */
131  SCIP_Bool* success /**< used to store whether new solution was found or not */
132  )
133 {
134  SCIP_VAR** vars; /* the original problem's variables */
135  int nvars; /* the original problem's number of variables */
136  SCIP_Real* subsolvals; /* solution values of the subproblem */
137  SCIP_SOL* newsol; /* solution to be created for the original problem */
138 
139  assert(scip != NULL);
140  assert(subscip != NULL);
141  assert(subvars != NULL);
142  assert(subsol != NULL);
143 
144  /* get variables' data */
145  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
146 
147  /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
148  * since constraint copying may have required the copy of variables that are fixed in the main SCIP
149  */
150  assert(nvars <= SCIPgetNOrigVars(subscip));
151 
152  SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
153 
154  /* copy the solution */
155  SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
156 
157  /* create new solution for the original problem */
158  SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
159  SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
160 
161  /* try to add new solution to scip and free it immediately */
162  SCIP_CALL( SCIPtrySolFree(scip, &newsol, TRUE, TRUE, TRUE, TRUE, TRUE, success) );
163 
164  SCIPfreeBufferArray(scip, &subsolvals);
165 
166  return SCIP_OKAY;
167 }
168 
169 /* setup and solve the sub-SCIP */
170 static
172  SCIP* scip, /**< original SCIP data structure */
173  SCIP* subscip, /**< sub-SCIP data structure */
174  SCIP_HEUR* heur, /**< heuristic data structure */
175  SCIP_HEURDATA* heurdata, /**< euristic's private data structure */
176  SCIP_RESULT* result, /**< result data structure */
177  SCIP_Longint nstallnodes, /**< number of stalling nodes for the subproblem */
178  SCIP_Bool* chgcoeffs /**< array of changed coefficients */
179 
180  )
181 {
182  SCIP_HASHMAP* varmapfw;
183  SCIP_VAR** vars;
184  SCIP_VAR** subvars;
185  SCIP_EVENTHDLR* eventhdlr;
186 
187  SCIP_SOL* sol;
188  SCIP_VAR** fixedvars;
189  SCIP_Real* fixedvals;
190  int nfixedvars;
191 
192  int nvars;
193  int nintvars;
194  int i;
195 
196  SCIP_SOL** subsols;
197  int nsubsols = 0;
198 
199  SCIP_Bool success;
200  SCIP_RETCODE retcode;
201  SCIP_STATUS status;
202 
203  assert(scip != NULL);
204  assert(subscip != NULL);
205  assert(heur != NULL);
206  assert(heurdata != NULL);
207  assert(result != NULL);
208  assert(chgcoeffs != NULL);
209 
210  SCIPdebugMsg(scip, "+---+ Start OFINS heuristic +---+\n");
211 
212  /* get variable data */
213  vars = SCIPgetVars(scip);
214  nvars = SCIPgetNVars(scip);
215 
216  /* create the variable mapping hash map */
217  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(subscip), nvars) );
218 
219  /* get optimal solution of the last iteration */
220  sol = SCIPgetReoptLastOptSol(scip);
221 
222  /* if the solution is NULL the last problem was infeasible */
223  if( sol == NULL )
224  return SCIP_OKAY;
225 
226  nintvars = SCIPgetNBinVars(scip) + SCIPgetNIntVars(scip) + SCIPgetNImplVars(scip);
227  SCIP_CALL( SCIPallocBufferArray(scip, &fixedvars, nvars) );
228  SCIP_CALL( SCIPallocBufferArray(scip, &fixedvals, nvars) );
229 
230  /* determine variables to fix in the sub-SCIP */
231  nfixedvars = 0;
232  for( i = 0; i < nintvars; i++ )
233  {
234  if( !chgcoeffs[i] )
235  {
236  fixedvars[nfixedvars] = vars[i];
237  fixedvals[nfixedvars] = SCIPgetSolVal(scip, sol, vars[i]);
238  ++nfixedvars;
239  }
240  }
241 
242  /* create a problem copy as sub SCIP */
243  SCIP_CALL( SCIPcopyLargeNeighborhoodSearch(scip, subscip, varmapfw, "ofins", fixedvars, fixedvals, nfixedvars, FALSE,
244  FALSE, &success, NULL) );
245  assert(success);
246 
247  SCIPfreeBufferArrayNull(scip, &fixedvals);
248  SCIPfreeBufferArrayNull(scip, &fixedvars);
249 
250  /* create event handler for LP events */
251  eventhdlr = NULL;
252  SCIP_CALL( SCIPincludeEventhdlrBasic(subscip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecOfins, NULL) );
253  if( eventhdlr == NULL )
254  {
255  SCIPerrorMessage("event handler for " HEUR_NAME " heuristic not found.\n");
256  return SCIP_PLUGINNOTFOUND;
257  }
258 
259  SCIP_CALL( SCIPallocBufferArray(scip, &subvars, nvars) );
260  for( i = 0; i < nvars; i++ )
261  {
262  subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
263  assert(subvars[i] != NULL);
264  }
265 
266  /* free hash map */
267  SCIPhashmapFree(&varmapfw);
268 
269  /* set an objective limit */
270  SCIPdebugMsg(scip, "set objective limit of %g to sub-SCIP\n", SCIPgetUpperbound(scip));
271  SCIP_CALL( SCIPsetObjlimit(subscip, SCIPgetUpperbound(scip)) );
272 
273  SCIPdebugMsg(scip, "OFINS subproblem: %d vars, %d cons\n", SCIPgetNVars(subscip), SCIPgetNConss(subscip));
274 
275  /* do not abort subproblem on CTRL-C */
276  SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
277 
278 #ifdef SCIP_DEBUG
279  /* for debugging, enable full output */
280  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 5) );
281  SCIP_CALL( SCIPsetIntParam(subscip, "display/freq", 100000000) );
282 #else
283  /* disable statistic timing inside sub SCIP and output to console */
284  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
285  SCIP_CALL( SCIPsetBoolParam(subscip, "timing/statistictiming", FALSE) );
286 #endif
287 
288  /* set limits for the subproblem */
289  SCIP_CALL( SCIPcopyLimits(scip, subscip) );
290  heurdata->nodelimit = heurdata->maxnodes;
291  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/stallnodes", nstallnodes) );
292  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", heurdata->maxnodes) );
293 
294  /* forbid recursive call of heuristics and separators solving sub-SCIPs */
295  SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
296 
297  /* disable cutting plane separation */
299 
300  /* disable expensive presolving */
302 
303  /* use best estimate node selection */
304  if( SCIPfindNodesel(subscip, "estimate") != NULL && !SCIPisParamFixed(subscip, "nodeselection/estimate/stdpriority") )
305  {
306  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/estimate/stdpriority", INT_MAX/4) );
307  }
308 
309  /* use inference branching */
310  if( SCIPfindBranchrule(subscip, "inference") != NULL && !SCIPisParamFixed(subscip, "branching/inference/priority") )
311  {
312  SCIP_CALL( SCIPsetIntParam(subscip, "branching/inference/priority", INT_MAX/4) );
313  }
314 
315  /* disable conflict analysis */
316  if( !SCIPisParamFixed(subscip, "conflict/enable") )
317  {
318  SCIP_CALL( SCIPsetBoolParam(subscip, "conflict/enable", FALSE) );
319  }
320 
321  /* speed up sub-SCIP by not checking dual LP feasibility */
322  SCIP_CALL( SCIPsetBoolParam(subscip, "lp/checkdualfeas", FALSE) );
323 
324  /* presolve the subproblem */
325  retcode = SCIPpresolve(subscip);
326 
327  /* errors in solving the subproblem should not kill the overall solving process;
328  * hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
329  */
330  if( retcode != SCIP_OKAY )
331  {
332  SCIPwarningMessage(scip, "Error while presolving subproblem in %s heuristic; sub-SCIP terminated with code <%d>\n", HEUR_NAME, retcode);
333 
334  SCIPABORT(); /*lint --e{527}*/
335 
336  /* free */
337  SCIPfreeBufferArray(scip, &subvars);
338  return SCIP_OKAY;
339  }
340 
341  SCIPdebugMsg(scip, "%s presolved subproblem: %d vars, %d cons\n", HEUR_NAME, SCIPgetNVars(subscip), SCIPgetNConss(subscip));
342 
343  assert(eventhdlr != NULL);
344 
345  SCIP_CALL( SCIPtransformProb(subscip) );
346  SCIP_CALL( SCIPcatchEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, NULL) );
347 
348  /* solve the subproblem */
349  SCIPdebugMsg(scip, "solving subproblem: nstallnodes=%" SCIP_LONGINT_FORMAT ", maxnodes=%" SCIP_LONGINT_FORMAT "\n", nstallnodes, heurdata->maxnodes);
350 
351  /* errors in solving the subproblem should not kill the overall solving process;
352  * hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
353  */
354  SCIP_CALL_ABORT( SCIPsolve(subscip) );
355 
356  SCIP_CALL( SCIPdropEvent(subscip, SCIP_EVENTTYPE_LPSOLVED, eventhdlr, (SCIP_EVENTDATA*) heurdata, -1) );
357 
358  /* print solving statistics of subproblem if we are in SCIP's debug mode */
360 
361  status = SCIPgetStatus(subscip);
362 
363  switch (status) {
365  break;
368  {
369  int nsubvars;
370 
371  nsubvars = SCIPgetNOrigVars(subscip);
372 
373  /* transfer the primal ray from the sub-SCIP to the main SCIP */
374  if( SCIPhasPrimalRay(subscip) )
375  {
376  SCIP_SOL* primalray;
377 
378  SCIP_CALL( SCIPcreateSol(scip, &primalray, heur) );
379 
380  /* transform the ray into the space of the source scip */
381  for( i = 0; i < nsubvars; i++ )
382  {
383  SCIP_CALL( SCIPsetSolVal(scip, primalray, vars[SCIPvarGetProbindex(subvars[i])],
384  SCIPgetPrimalRayVal(subscip, subvars[i])) );
385  }
386 
387  SCIPdebug( SCIP_CALL( SCIPprintRay(scip, primalray, 0, FALSE) ); );
388 
389  /* update the primal ray of the source scip */
390  SCIP_CALL( SCIPupdatePrimalRay(scip, primalray) );
391  SCIP_CALL( SCIPfreeSol(scip, &primalray) );
392 
393  *result = SCIP_UNBOUNDED;
394  }
395 
396  break;
397  }
398  default:
399  /* check, whether a solution was found;
400  * due to numerics, it might happen that not all solutions are feasible -> try all solutions until one was accepted
401  */
402  nsubsols = SCIPgetNSols(subscip);
403  subsols = SCIPgetSols(subscip);
404  success = FALSE;
405  for( i = 0; i < nsubsols && (!success || heurdata->addallsols); i++ )
406  {
407  SCIP_CALL( createNewSol(scip, subscip, subvars, heur, subsols[i], &success) );
408  if( success )
409  *result = SCIP_FOUNDSOL;
410  }
411  break;
412  } /*lint !e788*/
413 
414  SCIPstatisticPrintf("%s statistic: fixed %6.3f integer variables, needed %6.1f seconds, %" SCIP_LONGINT_FORMAT " nodes, solution %10.4f found at node %" SCIP_LONGINT_FORMAT "\n",
415  HEUR_NAME, 0.0, SCIPgetSolvingTime(subscip), SCIPgetNNodes(subscip), success ? SCIPgetPrimalbound(scip) : SCIPinfinity(scip),
416  nsubsols > 0 ? SCIPsolGetNodenum(SCIPgetBestSol(subscip)) : -1 );
417 
418  /* free subproblem */
419  SCIPfreeBufferArray(scip, &subvars);
420 
421  return SCIP_OKAY;
422 }
423 
424 /** main procedure of the OFINS heuristic, creates and solves a sub-SCIP */
425 static
427  SCIP* scip, /**< original SCIP data structure */
428  SCIP_HEUR* heur, /**< heuristic data structure */
429  SCIP_HEURDATA* heurdata, /**< euristic's private data structure */
430  SCIP_RESULT* result, /**< result data structure */
431  SCIP_Longint nstallnodes, /**< number of stalling nodes for the subproblem */
432  SCIP_Bool* chgcoeffs /**< array of changed coefficients */
433  )
434 {
435  SCIP* subscip;
436  SCIP_RETCODE retcode;
437  SCIP_Bool success;
438 
439  assert(scip != NULL);
440  assert(heur != NULL);
441  assert(heurdata != NULL);
442  assert(result != NULL);
443  assert(chgcoeffs != NULL);
444 
445  *result = SCIP_DIDNOTRUN;
446 
447  /* check whether there is enough time and memory left */
448  SCIP_CALL( SCIPcheckCopyLimits(scip, &success) );
449 
450  if( !success )
451  return SCIP_OKAY;
452 
453  *result = SCIP_DIDNOTFIND;
454 
455  /* do not run, if no solution was found */
456  if ( SCIPgetReoptLastOptSol(scip) == NULL )
457  return SCIP_OKAY;
458 
459  /* initialize the subproblem */
460  SCIP_CALL( SCIPcreate(&subscip) );
461 
462  retcode = setupAndSolve(scip, subscip, heur, heurdata, result, nstallnodes, chgcoeffs);
463 
464  SCIP_CALL( SCIPfree(&subscip) );
465 
466  SCIP_CALL( retcode );
467 
468  return SCIP_OKAY;
469 }
470 
471 
472 
473 
474 /*
475  * Callback methods of primal heuristic
476  */
477 
478 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
479 static
480 SCIP_DECL_HEURCOPY(heurCopyOfins)
481 { /*lint --e{715}*/
482  assert(scip != NULL);
483  assert(heur != NULL);
484  assert(strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0);
485 
486  /* call inclusion method of primal heuristic */
488 
489  return SCIP_OKAY;
490 }
491 
492 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
493 static
494 SCIP_DECL_HEURFREE(heurFreeOfins)
495 { /*lint --e{715}*/
496  SCIP_HEURDATA* heurdata;
497 
498  assert(heur != NULL);
499  assert(scip != NULL);
500 
501  /* get heuristic data */
502  heurdata = SCIPheurGetData(heur);
503  assert(heurdata != NULL);
504 
505  /* free heuristic data */
506  SCIPfreeBlockMemory(scip, &heurdata);
507  SCIPheurSetData(heur, NULL);
508 
509  return SCIP_OKAY;
510 }
511 
512 /** execution method of primal heuristic */
513 static
514 SCIP_DECL_HEUREXEC(heurExecOfins)
515 {/*lint --e{715}*/
516  SCIP_HEURDATA* heurdata;
517  SCIP_VAR** vars;
518  SCIP_Bool* chgcoeffs;
519  SCIP_Longint nstallnodes;
520  int nchgcoefs;
521  int nvars;
522  int v;
523 
524  assert( heur != NULL );
525  assert( scip != NULL );
526  assert( result != NULL );
527 
528  *result = SCIP_DELAYED;
529 
530  /* do not call heuristic of node was already detected to be infeasible */
531  if( nodeinfeasible )
532  return SCIP_OKAY;
533 
534  /* get heuristic data */
535  heurdata = SCIPheurGetData(heur);
536  assert( heurdata != NULL );
537 
538  /* only call heuristic, if reoptimization is enabled */
539  if( !SCIPisReoptEnabled(scip) )
540  return SCIP_OKAY;
541 
542  /* only call the heuristic, if we are in run >= 2 */
543  if( SCIPgetNReoptRuns(scip) <= 1 )
544  return SCIP_OKAY;
545 
546  *result = SCIP_DIDNOTRUN;
547 
548  if( SCIPisStopped(scip) )
549  return SCIP_OKAY;
550 
551  /* calculate the maximal number of branching nodes until heuristic is aborted */
552  nstallnodes = (SCIP_Longint)(heurdata->nodesquot * SCIPgetNNodes(scip));
553 
554  /* reward OFINS if it succeeded often */
555  nstallnodes = (SCIP_Longint)(nstallnodes * 3.0 * (SCIPheurGetNBestSolsFound(heur)+1.0)/(SCIPheurGetNCalls(heur) + 1.0));
556  nstallnodes -= 100 * SCIPheurGetNCalls(heur); /* count the setup costs for the sub-SCIP as 100 nodes */
557  nstallnodes += heurdata->nodesofs;
558 
559  /* determine the node limit for the current process */
560  nstallnodes = MIN(nstallnodes, heurdata->maxnodes);
561 
562  /* check whether we have enough nodes left to call subproblem solving */
563  if( nstallnodes < heurdata->minnodes )
564  {
565  SCIPdebugMsg(scip, "skipping OFINS: nstallnodes=%" SCIP_LONGINT_FORMAT ", minnodes=%" SCIP_LONGINT_FORMAT "\n", nstallnodes, heurdata->minnodes);
566  return SCIP_OKAY;
567  }
568 
569  /* get variable data and check which coefficient has changed */
570  vars = SCIPgetVars(scip);
571  nvars = SCIPgetNBinVars(scip) + SCIPgetNIntVars(scip) + SCIPgetNImplVars(scip);
572  nchgcoefs = 0;
573 
574  SCIP_CALL( SCIPallocBufferArray(scip, &chgcoeffs, nvars) );
575 
576  for( v = 0; v < nvars; v++ )
577  {
578  SCIP_Real newcoef;
579  SCIP_Real oldcoef;
580  SCIP_Real newcoefabs;
581  SCIP_Real oldcoefabs;
582  SCIP_Real frac;
583 
584  /* we only want to count variables that are unfixed after the presolving */
585  assert(SCIPvarGetStatus(vars[v]) != SCIP_VARSTATUS_ORIGINAL);
586  assert(SCIPvarIsActive(vars[v]));
587 
588  SCIP_CALL( SCIPgetReoptOldObjCoef(scip, vars[v], SCIPgetNReoptRuns(scip), &newcoef) );
589  SCIP_CALL( SCIPgetReoptOldObjCoef(scip, vars[v], SCIPgetNReoptRuns(scip)-1, &oldcoef) );
590  newcoefabs = REALABS(newcoef);
591  oldcoefabs = REALABS(oldcoef);
592 
593  /* if both coefficients are zero nothing has changed */
594  if( SCIPisZero(scip, newcoef) && SCIPisZero(scip, oldcoef) )
595  {
596  frac = 0;
597  }
598  /* if exactly one coefficient is zero, the other need to be close to zero */
599  else if( SCIPisZero(scip, newcoef) || SCIPisZero(scip, oldcoef) )
600  {
601  assert(SCIPisZero(scip, newcoef) != SCIPisZero(scip, oldcoef));
602  if( !SCIPisZero(scip, newcoef) )
603  frac = MIN(1, newcoefabs);
604  else
605  frac = MIN(1, oldcoefabs);
606  }
607  /* if both coefficients have the same sign we calculate the quotient
608  * MIN(newcoefabs, oldcoefabs)/MAX(newcoefabs, oldcoefabs)
609  */
610  else if( SCIPisPositive(scip, newcoef) == SCIPisPositive(scip, oldcoef) )
611  {
612  frac = 1.0 - MIN(newcoefabs, oldcoefabs)/MAX(newcoefabs, oldcoefabs);
613  }
614  /* if both coefficients have a different sign, we set frac = 1 */
615  else
616  {
617  assert((SCIPisPositive(scip, newcoef) && SCIPisNegative(scip, oldcoef))
618  || (SCIPisNegative(scip, newcoef) && SCIPisPositive(scip, oldcoef)));
619 
620  frac = 1;
621  }
622 
623  if( frac > heurdata->maxchange )
624  {
625  chgcoeffs[v] = TRUE;
626  nchgcoefs++;
627  }
628  else
629  chgcoeffs[v] = FALSE;
630  }
631 
632  SCIPdebugMsg(scip, "%d (rate %.4f) changed coefficients\n", nchgcoefs, nchgcoefs/((SCIP_Real)nvars));
633 
634  /* we only want to run the heuristic, if there at least 3 changed coefficients.
635  * if the number of changed coefficients is 2 the trivialnegation heuristic will construct an
636  * optimal solution without solving a MIP.
637  */
638  if( nchgcoefs < 3 )
639  goto TERMINATE;
640 
641  /* run the heuristic, if not too many coefficients have changed */
642  if( nchgcoefs/((SCIP_Real)nvars) > heurdata->maxchangerate )
643  goto TERMINATE;
644 
645  SCIP_CALL( applyOfins(scip, heur, heurdata, result, nstallnodes, chgcoeffs) );
646 
647  TERMINATE:
648  SCIPfreeBufferArray(scip, &chgcoeffs);
649 
650  return SCIP_OKAY;
651 }
652 
653 
654 /*
655  * primal heuristic specific interface methods
656  */
657 
658 /** creates the ofins primal heuristic and includes it in SCIP */
660  SCIP* scip /**< SCIP data structure */
661  )
662 {
663  SCIP_HEURDATA* heurdata;
664  SCIP_HEUR* heur;
665 
666  /* create ofins primal heuristic data */
667  SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
668  assert(heurdata != NULL);
669 
670  /* include primal heuristic */
671  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
673  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecOfins, heurdata) );
674 
675  assert(heur != NULL);
676 
677  /* set non fundamental callbacks via setter functions */
678  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyOfins) );
679  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeOfins) );
680 
681  /* add ofins primal heuristic parameters */
682 
683  SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/" HEUR_NAME "/maxnodes",
684  "maximum number of nodes to regard in the subproblem",
685  &heurdata->maxnodes, TRUE, DEFAULT_MAXNODES, 0LL, SCIP_LONGINT_MAX, NULL, NULL) );
686 
687  SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/" HEUR_NAME "/minnodes",
688  "minimum number of nodes required to start the subproblem",
689  &heurdata->minnodes, TRUE, DEFAULT_MINNODES, 0LL, SCIP_LONGINT_MAX, NULL, NULL) );
690 
691  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/maxchangerate",
692  "maximal rate of changed coefficients",
693  &heurdata->maxchangerate, FALSE, DEFAULT_MAXCHGRATE, 0.0, 1.0, NULL, NULL) );
694 
695  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/maxchange",
696  "maximal rate of change per coefficient to get fixed",
697  &heurdata->maxchange, FALSE, DEFAULT_MAXCHANGE, 0.0, 1.0, NULL, NULL) );
698 
699  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/copycuts",
700  "should all active cuts from cutpool be copied to constraints in subproblem?",
701  &heurdata->copycuts, TRUE, DEFAULT_COPYCUTS, NULL, NULL) );
702 
703  SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/addallsols",
704  "should all subproblem solutions be added to the original SCIP?",
705  &heurdata->addallsols, TRUE, DEFAULT_ADDALLSOLS, NULL, NULL) );
706 
707  SCIP_CALL( SCIPaddLongintParam(scip, "heuristics/" HEUR_NAME "/nodesofs",
708  "number of nodes added to the contingent of the total nodes",
709  &heurdata->nodesofs, FALSE, DEFAULT_NODESOFS, 0LL, SCIP_LONGINT_MAX, NULL, NULL) );
710 
711  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/nodesquot",
712  "contingent of sub problem nodes in relation to the number of nodes of the original problem",
713  &heurdata->nodesquot, FALSE, DEFAULT_NODESQUOT, 0.0, 1.0, NULL, NULL) );
714 
715  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/minimprove",
716  "factor by which RENS should at least improve the incumbent",
717  &heurdata->minimprove, TRUE, DEFAULT_MINIMPROVE, 0.0, 1.0, NULL, NULL) );
718 
719  SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/lplimfac",
720  "factor by which the limit on the number of LP depends on the node limit",
721  &heurdata->lplimfac, TRUE, DEFAULT_LPLIMFAC, 1.0, SCIP_REAL_MAX, NULL, NULL) );
722 
723  return SCIP_OKAY;
724 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
int SCIPgetNIntVars(SCIP *scip)
Definition: scip_prob.c:2134
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:436
#define SCIP_EVENTTYPE_LPSOLVED
Definition: type_event.h:84
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:1048
#define NULL
Definition: def.h:246
static SCIP_DECL_HEURCOPY(heurCopyOfins)
Definition: heur_ofins.c:481
public methods for SCIP parameter handling
public methods for node selector plugins
public methods for memory management
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1400
static SCIP_DECL_HEURFREE(heurFreeOfins)
Definition: heur_ofins.c:495
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip_prob.c:2484
public solving methods
static SCIP_DECL_EVENTEXEC(eventExecOfins)
Definition: heur_ofins.c:101
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip_event.c:172
public methods for timing
#define DEFAULT_COPYCUTS
Definition: heur_ofins.c:62
#define DEFAULT_NODESQUOT
Definition: heur_ofins.c:70
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip_prob.c:1918
#define DEFAULT_LPLIMFAC
Definition: heur_ofins.c:71
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip_sol.c:2312
#define FALSE
Definition: def.h:72
SCIP_RETCODE SCIPincludeHeurOfins(SCIP *scip)
Definition: heur_ofins.c:660
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2891
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:314
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:183
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip_copy.c:3012
static SCIP_RETCODE setupAndSolve(SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RESULT *result, SCIP_Longint nstallnodes, SCIP_Bool *chgcoeffs)
Definition: heur_ofins.c:172
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
static SCIP_DECL_HEUREXEC(heurExecOfins)
Definition: heur_ofins.c:515
#define TRUE
Definition: def.h:71
#define SCIPdebug(x)
Definition: pub_message.h:74
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
methods commonly used by primal heuristics
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:1022
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip_branch.c:286
int SCIPvarGetProbindex(SCIP_VAR *var)
Definition: var.c:17037
#define HEUR_DISPCHAR
Definition: heur_ofins.c:51
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
public methods for problem variables
#define HEUR_PRIORITY
Definition: heur_ofins.c:52
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:114
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_heur.c:187
#define HEUR_FREQ
Definition: heur_ofins.c:53
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3078
#define SCIP_LONGINT_MAX
Definition: def.h:143
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:142
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:338
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1175
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:97
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:203
#define SCIPdebugMsg
Definition: scip_message.h:88
#define HEUR_TIMING
Definition: heur_ofins.c:56
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
#define HEUR_MAXDEPTH
Definition: heur_ofins.c:55
public methods for numerical tolerances
public methods for querying solving statistics
#define EVENTHDLR_DESC
Definition: heur_ofins.c:75
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip_solve.c:2577
#define HEUR_DESC
Definition: heur_ofins.c:50
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1254
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip_param.c:291
#define DEFAULT_MINNODES
Definition: heur_ofins.c:68
#define HEUR_FREQOFS
Definition: heur_ofins.c:54
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip_heur.c:248
public methods for event handler plugins and event handlers
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1447
#define SCIPfreeBufferArrayNull(scip, ptr)
Definition: scip_mem.h:143
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip_param.c:520
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip_general.c:518
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip_solve.c:2416
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:128
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip_solve.c:3478
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:155
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2925
#define REALABS(x)
Definition: def.h:181
public methods for problem copies
public methods for primal CIP solutions
#define SCIP_CALL(x)
Definition: def.h:358
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip_solve.c:3154
#define SCIPstatisticPrintf
Definition: pub_message.h:107
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1380
#define HEUR_USESSUBSCIP
Definition: heur_ofins.c:57
public methods for primal heuristic plugins and divesets
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition: scip_sol.c:3556
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:130
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip_sol.c:1270
public data structures and miscellaneous methods
#define DEFAULT_ADDALLSOLS
Definition: heur_ofins.c:67
#define SCIP_Bool
Definition: def.h:69
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:354
int SCIPgetNImplVars(SCIP *scip)
Definition: scip_prob.c:2179
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
Definition: event.c:995
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2533
#define DEFAULT_MINIMPROVE
Definition: heur_ofins.c:66
SCIP_RETCODE SCIPprintRay(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip_sol.c:2227
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:58
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip_prob.c:1478
#define EVENTHDLR_NAME
Definition: heur_ofins.c:74
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_sol.c:3276
#define MIN(x, y)
Definition: def.h:216
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:578
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:388
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip_sol.c:1034
#define HEUR_NAME
Definition: heur_ofins.c:49
int SCIPgetNSols(SCIP *scip)
Definition: scip_sol.c:2263
int SCIPgetNBinVars(SCIP *scip)
Definition: scip_prob.c:2089
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:2044
#define SCIP_REAL_MAX
Definition: def.h:158
#define SCIP_LONGINT_FORMAT
Definition: def.h:149
SCIP_RETCODE SCIPgetReoptOldObjCoef(SCIP *scip, SCIP_VAR *var, int run, SCIP_Real *objcoef)
Definition: scip_solve.c:3181
public methods for branching rule plugins and branching
public methods for managing events
general public methods
#define MAX(x, y)
Definition: def.h:215
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip_sol.c:2362
public methods for solutions
int SCIPgetNReoptRuns(SCIP *scip)
#define DEFAULT_MAXNODES
Definition: heur_ofins.c:60
int SCIPgetNConss(SCIP *scip)
Definition: scip_prob.c:3094
public methods for message output
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip_nodesel.c:304
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:895
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip_prob.c:1999
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16849
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
Definition: heur_ofins.c:126
SCIP_RETCODE SCIPupdatePrimalRay(SCIP *scip, SCIP_SOL *primalray)
Definition: scip_sol.c:3601
#define SCIP_Real
Definition: def.h:157
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip_general.c:738
#define DEFAULT_MAXCHGRATE
Definition: heur_ofins.c:61
public methods for message handling
#define SCIP_Longint
Definition: def.h:142
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip_copy.c:2976
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1312
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip_solve.c:400
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip_heur.c:232
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip_solve.c:3439
SCIP_Real SCIPgetUpperbound(SCIP *scip)
public methods for primal heuristics
#define SCIP_CALL_ABORT(x)
Definition: def.h:337
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1165
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
#define SCIPABORT()
Definition: def.h:330
public methods for global and local (sub)problems
#define DEFAULT_MAXCHANGE
Definition: heur_ofins.c:65
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip_sol.c:1410
#define DEFAULT_NODESOFS
Definition: heur_ofins.c:69
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:211
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip_param.c:973
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip_param.c:636
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
Definition: scip_sol.c:3574
static SCIP_RETCODE applyOfins(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RESULT *result, SCIP_Longint nstallnodes, SCIP_Bool *chgcoeffs)
Definition: heur_ofins.c:427
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_param.c:129
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
Definition: var.c:17017
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:370
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:377
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.
memory allocation routines