# SCIP

Solving Constraint Integer Programs

heur_indicator.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 /* */
7 /* fuer Informationstechnik Berlin */
8 /* */
10 /* */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15
16 /**@file heur_indicator.c
17  * @brief handle partial solutions for linear problems with indicators and otherwise continuous variables
18  * @author Marc Pfetsch
19  *
20  * For linear problems with indicators and otherwise continuous variables, the indicator constraint handler can produce
21  * partial solutions, i.e., values for the indicator variables. This partial solution can be passed to this heuristic,
22  * which then fixes these values and solves an LP. Additionally a local search for a better solution is added.
23  */
24
25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
26
27 #include <assert.h>
28 #include <string.h>
29 #include "scip/scip.h"
30 #include "scip/heur_indicator.h"
31 #include "scip/cons_indicator.h"
32
33 #define HEUR_NAME "indicator"
34 #define HEUR_DESC "indicator heuristic to create feasible solutions from values for indicator variables"
35 #define HEUR_DISPCHAR 'A'
36 #define HEUR_PRIORITY -20200
37 #define HEUR_FREQ 1
38 #define HEUR_FREQOFS 0
39 #define HEUR_MAXDEPTH -1
40 #define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP
41 #define HEUR_USESSUBSCIP FALSE /**< does the heuristic use a secondary SCIP instance? */
42
43 #define DEFAULT_ONEOPT TRUE /**< whether the one-opt heuristic should be started */
44 #define DEFAULT_IMPROVESOLS FALSE /**< Try to improve other solutions by one-opt? */
45
46
47 /** primal heuristic data */
48 struct SCIP_HeurData
49 {
50  int nindconss; /**< number of indicator constraints */
51  SCIP_CONS** indconss; /**< indicator constraints */
52  SCIP_Bool* solcand; /**< bitset of indicator variables in solution candidate */
53  SCIP_Bool oneopt; /**< whether the one-opt heuristic should be started */
54  SCIP_CONSHDLR* indicatorconshdlr; /**< indicator constraint handler */
55  SCIP_SOL* lastsol; /**< last solution considered for improvement */
56  SCIP_Bool improvesols; /**< Try to improve other solutions by one-opt? */
57 };
58
59 /*
60  * Local methods
61  */
62
63 /** try one-opt on given solution */
64 static
66  SCIP* scip, /**< SCIP data structure */
67  SCIP_HEUR* heur, /**< indicator heuristic */
68  SCIP_HEURDATA* heurdata, /**< heuristic data */
69  int nindconss, /**< number of indicator constraints */
70  SCIP_CONS** indconss, /**< indicator constraints */
71  SCIP_Bool* solcand, /**< values for indicator variables in partial solution */
72  int* nfoundsols /**< number of solutions found */
73  )
74 {
75  SCIP_Bool cutoff;
76  SCIP_Bool lperror;
77  SCIP_Bool stored;
78  SCIP_SOL* sol;
79  int cnt = 0;
80  int i;
81  int c;
82
83  assert( scip != NULL );
84  assert( heur != NULL );
85  assert( heurdata != NULL );
86  assert( nindconss == 0 || indconss != NULL );
87  assert( solcand != NULL );
88  assert( nfoundsols != NULL );
89
90  SCIPdebugMsg(scip, "Performing one-opt ...\n");
91  *nfoundsols = 0;
92
93  SCIP_CALL( SCIPstartProbing(scip) );
94
95  for (i = 0; i < nindconss; ++i)
96  {
97  SCIP_VAR* binvar;
98
99  /* skip nonactive constraints */
100  if ( ! SCIPconsIsActive(indconss[i]) )
101  continue;
102
103  binvar = SCIPgetBinaryVarIndicator(indconss[i]);
104  assert( binvar != NULL );
105
106  /* skip constraints with fixed variables */
107  if ( SCIPvarGetUbLocal(binvar) < 0.5 || SCIPvarGetLbLocal(binvar) > 0.5 )
108  continue;
109
110  /* return if the we would exceed the depth limit of the tree */
111  if( SCIP_MAXTREEDEPTH <= SCIPgetDepth(scip) )
112  break;
113
114  /* get rid of all bound changes */
115  SCIP_CALL( SCIPnewProbingNode(scip) );
116  ++cnt;
117
118  /* fix variables */
119  for (c = 0; c < nindconss; ++c)
120  {
121  SCIP_Bool s;
122
123  /* skip nonactive constraints */
124  if ( ! SCIPconsIsActive(indconss[c]) )
125  continue;
126
127  binvar = SCIPgetBinaryVarIndicator(indconss[c]);
128  assert( binvar != NULL );
129
130  /* fix variables according to solution candidate, except constraint i */
131  if ( c == i )
132  s = ! solcand[c];
133  else
134  s = solcand[c];
135
136  if ( ! s )
137  {
138  if ( SCIPvarGetLbLocal(binvar) < 0.5 && SCIPvarGetUbLocal(binvar) > 0.5 )
139  {
140  SCIP_CALL( SCIPchgVarLbProbing(scip, binvar, 1.0) );
141  }
142  }
143  else
144  {
145  if ( SCIPvarGetUbLocal(binvar) > 0.5 && SCIPvarGetLbLocal(binvar) < 0.5 )
146  {
147  SCIP_CALL( SCIPchgVarUbProbing(scip, binvar, 0.0) );
148  }
149  }
150  }
151
152  /* propagate variables */
153  SCIP_CALL( SCIPpropagateProbing(scip, -1, &cutoff, NULL) );
154  if ( cutoff )
155  {
156  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
157  continue;
158  }
159
160  /* solve LP to move continuous variables */
161  SCIP_CALL( SCIPsolveProbingLP(scip, -1, &lperror, &cutoff) );
162
163  /* the LP often reaches the objective limit - we currently do not use such solutions */
164  if ( lperror || cutoff || SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL )
165  {
166 #ifdef SCIP_DEBUG
167  if ( lperror )
168  SCIPdebugMsg(scip, "An LP error occurred.\n");
169 #endif
170  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
171  continue;
172  }
173
174  /* create solution */
175  SCIP_CALL( SCIPcreateSol(scip, &sol, heur) );
176
177  /* copy the current LP solution to the working solution */
179
180  /* check solution for feasibility */
181  SCIPdebugMsg(scip, "One-opt found solution candidate with value %g.\n", SCIPgetSolTransObj(scip, sol));
182
183  /* only check integrality, because we solved an LP */
184  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, TRUE, FALSE, &stored) );
185  if ( stored )
186  ++(*nfoundsols);
187  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
188  }
189  SCIP_CALL( SCIPendProbing(scip) );
190
191  SCIPdebugMsg(scip, "Finished one-opt (tried variables: %d, found sols: %d).\n", cnt, *nfoundsols);
192
193  return SCIP_OKAY;
194 }
195
196
197 /** try given solution */
198 static
200  SCIP* scip, /**< SCIP data structure */
201  SCIP_HEUR* heur, /**< indicator heuristic */
202  SCIP_HEURDATA* heurdata, /**< heuristic data */
203  int nindconss, /**< number of indicator constraints */
204  SCIP_CONS** indconss, /**< indicator constraints */
205  SCIP_Bool* solcand, /**< values for indicator variables in partial solution */
206  int* nfoundsols /**< number of solutions found */
207  )
208 {
209  SCIP_Bool cutoff;
210  SCIP_Bool lperror;
211  SCIP_Bool stored;
212  SCIP_SOL* sol;
213  int c;
214
215  assert( scip != NULL );
216  assert( heur != NULL );
217  assert( heurdata != NULL );
218  assert( nindconss == 0 || indconss != NULL );
219  assert( solcand != NULL );
220  assert( nfoundsols != NULL );
221
222  SCIPdebugMsg(scip, "Trying to generate feasible solution with indicators from solution candidate ...\n");
223  *nfoundsols = 0;
224
225  SCIP_CALL( SCIPstartProbing(scip) );
226
227  /* we can stop here if we have already reached the maximal depth */
228  if( SCIP_MAXTREEDEPTH <= SCIPgetDepth(scip) )
229  {
230  SCIP_CALL( SCIPendProbing(scip) );
231  return SCIP_OKAY;
232  }
233
234  SCIP_CALL( SCIPnewProbingNode(scip) );
235
236  /* fix variables */
237  for (c = 0; c < nindconss; ++c)
238  {
239  SCIP_VAR* binvar;
240
241  /* skip nonactive constraints */
242  if ( ! SCIPconsIsActive(indconss[c]) )
243  continue;
244
245  binvar = SCIPgetBinaryVarIndicator(indconss[c]);
246  assert( binvar != NULL );
247
248  /* Fix binary variables not in cover to 1 and corresponding slack variables to 0. The other binary variables are fixed to 0. */
249  if ( ! solcand[c] )
250  {
251  /* to be sure, check for non-fixed variables */
252  if ( SCIPvarGetLbLocal(binvar) < 0.5 && SCIPvarGetUbLocal(binvar) > 0.5 )
253  {
254  SCIP_CALL( SCIPchgVarLbProbing(scip, binvar, 1.0) );
255  }
256  }
257  else
258  {
259  if ( SCIPvarGetUbLocal(binvar) > 0.5 && SCIPvarGetLbLocal(binvar) < 0.5 )
260  {
261  SCIP_CALL( SCIPchgVarUbProbing(scip, binvar, 0.0) );
262  }
263  }
264  }
265
266  /* propagate variables */
267  SCIP_CALL( SCIPpropagateProbing(scip, -1, &cutoff, NULL) );
268  if ( cutoff )
269  {
270  SCIPdebugMsg(scip, "Solution candidate reaches cutoff (in propagation).\n");
271  SCIP_CALL( SCIPendProbing(scip) );
272  return SCIP_OKAY;
273  }
274
275  /* solve LP to move continuous variables */
276  SCIP_CALL( SCIPsolveProbingLP(scip, -1, &lperror, &cutoff) );
277
278  /* the LP often reaches the objective limit - we currently do not use such solutions */
279  if ( lperror || cutoff || SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL )
280  {
281 #ifdef SCIP_DEBUG
282  if ( lperror )
283  {
284  SCIPdebugMsg(scip, "An LP error occurred.\n");
285  }
286  else
287  {
288  SCIPdebugMsg(scip, "Solution candidate reaches cutoff (in LP solving).\n");
289  }
290 #endif
291  SCIP_CALL( SCIPendProbing(scip) );
292  return SCIP_OKAY;
293  }
294
295  /* create solution */
296  SCIP_CALL( SCIPcreateSol(scip, &sol, heur) );
297
298  /* copy the current LP solution to the working solution */
300
301  /* check solution for feasibility */
302 #ifdef SCIP_DEBUG
303  SCIPdebugMsg(scip, "Found solution candidate with value %g.\n", SCIPgetSolTransObj(scip, sol));
304 #ifdef SCIP_MORE_DEBUG
305  SCIP_CALL( SCIPprintSol(scip, sol, NULL, FALSE) );
306 #endif
307  SCIP_CALL( SCIPtrySolFree(scip, &sol, TRUE, TRUE, TRUE, TRUE, TRUE, &stored) );
308  if ( stored )
309  {
310  ++(*nfoundsols);
311  SCIPdebugMsg(scip, "Solution is feasible and stored.\n");
312  }
313  else
314  SCIPdebugMsg(scip, "Solution was not stored.\n");
315 #else
316  /* only check integrality, because we solved an LP */
317  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, TRUE, FALSE, &stored) );
318  if ( stored )
319  ++(*nfoundsols);
320 #endif
321  SCIP_CALL( SCIPendProbing(scip) );
322
323  /* possibly perform one-opt */
324  if ( stored && heurdata->oneopt )
325  {
326  int nfound = 0;
327  assert( *nfoundsols > 0 );
328  SCIP_CALL( tryOneOpt(scip, heur, heurdata, nindconss, indconss, solcand, &nfound) );
329  }
330
331  return SCIP_OKAY;
332 }
333
334
335 /*
336  * Callback methods of primal heuristic
337  */
338
339 /** copy method for primal heuristic plugins (called when SCIP copies plugins) */
340 static
341 SCIP_DECL_HEURCOPY(heurCopyIndicator)
342 { /*lint --e{715}*/
343  assert( scip != NULL );
344  assert( heur != NULL );
345  assert( strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0 );
346
347  /* call inclusion method of primal heuristic */
349
350  return SCIP_OKAY;
351 }
352
353 /** initialization method of primal heuristic (called after problem was transformed) */
354 static
355 SCIP_DECL_HEURINIT(heurInitIndicator)
356 { /*lint --e{715}*/
357  SCIP_HEURDATA* heurdata;
358
359  assert( heur != NULL );
360  assert( scip != NULL );
361
362  /* get heuristic data */
363  heurdata = SCIPheurGetData(heur);
364  assert( heurdata != NULL );
365
366  if ( heurdata->indicatorconshdlr == NULL )
367  {
368  heurdata->indicatorconshdlr = SCIPfindConshdlr(scip, "indicator");
369  if ( heurdata->indicatorconshdlr == NULL )
370  {
371  SCIPwarningMessage(scip, "Could not find indicator constraint handler.\n");
372  }
373  }
374
375  return SCIP_OKAY;
376 }
377
378 /** destructor of primal heuristic to free user data (called when SCIP is exiting) */
379 static
380 SCIP_DECL_HEURFREE(heurFreeIndicator)
381 { /*lint --e{715}*/
382  SCIP_HEURDATA* heurdata;
383
384  assert( heur != NULL );
385  assert( scip != NULL );
386
387  /* get heuristic data */
388  heurdata = SCIPheurGetData(heur);
389  assert( heurdata != NULL );
390
391  SCIPfreeBlockMemoryArrayNull(scip, &(heurdata->indconss), heurdata->nindconss);
392  SCIPfreeBlockMemoryArrayNull(scip, &(heurdata->solcand), heurdata->nindconss);
393
394  /* free heuristic data */
395  SCIPfreeBlockMemory(scip, &heurdata);
396  SCIPheurSetData(heur, NULL);
397
398  return SCIP_OKAY;
399 }
400
401
402 /** execution method of primal heuristic */
403 static
404 SCIP_DECL_HEUREXEC(heurExecIndicator)
405 { /*lint --e{715}*/
406  SCIP_HEURDATA* heurdata;
407  int nfoundsols = 0;
408
409  assert( heur != NULL );
410  assert( scip != NULL );
411  assert( result != NULL );
412
413  *result = SCIP_DIDNOTRUN;
414
415  if ( SCIPgetSubscipDepth(scip) > 0 )
416  return SCIP_OKAY;
417
418  /* get heuristic's data */
419  heurdata = SCIPheurGetData(heur);
420  assert( heurdata != NULL );
421
422  /* call heuristic, if solution candidate is available */
423  if ( heurdata->solcand != NULL )
424  {
425  assert( heurdata->nindconss > 0 );
426  assert( heurdata->indconss != NULL );
427
428  /* The heuristic will only be successful if there are no integral variables and no binary variables except the
429  * indicator variables. */
430  if ( SCIPgetNIntVars(scip) > 0 || heurdata->nindconss < SCIPgetNBinVars(scip) )
431  return SCIP_OKAY;
432
433  SCIP_CALL( trySolCandidate(scip, heur, heurdata, heurdata->nindconss, heurdata->indconss, heurdata->solcand, &nfoundsols) );
434
435  if ( nfoundsols > 0 )
436  *result = SCIP_FOUNDSOL;
437  else
438  *result = SCIP_DIDNOTFIND;
439
440  /* free memory */
441  SCIPfreeBlockMemoryArray(scip, &(heurdata->solcand), heurdata->nindconss);
442  SCIPfreeBlockMemoryArray(scip, &(heurdata->indconss), heurdata->nindconss);
443  }
444
445  /* try to improve solutions generated by other heuristics */
446  if ( heurdata->improvesols )
447  {
448  SCIP_CONS** indconss;
449  SCIP_Bool* solcand;
450  SCIP_SOL* bestsol;
451  int nindconss;
452  int i;
453
454  if ( heurdata->indicatorconshdlr == NULL )
455  return SCIP_OKAY;
456
457  /* check whether a new best solution has been found */
458  bestsol = SCIPgetBestSol(scip);
459  if ( bestsol == heurdata->lastsol )
460  return SCIP_OKAY;
461  heurdata->lastsol = bestsol;
462
463  /* avoid solutions produced by this heuristic */
464  if ( SCIPsolGetHeur(bestsol) == heur )
465  return SCIP_OKAY;
466
467  /* The heuristic will only be successful if there are no integral variables and no binary variables except the
468  * indicator variables. */
469  nindconss = SCIPconshdlrGetNConss(heurdata->indicatorconshdlr);
470  if ( SCIPgetNIntVars(scip) > 0 || nindconss < SCIPgetNBinVars(scip) )
471  return SCIP_OKAY;
472
473  if ( nindconss == 0 )
474  return SCIP_OKAY;
475
476  indconss = SCIPconshdlrGetConss(heurdata->indicatorconshdlr);
477  assert( indconss != NULL );
478
479  /* fill solution candidate */
480  SCIP_CALL( SCIPallocBufferArray(scip, &solcand, nindconss) );
481  for (i = 0; i < nindconss; ++i)
482  {
483  SCIP_VAR* binvar;
484  SCIP_Real val;
485
486  solcand[i] = FALSE;
487  if ( SCIPconsIsActive(indconss[i]) )
488  {
489  binvar = SCIPgetBinaryVarIndicator(indconss[i]);
490  assert( binvar != NULL );
491
492  val = SCIPgetSolVal(scip, bestsol, binvar);
493  assert( SCIPisFeasIntegral(scip, val) );
494  if ( val > 0.5 )
495  solcand[i] = TRUE;
496  }
497  }
498
499  SCIPdebugMsg(scip, "Trying to improve best solution of value %f.\n", SCIPgetSolOrigObj(scip, bestsol) );
500
501  /* try one-opt heuristic */
502  SCIP_CALL( tryOneOpt(scip, heur, heurdata, nindconss, indconss, solcand, &nfoundsols) );
503
504  if ( nfoundsols > 0 )
505  *result = SCIP_FOUNDSOL;
506  else
507  *result = SCIP_DIDNOTFIND;
508
509  SCIPfreeBufferArray(scip, &solcand);
510  }
511
512  return SCIP_OKAY;
513 }
514
515
516 /*
517  * primal heuristic specific interface methods
518  */
519
520 /** creates the indicator primal heuristic and includes it in SCIP */
522  SCIP* scip /**< SCIP data structure */
523  )
524 {
525  SCIP_HEURDATA* heurdata;
526  SCIP_HEUR* heur;
527
528  /* create Indicator primal heuristic data */
529  SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
530  heurdata->nindconss = 0;
531  heurdata->indconss = NULL;
532  heurdata->solcand = NULL;
533  heurdata->lastsol = NULL;
534  heurdata->indicatorconshdlr = NULL;
535
536  /* include primal heuristic */
537  SCIP_CALL( SCIPincludeHeurBasic(scip, &heur,
539  HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecIndicator, heurdata) );
540
541  assert( heur != NULL );
542
543  /* set non-NULL pointers to callback methods */
544  SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyIndicator) );
545  SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitIndicator) );
546  SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeIndicator) );
547
550  "heuristics/" HEUR_NAME "/oneopt",
551  "whether the one-opt heuristic should be started",
552  &heurdata->oneopt, TRUE, DEFAULT_ONEOPT, NULL, NULL) );
553
555  "heuristics/" HEUR_NAME "/improvesols",
556  "Try to improve other solutions by one-opt?",
557  &heurdata->improvesols, TRUE, DEFAULT_IMPROVESOLS, NULL, NULL) );
558
559  return SCIP_OKAY;
560 }
561
562
563 /** pass partial solution for indicator variables to heuristic */
565  SCIP* scip, /**< SCIP data structure */
566  SCIP_HEUR* heur, /**< indicator heuristic */
567  int nindconss, /**< number of indicator constraints */
568  SCIP_CONS** indconss, /**< indicator constraints */
569  SCIP_Bool* solcand /**< values for indicator variables in partial solution */
570  )
571 {
572  SCIP_HEURDATA* heurdata;
573
574  assert( scip != NULL );
575  assert( heur != NULL );
576  assert( strcmp(SCIPheurGetName(heur), HEUR_NAME) == 0 );
577  assert( nindconss > 0 );
578  assert( indconss != NULL );
579  assert( solcand != NULL );
580
581  /* get heuristic's data */
582  heurdata = SCIPheurGetData(heur);
583  assert( heurdata != NULL );
584
585  /* copy indicator information */
586  if ( heurdata->indconss != NULL )
587  SCIPfreeBlockMemoryArray(scip, &(heurdata->indconss), heurdata->nindconss);
588
589  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(heurdata->indconss), indconss, nindconss) );
590  heurdata->nindconss = nindconss;
591
592  /* copy partial solution */
593  if ( heurdata->solcand != NULL )
594  BMScopyMemoryArray(heurdata->solcand, solcand, nindconss);
595  else
596  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(heurdata->solcand), solcand, nindconss) );
597
598  return SCIP_OKAY;
599 }
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip.h:21909
SCIP_RETCODE SCIPheurPassIndicator(SCIP *scip, SCIP_HEUR *heur, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand)
int SCIPgetNIntVars(SCIP *scip)
Definition: scip.c:11721
Definition: scip.c:37672
SCIP_RETCODE SCIPincludeHeurIndicator(SCIP *scip)
static SCIP_DECL_HEURCOPY(heurCopyIndicator)
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip.c:35152
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:6541
#define HEUR_DESC
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17222
constraint handler for indicator constraints
static SCIP_DECL_HEURINIT(heurInitIndicator)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4485
#define FALSE
Definition: def.h:64
int SCIPgetSubscipDepth(SCIP *scip)
Definition: scip.c:3533
#define TRUE
Definition: def.h:63
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip.h:21907
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
Definition: scip.c:7999
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35220
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:21937
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur.c:1102
#define HEUR_MAXDEPTH
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip.h:21890
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1260
#define SCIPdebugMsg
Definition: scip.h:451
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
Definition: cons.c:7942
static SCIP_DECL_HEURFREE(heurFreeIndicator)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip.h:21904
#define HEUR_DISPCHAR
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1181
#define HEUR_TIMING
#define DEFAULT_ONEOPT
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:8060
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
Definition: scip.c:35477
#define HEUR_PRIORITY
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:35187
#define NULL
Definition: lpi_spx1.cpp:137
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2382
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38137
#define DEFAULT_IMPROVESOLS
#define HEUR_NAME
handle partial solutions for linear problems with indicators and otherwise continuous variables ...
#define SCIP_CALL(x)
Definition: def.h:306
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:35713
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4515
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:21925
#define SCIP_Bool
Definition: def.h:61
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:28854
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:42094
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
Definition: scip.c:39843
#define BMScopyMemoryArray(ptr, source, num)
Definition: memory.h:89
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38090
SCIP_VAR * SCIPgetBinaryVarIndicator(SCIP_CONS *cons)
#define SCIP_MAXTREEDEPTH
Definition: def.h:242
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:11676
static SCIP_RETCODE tryOneOpt(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand, int *nfoundsols)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:38931
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:8076
#define SCIP_Real
Definition: def.h:135
static SCIP_RETCODE trySolCandidate(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand, int *nfoundsols)
#define HEUR_FREQ
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:8044
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17232
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
Definition: scip.h:21910
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:35092
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46187
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:35055
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
Definition: heur.c:1092
#define HEUR_USESSUBSCIP
static SCIP_DECL_HEUREXEC(heurExecIndicator)
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35264
#define HEUR_FREQOFS
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:38007
SCIP callable library.
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip.c:4176
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37005
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38421