SCIP Doxygen Documentation
Loading...
Searching...
No Matches
iisfinder.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-2026 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file iisfinder.c
26 * @ingroup OTHER_CFILES
27 * @brief methods for IIS finders
28 * @author Mark Turner
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#include <assert.h>
34
35#include "scip/set.h"
36#include "scip/clock.h"
37#include "scip/misc.h"
38#include "scip/paramset.h"
39#include "scip/scip.h"
40#include "scip/cons_linear.h"
41#include "scip/iisfinder.h"
44#include "scip/type_misc.h"
45
46
47/** method to call, when the priority of an IIS finder was changed */
48static
49SCIP_DECL_PARAMCHGD(paramChgdIISfinderPriority)
50{ /*lint --e{715}*/
51 SCIP_PARAMDATA* paramdata;
52
53 paramdata = SCIPparamGetData(param);
54 assert(paramdata != NULL);
55
56 /* use SCIPsetIISPriority() to mark the IIS unsorted */
57 SCIP_CALL( SCIPsetIISfinderPriority(scip, (SCIP_IISFINDER*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
58
59 return SCIP_OKAY;
60}
61
62/** internal method for creating the subscip that will hold the IIS */
63static
65 SCIP_SET* set, /**< global SCIP settings */
66 SCIP_IIS* iis, /**< pointer to store IIS */
67 SCIP_Real timelim, /**< timelimit */
68 SCIP_Longint nodelim, /**< nodelimit */
69 SCIP_Bool* success /**< whether the created subscip is complete */
70 )
71{
72 SCIP_VAR** vars;
73 int nvars;
74 int i;
75
76 assert(set != NULL);
77 assert(iis != NULL);
78 assert(success != NULL);
79
80 *success = FALSE;
81
82 /* Create the subscip used for storing the IIS */
83 if( iis->subscip != NULL )
84 {
85 SCIPdebugMsg(set->scip, "An IIS for this problem already exists. Removing it before starting search procedure again.\n");
86
87 /* free sub-SCIP */
88 SCIP_CALL( SCIPiisReset(&iis) );
89 }
90
91 assert( iis->subscip == NULL );
92 assert( iis->varsmap == NULL );
93 assert( iis->conssmap == NULL );
94
95 /* create a new SCIP instance */
96 SCIP_CALL( SCIPcreate(&(iis->subscip)) );
97
98 /* Create hash maps */
101
102 /* create problem in sub-SCIP */
103 SCIP_CALL( SCIPcopyOrig(set->scip, iis->subscip, iis->varsmap, iis->conssmap, "iis", TRUE, FALSE, TRUE, success) );
104
105 if( !(*success) )
106 return SCIP_OKAY;
107
108 /* Remove the objective */
111 for( i = 0; i < nvars; i++ )
112 SCIP_CALL( SCIPchgVarObj(iis->subscip, vars[i], 0.0 ) );
113
114 /* copy parameter settings */
115 /** @todo: Do we really want to copy the parameter settings? */
117#ifdef SCIP_DEBUG
118 /* for debugging, enable full output */
119 SCIP_CALL( SCIPsetIntParam(iis->subscip, "display/verblevel", 5) );
120 SCIP_CALL( SCIPsetIntParam(iis->subscip, "display/freq", 100000000) );
121#else
122 /* disable statistic timing inside sub SCIP and output to console */
123 SCIP_CALL( SCIPsetIntParam(iis->subscip, "display/verblevel", 0) );
124 SCIP_CALL( SCIPsetBoolParam(iis->subscip, "timing/statistictiming", FALSE) );
125#endif
127 SCIP_CALL( SCIPsetIntParam(iis->subscip, "limits/bestsol", 1) );
128 SCIP_CALL( SCIPsetRealParam(iis->subscip, "limits/time", timelim - SCIPclockGetTime(iis->iistime)) );
129 SCIP_CALL( SCIPsetLongintParam(iis->subscip, "limits/nodes", nodelim) );
130
131 return SCIP_OKAY;
132}
133
134/** checks the problem for trivial infeasibility reasons, e.g. contradicting bounds */
135static
137 SCIP* scip, /**< pointer to SCIP */
138 SCIP_Bool* trivial /**< pointer to store whether the problem is trivially infeasible */
139 )
140{
141 SCIP_CONS** conss;
142 SCIP_VAR** vars;
143 SCIP_Real* coefs;
144 SCIP_Real maxactivity;
145 SCIP_Real minactivity;
146 SCIP_Real lhs;
147 SCIP_Real rhs;
148 SCIP_Bool success;
149 int violatingcons;
150 int nconss;
151 int nvars;
152 int i;
153 int j;
154
155 assert( trivial != NULL );
156 *trivial = FALSE;
157
158 /* Check for contradicting bounds */
161 for( i = 0; i < nvars; i++ )
162 {
164 {
165 *trivial = TRUE;
166 break;
167 }
168 }
169
170 /* Check for linear max (min) activities that do not respect their lhs (rhs) */
171 violatingcons = -1;
172 conss = SCIPgetConss(scip);
173 nconss = SCIPgetNConss(scip);
174 for( i = 0; i < nconss; ++i )
175 {
176 /**@todo generalize activity evaluation */
177 /* Skip the constraint if it is not linear */
178 if( strcmp(SCIPconshdlrGetName(SCIPconsGetHdlr(conss[i])), "linear") != 0 )
179 continue;
180
181 /* Get variable information */
182 nvars = SCIPgetNVarsLinear(scip, conss[i]);
183 vars = SCIPgetVarsLinear(scip, conss[i]);
184 coefs = SCIPgetValsLinear(scip, conss[i]);
185
186 /* Check the left-hand side */
187 lhs = SCIPconsGetLhs(scip, conss[i], &success);
188 assert( success );
189
190 if( !SCIPisInfinity(scip, -lhs) )
191 {
192 /* Compute the maximum activity */
193 maxactivity = 0.0;
194 for( j = 0; j < nvars; ++j )
195 maxactivity += coefs[j] * (coefs[j] >= 0.0 ? SCIPvarGetUbOriginal(vars[j]) : SCIPvarGetLbOriginal(vars[j]));
196
197 /* Is the violation (maxactivity < lhs) true? */
198 if( SCIPisSumLT(scip, maxactivity, lhs) )
199 {
200 *trivial = TRUE;
201 violatingcons = i;
202 break;
203 }
204 }
205
206 /* Check the right-hand side */
207 rhs = SCIPconsGetRhs(scip, conss[i], &success);
208 assert( success );
209
210 if( !SCIPisInfinity(scip, rhs) )
211 {
212 /* Compute the minimum activity */
213 minactivity = 0.0;
214 for( j = 0; j < nvars; ++j )
215 minactivity += coefs[j] * (coefs[j] >= 0.0 ? SCIPvarGetLbOriginal(vars[j]) : SCIPvarGetUbOriginal(vars[j]));
216
217 /* Is the violation (rhs < minactivity) true? */
218 if( SCIPisSumLT(scip, rhs, minactivity) )
219 {
220 *trivial = TRUE;
221 violatingcons = i;
222 break;
223 }
224 }
225 }
226
227 /* Delete all constraints not relevant to the infeasibility */
228 if( *trivial )
229 {
230 for( i = nconss - 1; i >= 0; i-- )
231 {
232 if( i == violatingcons )
233 continue;
234 SCIP_CALL( SCIPdelCons(scip, conss[i]) );
235 }
236 }
237 return SCIP_OKAY;
238}
239
240/** internal method for creating an IIS finder */
241static
243 SCIP_IISFINDER** iisfinder, /**< pointer to store IIS finder */
244 SCIP_SET* set, /**< global SCIP settings */
245 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
246 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
247 const char* name, /**< name of IIS finder */
248 const char* desc, /**< description of IIS finder */
249 int priority, /**< priority of the IIS finder */
250 SCIP_DECL_IISFINDERCOPY ((*iisfindercopy)), /**< copy method of IIS finder or NULL if you don't want to copy your plugin into sub-SCIPs */
251 SCIP_DECL_IISFINDERFREE ((*iisfinderfree)), /**< destructor of IIS finder */
252 SCIP_DECL_IISFINDEREXEC ((*iisfinderexec)), /**< IIS finder execution method */
253 SCIP_IISFINDERDATA* iisfinderdata /**< IIS finder data */
254 )
255{
257 char paramdesc[SCIP_MAXSTRLEN];
258
259 assert(iisfinder != NULL);
260 assert(name != NULL);
261 assert(desc != NULL);
262 assert(iisfinderexec != NULL);
263
264 SCIP_ALLOC( BMSallocClearBlockMemory(blkmem, iisfinder) );
265
266 SCIP_ALLOC( BMSduplicateBlockMemoryArray(blkmem, &(*iisfinder)->name, name, strlen(name)+1) );
267 SCIP_ALLOC( BMSduplicateBlockMemoryArray(blkmem, &(*iisfinder)->desc, desc, strlen(desc)+1) );
268 (*iisfinder)->priority = priority;
269 (*iisfinder)->iisfindercopy = iisfindercopy;
270 (*iisfinder)->iisfinderfree = iisfinderfree;
271 (*iisfinder)->iisfinderexec = iisfinderexec;
272 (*iisfinder)->iisfinderdata = iisfinderdata;
273
274 /* create clocks */
275 SCIP_CALL( SCIPclockCreate(&(*iisfinder)->iisfindertime, SCIP_CLOCKTYPE_DEFAULT) );
276
277 /* add parameters */
278 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "iis/%s/priority", name);
279 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of iis generation rule <%s>", name);
280 SCIP_CALL( SCIPsetAddIntParam(set, messagehdlr, blkmem, paramname, paramdesc,
281 &(*iisfinder)->priority, FALSE, priority, INT_MIN/4, INT_MAX/2,
282 paramChgdIISfinderPriority, (SCIP_PARAMDATA*)(*iisfinder)) ); /*lint !e740*/
283
284 return SCIP_OKAY;
285}
286
287
288/** creates an IIS finder */
290 SCIP_IISFINDER** iisfinder, /**< pointer to store IIS finder */
291 SCIP_SET* set, /**< global SCIP settings */
292 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
293 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
294 const char* name, /**< name of IIS finder */
295 const char* desc, /**< description of IIS finder */
296 int priority, /**< priority of the IIS finder in standard mode */
297 SCIP_DECL_IISFINDERCOPY ((*iisfindercopy)), /**< copy method of IIS finder or NULL if you don't want to copy your plugin into sub-SCIPs */
298 SCIP_DECL_IISFINDERFREE ((*iisfinderfree)), /**< destructor of IIS finder */
299 SCIP_DECL_IISFINDEREXEC ((*iisfinderexec)), /**< IIS finder execution method */
300 SCIP_IISFINDERDATA* iisfinderdata /**< IIS finder data */
301 )
302{
303 assert(iisfinder != NULL);
304 assert(name != NULL);
305 assert(desc != NULL);
306 assert(iisfinderexec != NULL);
307
308 SCIP_CALL_FINALLY( doIISfinderCreate(iisfinder, set, messagehdlr, blkmem, name, desc, priority,
309 iisfindercopy, iisfinderfree, iisfinderexec, iisfinderdata), (void) SCIPiisfinderFree(iisfinder, set, blkmem) );
310
311 return SCIP_OKAY;
312}
313
314/** gets name of IIS finder */
316 SCIP_IISFINDER* iisfinder /**< IIS finder */
317 )
318{
319 assert(iisfinder != NULL);
320
321 return iisfinder->name;
322}
323
324/** calls IIS finder generation method */
326 SCIP_SET* set /**< global SCIP settings */
327 )
328{
329 SCIP_CONS** conss;
330 SCIP_CONS* imagecons;
331 SCIP_VAR** vars;
332 SCIP_VAR* imagevar;
333 SCIP_IIS* iis;
334 SCIP_HASHMAP* invconssmap;
335 SCIP_HASHMAP* invvarsmap;
337 SCIP_RETCODE retcode;
338 SCIP_Real timelim;
339 SCIP_Longint nodelim;
340 SCIP_Bool silent;
341 SCIP_Bool makeirreducible;
342 SCIP_Bool stopafterone;
343 SCIP_Bool removeunusedvars;
344 SCIP_Bool trivial;
345 SCIP_Bool islinear;
346 SCIP_Bool success;
347 int nconss;
348 int nvars;
349 int nbounds;
350 int i;
351 int j;
352
353 /* exact mode is not supported */
354 if( set->exact_enable )
355 {
356 SCIPinfoMessage(set->scip, NULL, "IIS generation does not yet support exact mode.\n");
357 return SCIP_OKAY;
358 }
359
360 /* sort the iis finders by priority */
362
363 /* Get the IIS data. */
364 iis = SCIPgetIIS(set->scip);
365 SCIP_CALL( SCIPiisReset(&iis) );
366 SCIP_CALL( SCIPgetRealParam(set->scip, "iis/time", &timelim) );
367 SCIP_CALL( SCIPgetLongintParam(set->scip, "iis/nodes", &nodelim) );
368
369 /* Create the subscip used for storing the IIS */
370 SCIP_CALL( createSubscipIIS(set, iis, timelim, nodelim, &success) );
371
372 if( !success )
373 {
374 SCIPinfoMessage(iis->subscip, NULL, "Error copying original problem instance. IIS generation suspended.\n");
375 return SCIP_OKAY;
376 }
377
379
380 /* If the model is not yet shown to be infeasible then check for infeasibility */
381 if( SCIPgetStage(set->scip) == SCIP_STAGE_PROBLEM )
382 {
383 retcode = SCIPsolve(iis->subscip);
384
385 if( retcode != SCIP_OKAY )
386 {
387 SCIPinfoMessage(iis->subscip, NULL, "Error proving infeasibility of initial problem. IIS generation suspended.\n");
389 return SCIP_OKAY;
390 }
391
393 {
394 switch( SCIPgetStatus(iis->subscip) )
395 {
405 SCIPinfoMessage(iis->subscip, NULL, "Some limit reached. Failed to prove infeasibility of initial problem.\n");
407 return SCIP_OKAY;
408
410 SCIPinfoMessage(iis->subscip, NULL, "Initial problem is infeasible or Unbounded. Not performing IIS generation.\n");
412 return SCIP_OKAY;
413
416 SCIPdebugMsg(iis->subscip, "User interrupt. Stopping.\n");
418 return SCIP_OKAY;
419
424 SCIPinfoMessage(iis->subscip, NULL, "Initial problem is feasible. No IIS exists.\n");
426 return SCIP_OKAY;
427
429 break;
430
432 default:
433 SCIPinfoMessage(iis->subscip, NULL, "Unexpected return status %d. Failing to show (in)feasibility of initial problem. Exiting ...\n", SCIPgetStatus(iis->subscip));
435 return SCIP_OKAY;
436 }
437 }
438 else
439 {
440 SCIPinfoMessage(iis->subscip, NULL, "Initial solve to verify infeasibility failed.\n");
442 return SCIP_OKAY;
443 }
444 iis->nnodes += SCIPgetNTotalNodes(iis->subscip);
446 iis->infeasible = TRUE;
447 }
448 else if( SCIPgetStage(set->scip) == SCIP_STAGE_SOLVED )
449 {
451 {
452 SCIPinfoMessage(iis->subscip, NULL, "Initial problem does not have an infeasible status. Not performing an IIS algorithm.\n");
454 return SCIP_OKAY;
455 }
456 iis->infeasible = TRUE;
457 }
458 else
459 {
460 SCIPinfoMessage(iis->subscip, NULL, "Initial problem is neither in problem stage or infeasible.\n");
461 return SCIP_OKAY;
462 }
463
464 /* build inverse constraints hashmap */
465 conss = SCIPgetOrigConss(set->scip);
466 nconss = SCIPgetNOrigConss(iis->subscip);
467 assert(nconss == SCIPgetNOrigConss(set->scip));
468 SCIP_CALL( SCIPhashmapCreate(&invconssmap, SCIPblkmem(set->scip), nconss) );
469 for( i = 0; i < nconss; ++i )
470 {
471 imagecons = SCIPhashmapGetImage(iis->conssmap, conss[i]);
472 assert(imagecons != NULL);
473 SCIP_CALL( SCIPhashmapInsert(invconssmap, imagecons, conss[i]) );
474 }
476
477 /* Check for trivial infeasibility reasons */
478 SCIP_CALL( checkTrivialInfeas(iis->subscip, &trivial) );
479 if( trivial )
481
482 /* Try all IIS generators */
483 SCIP_CALL( SCIPgetBoolParam(set->scip, "iis/stopafterone", &stopafterone) );
484 if( !trivial )
485 {
486 for( i = 0; i < set->niisfinders; ++i )
487 {
488 SCIP_IISFINDER* iisfinder;
489 iisfinder = set->iisfinders[i];
490 assert( iis->infeasible );
491
492 /* start timing */
493 SCIPclockStart(iisfinder->iisfindertime, set);
494
495 SCIPdebugMsg(iis->subscip, "----- STARTING IIS FINDER %s -----\n", iisfinder->name);
496 SCIP_CALL( iisfinder->iisfinderexec(iis, iisfinder, &result) );
498
499 /* stop timing */
500 SCIPclockStop(iisfinder->iisfindertime, set);
501
502 /* recreate the initial subscip if the IIS finder has produced an invalid infeasible subsystem */
503 if( !iis->infeasible )
504 {
505 SCIP_CALL( createSubscipIIS(set, iis, timelim, nodelim, &success) );
506 assert(success);
507 }
508
509 if( timelim - SCIPclockGetTime(iis->iistime) <= 0 || (nodelim != -1 && iis->nnodes > nodelim) )
510 {
511 SCIPdebugMsg(iis->subscip, "Time or node limit hit. Stopping Search.\n");
512 break;
513 }
514
515 if( (stopafterone && (result == SCIP_SUCCESS)) || (iis->irreducible == TRUE) )
516 break;
517 }
518 }
519
520 /* Ensure the problem is irreducible if requested */
521 SCIP_CALL( SCIPgetBoolParam(set->scip, "iis/irreducible", &makeirreducible) );
522 if( !iis->irreducible && makeirreducible && !(timelim - SCIPclockGetTime(iis->iistime) <= 0 || (nodelim != -1 && iis->nnodes > nodelim)) && !trivial )
523 {
524 SCIPdebugMsg(iis->subscip, "----- STARTING GREEDY SINGLETON DELETION ALGORITHM. ATTEMPT TO ENSURE IRREDUCIBILITY -----\n");
525
526 assert( iis->infeasible );
528 assert( iis->infeasible );
529 }
530
531 /* Remove redundant constraints that potentially are left over from indicator constraints,
532 * that is constraints containing a variables with no bounds and that only features in a single constraint */
533 nconss = SCIPgetNOrigConss(iis->subscip);
534 conss = SCIPgetOrigConss(iis->subscip);
535 for( i = nconss -1; i >= 0; --i )
536 {
537 islinear = strcmp(SCIPconshdlrGetName(SCIPconsGetHdlr(conss[i])), "linear") == 0;
538 if( islinear && SCIPconsGetNUses(conss[i]) <= 1)
539 {
540 nvars = SCIPgetNVarsLinear(iis->subscip, conss[i]);
541 vars = SCIPgetVarsLinear(iis->subscip, conss[i]);
542 for( j = 0; j < nvars; ++j )
543 {
545 {
546 SCIP_CALL( SCIPdelCons(iis->subscip, conss[i]) );
547 break;
548 }
549 }
550 }
551 }
552
553 SCIP_CALL( SCIPgetBoolParam(set->scip, "iis/removeunusedvars", &removeunusedvars) );
554 if( removeunusedvars )
555 {
556 SCIP_Bool deleted;
557
558 /* build inverse variables hashmap */
559 vars = SCIPgetOrigVars(set->scip);
561 assert(nvars == SCIPgetNOrigVars(set->scip));
562 SCIP_CALL( SCIPhashmapCreate(&invvarsmap, SCIPblkmem(set->scip), nvars) );
563 for( i = 0; i < nvars; ++i )
564 {
565 imagevar = SCIPhashmapGetImage(iis->varsmap, vars[i]);
566 assert(imagevar != NULL);
567 SCIP_CALL( SCIPhashmapInsert(invvarsmap, imagevar, vars[i]) );
568 }
570
573 for( i = nvars - 1; i >= 0; i-- )
574 {
577 {
578 SCIP_CALL( SCIPdelVar(iis->subscip, vars[i], &deleted) );
579 assert( deleted );
580 }
581 }
582
583 /* recreate main variables hashmap */
586 for( i = 0; i < nvars; ++i )
587 {
588 imagevar = SCIPhashmapGetImage(invvarsmap, vars[i]);
589 assert(imagevar != NULL);
590 SCIP_CALL( SCIPhashmapInsert(iis->varsmap, imagevar, vars[i]) );
591 }
592 SCIPhashmapFree(&invvarsmap);
593 }
594
595 /* recreate main constraints hashmap */
596 nconss = SCIPgetNOrigConss(iis->subscip);
597 conss = SCIPgetOrigConss(iis->subscip);
598 for( i = 0; i < nconss; ++i )
599 {
600 imagecons = SCIPhashmapGetImage(invconssmap, conss[i]);
601 assert(imagecons != NULL);
602 SCIP_CALL( SCIPhashmapInsert(iis->conssmap, imagecons, conss[i]) );
603 }
604 SCIPhashmapFree(&invconssmap);
605
606 SCIP_CALL( SCIPgetBoolParam(set->scip, "iis/silent", &silent) );
607 if( !silent )
609
610 /* stop timing */
612
613 if( !silent )
614 {
615 nbounds = 0;
616 SCIPinfoMessage(set->scip, NULL, "\n");
617 if( iis->infeasible && iis->irreducible )
618 SCIPinfoMessage(set->scip, NULL, "IIS Status : irreducible infeasible subsystem (IIS) found\n");
619 else if( iis->infeasible )
620 SCIPinfoMessage(set->scip, NULL, "IIS Status : infeasible subsystem (IS) found\n");
621 else
622 SCIPinfoMessage(set->scip, NULL, "IIS Status : failed to find an infeasible subsystem (IS)\n");
623 if( iis->irreducible )
624 SCIPinfoMessage(set->scip, NULL, "IIS irreducible : yes\n");
625 else
626 SCIPinfoMessage(set->scip, NULL, "IIS irreducible : no\n");
627 assert( iis->subscip != NULL );
628 SCIPinfoMessage(set->scip, NULL, "Generation Time (sec) : %.2f\n", SCIPiisGetTime(iis));
629 SCIPinfoMessage(set->scip, NULL, "Generation Nodes : %lld\n", SCIPiisGetNNodes(iis));
630 SCIPinfoMessage(set->scip, NULL, "Num. Cons. in IIS : %d\n", SCIPgetNOrigConss(iis->subscip));
633 for( i = 0; i < nvars; i++ )
634 {
636 ++nbounds;
638 ++nbounds;
639 }
640 SCIPinfoMessage(set->scip, NULL, "Num. Vars. in IIS : %d\n", nvars);
641 SCIPinfoMessage(set->scip, NULL, "Num. Bounds in IIS : %d\n", nbounds);
642 }
643
644 return SCIP_OKAY;
645}
646
647/** gets description of the IIS finder */
649 SCIP_IISFINDER* iisfinder /**< IIS finder */
650 )
651{
652 assert(iisfinder != NULL);
653
654 return iisfinder->desc;
655}
656
657/** copies the given IIS finder to a new scip */
659 SCIP_IISFINDER* iisfinder, /**< IIS finder */
660 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
661 )
662{
663 assert(iisfinder != NULL);
664 assert(set != NULL);
665 assert(set->scip != NULL);
666
667 if( iisfinder->iisfindercopy != NULL )
668 {
669 SCIPsetDebugMsg(set, "including IIS finder %s in subscip %p\n", SCIPiisfinderGetName(iisfinder), (void*)set->scip);
670 SCIP_CALL( iisfinder->iisfindercopy(set->scip, iisfinder) );
671 }
672 return SCIP_OKAY;
673}
674
675/** frees memory of IIS finder */
677 SCIP_IISFINDER** iisfinder, /**< IIS finder */
678 SCIP_SET* set, /**< global SCIP settings */
679 BMS_BLKMEM* blkmem /**< block memory */
680 )
681{
682 assert(iisfinder != NULL);
683
684 if( *iisfinder == NULL )
685 return SCIP_OKAY;
686
687 assert(set != NULL);
688
689 /* call destructor of IIS */
690 if( (*iisfinder)->iisfinderfree != NULL )
691 {
692 SCIP_CALL( (*iisfinder)->iisfinderfree(set->scip, *iisfinder) );
693 }
694
695 /* free clocks */
696 SCIPclockFree(&(*iisfinder)->iisfindertime);
697
698 BMSfreeBlockMemoryArrayNull(blkmem, &(*iisfinder)->name, strlen((*iisfinder)->name)+1);
699 BMSfreeBlockMemoryArrayNull(blkmem, &(*iisfinder)->desc, strlen((*iisfinder)->desc)+1);
700 BMSfreeBlockMemory(blkmem, iisfinder);
701
702 return SCIP_OKAY;
703}
704
705/** gets user data of IIS finder */
707 SCIP_IISFINDER* iisfinder /**< IIS finder */
708 )
709{
710 assert(iisfinder != NULL);
711
712 return iisfinder->iisfinderdata;
713}
714
715/** sets user data of IIS finder; user has to free old data in advance! */
717 SCIP_IISFINDER* iisfinder, /**< IIS finder */
718 SCIP_IISFINDERDATA* iisfinderdata /**< new IIS finder user data */
719 )
720{
721 assert(iisfinder != NULL);
722
723 iisfinder->iisfinderdata = iisfinderdata;
724}
725
726/** gets priority of IIS finder */
728 SCIP_IISFINDER* iisfinder /**< IIS finder */
729 )
730{
731 assert(iisfinder != NULL);
732
733 return iisfinder->priority;
734}
735
736/** enables or disables all clocks of @p iisfinder, depending on the value of the flag */
738 SCIP_IISFINDER* iisfinder, /**< the IIS finder for which all clocks should be enabled or disabled */
739 SCIP_Bool enable /**< should the clocks of the IIS be enabled? */
740 )
741{
742 assert(iisfinder != NULL);
743
744 SCIPclockEnableOrDisable(iisfinder->iisfindertime, enable);
745}
746
747/** sets copy method of IIS finder */
749 SCIP_IISFINDER* iisfinder, /**< IIS finder */
750 SCIP_DECL_IISFINDERCOPY ((*iisfindercopy)) /**< copy method of IIS finder or NULL if you don't want to copy your plugin into sub-SCIPs */
751 )
752{
753 assert(iisfinder != NULL);
754
755 iisfinder->iisfindercopy = iisfindercopy;
756}
757
758/** sets destructor method of IIS finder */
760 SCIP_IISFINDER* iisfinder, /**< IIS finder */
761 SCIP_DECL_IISFINDERFREE ((*iisfinderfree)) /**< destructor of IIS finder */
762 )
763{
764 assert(iisfinder != NULL);
765
766 iisfinder->iisfinderfree = iisfinderfree;
767}
768
769/** sets priority of IIS finder */
771 SCIP_IISFINDER* iisfinder, /**< IIS finder */
772 SCIP_SET* set, /**< global SCIP settings */
773 int priority /**< new priority of the IIS finder */
774 )
775{
776 assert(iisfinder != NULL);
777 assert(set != NULL);
778
779 iisfinder->priority = priority;
780 set->iisfinderssorted = FALSE;
781}
782
783/** gets time in seconds used in this IIS finder */
785 SCIP_IISFINDER* iisfinder /**< IIS finder */
786 )
787{
788 assert(iisfinder != NULL);
789
790 return SCIPclockGetTime(iisfinder->iisfindertime);
791}
792
793/** prints output line during IIS calculations */
795 SCIP_IIS* iis, /**< pointer to the IIS */
796 SCIP_Bool printheaders /**< whether the headers should be printed instead of the info */
797 )
798{
799 SCIP_VAR** vars;
800 SCIP* scip;
801 int i;
802 int nvars;
803 int nbounds = 0;
804 const char* infeasible = iis->infeasible ? "yes" : "no";
805
806 scip = SCIPiisGetSubscip(iis);
807 assert(scip != NULL);
808
809 if( printheaders || (iis->niismessagecalls % 15 == 0) )
810 {
811 SCIPinfoMessage(scip, NULL, "time(s)| node | cons | vars | bounds| infeasible\n");
812 if( printheaders )
813 return;
814 }
815 iis->niismessagecalls += 1;
816
819 for( i = 0; i < nvars; i++ )
820 {
822 ++nbounds;
824 ++nbounds;
825 }
826 SCIPinfoMessage(scip, NULL, "%7.1f|%7lld|%7d|%7d|%7d| %10s\n", SCIPiisGetTime(iis), SCIPiisGetNNodes(iis), SCIPgetNOrigConss(scip), nvars, nbounds, infeasible);
827}
828
829/** creates and captures a new IIS */
831 SCIP_IIS** iis, /**< pointer to return the created IIS */
832 SCIP_SET* set, /**< global SCIP settings */
833 BMS_BLKMEM* blkmem /**< block memory */
834 )
835{
836 assert(iis != NULL);
837
838 SCIP_ALLOC( BMSallocBlockMemory(blkmem, iis) );
839
840 (*iis)->subscip = NULL;
841 (*iis)->subscip = NULL;
842 (*iis)->varsmap = NULL;
843 (*iis)->conssmap = NULL;
844 SCIP_CALL( SCIPrandomCreate(&((*iis)->randnumgen), blkmem, SCIPsetInitializeRandomSeed(set, 0x5EED)) );
846 (*iis)->niismessagecalls = 0;
847 (*iis)->nnodes = 0;
848 (*iis)->infeasible = FALSE;
849 (*iis)->irreducible = FALSE;
850
851 return SCIP_OKAY;
852}
853
854/** releases an IIS */
856 SCIP_IIS** iis, /**< pointer to the IIS */
857 BMS_BLKMEM* blkmem /**< block memory */
858 )
859{
860 assert(iis != NULL);
861 if( *iis == NULL )
862 return SCIP_OKAY;
863
864 if( (*iis)->subscip != NULL )
865 {
866 SCIP_CALL( SCIPfree(&((*iis)->subscip)) );
867 (*iis)->subscip = NULL;
868 }
869
870 if( (*iis)->varsmap != NULL )
871 {
872 SCIPhashmapFree(&((*iis)->varsmap));
873 (*iis)->varsmap = NULL;
874 }
875
876 if( (*iis)->conssmap != NULL )
877 {
878 SCIPhashmapFree(&((*iis)->conssmap));
879 (*iis)->conssmap = NULL;
880 }
881
882 if( (*iis)->randnumgen != NULL )
883 {
884 SCIPrandomFree(&((*iis)->randnumgen), blkmem);
885 (*iis)->randnumgen = NULL;
886 }
887
888 SCIPclockFree(&(*iis)->iistime);
889
890 BMSfreeBlockMemory(blkmem, iis);
891 *iis = NULL;
892
893 return SCIP_OKAY;
894}
895
896/** reset an IIS (in case one exists from a previous solve) */
898 SCIP_IIS** iis /**< pointer to the IIS */
899 )
900{
901 assert(iis != NULL);
902 if( *iis == NULL )
903 return SCIP_OKAY;
904
905 if( (*iis)->subscip != NULL )
906 {
907 SCIP_CALL( SCIPfree(&((*iis)->subscip)) );
908 (*iis)->subscip = NULL;
909 }
910
911 if( (*iis)->varsmap != NULL )
912 {
913 SCIPhashmapFree(&((*iis)->varsmap));
914 (*iis)->varsmap = NULL;
915 }
916
917 if( (*iis)->conssmap != NULL )
918 {
919 SCIPhashmapFree(&((*iis)->conssmap));
920 (*iis)->conssmap = NULL;
921 }
922
923 SCIPclockReset((*iis)->iistime);
924 (*iis)->niismessagecalls = 0;
925 (*iis)->nnodes = 0;
926 (*iis)->infeasible = FALSE;
927 (*iis)->irreducible = FALSE;
928
929 return SCIP_OKAY;
930}
931
932/** gets time in seconds used in the IIS */
934 SCIP_IIS* iis /**< IIS */
935 )
936{
937 assert( iis != NULL );
938
939 return SCIPclockGetTime(iis->iistime);
940}
941
942/** Gets whether the IIS subscip is currently infeasible. */
944 SCIP_IIS* iis /**< IIS data structure */
945 )
946{
947 assert( iis != NULL );
948
949 return iis->infeasible;
950}
951
952/** Gets whether the IIS subscip is irreducible. */
954 SCIP_IIS* iis /**< IIS data structure */
955 )
956{
957 assert( iis != NULL );
958
959 return iis->irreducible;
960}
961
962/** Gets the number of nodes in the IIS solve. */
964 SCIP_IIS* iis /**< IIS data structure */
965 )
966{
967 assert( iis != NULL );
968
969 return iis->nnodes;
970}
971
972/** Sets the flag that states whether the IIS subscip is currently infeasible. */
974 SCIP_IIS* iis, /**< IIS data structure */
975 SCIP_Bool infeasible /**< The new infeasibility status of the IIS subscip */
976 )
977{
978 assert( iis != NULL );
979 iis->infeasible = infeasible;
980}
981
982/** Sets the flag that states whether the IIS subscip is irreducible. */
984 SCIP_IIS* iis, /**< IIS data structure */
985 SCIP_Bool irreducible /**< The new irreducible status of the IIS */
986 )
987{
988 assert( iis != NULL );
989 iis->irreducible = irreducible;
990}
991
992/** Increments the number of nodes in the IIS solve. */
994 SCIP_IIS* iis, /**< IIS data structure */
995 SCIP_Longint nnodes /**< The number of nodes to add to the IIS */
996 )
997{
998 assert( iis != NULL );
999 iis->nnodes += nnodes;
1000}
1001
1002/** get the randnumgen of the IIS */
1004 SCIP_IIS* iis /**< pointer to the IIS */
1005 )
1006{
1007 assert( iis != NULL );
1008 return iis->randnumgen;
1009}
1010
1011/** get the subscip of an IIS */
1013 SCIP_IIS* iis /**< pointer to the IIS */
1014 )
1015{
1016 assert( iis != NULL );
1017 return iis->subscip;
1018}
1019
1020/** get the constraint in the IIS subscip corresponding to the given main constraint,
1021or NULL if it was removed */
1023 SCIP_IIS* iis, /**< pointer to the IIS */
1024 SCIP_CONS* cons /**< constraint from the original model */
1025 )
1026{
1027 assert( iis != NULL );
1028 return SCIPhashmapGetImage(iis->conssmap, cons);
1029}
1030
1031/** get the variable in the IIS subscip corresponding to an original variable,
1032or NULL if it does not exist */
1034 SCIP_IIS* iis, /**< pointer to the IIS */
1035 SCIP_VAR* var /**< variable from the original model */
1036 )
1037{
1038 assert( iis != NULL );
1039 return SCIPhashmapGetImage(iis->varsmap, var);
1040}
1041
1042/** get the varsmap of an IIS */
1044 SCIP_IIS* iis /**< pointer to the IIS */
1045 )
1046{
1047 assert( iis != NULL );
1048 return iis->varsmap;
1049}
1050
1051/** get the conssmap of an IIS */
1053 SCIP_IIS* iis /**< pointer to the IIS */
1054 )
1055{
1056 assert( iis != NULL );
1057 return iis->conssmap;
1058}
1059
1060
1061/** compares two IIS finders w. r. to their priority */
1062SCIP_DECL_SORTPTRCOMP(SCIPiisfinderComp)
1063{ /*lint --e{715}*/
1064 return ((SCIP_IISFINDER*)elem2)->priority - ((SCIP_IISFINDER*)elem1)->priority;
1065}
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition clock.c:360
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition clock.c:260
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition clock.c:290
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition clock.c:438
void SCIPclockReset(SCIP_CLOCK *clck)
Definition clock.c:209
void SCIPclockFree(SCIP_CLOCK **clck)
Definition clock.c:185
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition clock.c:170
internal methods for clocks and timing issues
Constraint handler for linear constraints in their most general form, .
#define NULL
Definition def.h:257
#define SCIP_MAXSTRLEN
Definition def.h:278
#define SCIP_Longint
Definition def.h:150
#define SCIP_Bool
Definition def.h:100
#define SCIP_ALLOC(x)
Definition def.h:375
#define SCIP_Real
Definition def.h:165
#define TRUE
Definition def.h:102
#define FALSE
Definition def.h:103
#define SCIP_CALL(x)
Definition def.h:364
#define SCIP_CALL_FINALLY(x, y)
Definition def.h:406
#define nnodes
Definition gastrans.c:74
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcopyOrig(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition scip_copy.c:3045
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition scip_copy.c:2548
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNOrigConss(SCIP *scip)
Definition scip_prob.c:3712
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition scip_prob.c:2811
SCIP_CONS ** SCIPgetConss(SCIP *scip)
Definition scip_prob.c:3666
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
Definition scip_prob.c:3420
int SCIPgetNConss(SCIP *scip)
Definition scip_prob.c:3620
int SCIPgetNOrigVars(SCIP *scip)
Definition scip_prob.c:2838
SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
Definition scip_prob.c:2041
SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
Definition scip_prob.c:3739
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition misc.c:3095
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition misc.c:3284
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition misc.c:3143
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition misc.c:3061
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
Definition misc.c:3676
SCIP_RETCODE SCIPiisGreedyMakeIrreducible(SCIP_IIS *iis)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsg
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition scip_param.c:250
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition scip_param.c:545
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition scip_param.c:487
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition scip_param.c:904
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition scip_param.c:307
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
Definition scip_param.c:288
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition scip_param.c:429
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition scip_param.c:603
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition cons.c:4320
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
Definition cons.c:8413
int SCIPconsGetNUses(SCIP_CONS *cons)
Definition cons.c:8433
SCIP_RETCODE SCIPsetIISfinderPriority(SCIP *scip, SCIP_IISFINDER *iisfinder, int priority)
const char * SCIPiisfinderGetName(SCIP_IISFINDER *iisfinder)
Definition iisfinder.c:315
SCIP_IISFINDERDATA * SCIPiisfinderGetData(SCIP_IISFINDER *iisfinder)
Definition iisfinder.c:706
int SCIPiisfinderGetPriority(SCIP_IISFINDER *iisfinder)
Definition iisfinder.c:727
void SCIPiisfinderSetData(SCIP_IISFINDER *iisfinder, SCIP_IISFINDERDATA *iisfinderdata)
Definition iisfinder.c:716
void SCIPiisfinderInfoMessage(SCIP_IIS *iis, SCIP_Bool printheaders)
Definition iisfinder.c:794
SCIP_Real SCIPiisfinderGetTime(SCIP_IISFINDER *iisfinder)
Definition iisfinder.c:784
const char * SCIPiisfinderGetDesc(SCIP_IISFINDER *iisfinder)
Definition iisfinder.c:648
SCIP_RANDNUMGEN * SCIPiisGetRandnumgen(SCIP_IIS *iis)
Definition iisfinder.c:1003
void SCIPiisAddNNodes(SCIP_IIS *iis, SCIP_Longint nnodes)
Definition iisfinder.c:993
SCIP * SCIPiisGetSubscip(SCIP_IIS *iis)
Definition iisfinder.c:1012
SCIP_CONS * SCIPiisGetSubscipCons(SCIP_IIS *iis, SCIP_CONS *cons)
Definition iisfinder.c:1022
SCIP_VAR * SCIPiisGetSubscipVar(SCIP_IIS *iis, SCIP_VAR *var)
Definition iisfinder.c:1033
void SCIPiisSetSubscipIrreducible(SCIP_IIS *iis, SCIP_Bool irreducible)
Definition iisfinder.c:983
SCIP_Longint SCIPiisGetNNodes(SCIP_IIS *iis)
Definition iisfinder.c:963
SCIP_HASHMAP * SCIPiisGetConssmap(SCIP_IIS *iis)
Definition iisfinder.c:1052
SCIP_Real SCIPiisGetTime(SCIP_IIS *iis)
Definition iisfinder.c:933
SCIP_Bool SCIPiisIsSubscipInfeasible(SCIP_IIS *iis)
Definition iisfinder.c:943
void SCIPiisSetSubscipInfeasible(SCIP_IIS *iis, SCIP_Bool infeasible)
Definition iisfinder.c:973
SCIP_Bool SCIPiisIsSubscipIrreducible(SCIP_IIS *iis)
Definition iisfinder.c:953
SCIP_HASHMAP * SCIPiisGetVarsmap(SCIP_IIS *iis)
Definition iisfinder.c:1043
SCIP_IIS * SCIPgetIIS(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition scip_mem.c:57
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Longint SCIPgetNTotalNodes(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
Definition var.c:23900
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition var.c:24052
int SCIPvarGetNUses(SCIP_VAR *var)
Definition var.c:23309
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition var.c:24095
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition scip_var.c:5372
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition misc.c:10827
return SCIP_OKAY
assert(minobj< SCIPgetCutoffbound(scip))
int nvars
SCIP_VAR * var
static SCIP_VAR ** vars
SCIP_RETCODE SCIPiisCreate(SCIP_IIS **iis, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition iisfinder.c:830
SCIP_RETCODE SCIPiisReset(SCIP_IIS **iis)
Definition iisfinder.c:897
SCIP_RETCODE SCIPiisfinderCreate(SCIP_IISFINDER **iisfinder, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_DECL_IISFINDERCOPY((*iisfindercopy)), SCIP_DECL_IISFINDERFREE((*iisfinderfree)), SCIP_DECL_IISFINDEREXEC((*iisfinderexec)), SCIP_IISFINDERDATA *iisfinderdata)
Definition iisfinder.c:289
void SCIPiisfinderSetPriority(SCIP_IISFINDER *iisfinder, SCIP_SET *set, int priority)
Definition iisfinder.c:770
static SCIP_RETCODE checkTrivialInfeas(SCIP *scip, SCIP_Bool *trivial)
Definition iisfinder.c:136
void SCIPiisfinderSetCopy(SCIP_IISFINDER *iisfinder,)
Definition iisfinder.c:748
SCIP_RETCODE SCIPiisFree(SCIP_IIS **iis, BMS_BLKMEM *blkmem)
Definition iisfinder.c:855
static SCIP_RETCODE createSubscipIIS(SCIP_SET *set, SCIP_IIS *iis, SCIP_Real timelim, SCIP_Longint nodelim, SCIP_Bool *success)
Definition iisfinder.c:64
void SCIPiisfinderEnableOrDisableClocks(SCIP_IISFINDER *iisfinder, SCIP_Bool enable)
Definition iisfinder.c:737
void SCIPiisfinderSetFree(SCIP_IISFINDER *iisfinder,)
Definition iisfinder.c:759
SCIP_RETCODE SCIPiisfinderFree(SCIP_IISFINDER **iisfinder, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition iisfinder.c:676
SCIP_RETCODE SCIPiisfinderCopyInclude(SCIP_IISFINDER *iisfinder, SCIP_SET *set)
Definition iisfinder.c:658
SCIP_RETCODE SCIPiisGenerate(SCIP_SET *set)
Definition iisfinder.c:325
static SCIP_RETCODE doIISfinderCreate(SCIP_IISFINDER **iisfinder, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_DECL_IISFINDERCOPY((*iisfindercopy)), SCIP_DECL_IISFINDERFREE((*iisfinderfree)), SCIP_DECL_IISFINDEREXEC((*iisfinderexec)), SCIP_IISFINDERDATA *iisfinderdata)
Definition iisfinder.c:242
internal methods for IIS finder
greedy deletion and addition filter heuristic to compute IISs
static const char * paramname[]
Definition lpi_msk.c:5172
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
Definition memory.h:462
#define BMSfreeBlockMemory(mem, ptr)
Definition memory.h:465
#define BMSallocBlockMemory(mem, ptr)
Definition memory.h:451
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
Definition memory.h:468
#define BMSallocClearBlockMemory(mem, ptr)
Definition memory.h:452
struct BMS_BlkMem BMS_BLKMEM
Definition memory.h:437
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
Definition misc.c:10209
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition misc.c:10193
internal miscellaneous methods
SCIP_Real SCIPconsGetLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Real SCIPconsGetRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
Definition misc_linear.c:48
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition paramset.c:676
int SCIPparamGetInt(SCIP_PARAM *param)
Definition paramset.c:731
internal methods for handling parameter settings
SCIP callable library.
SCIP_RETCODE SCIPsetAddIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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 set.c:3235
void SCIPsetSortIISfinders(SCIP_SET *set)
Definition set.c:5243
unsigned int SCIPsetInitializeRandomSeed(SCIP_SET *set, unsigned int initialseedvalue)
Definition set.c:7806
internal methods for global SCIP settings
#define SCIPsetDebugMsg
Definition set.h:1811
SCIP_Longint nnodes
SCIP_HASHMAP * conssmap
SCIP_HASHMAP * varsmap
SCIP_Bool irreducible
SCIP_Bool infeasible
SCIP_RANDNUMGEN * randnumgen
SCIP_CLOCK * iistime
SCIP_CLOCK * iisfindertime
SCIP_IISFINDERDATA * iisfinderdata
data structures for irreducible infeasible subsystems (IIS)
@ SCIP_CLOCKTYPE_DEFAULT
Definition type_clock.h:43
struct SCIP_Cons SCIP_CONS
Definition type_cons.h:63
#define SCIP_DECL_IISFINDERFREE(x)
#define SCIP_DECL_IISFINDEREXEC(x)
struct SCIP_IISfinder SCIP_IISFINDER
struct SCIP_IISfinderData SCIP_IISFINDERDATA
#define SCIP_DECL_IISFINDERCOPY(x)
struct SCIP_Messagehdlr SCIP_MESSAGEHDLR
type definitions for miscellaneous datastructures
struct SCIP_HashMap SCIP_HASHMAP
Definition type_misc.h:106
#define SCIP_DECL_SORTPTRCOMP(x)
Definition type_misc.h:189
struct SCIP_RandNumGen SCIP_RANDNUMGEN
Definition type_misc.h:127
struct SCIP_ParamData SCIP_PARAMDATA
#define SCIP_DECL_PARAMCHGD(x)
@ SCIP_DIDNOTRUN
Definition type_result.h:42
@ SCIP_DIDNOTFIND
Definition type_result.h:44
@ SCIP_SUCCESS
Definition type_result.h:58
enum SCIP_Result SCIP_RESULT
Definition type_result.h:61
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
Definition type_scip.h:39
struct SCIP_Set SCIP_SET
Definition type_set.h:71
@ SCIP_STAGE_PROBLEM
Definition type_set.h:45
@ SCIP_STAGE_SOLVED
Definition type_set.h:54
@ SCIP_STATUS_OPTIMAL
Definition type_stat.h:43
@ SCIP_STATUS_TOTALNODELIMIT
Definition type_stat.h:50
@ SCIP_STATUS_BESTSOLLIMIT
Definition type_stat.h:60
@ SCIP_STATUS_SOLLIMIT
Definition type_stat.h:59
@ SCIP_STATUS_UNBOUNDED
Definition type_stat.h:45
@ SCIP_STATUS_UNKNOWN
Definition type_stat.h:42
@ SCIP_STATUS_PRIMALLIMIT
Definition type_stat.h:57
@ SCIP_STATUS_GAPLIMIT
Definition type_stat.h:56
@ SCIP_STATUS_USERINTERRUPT
Definition type_stat.h:47
@ SCIP_STATUS_TERMINATE
Definition type_stat.h:48
@ SCIP_STATUS_INFORUNBD
Definition type_stat.h:46
@ SCIP_STATUS_STALLNODELIMIT
Definition type_stat.h:52
@ SCIP_STATUS_TIMELIMIT
Definition type_stat.h:54
@ SCIP_STATUS_INFEASIBLE
Definition type_stat.h:44
@ SCIP_STATUS_NODELIMIT
Definition type_stat.h:49
@ SCIP_STATUS_DUALLIMIT
Definition type_stat.h:58
@ SCIP_STATUS_MEMLIMIT
Definition type_stat.h:55
@ SCIP_STATUS_RESTARTLIMIT
Definition type_stat.h:62
struct SCIP_Var SCIP_VAR
Definition type_var.h:166