Scippy

SCIP

Solving Constraint Integer Programs

prop_nlobbt.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 prop_nlobbt.c
17  * @brief nlobbt propagator
18  * @author Benjamin Mueller
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include <assert.h>
24 
25 #include "scip/prop_nlobbt.h"
26 #include "scip/prop_genvbounds.h"
27 #include "nlpi/nlpi.h"
28 
29 #define PROP_NAME "nlobbt"
30 #define PROP_DESC "propagator template"
31 #define PROP_PRIORITY -1100000
32 #define PROP_FREQ -1
33 #define PROP_DELAY TRUE
34 #define PROP_TIMING SCIP_PROPTIMING_AFTERLPLOOP
35 
36 #define DEFAULT_MINNONCONVEXFRAC 0.20 /**< default minimum (# convex nlrows)/(# nonconvex nlrows) threshold to apply propagator */
37 #define DEFAULT_MINLINEARFRAC 0.02 /**< default minimum (# convex nlrows)/(# linear nlrows) threshold to apply propagator */
38 #define DEFAULT_FEASTOLFAC 0.01 /**< default factor for NLP feasibility tolerance */
39 #define DEFAULT_RELOBJTOLFAC 0.01 /**< default factor for NLP relative objective tolerance */
40 #define DEFAULT_ADDLPROWS TRUE /**< should (non-initial) LP rows be used? */
41 #define DEFAULT_ITLIMITFACTOR 2.0 /**< multiple of root node LP iterations used as total LP iteration
42  * limit for nlobbt (<= 0: no limit ) */
43 #define DEFAULT_NLPITERLIMIT 500 /**< default iteration limit of NLP solver; 0 for no limit */
44 #define DEFAULT_NLPTIMELIMIT 0.0 /**< default time limit of NLP solver; 0.0 for no limit */
45 #define DEFAULT_NLPVERLEVEL 0 /**< verbosity level of NLP solver */
46 #define DEFAULT_RANDSEED 79 /**< initial random seed */
47 
48 /*
49  * Data structures
50  */
51 
52 /** status of bound candidates */
53 enum BoundStatus
54 {
55  UNSOLVED = 1, /**< did not solve LB or UB problem */
56  SOLVEDLB = 2, /**< solved LB problem */
57  SOLVEDUB = 4 /**< solved UB problem */
58 };
59 
60 /** propagator data */
61 struct SCIP_PropData
62 {
63  SCIP_NLPI* nlpi; /**< nlpi used to create the nlpi problem */
64  SCIP_NLPIPROBLEM* nlpiprob; /**< nlpi problem representing the convex NLP relaxation */
65  SCIP_HASHMAP* var2nlpiidx; /**< mapping between variables and nlpi indices */
66  SCIP_VAR** nlpivars; /**< array containing all variables of the nlpi */
67  int nlpinvars; /**< total number of nlpi variables */
68  SCIP_Real* nlscore; /**< score for each nonlinear variable */
69  int* status; /**< array containing a bound status for each candidate (type int* is
70  * necessary to use sort functions) */
71  SCIP_PROP* genvboundprop; /**< genvbound propagator */
72  SCIP_RANDNUMGEN* randnumgen; /**< random number generator */
73  SCIP_Bool skipprop; /**< should the propagator be skipped? */
74  SCIP_Longint lastnode; /**< number of last node where obbt was performed */
75  int currpos; /**< current position in the nlpivars array */
76 
77  int nlpiterlimit; /**< iteration limit of NLP solver; 0 for no limit */
78  SCIP_Real nlptimelimit; /**< time limit of NLP solver; 0.0 for no limit */
79  int nlpverblevel; /**< verbosity level of NLP solver */
80  SCIP_NLPSTATISTICS* nlpstatistics; /**< statistics from NLP solver */
81 
82  SCIP_Real feastolfac; /**< factor for NLP feasibility tolerance */
83  SCIP_Real relobjtolfac; /**< factor for NLP relative objective tolerance */
84  SCIP_Real minnonconvexfrac; /**< minimum (#convex nlrows)/(#nonconvex nlrows) threshold to apply propagator */
85  SCIP_Real minlinearfrac; /**< minimum (#convex nlrows)/(#linear nlrows) threshold to apply propagator */
86  SCIP_Bool addlprows; /**< should (non-initial) LP rows be used? */
87  SCIP_Real itlimitfactor; /**< LP iteration limit for nlobbt will be this factor times total LP
88  * iterations in root node */
89 };
90 
91 /*
92  * Local methods
93  */
94 
95 /** clears the propagator data */
96 static
98  SCIP* scip, /**< SCIP data structure */
99  SCIP_PROPDATA* propdata /**< propagator data */
100  )
101 {
102  assert(propdata != NULL);
103 
104  if( propdata->nlpiprob != NULL )
105  {
106  assert(propdata->nlpi != NULL);
107 
108  SCIPfreeBlockMemoryArray(scip, &propdata->status, propdata->nlpinvars);
109  SCIPfreeBlockMemoryArray(scip, &propdata->nlscore, propdata->nlpinvars);
110  SCIPfreeBlockMemoryArray(scip, &propdata->nlpivars, propdata->nlpinvars);
111  SCIPhashmapFree(&propdata->var2nlpiidx);
112  SCIP_CALL( SCIPnlpiFreeProblem(propdata->nlpi, &propdata->nlpiprob) );
113 
114  propdata->nlpinvars = 0;
115  }
116  assert(propdata->nlpinvars == 0);
117 
118  propdata->skipprop = FALSE;
119  propdata->currpos = 0;
120  propdata->lastnode = -1;
121 
122  return SCIP_OKAY;
123 }
124 
125 /** checks whether it is worth to call nonlinear OBBT procedure */
126 static
128  SCIP* scip, /**< SCIP data structure */
129  SCIP_PROPDATA* propdata /**< propagation data */
130  )
131 {
132  SCIP_NLROW** nlrows;
133  int nnonconvexnlrows;
134  int nconvexnlrows;
135  int nlinearnlrows;
136  int nnlrows;
137  int i;
138 
139  nlrows = SCIPgetNLPNlRows(scip);
140  nnlrows = SCIPgetNNLPNlRows(scip);
141  nnonconvexnlrows = 0;
142  nconvexnlrows = 0;
143  nlinearnlrows = 0;
144 
145  for( i = 0; i < nnlrows; ++i )
146  {
147  if( SCIPnlrowGetNQuadElems(nlrows[i]) == 0 && SCIPnlrowGetExprtree(nlrows[i]) == NULL )
148  ++nlinearnlrows;
149  else if( SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONVEX )
150  {
151  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
152  ++nconvexnlrows;
153  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
154  ++nnonconvexnlrows;
155  }
156  else if( SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONCAVE )
157  {
158  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
159  ++nnonconvexnlrows;
160  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
161  ++nconvexnlrows;
162  }
163  else
164  {
165  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
166  ++nnonconvexnlrows;
167  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
168  ++nnonconvexnlrows;
169  }
170  }
171 
172  SCIPdebugMsg(scip, "nconvex=%d nnonconvex=%d nlinear=%d\n", nconvexnlrows, nnonconvexnlrows, nlinearnlrows);
173 
174  return nconvexnlrows > 0
175  && nnonconvexnlrows > 0
176  && (SCIPisGE(scip, (SCIP_Real)nconvexnlrows, nnonconvexnlrows * propdata->minnonconvexfrac))
177  && (SCIPisGE(scip, (SCIP_Real)nconvexnlrows, nlinearnlrows * propdata->minlinearfrac));
178 }
179 
180 /** filters variables which achieve their lower or dual bound in the current NLP solution */
181 static
183  SCIP* scip, /**< SCIP data structure */
184  SCIP_PROPDATA* propdata /**< propagator data */
185  )
186 {
187  SCIP_Real* primal;
188  int i;
189 
190  assert(propdata->currpos >= 0 && propdata->currpos < propdata->nlpinvars);
191  assert(SCIPnlpiGetSolstat(propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_FEASIBLE);
192 
193  SCIP_CALL( SCIPnlpiGetSolution(propdata->nlpi, propdata->nlpiprob, &primal, NULL, NULL, NULL) );
194  assert(primal != NULL);
195 
196  /* we skip all candidates which have been processed already, i.e., starting at propdata->currpos + 1 */
197  for( i = propdata->currpos + 1; i < propdata->nlpinvars; ++i )
198  {
199  SCIP_VAR* var;
200  SCIP_Real val;
201  int varidx;
202 
203  /* only uninteresting variables left -> stop filtering */
204  if( SCIPisLE(scip, propdata->nlscore[i], 0.0) )
205  break;
206 
207  var = propdata->nlpivars[i];
208  assert(var != NULL && SCIPhashmapExists(propdata->var2nlpiidx, (void*)var));
209 
210  varidx = (int)(size_t)SCIPhashmapGetImage(propdata->var2nlpiidx, (void*)var);
211  assert(SCIPgetVars(scip)[varidx] == var);
212  val = primal[varidx];
213 
214  if( (propdata->status[i] & SOLVEDLB) == 0 && !SCIPisInfinity(scip, -val) /*lint !e641*/
215  && SCIPisFeasLE(scip, val, SCIPvarGetLbLocal(var)) )
216  {
217  SCIPdebugMsg(scip, "filter LB of %s in [%g,%g] with %g\n", SCIPvarGetName(var), SCIPvarGetLbLocal(var),
218  SCIPvarGetUbLocal(var), val);
219  propdata->status[i] |= SOLVEDLB; /*lint !e641*/
220  assert((propdata->status[i] & SOLVEDLB) != 0); /*lint !e641*/
221  }
222 
223  if( (propdata->status[i] & SOLVEDUB) == 0 && !SCIPisInfinity(scip, val) /*lint !e641*/
224  && SCIPisFeasGE(scip, val, SCIPvarGetUbLocal(var)) )
225  {
226  SCIPdebugMsg(scip, "filter UB of %s in [%g,%g] with %g\n", SCIPvarGetName(var), SCIPvarGetLbLocal(var),
227  SCIPvarGetUbLocal(var), val);
228  propdata->status[i] |= SOLVEDUB; /*lint !e641*/
229  assert((propdata->status[i] & SOLVEDUB) != 0); /*lint !e641*/
230  }
231  }
232 
233  return SCIP_OKAY;
234 }
235 
236 /** tries to add a generalized variable bound by exploiting the dual solution of the last NLP solve (see @ref
237  * prop_nlobbt.h for more information)
238  */
239 static
241  SCIP* scip, /**< SCIP data structure */
242  SCIP_PROPDATA* propdata, /**< propagator data */
243  SCIP_VAR* var, /**< variable used in last NLP solve */
244  int varidx, /**< variable index in the propdata->nlpivars array */
245  SCIP_BOUNDTYPE boundtype, /**< type of bound provided by the genvbound */
246  SCIP_Real cutoffbound /**< cutoff bound */
247  )
248 {
249  SCIP_VAR** lvbvars;
250  SCIP_Real* lvbcoefs;
251  SCIP_Real* primal;
252  SCIP_Real* dual;
253  SCIP_Real* alpha;
254  SCIP_Real* beta;
255  SCIP_Real constant;
256  SCIP_Real mu;
257  int nlvbvars;
258  int i;
259 
260  assert(propdata->genvboundprop != NULL);
261  assert(var != NULL);
262  assert(varidx >= 0 && varidx < propdata->nlpinvars);
263  assert(SCIPnlpiGetSolstat(propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_LOCOPT);
264 
265  SCIP_CALL( SCIPnlpiGetSolution(propdata->nlpi, propdata->nlpiprob, &primal, &dual, &alpha, &beta) );
266 
267  /* not possible to generate genvbound if the duals for the propagated variable do not disappear */
268  if( !SCIPisFeasZero(scip, alpha[varidx] - beta[varidx]) )
269  return SCIP_OKAY;
270 
271  SCIP_CALL( SCIPallocBufferArray(scip, &lvbcoefs, propdata->nlpinvars) );
272  SCIP_CALL( SCIPallocBufferArray(scip, &lvbvars, propdata->nlpinvars) );
273  constant = boundtype == SCIP_BOUNDTYPE_LOWER ? primal[varidx] : -primal[varidx];
274  mu = 0.0;
275  nlvbvars = 0;
276 
277  /* collect coefficients of genvbound */
278  for( i = 0; i < propdata->nlpinvars; ++i )
279  {
280  if( !SCIPisZero(scip, beta[i] - alpha[i]) )
281  {
282  lvbvars[nlvbvars] = propdata->nlpivars[i];
283  lvbcoefs[nlvbvars] = beta[i] - alpha[i];
284  ++nlvbvars;
285 
286  constant += (alpha[i] - beta[i]) * primal[i];
287  }
288  }
289 
290  /* first dual multiplier corresponds to the cutoff row if cutoffbound < SCIPinfinity() */
291  if( !SCIPisInfinity(scip, cutoffbound) && SCIPisGT(scip, dual[0], 0.0) )
292  {
293  mu = dual[0];
294  constant += mu * cutoffbound;
295  }
296 
297  /* add genvbound to genvbounds propagator */
298  if( !SCIPisInfinity(scip, REALABS(constant)) && (nlvbvars > 0 || SCIPisFeasGT(scip, mu, 0.0)) )
299  {
300  SCIP_CALL( SCIPgenVBoundAdd(scip, propdata->genvboundprop, lvbvars, var, lvbcoefs, nlvbvars, -mu, constant,
301  boundtype) );
302  SCIPdebugMsg(scip, "add genvbound for %s\n", SCIPvarGetName(var));
303  }
304 
305  SCIPfreeBufferArray(scip, &lvbvars);
306  SCIPfreeBufferArray(scip, &lvbcoefs);
307 
308  return SCIP_OKAY;
309 }
310 
311 /** sets the objective function, solves the NLP, and tightens the given variable; after calling this function, the
312  * objective function is set to zero
313  *
314  * @note function assumes that objective function is zero
315  */
316 static
318  SCIP* scip, /**< SCIP data structure */
319  SCIP_PROPDATA* propdata, /**< propagator data */
320  SCIP_VAR* var, /**< variable to propagate */
321  int varidx, /**< variable index in the propdata->nlpivars array */
322  SCIP_BOUNDTYPE boundtype, /**< minimize or maximize var? */
323  int* nlpiter, /**< buffer to store the total number of nlp iterations */
324  SCIP_RESULT* result /**< pointer to store result */
325  )
326 {
327  SCIP_Real timelimit;
328  SCIP_Real* primal;
329  SCIP_Real obj;
330  int iterlimit;
331 
332 #ifdef SCIP_DEBUG
333  SCIP_Real oldlb;
334  SCIP_Real oldub;
335 
336  oldlb = SCIPvarGetLbLocal(var);
337  oldub = SCIPvarGetUbLocal(var);
338 #endif
339 
340  assert(var != NULL);
341  assert(varidx >= 0 && varidx < propdata->nlpinvars);
342  assert(result != NULL && *result != SCIP_CUTOFF);
343 
344  *nlpiter = 0;
345 
346  /* set time and iteration limit */
347  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
348  if( !SCIPisInfinity(scip, timelimit) )
349  {
350  timelimit -= SCIPgetSolvingTime(scip);
351  if( timelimit <= 0.0 )
352  {
353  SCIPdebugMsg(scip, "skip NLP solve; no time left\n");
354  return SCIP_OKAY;
355  }
356  }
357  if( propdata->nlptimelimit > 0.0 )
358  timelimit = MIN(propdata->nlptimelimit, timelimit);
359  iterlimit = propdata->nlpiterlimit > 0 ? propdata->nlpiterlimit : INT_MAX;
360  SCIP_CALL( SCIPnlpiSetRealPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_TILIM, timelimit) );
361  SCIP_CALL( SCIPnlpiSetIntPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_ITLIM, iterlimit) );
362 
363  /* set corresponding objective coefficient and solve NLP */
364  obj = boundtype == SCIP_BOUNDTYPE_LOWER ? 1.0 : -1.0;
365  SCIP_CALL( SCIPnlpiSetObjective(propdata->nlpi, propdata->nlpiprob, 1, &varidx, &obj, 0, NULL, NULL, NULL, 0.0) );
366 
367  SCIPdebugMsg(scip, "solve var=%s boundtype=%d nlscore=%g\n", SCIPvarGetName(var), boundtype,
368  propdata->nlscore[propdata->currpos]);
369  SCIP_CALL( SCIPnlpiSolve(propdata->nlpi, propdata->nlpiprob) );
370  SCIPdebugMsg(scip, "NLP solstat = %d\n", SCIPnlpiGetSolstat(propdata->nlpi, propdata->nlpiprob));
371 
372  /* collect NLP statistics */
373  assert(propdata->nlpstatistics != NULL);
374  SCIP_CALL( SCIPnlpiGetStatistics(propdata->nlpi, propdata->nlpiprob, propdata->nlpstatistics) );
375  *nlpiter = SCIPnlpStatisticsGetNIterations(propdata->nlpstatistics);
376  SCIPdebugMsg(scip, "iterations %d time %g\n", *nlpiter, SCIPnlpStatisticsGetTotalTime(propdata->nlpstatistics));
377 
378  /* filter bound candidates first, otherwise we do not have access to the primal solution values */
379  if( SCIPnlpiGetSolstat(propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_FEASIBLE )
380  {
381  SCIP_CALL( filterCands(scip, propdata) );
382  }
383 
384  /* try to tighten variable bound */
385  if( SCIPnlpiGetSolstat(propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_LOCOPT )
386  {
387  SCIP_Bool tightened;
388  SCIP_Bool infeasible;
389 
390  /* try to add a genvbound in the root node */
391  if( propdata->genvboundprop != NULL && SCIPgetDepth(scip) == 0 )
392  {
393  SCIP_CALL( addGenVBound(scip, propdata, var, varidx, boundtype, SCIPgetCutoffbound(scip)) );
394  }
395 
396  SCIP_CALL( SCIPnlpiGetSolution(propdata->nlpi, propdata->nlpiprob, &primal, NULL, NULL, NULL) );
397 
398  if( boundtype == SCIP_BOUNDTYPE_LOWER )
399  {
400  SCIP_CALL( SCIPtightenVarLb(scip, var, primal[varidx], FALSE, &infeasible, &tightened) );
401  }
402  else
403  {
404  SCIP_CALL( SCIPtightenVarUb(scip, var, primal[varidx], FALSE, &infeasible, &tightened) );
405  }
406 
407  if( infeasible )
408  {
409  SCIPdebugMsg(scip, "detect infeasibility after propagating %s\n", SCIPvarGetName(var));
410  *result = SCIP_CUTOFF;
411  }
412  else if( tightened )
413  {
414  SCIP_Real lb;
415  SCIP_Real ub;
416 
417  *result = SCIP_REDUCEDDOM;
418 
419  /* update bounds in NLP */
420  lb = SCIPvarGetLbLocal(var);
421  ub = SCIPvarGetUbLocal(var);
422  SCIP_CALL( SCIPnlpiChgVarBounds(propdata->nlpi, propdata->nlpiprob, 1, &varidx, &lb, &ub) );
423 
424 #ifdef SCIP_DEBUG
425  SCIPdebugMsg(scip, "tightened bounds of %s from [%g,%g] to [%g,%g]\n", SCIPvarGetName(var), oldlb, oldub, lb, ub);
426 #endif
427  }
428  }
429 
430  /* reset objective function */
431  obj = 0.0;
432  SCIP_CALL( SCIPnlpiSetObjective(propdata->nlpi, propdata->nlpiprob, 1, &varidx, &obj, 0, NULL, NULL, NULL, 0.0) );
433 
434  return SCIP_OKAY;
435 }
436 
437 /** main method of the propagator
438  *
439  * creates a convex NLP relaxation and solves the OBBT-NLPs for each possible candidate;
440  * binary and variables with a small domain will be ignored to reduce the computational cost of the propagator; after
441  * solving each NLP we filter out all variable candidates which are on their lower or upper bound; candidates with a
442  * larger number of occurrences are preferred
443  */
444 static
446  SCIP* scip, /**< SCIP data structure */
447  SCIP_PROPDATA* propdata, /**< propagation data */
448  SCIP_RESULT* result /**< pointer to store result */
449  )
450 {
451  int nlpiterleft;
452 
453  assert(result != NULL);
454  assert(!propdata->skipprop);
455  assert(SCIPgetNNlpis(scip) > 0);
456 
457  *result = SCIP_DIDNOTRUN;
458 
459  if( propdata->nlpiprob == NULL && !isNlobbtApplicable(scip, propdata) )
460  {
461  /* do not call the propagator anymore (except after a restart) */
462  SCIPdebugMsg(scip, "nlobbt propagator is not applicable\n");
463  propdata->skipprop = TRUE;
464  return SCIP_OKAY;
465  }
466 
467  *result = SCIP_DIDNOTFIND;
468 
469  /* compute NLP iteration limit */
470  if( propdata->itlimitfactor > 0.0 )
471  nlpiterleft = (int)(propdata->itlimitfactor * SCIPgetNRootLPIterations(scip));
472  else
473  nlpiterleft = INT_MAX;
474 
475  /* recompute NLP relaxation if the variable set changed */
476  if( propdata->nlpiprob != NULL && SCIPgetNVars(scip) != propdata->nlpinvars )
477  {
478  SCIP_CALL( propdataClear(scip, propdata) );
479  assert(propdata->nlpiprob == NULL);
480  }
481 
482  /* create or update NLP relaxation */
483  if( propdata->nlpiprob == NULL )
484  {
485  int i;
486 
487  propdata->nlpinvars = SCIPgetNVars(scip);
488  propdata->nlpi = SCIPgetNlpis(scip)[0];
489  assert(propdata->nlpi != NULL);
490 
491  SCIP_CALL( SCIPnlpiCreateProblem(propdata->nlpi, &propdata->nlpiprob, "nlobbt-nlp") );
492  SCIP_CALL( SCIPhashmapCreate(&propdata->var2nlpiidx, SCIPblkmem(scip), propdata->nlpinvars) );
493  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &propdata->nlpivars, SCIPgetVars(scip), propdata->nlpinvars) );
494  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &propdata->nlscore, propdata->nlpinvars) );
495  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &propdata->status, propdata->nlpinvars) );
496 
497  SCIP_CALL( SCIPcreateNlpiProb(scip, propdata->nlpi, SCIPgetNLPNlRows(scip), SCIPgetNNLPNlRows(scip),
498  propdata->nlpiprob, propdata->var2nlpiidx, propdata->nlscore, SCIPgetCutoffbound(scip), FALSE, TRUE) );
499 
500  /* initialize bound status; perturb nlscores by a factor which ensures that zero scores remain zero */
501  assert(propdata->randnumgen != NULL);
502  for( i = 0; i < propdata->nlpinvars; ++i )
503  {
504  propdata->status[i] = UNSOLVED; /*lint !e641*/
505  propdata->nlscore[i] *= 1.0 + SCIPrandomGetReal(propdata->randnumgen, SCIPfeastol(scip), 2.0 * SCIPfeastol(scip));
506  }
507 
508  /* add rows of the LP */
509  if( SCIPgetDepth(scip) == 0 )
510  {
511  SCIP_CALL( SCIPaddNlpiProbRows(scip, propdata->nlpi, propdata->nlpiprob, propdata->var2nlpiidx,
512  SCIPgetLPRows(scip), SCIPgetNLPRows(scip)) );
513  }
514  }
515  else
516  {
517  SCIP_CALL( SCIPupdateNlpiProb(scip, propdata->nlpi, propdata->nlpiprob, propdata->var2nlpiidx,
518  propdata->nlpivars, propdata->nlpinvars, SCIPgetCutoffbound(scip)) );
519  }
520 
521  assert(propdata->nlpiprob != NULL);
522  assert(propdata->var2nlpiidx != NULL);
523  assert(propdata->nlpivars != NULL);
524  assert(propdata->nlscore != NULL);
525 
526  /* sort variables w.r.t. their nlscores if we did not solve any NLP for this node */
527  if( propdata->currpos == 0 )
528  {
529  SCIPsortDownRealIntPtr(propdata->nlscore, propdata->status, (void**)propdata->nlpivars, propdata->nlpinvars);
530  }
531 
532  /* set parameters of NLP solver */
533  SCIP_CALL( SCIPnlpiSetRealPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_FEASTOL,
534  SCIPfeastol(scip) * propdata->feastolfac) );
535  SCIP_CALL( SCIPnlpiSetRealPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_FEASTOL,
536  SCIPfeastol(scip) * propdata->feastolfac) );
537  SCIP_CALL( SCIPnlpiSetRealPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_RELOBJTOL,
538  SCIPfeastol(scip) * propdata->relobjtolfac) );
539  SCIP_CALL( SCIPnlpiSetIntPar(propdata->nlpi, propdata->nlpiprob, SCIP_NLPPAR_VERBLEVEL, propdata->nlpverblevel) );
540 
541  /* main propagation loop */
542  while( propdata->currpos < propdata->nlpinvars
543  && nlpiterleft > 0
544  && SCIPisGT(scip, propdata->nlscore[propdata->currpos], 0.0)
545  && *result != SCIP_CUTOFF
546  && !SCIPisStopped(scip) )
547  {
548  SCIP_VAR* var;
549  int varidx;
550  int iters;
551 
552  var = propdata->nlpivars[propdata->currpos];
553  assert(var != NULL);
554 
555  /* skip binary or almost fixed variables */
557  || SCIPisFeasEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
558  {
559  ++(propdata->currpos);
560  continue;
561  }
562 
563  SCIPdebugMsg(scip, "iterations left %d\n", nlpiterleft);
564 
565  /* get index of var in the nlpi */
566  assert(SCIPhashmapExists(propdata->var2nlpiidx, (void*)var) );
567  varidx = (int)(size_t)SCIPhashmapGetImage(propdata->var2nlpiidx, (void*)var);
568  assert(var == SCIPgetVars(scip)[varidx]);
569 
570  /* case: minimize var */
571  if( (propdata->status[propdata->currpos] & SOLVEDLB) == 0 ) /*lint !e641*/
572  {
573  SCIP_CALL( solveNlp(scip, propdata, var, varidx, SCIP_BOUNDTYPE_LOWER, &iters, result) );
574  nlpiterleft -= iters;
575  }
576 
577  /* case: maximize var */
578  if( *result != SCIP_CUTOFF && (propdata->status[propdata->currpos] & SOLVEDUB) == 0 ) /*lint !e641*/
579  {
580  SCIP_CALL( solveNlp(scip, propdata, var, varidx, SCIP_BOUNDTYPE_UPPER, &iters, result) );
581  nlpiterleft -= iters;
582  }
583 
584  /* update the current position */
585  ++(propdata->currpos);
586  }
587 
588  return SCIP_OKAY;
589 }
590 
591 /*
592  * Callback methods of propagator
593  */
594 
595 /** destructor of propagator to free user data (called when SCIP is exiting) */
596 static
597 SCIP_DECL_PROPFREE(propFreeNlobbt)
598 { /*lint --e{715}*/
599  SCIP_PROPDATA* propdata;
600 
601  propdata = SCIPpropGetData(prop);
602  assert(propdata != NULL);
603 
604  SCIP_CALL( propdataClear(scip, propdata) );
605  SCIPfreeBlockMemory(scip, &propdata);
606  SCIPpropSetData(prop, NULL);
607 
608  return SCIP_OKAY;
609 }
610 
611 /** solving process initialization method of propagator (called when branch and bound process is about to begin) */
612 static
613 SCIP_DECL_PROPINITSOL(propInitsolNlobbt)
614 { /*lint --e{715}*/
615  SCIP_PROPDATA* propdata;
616 
617  assert(scip != NULL);
618  assert(prop != NULL);
619 
620  propdata = SCIPpropGetData(prop);
621  assert(propdata != NULL);
622 
623  /* if genvbounds propagator is not available, we cannot create genvbounds */
624  propdata->genvboundprop = SCIPfindProp(scip, "genvbounds");
625 
626  SCIP_CALL( SCIPrandomCreate(&propdata->randnumgen, SCIPblkmem(scip),
628  SCIP_CALL( SCIPnlpStatisticsCreate(&propdata->nlpstatistics) );
629  propdata->lastnode = -1;
630 
631  return SCIP_OKAY;
632 }
633 
634 /** solving process deinitialization method of propagator (called before branch and bound process data is freed) */
635 static
636 SCIP_DECL_PROPEXITSOL(propExitsolNlobbt)
637 { /*lint --e{715}*/
638  SCIP_PROPDATA* propdata;
639 
640  propdata = SCIPpropGetData(prop);
641  assert(propdata != NULL);
642 
643  SCIPnlpStatisticsFree(&propdata->nlpstatistics);
644  SCIPrandomFree(&propdata->randnumgen);
645 
646  SCIP_CALL( propdataClear(scip, propdata) );
647 
648  return SCIP_OKAY;
649 }
650 
651 /** execution method of propagator */
652 static
653 SCIP_DECL_PROPEXEC(propExecNlobbt)
654 { /*lint --e{715}*/
655  SCIP_PROPDATA* propdata;
656 
657  *result = SCIP_DIDNOTRUN;
658 
659  propdata = SCIPpropGetData(prop);
660  assert(propdata != NULL);
661 
662  if( propdata->skipprop || SCIPgetStage(scip) != SCIP_STAGE_SOLVING || SCIPinRepropagation(scip)
663  || SCIPinProbing(scip) || SCIPinDive(scip) || !SCIPallowObjProp(scip) || SCIPgetNNlpis(scip) == 0 )
664  {
665  SCIPdebugMsg(scip, "skip nlobbt propagator\n");
666  return SCIP_OKAY;
667  }
668 
669  /* only run if LP all columns are in the LP, e.g., do not run if pricers are active */
670  if( !SCIPallColsInLP(scip) )
671  {
672  SCIPdebugMsg(scip, "not all columns in LP, skipping obbt\n");
673  return SCIP_OKAY;
674  }
675 
676  /* do not run if SCIP does not have constructed an NLP */
677  if( !SCIPisNLPConstructed(scip) )
678  {
679  SCIPdebugMsg(scip, "NLP not constructed, skipping nlobbt\n");
680  return SCIP_OKAY;
681  }
682 
683  /* consider all variables again if we process a new node */
684  if( SCIPnodeGetNumber(SCIPgetCurrentNode(scip)) != propdata->lastnode )
685  {
686  propdata->lastnode = SCIPnodeGetNumber(SCIPgetCurrentNode(scip));
687  propdata->currpos = 0;
688  }
689 
690  /* call main procedure of nonlinear OBBT propagator */
691  SCIP_CALL( applyNlobbt(scip, propdata, result) );
692 
693  return SCIP_OKAY;
694 }
695 
696 /*
697  * propagator specific interface methods
698  */
699 
700 /** creates the nlobbt propagator and includes it in SCIP */
702  SCIP* scip /**< SCIP data structure */
703  )
704 {
705  SCIP_PROPDATA* propdata;
706  SCIP_PROP* prop;
707 
708  propdata = NULL;
709  prop = NULL;
710 
711  SCIP_CALL( SCIPallocBlockMemory(scip, &propdata) );
712  assert(propdata != NULL);
713  BMSclearMemory(propdata);
714 
716  propExecNlobbt, propdata) );
717  assert(prop != NULL);
718 
719  SCIP_CALL( SCIPsetPropFree(scip, prop, propFreeNlobbt) );
720  SCIP_CALL( SCIPsetPropInitsol(scip, prop, propInitsolNlobbt) );
721  SCIP_CALL( SCIPsetPropExitsol(scip, prop, propExitsolNlobbt) );
722 
723  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/feastolfac",
724  "factor for NLP feasibility tolerance",
725  &propdata->feastolfac, TRUE, DEFAULT_FEASTOLFAC, 0.0, 1.0, NULL, NULL) );
726 
727  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/relobjtolfac",
728  "factor for NLP relative objective tolerance",
729  &propdata->relobjtolfac, TRUE, DEFAULT_RELOBJTOLFAC, 0.0, 1.0, NULL, NULL) );
730 
731  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/minnonconvexfrac",
732  "(#convex nlrows)/(#nonconvex nlrows) threshold to apply propagator",
733  &propdata->minnonconvexfrac, TRUE, DEFAULT_MINNONCONVEXFRAC, 0.0, SCIPinfinity(scip), NULL, NULL) );
734 
735  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/minlinearfrac",
736  "minimum (#convex nlrows)/(#linear nlrows) threshold to apply propagator",
737  &propdata->minlinearfrac, TRUE, DEFAULT_MINLINEARFRAC, 0.0, SCIPinfinity(scip), NULL, NULL) );
738 
739  SCIP_CALL( SCIPaddBoolParam(scip, "propagating/"PROP_NAME"/addlprows",
740  "should non-initial LP rows be used?",
741  &propdata->addlprows, FALSE, DEFAULT_ADDLPROWS, NULL, NULL) );
742 
743  SCIP_CALL( SCIPaddIntParam(scip, "propagating/"PROP_NAME"/nlpiterlimit",
744  "iteration limit of NLP solver; 0 for no limit",
745  &propdata->nlpiterlimit, TRUE, DEFAULT_NLPITERLIMIT, 0, INT_MAX, NULL, NULL) );
746 
747  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/nlptimelimit",
748  "time limit of NLP solver; 0.0 for no limit",
749  &propdata->nlptimelimit, TRUE, DEFAULT_NLPTIMELIMIT, 0.0, SCIP_REAL_MAX, NULL, NULL) );
750 
751  SCIP_CALL( SCIPaddIntParam(scip, "propagating/"PROP_NAME"/nlpverblevel",
752  "verbosity level of NLP solver",
753  &propdata->nlpverblevel, TRUE, DEFAULT_NLPVERLEVEL, 0, 5, NULL, NULL) );
754 
755  SCIP_CALL( SCIPaddRealParam(scip, "propagating/"PROP_NAME"/itlimitfactor",
756  "LP iteration limit for nlobbt will be this factor times total LP iterations in root node",
757  &propdata->itlimitfactor, TRUE, DEFAULT_ITLIMITFACTOR, 0.0, SCIP_REAL_MAX, NULL, NULL) );
758 
759  return SCIP_OKAY;
760 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip.h:21909
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
static SCIP_DECL_PROPINITSOL(propInitsolNlobbt)
Definition: prop_nlobbt.c:614
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
Definition: scip.c:29200
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:46151
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition: misc.c:8693
SCIP_Bool SCIPinRepropagation(SCIP *scip)
Definition: scip.c:40508
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip.c:31064
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:45137
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
Definition: scip.c:41426
SCIP_RETCODE SCIPnlpiGetStatistics(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:553
SCIP_Real SCIPfeastol(SCIP *scip)
Definition: scip.c:45274
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip.h:21892
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip.c:30835
SCIP_RETCODE SCIPnlpStatisticsCreate(SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:781
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22118
static SCIP_DECL_PROPEXITSOL(propExitsolNlobbt)
Definition: prop_nlobbt.c:637
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46086
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip.c:40453
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:814
#define PROP_FREQ
Definition: prop_nlobbt.c:32
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:42499
SCIP_RETCODE SCIPcreateNlpiProb(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLROW **nlrows, int nnlrows, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_Real *nlscore, SCIP_Real cutoffbound, SCIP_Bool setobj, SCIP_Bool onlyconvex)
Definition: scip.c:33265
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip.c:7788
#define PROP_PRIORITY
Definition: prop_nlobbt.c:31
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:4426
#define DEFAULT_FEASTOLFAC
Definition: prop_nlobbt.c:38
void SCIPsortDownRealIntPtr(SCIP_Real *realarray, int *intarray, void **ptrarray, int len)
SCIP_Real SCIPnlpStatisticsGetTotalTime(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:820
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17222
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45803
internal methods for NLPI solver interfaces
static SCIP_RETCODE addGenVBound(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, int varidx, SCIP_BOUNDTYPE boundtype, SCIP_Real cutoffbound)
Definition: prop_nlobbt.c:241
SCIP_RETCODE SCIPnlpiCreateProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem, const char *name)
Definition: nlpi.c:211
#define DEFAULT_MINLINEARFRAC
Definition: prop_nlobbt.c:37
#define DEFAULT_NLPITERLIMIT
Definition: prop_nlobbt.c:44
SCIP_RETCODE SCIPincludePropNlobbt(SCIP *scip)
Definition: prop_nlobbt.c:702
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46138
#define FALSE
Definition: def.h:64
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2765
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:45816
#define TRUE
Definition: def.h:63
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3383
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22234
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip.h:21907
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:3393
SCIP_RETCODE SCIPnlpiGetSolution(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_Real **primalvalues, SCIP_Real **consdualvalues, SCIP_Real **varlbdualvalues, SCIP_Real **varubdualvalues)
Definition: nlpi.c:535
SCIP_RETCODE SCIPnlpiChgVarBounds(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nvars, const int *indices, const SCIP_Real *lbs, const SCIP_Real *ubs)
Definition: nlpi.c:325
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2903
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:21937
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:21890
#define DEFAULT_RELOBJTOLFAC
Definition: prop_nlobbt.c:39
#define SCIPdebugMsg
Definition: scip.h:451
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:4202
#define DEFAULT_RANDSEED
Definition: prop_nlobbt.c:47
void SCIPnlpStatisticsFree(SCIP_NLPSTATISTICS **statistics)
Definition: nlpi.c:798
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip.c:31042
static SCIP_RETCODE propdataClear(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:98
int SCIPnlrowGetNQuadElems(SCIP_NLROW *nlrow)
Definition: nlp.c:3322
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2997
SCIP_RETCODE SCIPnlpiSolve(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:495
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
Definition: tree.c:7143
#define DEFAULT_NLPVERLEVEL
Definition: prop_nlobbt.c:46
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip.h:21904
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
Definition: misc.c:8710
#define DEFAULT_NLPTIMELIMIT
Definition: prop_nlobbt.c:45
static SCIP_RETCODE applyNlobbt(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_RESULT *result)
Definition: prop_nlobbt.c:446
SCIP_RETCODE SCIPgenVBoundAdd(SCIP *scip, SCIP_PROP *genvboundprop, SCIP_VAR **vars, SCIP_VAR *var, SCIP_Real *coefs, int ncoefs, SCIP_Real coefcutoffbound, SCIP_Real constant, SCIP_BOUNDTYPE boundtype)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:45519
#define PROP_NAME
Definition: prop_nlobbt.c:29
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16552
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2798
SCIP_RETCODE SCIPaddNlpiProbRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows)
Definition: scip.c:33640
#define NULL
Definition: lpi_spx1.cpp:137
int SCIPgetNNlpis(SCIP *scip)
Definition: scip.c:9444
#define REALABS(x)
Definition: def.h:159
int SCIPgetNLPRows(SCIP *scip)
Definition: scip.c:29221
#define SCIP_CALL(x)
Definition: def.h:306
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46125
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46112
SCIP_NLPSOLSTAT SCIPnlpiGetSolstat(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem)
Definition: nlpi.c:509
static SCIP_RETCODE solveNlp(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, int varidx, SCIP_BOUNDTYPE boundtype, int *nlpiter, SCIP_RESULT *result)
Definition: prop_nlobbt.c:318
SCIP_RETCODE SCIPnlpiSetObjective(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, int nlins, const int *lininds, const SCIP_Real *linvals, int nquadelems, const SCIP_QUADELEM *quadelems, const int *exprvaridxs, const SCIP_EXPRTREE *exprtree, const SCIP_Real constant)
Definition: nlpi.c:300
SCIP_RETCODE SCIPnlpiFreeProblem(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **problem)
Definition: nlpi.c:224
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:21925
#define PROP_DESC
Definition: prop_nlobbt.c:30
#define SCIP_Bool
Definition: def.h:61
SCIP_RETCODE SCIPupdateNlpiProb(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2nlpiidx, SCIP_VAR **nlpivars, int nlpinvars, SCIP_Real cutoffbound)
Definition: scip.c:33588
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:42094
SCIP_RETCODE SCIPnlpiSetIntPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, int ival)
Definition: nlpi.c:633
nonlinear OBBT propagator
#define DEFAULT_ITLIMITFACTOR
Definition: prop_nlobbt.c:41
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
Definition: scip.c:25467
#define PROP_DELAY
Definition: prop_nlobbt.c:33
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:45827
#define BMSclearMemory(ptr)
Definition: memory.h:84
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip.c:7690
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:8745
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:35033
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:11631
#define SCIP_REAL_MAX
Definition: def.h:136
SCIP_EXPRTREE * SCIPnlrowGetExprtree(SCIP_NLROW *nlrow)
Definition: nlp.c:3363
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip.c:34999
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45790
static SCIP_RETCODE filterCands(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:183
static SCIP_DECL_PROPEXEC(propExecNlobbt)
Definition: prop_nlobbt.c:654
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip.c:11586
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip.c:7674
#define PROP_TIMING
Definition: prop_nlobbt.c:34
#define SCIP_Real
Definition: def.h:135
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:38
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip.c:1138
#define MIN(x, y)
Definition: memory.c:75
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip.c:7626
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
Definition: prop.c:735
void SCIPpropSetData(SCIP_PROP *prop, SCIP_PROPDATA *propdata)
Definition: prop.c:745
int SCIPnlpStatisticsGetNIterations(SCIP_NLPSTATISTICS *statistics)
Definition: nlpi.c:810
#define SCIP_Longint
Definition: def.h:120
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:29244
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16717
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:45864
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45777
#define DEFAULT_MINNONCONVEXFRAC
Definition: prop_nlobbt.c:36
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17232
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip.c:9431
#define DEFAULT_ADDLPROWS
Definition: prop_nlobbt.c:40
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:3373
static SCIP_DECL_PROPFREE(propFreeNlobbt)
Definition: prop_nlobbt.c:598
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:4258
static SCIP_Bool isNlobbtApplicable(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:128
SCIP_Bool SCIPallowObjProp(SCIP *scip)
Definition: scip.c:25457
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:4176
generalized variable bounds propagator
SCIP_RETCODE SCIPnlpiSetRealPar(SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *problem, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlpi.c:668
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
Definition: scip.c:7573
BoundStatus
Definition: prop_nlobbt.c:54