Scippy

SCIP

Solving Constraint Integer Programs

sepa_rapidlearning.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file sepa_rapidlearning.c
17  * @brief rapidlearning separator
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 #ifndef NDEBUG
25 #include <string.h>
26 #endif
27 
29 #include "scip/scipdefplugins.h"
30 #include "scip/pub_var.h"
31 
32 #define SEPA_NAME "rapidlearning"
33 #define SEPA_DESC "rapid learning heuristic and separator"
34 #define SEPA_PRIORITY -1200000
35 #define SEPA_FREQ -1
36 #define SEPA_MAXBOUNDDIST 1.0
37 #define SEPA_USESSUBSCIP TRUE /**< does the separator use a secondary SCIP instance? */
38 #define SEPA_DELAY FALSE /**< should separation method be delayed, if other separators found cuts? */
39 
40 #define DEFAULT_APPLYCONFLICTS TRUE /**< should the found conflicts be applied in the original SCIP? */
41 #define DEFAULT_APPLYBDCHGS TRUE /**< should the found global bound deductions be applied in the original SCIP?
42  * apply only if conflicts and incumbent solution will be copied too
43  */
44 #define DEFAULT_APPLYINFERVALS TRUE /**< should the inference values be used as initialization in the original SCIP? */
45 #define DEFAULT_REDUCEDINFER FALSE /**< should the inference values only be used when rapid learning found other reductions? */
46 #define DEFAULT_APPLYPRIMALSOL TRUE /**< should the incumbent solution be copied to the original SCIP? */
47 #define DEFAULT_APPLYSOLVED TRUE /**< should a solved status be copied to the original SCIP? */
48 
49 #define DEFAULT_MAXNVARS 10000 /**< maximum problem size (variables) for which rapid learning will be called */
50 #define DEFAULT_MAXNCONSS 10000 /**< maximum problem size (constraints) for which rapid learning will be called */
51 
52 #define DEFAULT_MINNODES 500 /**< minimum number of nodes considered in rapid learning run */
53 #define DEFAULT_MAXNODES 5000 /**< maximum number of nodes considered in rapid learning run */
54 
55 #define DEFAULT_CONTVARS FALSE /**< should rapid learning be applied when there are continuous variables? */
56 #define DEFAULT_CONTVARSQUOT 0.3 /**< maximal portion of continuous variables to apply rapid learning */
57 #define DEFAULT_LPITERQUOT 0.2 /**< maximal fraction of LP iterations compared to node LP iterations */
58 #define DEFAULT_COPYCUTS TRUE /**< should all active cuts from the cutpool of the
59  * original scip be copied to constraints of the subscip
60  */
61 
62 
63 /*
64  * Data structures
65  */
66 
67 /** separator data */
68 struct SCIP_SepaData
69 {
70  SCIP_Bool applyconflicts; /**< should the found conflicts be applied in the original SCIP? */
71  SCIP_Bool applybdchgs; /**< should the found global bound deductions be applied in the original SCIP? */
72  SCIP_Bool applyinfervals; /**< should the inference values be used as initialization in the original SCIP? */
73  SCIP_Bool reducedinfer; /**< should the inference values only be used when rapid learning found other reductions? */
74  SCIP_Bool applyprimalsol; /**< should the incumbent solution be copied to the original SCIP? */
75  SCIP_Bool applysolved; /**< should a solved status ba copied to the original SCIP? */
76  int maxnvars; /**< maximum problem size (variables) for which rapid learning will be called */
77  int maxnconss; /**< maximum problem size (constraints) for which rapid learning will be called */
78  int minnodes; /**< minimum number of nodes considered in rapid learning run */
79  int maxnodes; /**< maximum number of nodes considered in rapid learning run */
80  SCIP_Bool contvars; /**< should rapid learning be applied when there are continuous variables? */
81  SCIP_Real contvarsquot; /**< maximal portion of continuous variables to apply rapid learning */
82  SCIP_Real lpiterquot; /**< maximal fraction of LP iterations compared to node LP iterations */
83  SCIP_Bool copycuts; /**< should all active cuts from cutpool be copied to constraints in
84  * subproblem?
85  */
86 };
87 
88 /** creates a new solution for the original problem by copying the solution of the subproblem */
89 static
91  SCIP* scip, /**< original SCIP data structure */
92  SCIP* subscip, /**< SCIP structure of the subproblem */
93  SCIP_VAR** subvars, /**< the variables of the subproblem */
94  SCIP_HEUR* heur, /**< trysol heuristic structure */
95  SCIP_SOL* subsol, /**< solution of the subproblem */
96  SCIP_Bool* success /**< used to store whether new solution was found or not */
97  )
98 {
99  SCIP_VAR** vars; /* the original problem's variables */
100  int nvars;
101  SCIP_Real* subsolvals; /* solution values of the subproblem */
102  SCIP_SOL* newsol; /* solution to be created for the original problem */
103 
104  assert( scip != NULL );
105  assert( subscip != NULL );
106  assert( subvars != NULL );
107  assert( heur != NULL );
108  assert( subsol != NULL );
109  assert( success != NULL );
110 
111  /* get variables' data */
112  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
113  /* sub-SCIP may have more variables than the number of active (transformed) variables in the main SCIP
114  * since constraint copying may have required the copy of variables that are fixed in the main SCIP
115  */
116  assert(nvars <= SCIPgetNOrigVars(subscip));
117 
118  SCIP_CALL( SCIPallocBufferArray(scip, &subsolvals, nvars) );
119 
120  /* copy the solution */
121  SCIP_CALL( SCIPgetSolVals(subscip, subsol, nvars, subvars, subsolvals) );
122 
123  /* create new solution for the original problem */
124  SCIP_CALL( SCIPcreateSol(scip, &newsol, heur) );
125  SCIP_CALL( SCIPsetSolVals(scip, newsol, nvars, vars, subsolvals) );
126 
127  /* check feasibility of new solution and pass it to trysol heuristic */
128  SCIP_CALL( SCIPtrySolFree(scip, &newsol, FALSE, TRUE, TRUE, TRUE, success) );
129 
130  SCIPfreeBufferArray(scip, &subsolvals);
131 
132  return SCIP_OKAY;
133 }
134 
135 /*
136  * Callback methods of separator
137  */
138 
139 /** copy method for separator plugins (called when SCIP copies plugins) */
140 static
141 SCIP_DECL_SEPACOPY(sepaCopyRapidlearning)
142 { /*lint --e{715}*/
143  assert(scip != NULL);
144  assert(sepa != NULL);
145  assert(strcmp(SCIPsepaGetName(sepa), SEPA_NAME) == 0);
146 
147  /* call inclusion method of constraint handler */
149 
150  return SCIP_OKAY;
151 }
152 
153 /** destructor of separator to free user data (called when SCIP is exiting) */
154 static
155 SCIP_DECL_SEPAFREE(sepaFreeRapidlearning)
156 { /*lint --e{715}*/
157  SCIP_SEPADATA* sepadata;
158 
159  assert(sepa != NULL);
160  assert(strcmp(SCIPsepaGetName(sepa), SEPA_NAME) == 0);
161  assert(scip != NULL);
162 
163  /* free separator data */
164  sepadata = SCIPsepaGetData(sepa);
165  assert(sepadata != NULL);
166  SCIPfreeMemory(scip, &sepadata);
167  SCIPsepaSetData(sepa, NULL);
168 
169  return SCIP_OKAY;
170 }
171 
172 
173 /** LP solution separation method of separator */
174 static
175 SCIP_DECL_SEPAEXECLP(sepaExeclpRapidlearning)
176 {/*lint --e{715}*/
177  SCIP* subscip; /* the subproblem created by rapid learning */
178  SCIP_SEPADATA* sepadata; /* separator's private data */
180  SCIP_VAR** vars; /* original problem's variables */
181  SCIP_VAR** subvars; /* subproblem's variables */
182  SCIP_HASHMAP* varmapfw; /* mapping of SCIP variables to sub-SCIP variables */
183  SCIP_HASHMAP* varmapbw; /* mapping of sub-SCIP variables to SCIP variables */
184 
185  SCIP_CONSHDLR** conshdlrs; /* array of constraint handler's that might that might obtain conflicts */
186  int* oldnconss; /* number of constraints without rapid learning conflicts */
187 
188  SCIP_Longint nodelimit; /* node limit for the subproblem */
189  SCIP_Real timelimit; /* time limit for the subproblem */
190  SCIP_Real memorylimit; /* memory limit for the subproblem */
191 
192  int nconshdlrs; /* size of conshdlr and oldnconss array */
193  int nfixedvars; /* number of variables that could be fixed by rapid learning */
194  int nvars; /* number of variables */
195  int restartnum; /* maximal number of conflicts that should be created */
196  int i; /* counter */
197 
198  SCIP_Bool success; /* was problem creation / copying constraint successful? */
199  SCIP_RETCODE retcode; /* used for catching sub-SCIP errors in debug mode */
200 
201  int nconflicts; /* statistic: number of conflicts applied */
202  int nbdchgs; /* statistic: number of bound changes applied */
203  int n1startinfers; /* statistic: number of one side infer values */
204  int n2startinfers; /* statistic: number of both side infer values */
205 
206  SCIP_Bool soladded; /* statistic: was a new incumbent found? */
207  SCIP_Bool dualboundchg; /* statistic: was a new dual bound found? */
208  SCIP_Bool disabledualreductions; /* TRUE, if dual reductions in sub-SCIP are not valid for original SCIP,
209  * e.g., because a constraint could not be copied or a primal solution
210  * could not be copied back
211  */
212 
213  int ndiscvars;
214 
215  soladded = FALSE;
216 
217  assert(sepa != NULL);
218  assert(scip != NULL);
219  assert(result != NULL);
220 
221  *result = SCIP_DIDNOTRUN;
222 
223  ndiscvars = SCIPgetNBinVars(scip) + SCIPgetNIntVars(scip) + SCIPgetNImplVars(scip);
224 
225  /* only run when still not fixed binary variables exists */
226  if( ndiscvars == 0 )
227  return SCIP_OKAY;
228 
229  /* get separator's data */
230  sepadata = SCIPsepaGetData(sepa);
231  assert(sepadata != NULL);
232 
233  /* only run for integer programs */
234  if( !sepadata->contvars && ndiscvars != SCIPgetNVars(scip) )
235  return SCIP_OKAY;
236 
237  /* only run if there are few enough continuous variables */
238  if( sepadata->contvars && SCIPgetNContVars(scip) > sepadata->contvarsquot * SCIPgetNVars(scip) )
239  return SCIP_OKAY;
240 
241  /* do not run if pricers are present */
242  if( SCIPgetNActivePricers(scip) > 0 )
243  return SCIP_OKAY;
244 
245  /* if the separator should be exclusive to the root node, this prevents multiple calls due to restarts */
246  if( SCIPsepaGetFreq(sepa) == 0 && SCIPsepaGetNCalls(sepa) > 0 )
247  return SCIP_OKAY;
248 
249  /* call separator at most once per node */
250  if( SCIPsepaGetNCallsAtNode(sepa) > 0 )
251  return SCIP_OKAY;
252 
253  /* do not call rapid learning, if the problem is too big */
254  if( SCIPgetNVars(scip) > sepadata->maxnvars || SCIPgetNConss(scip) > sepadata->maxnconss )
255  return SCIP_OKAY;
256 
257  if( SCIPisStopped(scip) )
258  return SCIP_OKAY;
259 
260  *result = SCIP_DIDNOTFIND;
261 
262  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
263 
264  /* initializing the subproblem */
265  SCIP_CALL( SCIPallocBufferArray(scip, &subvars, nvars) );
266  SCIP_CALL( SCIPcreate(&subscip) );
267  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(subscip), SCIPcalcHashtableSize(5 * nvars)) );
268  success = FALSE;
269 
270  /* copy the subproblem */
271  SCIP_CALL( SCIPcopy(scip, subscip, varmapfw, NULL, "rapid", FALSE, FALSE, TRUE, &success) );
272 
273  if( sepadata->copycuts )
274  {
275  /* copies all active cuts from cutpool of sourcescip to linear constraints in targetscip */
276  SCIP_CALL( SCIPcopyCuts(scip, subscip, varmapfw, NULL, FALSE, NULL) );
277  }
278 
279  for( i = 0; i < nvars; i++ )
280  {
281  subvars[i] = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
282 
283  /* change implicit integer variables to integer type */
284  if( SCIPvarGetType(subvars[i]) == SCIP_VARTYPE_IMPLINT )
285  {
286  SCIP_Bool infeasible;
287 
288  SCIP_CALL( SCIPchgVarType(subscip, subvars[i], SCIP_VARTYPE_INTEGER, &infeasible) );
289  assert(!infeasible);
290  }
291  }
292 
293  SCIPhashmapFree(&varmapfw);
294 
295  /* This avoids dual presolving.
296  *
297  * If the copy is not valid, it should be a relaxation of the problem (constraints might have failed to be copied,
298  * but no variables should be missing because we stop earlier anyway if pricers are present).
299  * By disabling dual presolving, conflicts found in a relaxation are still valid for the original problem.
300  */
301  if( !success )
302  {
303  for( i = 0; i < nvars; i++ )
304  {
305  SCIP_CALL( SCIPaddVarLocks(subscip, subvars[i], 1, 1 ) );
306  }
307  }
308 
309  SCIPdebugMessage("Copying SCIP was%s successful.\n", success ? "" : " not");
310 
311  /* mimic an FD solver: DFS, no LP solving, 1-FUIP instead of all-FUIP */
312  if( SCIPisParamFixed(subscip, "lp/solvefreq") )
313  {
314  SCIPwarningMessage(scip, "unfixing parameter lp/solvefreq in subscip of rapidlearning\n");
315  SCIP_CALL( SCIPunfixParam(subscip, "lp/solvefreq") );
316  }
317  SCIP_CALL( SCIPsetIntParam(subscip, "lp/solvefreq", -1) );
318  if( !SCIPisParamFixed(subscip, "conflict/fuiplevels") )
319  {
320  SCIP_CALL( SCIPsetIntParam(subscip, "conflict/fuiplevels", 1) );
321  }
322  if( SCIPisParamFixed(subscip, "nodeselection/dfs/stdpriority") )
323  {
324  SCIPwarningMessage(scip, "unfixing parameter nodeselection/dfs/stdpriority in subscip of rapidlearning\n");
325  SCIP_CALL( SCIPunfixParam(subscip, "nodeselection/dfs/stdpriority") );
326  }
327  SCIP_CALL( SCIPsetIntParam(subscip, "nodeselection/dfs/stdpriority", INT_MAX/4) );
328 
329  if( !SCIPisParamFixed(subscip, "propagating/pseudoobj/freq") )
330  {
331  SCIP_CALL( SCIPsetIntParam(subscip, "propagating/pseudoobj/freq", -1) );
332  }
333  if( !SCIPisParamFixed(subscip, "constraints/disableenfops") )
334  {
335  SCIP_CALL( SCIPsetBoolParam(subscip, "constraints/disableenfops", TRUE) );
336  }
337 
338  /* use inference branching */
339  if( !SCIPisParamFixed(subscip, "branching/inference/useweightedsum") )
340  {
341  SCIP_CALL( SCIPsetBoolParam(subscip, "branching/inference/useweightedsum", FALSE) );
342  }
343 
344  /* only create short conflicts */
345  if( !SCIPisParamFixed(subscip, "conflict/maxvarsfac") )
346  {
347  SCIP_CALL( SCIPsetRealParam(subscip, "conflict/maxvarsfac", 0.05) );
348  }
349 
350  /* set limits for the subproblem */
351  nodelimit = SCIPgetNLPIterations(scip);
352  nodelimit = MAX(sepadata->minnodes, nodelimit);
353  nodelimit = MIN(sepadata->maxnodes, nodelimit);
354 
355  restartnum = 1000;
356 
357  /* check whether there is enough time and memory left */
358  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
359  if( !SCIPisInfinity(scip, timelimit) )
360  timelimit -= SCIPgetSolvingTime(scip);
361  SCIP_CALL( SCIPgetRealParam(scip, "limits/memory", &memorylimit) );
362 
363  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
364  if( !SCIPisInfinity(scip, memorylimit) )
365  {
366  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
367  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
368  }
369 
370  /* abort if no time is left or not enough memory to create a copy of SCIP
371  * for rapid learning, this does not include external memory usage, because no LPs are solved
372  */
373  if( timelimit <= 0.0 || memorylimit <= SCIPgetMemExternEstim(scip)/1048576.0 )
374  goto TERMINATE;
375 
376  /* disable statistic timing inside sub SCIP */
377  SCIP_CALL( SCIPsetBoolParam(subscip, "timing/statistictiming", FALSE) );
378 
379  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", nodelimit/5) );
380  SCIP_CALL( SCIPsetRealParam(subscip, "limits/time", timelimit) );
381  SCIP_CALL( SCIPsetRealParam(subscip, "limits/memory", memorylimit) );
382  SCIP_CALL( SCIPsetIntParam(subscip, "limits/restarts", 0) );
383  SCIP_CALL( SCIPsetIntParam(subscip, "conflict/restartnum", restartnum) );
384 
385  /* forbid recursive call of heuristics and separators solving subMIPs */
386  SCIP_CALL( SCIPsetSubscipsOff(subscip, TRUE) );
387 
388  /* disable cutting plane separation */
390 
391  /* disable expensive presolving */
393 
394  /* do not abort subproblem on CTRL-C */
395  SCIP_CALL( SCIPsetBoolParam(subscip, "misc/catchctrlc", FALSE) );
396 
397 #ifndef SCIP_DEBUG
398  /* disable output to console */
399  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", 0) );
400 #endif
401 
402  /* add an objective cutoff */
403  SCIP_CALL( SCIPsetObjlimit(subscip, SCIPgetUpperbound(scip)) );
404 
405  /* create the variable mapping hash map */
406  SCIP_CALL( SCIPhashmapCreate(&varmapbw, SCIPblkmem(scip), SCIPcalcHashtableSize(5 * nvars)) );
407 
408  /* store reversing mapping of variables */
409  SCIP_CALL( SCIPtransformProb(subscip) );
410  for( i = 0; i < nvars; ++i)
411  {
412  SCIP_CALL( SCIPhashmapInsert(varmapbw, SCIPvarGetTransVar(subvars[i]), vars[i]) );
413  }
414 
415  /* allocate memory for constraints storage. Each constraint that will be created from now on will be a conflict.
416  * Therefore, we need to remember oldnconss to get the conflicts from the FD search.
417  */
418  nconshdlrs = 4;
419  SCIP_CALL( SCIPallocBufferArray(scip, &conshdlrs, nconshdlrs) );
420  SCIP_CALL( SCIPallocBufferArray(scip, &oldnconss, nconshdlrs) );
421 
422  /* store number of constraints before rapid learning search */
423  conshdlrs[0] = SCIPfindConshdlr(subscip, "bounddisjunction");
424  conshdlrs[1] = SCIPfindConshdlr(subscip, "setppc");
425  conshdlrs[2] = SCIPfindConshdlr(subscip, "linear");
426  conshdlrs[3] = SCIPfindConshdlr(subscip, "logicor");
427 
428  /* redundant constraints might be eliminated in presolving */
429  SCIP_CALL( SCIPpresolve(subscip));
430 
431  for( i = 0; i < nconshdlrs; ++i)
432  {
433  if( conshdlrs[i] != NULL )
434  oldnconss[i] = SCIPconshdlrGetNConss(conshdlrs[i]);
435  }
436 
437  nfixedvars = SCIPgetNFixedVars(scip);
438 
439  /* solve the subproblem */
440  retcode = SCIPsolve(subscip);
441 
442  /* Errors in solving the subproblem should not kill the overall solving process
443  * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
444  */
445  if( retcode != SCIP_OKAY )
446  {
447 #ifndef NDEBUG
448  SCIP_CALL( retcode );
449 #endif
450  SCIPwarningMessage(scip, "Error while solving subproblem in rapid learning separator; sub-SCIP terminated with code <%d>\n",retcode);
451  }
452 
453  /* if problem was already solved do not increase limits to run again */
454  if( SCIPgetStage(subscip) == SCIP_STAGE_SOLVED )
455  {
456  SCIPdebugMessage("Subscip was completely solved, status %d.\n", SCIPgetStatus(subscip));
457  }
458  /* abort solving, if limit of applied conflicts is reached */
459  else if( SCIPgetNConflictConssApplied(subscip) >= restartnum )
460  {
461  SCIPdebugMessage("finish after %" SCIP_LONGINT_FORMAT " successful conflict calls.\n", SCIPgetNConflictConssApplied(subscip));
462  }
463  /* if the first 20% of the solution process were successful, proceed */
464  else if( (sepadata->applyprimalsol && SCIPgetNSols(subscip) > 0 && SCIPisFeasLT(scip, SCIPgetUpperbound(subscip), SCIPgetUpperbound(scip) ) )
465  || (sepadata->applybdchgs && SCIPgetNFixedVars(subscip) > nfixedvars)
466  || (sepadata->applyconflicts && SCIPgetNConflictConssApplied(subscip) > 0) )
467  {
468  SCIPdebugMessage("proceed solving after the first 20%% of the solution process, since:\n");
469 
470  if( SCIPgetNSols(subscip) > 0 && SCIPisFeasLE(scip, SCIPgetUpperbound(subscip), SCIPgetUpperbound(scip) ) )
471  {
472  SCIPdebugMessage(" - there was a better solution (%f < %f)\n",SCIPgetUpperbound(subscip), SCIPgetUpperbound(scip));
473  }
474  if( SCIPgetNFixedVars(subscip) > nfixedvars )
475  {
476  SCIPdebugMessage(" - there were %d variables fixed\n", SCIPgetNFixedVars(scip)-nfixedvars );
477  }
478  if( SCIPgetNConflictConssFound(subscip) > 0 )
479  {
480  SCIPdebugMessage(" - there were %" SCIP_LONGINT_FORMAT " conflict constraints created\n", SCIPgetNConflictConssApplied(subscip));
481  }
482 
483  /* set node limit to 100% */
484  SCIP_CALL( SCIPsetLongintParam(subscip, "limits/nodes", nodelimit) );
485 
486  /* solve the subproblem */
487  retcode = SCIPsolve(subscip);
488 
489  /* Errors in solving the subproblem should not kill the overall solving process
490  * Hence, the return code is caught and a warning is printed, only in debug mode, SCIP will stop.
491  */
492  if( retcode != SCIP_OKAY )
493  {
494 #ifndef NDEBUG
495  SCIP_CALL( retcode );
496 #endif
497  SCIPwarningMessage(scip, "Error while solving subproblem in rapid learning separator; sub-SCIP terminated with code <%d>\n",retcode);
498  }
499  }
500  else
501  {
502  SCIPdebugMessage("do not proceed solving after the first 20%% of the solution process.\n");
503  }
504 
505 #ifdef SCIP_DEBUG
506  SCIP_CALL( SCIPprintStatistics(subscip, NULL) );
507 #endif
508 
509  disabledualreductions = FALSE;
510 
511  /* check, whether a solution was found */
512  if( sepadata->applyprimalsol && SCIPgetNSols(subscip) > 0 && SCIPfindHeur(scip, "trysol") != NULL )
513  {
514  SCIP_HEUR* heurtrysol;
515  SCIP_SOL** subsols;
516  int nsubsols;
517 
518  /* check, whether a solution was found;
519  * due to numerics, it might happen that not all solutions are feasible -> try all solutions until was declared to be feasible
520  */
521  nsubsols = SCIPgetNSols(subscip);
522  subsols = SCIPgetSols(subscip);
523  soladded = FALSE;
524  heurtrysol = SCIPfindHeur(scip, "trysol");
525 
526  /* sequentially add solutions to trysol heuristic */
527  for( i = 0; i < nsubsols && !soladded; ++i )
528  {
529  SCIPdebugMessage("Try to create new solution by copying subscip solution.\n");
530  SCIP_CALL( createNewSol(scip, subscip, subvars, heurtrysol, subsols[i], &soladded) );
531  }
532  if( !soladded || !SCIPisEQ(scip, SCIPgetSolOrigObj(subscip, subsols[i-1]), SCIPgetSolOrigObj(subscip, subsols[0])) )
533  disabledualreductions = TRUE;
534  }
535 
536  /* if the sub problem was solved completely, we update the dual bound */
537  dualboundchg = FALSE;
538  if( sepadata->applysolved && !disabledualreductions
540  {
541  /* we need to multiply the dualbound with the scaling factor and add the offset,
542  * because this information has been disregarded in the sub-SCIP
543  */
544  SCIPdebugMessage("Update old dualbound %g to new dualbound %g.\n", SCIPgetDualbound(scip), SCIPretransformObj(scip, SCIPgetDualbound(subscip)));
545 
547  dualboundchg = TRUE;
548  }
549 
550  /* check, whether conflicts were created */
551  nconflicts = 0;
552  if( sepadata->applyconflicts && !disabledualreductions && SCIPgetNConflictConssApplied(subscip) > 0 )
553  {
554  SCIP_HASHMAP* consmap;
555  int hashtablesize;
556 
557  assert(SCIPgetNConflictConssApplied(subscip) < (SCIP_Longint) INT_MAX);
558  hashtablesize = (int) SCIPgetNConflictConssApplied(subscip);
559  assert(hashtablesize < INT_MAX/5);
560  hashtablesize *= 5;
561 
562  /* create the variable mapping hash map */
563  SCIP_CALL( SCIPhashmapCreate(&consmap, SCIPblkmem(scip), SCIPcalcHashtableSize(hashtablesize)) );
564 
565  /* loop over all constraint handlers that might contain conflict constraints */
566  for( i = 0; i < nconshdlrs; ++i)
567  {
568  /* copy constraints that have been created in FD run */
569  if( conshdlrs[i] != NULL && SCIPconshdlrGetNConss(conshdlrs[i]) > oldnconss[i] )
570  {
571  SCIP_CONS** conss;
572  int c;
573  int nconss;
574 
575  nconss = SCIPconshdlrGetNConss(conshdlrs[i]);
576  conss = SCIPconshdlrGetConss(conshdlrs[i]);
577 
578  /* loop over all constraints that have been added in sub-SCIP run, these are the conflicts */
579  for( c = oldnconss[i]; c < nconss; ++c)
580  {
581  SCIP_CONS* cons;
582  SCIP_CONS* conscopy;
583 
584  cons = conss[c];
585  assert(cons != NULL);
586 
587  success = FALSE;
588 
589  /* @todo assert that flags are as they should be for conflicts */
590  SCIP_CALL( SCIPgetConsCopy(subscip, scip, cons, &conscopy, conshdlrs[i], varmapbw, consmap, NULL,
593  SCIPconsIsRemovable(cons), FALSE, TRUE, &success) );
594 
595  if( success )
596  {
597  nconflicts++;
598  SCIP_CALL( SCIPaddCons(scip, conscopy) );
599  SCIP_CALL( SCIPreleaseCons(scip, &conscopy) );
600  }
601  else
602  {
603  SCIPdebugMessage("failed to copy conflict constraint %s back to original SCIP\n", SCIPconsGetName(cons));
604  }
605  }
606  }
607  }
608  SCIPhashmapFree(&consmap);
609  }
610 
611  /* check, whether tighter global bounds were detected */
612  nbdchgs = 0;
613  if( sepadata->applybdchgs && !disabledualreductions )
614  for( i = 0; i < nvars; ++i )
615  {
616  SCIP_Bool infeasible;
617  SCIP_Bool tightened;
618 
619  assert(SCIPisLE(scip, SCIPvarGetLbGlobal(vars[i]), SCIPvarGetLbGlobal(subvars[i])));
620  assert(SCIPisLE(scip, SCIPvarGetLbGlobal(subvars[i]), SCIPvarGetUbGlobal(subvars[i])));
621  assert(SCIPisLE(scip, SCIPvarGetUbGlobal(subvars[i]), SCIPvarGetUbGlobal(vars[i])));
622 
623  /* update the bounds of the original SCIP, if a better bound was proven in the sub-SCIP */
624  /* @todo handle infeasible pointer? can it be set to TRUE? */
625  SCIP_CALL( SCIPtightenVarUb(scip, vars[i], SCIPvarGetUbGlobal(subvars[i]), FALSE, &infeasible, &tightened) );
626  if( tightened )
627  nbdchgs++;
628 
629  SCIP_CALL( SCIPtightenVarLb(scip, vars[i], SCIPvarGetLbGlobal(subvars[i]), FALSE, &infeasible, &tightened) );
630  if( tightened )
631  nbdchgs++;
632  }
633 
634  n1startinfers = 0;
635  n2startinfers = 0;
636 
637  /* install start values for inference branching */
638  /* @todo use different nbranching counters for pseudo cost and inference values and update inference values in the tree */
639  if( sepadata->applyinfervals && SCIPgetDepth(scip) == 0 && (!sepadata->reducedinfer || soladded || nbdchgs+nconflicts > 0) )
640  {
641  for( i = 0; i < nvars; ++i )
642  {
643  SCIP_Real downinfer;
644  SCIP_Real upinfer;
645  SCIP_Real downvsids;
646  SCIP_Real upvsids;
647  SCIP_Real downconflen;
648  SCIP_Real upconflen;
649 
650  /* copy downwards branching statistics */
651  downvsids = SCIPgetVarVSIDS(subscip, subvars[i], SCIP_BRANCHDIR_DOWNWARDS);
652  downconflen = SCIPgetVarAvgConflictlength(subscip, subvars[i], SCIP_BRANCHDIR_DOWNWARDS);
653  downinfer = SCIPgetVarAvgInferences(subscip, subvars[i], SCIP_BRANCHDIR_DOWNWARDS);
654 
655  /* copy upwards branching statistics */
656  upvsids = SCIPgetVarVSIDS(subscip, subvars[i], SCIP_BRANCHDIR_UPWARDS);
657  upconflen = SCIPgetVarAvgConflictlength(subscip, subvars[i], SCIP_BRANCHDIR_UPWARDS);
658  upinfer = SCIPgetVarAvgInferences(subscip, subvars[i], SCIP_BRANCHDIR_UPWARDS);
659 
660  /* memorize statistics */
661  if( downinfer+downconflen+downvsids > 0.0 || upinfer+upconflen+upvsids != 0 )
662  n1startinfers++;
663 
664  if( downinfer+downconflen+downvsids > 0.0 && upinfer+upconflen+upvsids != 0 )
665  n2startinfers++;
666 
667  SCIP_CALL( SCIPinitVarBranchStats(scip, vars[i], 0.0, 0.0, downvsids, upvsids, downconflen, upconflen, downinfer, upinfer, 0.0, 0.0) );
668  }
669  }
670 
671  SCIPdebugPrintf("XXX Rapidlearning added %d conflicts, changed %d bounds, %s primal solution, %s dual bound improvement.\n", nconflicts, nbdchgs, soladded ? "found" : "no",
672  dualboundchg ? "found" : "no");
673 
674  SCIPdebugPrintf("YYY Infervalues initialized on one side: %5.2f %% of variables, %5.2f %% on both sides\n",
675  100.0 * n1startinfers/(SCIP_Real)nvars, 100.0 * n2startinfers/(SCIP_Real)nvars);
676 
677  /* change result pointer */
678  if( nconflicts > 0 || dualboundchg )
679  *result = SCIP_CONSADDED;
680  else if( nbdchgs > 0 )
681  *result = SCIP_REDUCEDDOM;
682 
683  /* free local data */
684  SCIPfreeBufferArray(scip, &oldnconss);
685  SCIPfreeBufferArray(scip, &conshdlrs);
686 
687  SCIPhashmapFree(&varmapbw);
688 
689  TERMINATE:
690  /* free subproblem */
691  SCIPfreeBufferArray(scip, &subvars);
692  SCIP_CALL( SCIPfree(&subscip) );
693 
694  return SCIP_OKAY;
695 }
696 
697 
698 /*
699  * separator specific interface methods
700  */
701 
702 /** creates the rapidlearning separator and includes it in SCIP */
704  SCIP* scip /**< SCIP data structure */
705  )
706 {
707  SCIP_SEPADATA* sepadata;
708  SCIP_SEPA* sepa;
709 
710  /* create rapidlearning separator data */
711  SCIP_CALL( SCIPallocMemory(scip, &sepadata) );
712 
713  /* include separator */
716  sepaExeclpRapidlearning, NULL,
717  sepadata) );
718 
719  assert(sepa != NULL);
720 
721  /* set non-NULL pointers to callback methods */
722  SCIP_CALL( SCIPsetSepaCopy(scip, sepa, sepaCopyRapidlearning) );
723  SCIP_CALL( SCIPsetSepaFree(scip, sepa, sepaFreeRapidlearning) );
724 
725  /* add rapidlearning separator parameters */
726  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/applyconflicts",
727  "should the found conflicts be applied in the original SCIP?",
728  &sepadata->applyconflicts, TRUE, DEFAULT_APPLYCONFLICTS, NULL, NULL) );
729 
730  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/applybdchgs",
731  "should the found global bound deductions be applied in the original SCIP?",
732  &sepadata->applybdchgs, TRUE, DEFAULT_APPLYBDCHGS, NULL, NULL) );
733 
734  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/applyinfervals",
735  "should the inference values be used as initialization in the original SCIP?",
736  &sepadata->applyinfervals, TRUE, DEFAULT_APPLYINFERVALS, NULL, NULL) );
737 
738  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/reducedinfer",
739  "should the inference values only be used when " SEPA_NAME " found other reductions?",
740  &sepadata->reducedinfer, TRUE, DEFAULT_REDUCEDINFER, NULL, NULL) );
741 
742  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/applyprimalsol",
743  "should the incumbent solution be copied to the original SCIP?",
744  &sepadata->applyprimalsol, TRUE, DEFAULT_APPLYPRIMALSOL, NULL, NULL) );
745 
746  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/applysolved",
747  "should a solved status be copied to the original SCIP?",
748  &sepadata->applysolved, TRUE, DEFAULT_APPLYSOLVED, NULL, NULL) );
749 
750  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/contvars",
751  "should rapid learning be applied when there are continuous variables?",
752  &sepadata->contvars, TRUE, DEFAULT_CONTVARS, NULL, NULL) );
753 
754  SCIP_CALL( SCIPaddRealParam(scip, "separating/" SEPA_NAME "/contvarsquot",
755  "maximal portion of continuous variables to apply rapid learning",
756  &sepadata->contvarsquot, TRUE, DEFAULT_CONTVARSQUOT, 0.0, 1.0, NULL, NULL) );
757 
758  SCIP_CALL( SCIPaddRealParam(scip, "separating/" SEPA_NAME "/lpiterquot",
759  "maximal fraction of LP iterations compared to node LP iterations",
760  &sepadata->lpiterquot, TRUE, DEFAULT_LPITERQUOT, 0.0, SCIP_REAL_MAX, NULL, NULL) );
761 
762  SCIP_CALL( SCIPaddIntParam(scip, "separating/" SEPA_NAME "/maxnvars",
763  "maximum problem size (variables) for which rapid learning will be called",
764  &sepadata->maxnvars, TRUE, DEFAULT_MAXNVARS, 0, INT_MAX, NULL, NULL) );
765 
766  SCIP_CALL( SCIPaddIntParam(scip, "separating/" SEPA_NAME "/maxnconss",
767  "maximum problem size (constraints) for which rapid learning will be called",
768  &sepadata->maxnconss, TRUE, DEFAULT_MAXNCONSS, 0, INT_MAX, NULL, NULL) );
769 
770  SCIP_CALL( SCIPaddIntParam(scip, "separating/" SEPA_NAME "/maxnodes",
771  "maximum number of nodes considered in rapid learning run",
772  &sepadata->maxnodes, TRUE, DEFAULT_MAXNODES, 0, INT_MAX, NULL, NULL) );
773 
774  SCIP_CALL( SCIPaddIntParam(scip, "separating/" SEPA_NAME "/minnodes",
775  "minimum number of nodes considered in rapid learning run",
776  &sepadata->minnodes, TRUE, DEFAULT_MINNODES, 0, INT_MAX, NULL, NULL) );
777 
778  SCIP_CALL( SCIPaddBoolParam(scip, "separating/" SEPA_NAME "/copycuts",
779  "should all active cuts from cutpool be copied to constraints in subproblem?",
780  &sepadata->copycuts, TRUE, DEFAULT_COPYCUTS, NULL, NULL) );
781 
782  return SCIP_OKAY;
783 }
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
Definition: var.c:16760
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41572
#define SEPA_USESSUBSCIP
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:40329
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:10698
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:5878
#define SCIPallocMemory(scip, ptr)
Definition: scip.h:20526
#define DEFAULT_REDUCEDINFER
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip.c:908
#define SEPA_FREQ
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:41648
#define DEFAULT_MINNODES
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1248
SCIP_Real SCIPgetVarAvgConflictlength(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23769
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41920
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
Definition: scip.c:37454
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4288
#define NULL
Definition: lpi_spx.cpp:130
#define DEFAULT_CONTVARSQUOT
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4258
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1125
#define DEFAULT_LPITERQUOT
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17067
static SCIP_DECL_SEPAEXECLP(sepaExeclpRapidlearning)
#define DEFAULT_COPYCUTS
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
Definition: scip.c:3875
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip.c:7393
#define FALSE
Definition: def.h:56
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:41009
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2057
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4046
int SCIPsepaGetFreq(SCIP_SEPA *sepa)
Definition: sepa.c:677
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:10743
#define TRUE
Definition: def.h:55
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIP_CALL(x)
Definition: def.h:266
SCIP_RETCODE SCIPincludeSepaRapidlearning(SCIP *scip)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:36299
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:4109
SCIP_RETCODE SCIPgetConsCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, 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_Bool global, SCIP_Bool *success)
Definition: scip.c:2365
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip.c:5017
public methods for problem variables
#define SCIPdebugMessage
Definition: pub_message.h:77
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2116
int SCIPgetNContVars(SCIP *scip)
Definition: scip.c:10878
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition: cons.c:7779
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip.c:6718
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
Definition: sepa.c:544
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:24949
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:633
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition: cons.c:7769
#define DEFAULT_APPLYCONFLICTS
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:35066
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2883
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:35668
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3547
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3573
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:11138
SCIP_RETCODE SCIPupdateLocalDualbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:12252
#define SCIPfreeMemory(scip, ptr)
Definition: scip.h:20542
int SCIPgetNConss(SCIP *scip)
Definition: scip.c:11736
SCIP_Real SCIPgetDualbound(SCIP *scip)
Definition: scip.c:38372
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:3254
SCIP_Longint SCIPsepaGetNCalls(SCIP_SEPA *sepa)
Definition: sepa.c:750
#define SCIPdebugPrintf
Definition: pub_message.h:80
int SCIPcalcHashtableSize(int minsize)
Definition: misc.c:1157
#define DEFAULT_APPLYBDCHGS
SCIP_Real SCIPgetVarAvgInferences(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23823
#define SEPA_DELAY
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41598
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:34002
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:41353
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:7620
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2075
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4457
#define SEPA_PRIORITY
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:35020
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip.c:14342
#define DEFAULT_MAXNCONSS
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:766
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:35717
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:12623
#define DEFAULT_MAXNVARS
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:38534
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:22681
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20193
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
Definition: sepa.c:554
#define SCIP_Bool
Definition: def.h:53
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4001
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:35198
SCIP_Longint SCIPgetNConflictConssFound(SCIP *scip)
Definition: scip.c:38057
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:801
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition: cons.c:7859
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:3709
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip.c:6702
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:4382
#define MAX(x, y)
Definition: tclique_def.h:75
#define DEFAULT_APPLYINFERVALS
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition: cons.c:7869
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:41396
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:4431
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:38140
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
#define SCIP_REAL_MAX
Definition: def.h:128
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:11477
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:14503
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16608
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:20585
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17057
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:692
static SCIP_DECL_SEPAFREE(sepaFreeRapidlearning)
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip.c:11015
int SCIPgetNIntVars(SCIP *scip)
Definition: scip.c:10788
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:41933
#define SCIP_Real
Definition: def.h:127
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:7799
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:20299
#define MIN(x, y)
Definition: memory.c:67
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:10194
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
Definition: scip.c:38114
rapidlearning separator
#define SCIP_Longint
Definition: def.h:112
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
Definition: sepa.c:760
#define DEFAULT_APPLYPRIMALSOL
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:34885
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
Definition: scip.c:19399
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:3938
#define SEPA_NAME
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:10572
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:20597
SCIP_Real SCIPgetVarVSIDS(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:23581
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:3797
#define DEFAULT_MAXNODES
#define SEPA_DESC
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2094
SCIP_RETCODE SCIPinitVarBranchStats(SCIP *scip, SCIP_VAR *var, SCIP_Real downpscost, SCIP_Real uppscost, SCIP_Real downvsids, SCIP_Real upvsids, SCIP_Real downconflen, SCIP_Real upconflen, SCIP_Real downinfer, SCIP_Real upinfer, SCIP_Real downcutoff, SCIP_Real upcutoff)
Definition: scip.c:23941
int SCIPgetNImplVars(SCIP *scip)
Definition: scip.c:10833
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
Definition: scip.c:6660
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:3629
#define DEFAULT_APPLYSOLVED
#define SEPA_MAXBOUNDDIST
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition: cons.c:7789
default SCIP plugins
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition: cons.c:7819
#define DEFAULT_CONTVARS
static SCIP_DECL_SEPACOPY(sepaCopyRapidlearning)
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:41409