SCIP Doxygen Documentation
Loading...
Searching...
No Matches
cons_samediff.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 cons_samediff.c
26 * @brief Constraint handler stores the local branching decision data
27 * @author Timo Berthold
28 * @author Stefan Heinz
29 *
30 * This constraint handler is used to store the branching decision of the \ref BINPACKING_BRANCHING "Ryan/Foster branching rule"
31 * which is implemented in \ref branch_ryanfoster.c.
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#include "cons_samediff.h"
37#include "probdata_binpacking.h"
38#include "vardata_binpacking.h"
39
40
41/**@name Constraint handler properties
42 *
43 * @{
44 */
45
46#define CONSHDLR_NAME "samediff"
47#define CONSHDLR_DESC "stores the local branching decisions"
48#define CONSHDLR_ENFOPRIORITY 0 /**< priority of the constraint handler for constraint enforcing */
49#define CONSHDLR_CHECKPRIORITY -9999999 /**< priority of the constraint handler for checking feasibility */
50#define CONSHDLR_PROPFREQ 1 /**< frequency for propagating domains; zero means only preprocessing propagation */
51#define CONSHDLR_EAGERFREQ 1 /**< frequency for using all instead of only the useful constraints in separation,
52 * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
53#define CONSHDLR_DELAYPROP FALSE /**< should propagation method be delayed, if other propagators found reductions? */
54#define CONSHDLR_NEEDSCONS TRUE /**< should the constraint handler be skipped, if no constraints are available? */
55
56#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP
57
58/**@} */
59
60/*
61 * Data structures
62 */
63
64/** Constraint data for \ref cons_samediff.c "SameDiff" constraints */
65struct SCIP_ConsData
66{
67 int itemid1; /**< item id one */
68 int itemid2; /**< item id two */
69 CONSTYPE type; /**< stores whether the items have to be in the SAME or DIFFER packing */
70 int npropagatedvars; /**< number of variables that existed, the last time, the related node was
71 * propagated, used to determine whether the constraint should be
72 * repropagated*/
73 int npropagations; /**< stores the number propagations runs of this constraint */
74 unsigned int propagated:1; /**< is constraint already propagated? */
75 SCIP_NODE* node; /**< the node in the B&B-tree at which the cons is sticking */
76};
77
78/**@name Local methods
79 *
80 * @{
81 */
82
83/** create constraint data */
84static
86 SCIP* scip, /**< SCIP data structure */
87 SCIP_CONSDATA** consdata, /**< pointer to store the constraint data */
88 int itemid1, /**< item id one */
89 int itemid2, /**< item id two */
90 CONSTYPE type, /**< stores whether the items have to be in the SAME or DIFFER packing */
91 SCIP_NODE* node /**< the node in the B&B-tree at which the cons is sticking */
92 )
93{
94 assert( scip != NULL );
95 assert( consdata != NULL );
96 assert( itemid1 >= 0 );
97 assert( itemid2 >= 0 );
98 assert( type == DIFFER || type == SAME );
99
100 SCIP_CALL( SCIPallocBlockMemory(scip, consdata) );
101
102 (*consdata)->itemid1 = itemid1;
103 (*consdata)->itemid2 = itemid2;
104 (*consdata)->type = type;
105 (*consdata)->npropagatedvars = 0;
106 (*consdata)->npropagations = 0;
107 (*consdata)->propagated = FALSE;
108 (*consdata)->node = node;
109
110 return SCIP_OKAY;
111}
112
113/** display constraints */
114static
116 SCIP* scip, /**< SCIP data structure */
117 SCIP_CONSDATA* consdata, /**< constraint data */
118 FILE* file /**< file stream */
119 )
120{
121 SCIP_PROBDATA* probdata;
122 int* ids;
123
124 probdata = SCIPgetProbData(scip);
125 assert(probdata != NULL);
126
127 ids = SCIPprobdataGetIds(probdata);
128 assert(ids != NULL);
129
130 SCIPinfoMessage(scip, file, "%s(%d,%d) at node %" SCIP_LONGINT_FORMAT "\n",
131 consdata->type == SAME ? "same" : "diff",
132 ids[consdata->itemid1], ids[consdata->itemid2], SCIPnodeGetNumber(consdata->node) );
133}
134
135/** fixes a variable to zero if the corresponding packings are not valid for this constraint/node (due to branching) */
136static
138 SCIP* scip, /**< SCIP data structure */
139 SCIP_CONSDATA* consdata, /**< constraint data */
140 SCIP_VAR* var, /**< variables to check */
141 int* nfixedvars, /**< pointer to store the number of fixed variables */
142 SCIP_Bool* cutoff /**< pointer to store if a cutoff was detected */
143 )
144{
145 SCIP_VARDATA* vardata;
146 int* consids;
147 int nconsids;
148
149 SCIP_Bool existid1;
150 SCIP_Bool existid2;
151 CONSTYPE type;
152
153 SCIP_Bool fixed;
154 SCIP_Bool infeasible;
155
156 int pos;
157
158 assert(scip != NULL);
159 assert(consdata != NULL);
160 assert(var != NULL);
161 assert(nfixedvars != NULL);
162 assert(cutoff != NULL);
163
164 /* if variables is locally fixed to zero continue */
165 if( SCIPvarGetUbLocal(var) < 0.5 )
166 return SCIP_OKAY;
167
168 /* check if the packing which corresponds to the variable is feasible for this constraint */
169 vardata = SCIPvarGetData(var);
170
171 nconsids = SCIPvardataGetNConsids(vardata);
172 consids = SCIPvardataGetConsids(vardata);
173
174 existid1 = SCIPsortedvecFindInt(consids, consdata->itemid1, nconsids, &pos);
175 existid2 = SCIPsortedvecFindInt(consids, consdata->itemid2, nconsids, &pos);
176 type = consdata->type;
177
178 if( (type == SAME && existid1 != existid2) || (type == DIFFER && existid1 && existid2) )
179 {
180 SCIP_CALL( SCIPfixVar(scip, var, 0.0, &infeasible, &fixed) );
181
182 if( infeasible )
183 {
184 assert( SCIPvarGetLbLocal(var) > 0.5 );
185 SCIPdebugMsg(scip, "-> cutoff\n");
186 (*cutoff) = TRUE;
187 }
188 else
189 {
190 assert(fixed);
191 (*nfixedvars)++;
192 }
193 }
194
195 return SCIP_OKAY;
196}
197
198/** fixes variables to zero if the corresponding packings are not valid for this sonstraint/node (due to branching) */
199static
201 SCIP* scip, /**< SCIP data structure */
202 SCIP_CONSDATA* consdata, /**< constraint data */
203 SCIP_VAR** vars, /**< generated variables */
204 int nvars, /**< number of generated variables */
205 SCIP_RESULT* result /**< pointer to store the result of the fixing */
206 )
207{
208 int nfixedvars;
209 int v;
211
212 nfixedvars = 0;
213 cutoff = FALSE;
214
215 SCIPdebugMsg(scip, "check variables %d to %d\n", consdata->npropagatedvars, nvars);
216
217 for( v = consdata->npropagatedvars; v < nvars && !cutoff; ++v )
218 {
219 SCIP_CALL( checkVariable(scip, consdata, vars[v], &nfixedvars, &cutoff) );
220 }
221
222 SCIPdebugMsg(scip, "fixed %d variables locally\n", nfixedvars);
223
224 if( cutoff )
226 else if( nfixedvars > 0 )
228
229 return SCIP_OKAY;
230}
231
232
233/** check if all variables are valid for the given consdata */
234#ifndef NDEBUG
235static
237 SCIP* scip, /**< SCIP data structure */
238 SCIP_PROBDATA* probdata, /**< problem data */
239 SCIP_CONSDATA* consdata, /**< constraint data */
240 SCIP_Bool beforeprop /**< is this check performed before propagation? */
241 )
242{
243 SCIP_VAR** vars;
244 int nvars;
245
246 SCIP_VARDATA* vardata;
247 SCIP_VAR* var;
248
249 int* consids;
250 int nconsids;
251 SCIP_Bool existid1;
252 SCIP_Bool existid2;
253 CONSTYPE type;
254
255 int pos;
256 int v;
257
258 vars = SCIPprobdataGetVars(probdata);
259 nvars = (beforeprop ? consdata->npropagatedvars : SCIPprobdataGetNVars(probdata));
260 assert(nvars <= SCIPprobdataGetNVars(probdata));
261
262 for( v = 0; v < nvars; ++v )
263 {
264 var = vars[v];
265
266 /* if variables is locally fixed to zero continue */
267 if( SCIPvarGetUbLocal(var) < 0.5 )
268 continue;
269
270 /* check if the packing which corresponds to the variable is feasible for this constraint */
271 vardata = SCIPvarGetData(var);
272
273 nconsids = SCIPvardataGetNConsids(vardata);
274 consids = SCIPvardataGetConsids(vardata);
275
276 existid1 = SCIPsortedvecFindInt(consids, consdata->itemid1, nconsids, &pos);
277 existid2 = SCIPsortedvecFindInt(consids, consdata->itemid2, nconsids, &pos);
278 type = consdata->type;
279
280 if( (type == SAME && existid1 != existid2) || (type == DIFFER && existid1 && existid2) )
281 {
282 SCIPdebug( SCIPvardataPrint(scip, vardata, NULL) );
283 SCIPdebug( consdataPrint(scip, consdata, NULL) );
285 return FALSE;
286 }
287 }
288
289 return TRUE;
290}
291#endif
292
293/** frees samediff constraint data */
294static
296 SCIP* scip, /**< SCIP data structure */
297 SCIP_CONSDATA** consdata /**< pointer to the constraint data */
298 )
299{
300 assert(consdata != NULL);
301 assert(*consdata != NULL);
302
303 SCIPfreeBlockMemory(scip, consdata);
304
305 return SCIP_OKAY;
306}
307
308/**@} */
309
310
311/**@name Callback methods
312 *
313 * @{
314 */
315
316/** frees specific constraint data */
317static
318SCIP_DECL_CONSDELETE(consDeleteSamediff)
319{ /*lint --e{715}*/
320 assert(conshdlr != NULL);
321 assert(consdata != NULL);
322 assert(*consdata != NULL);
323
325
326 /* free samediff constraint */
327 SCIP_CALL( consdataFree(scip, consdata) );
328
329 return SCIP_OKAY;
330}
331
332/** transforms constraint data into data belonging to the transformed problem */
333static
334SCIP_DECL_CONSTRANS(consTransSamediff)
335{ /*lint --e{715}*/
336 SCIP_CONSDATA* sourcedata;
337 SCIP_CONSDATA* targetdata;
338
339 assert(conshdlr != NULL);
341 assert(sourcecons != NULL);
342 assert(targetcons != NULL);
343
345
346 sourcedata = SCIPconsGetData(sourcecons);
347 assert(sourcedata != NULL);
348
349 /* create constraint data for target constraint */
350 SCIP_CALL( consdataCreate(scip, &targetdata,
351 sourcedata->itemid1, sourcedata->itemid2, sourcedata->type, sourcedata->node) );
352
353 /* create target constraint */
354 SCIP_CALL( SCIPcreateCons(scip, targetcons, SCIPconsGetName(sourcecons), conshdlr, targetdata,
355 SCIPconsIsInitial(sourcecons), SCIPconsIsSeparated(sourcecons), SCIPconsIsEnforced(sourcecons),
356 SCIPconsIsChecked(sourcecons), SCIPconsIsPropagated(sourcecons),
357 SCIPconsIsLocal(sourcecons), SCIPconsIsModifiable(sourcecons),
358 SCIPconsIsDynamic(sourcecons), SCIPconsIsRemovable(sourcecons), SCIPconsIsStickingAtNode(sourcecons)) );
359
360 return SCIP_OKAY;
361}
362
363/** constraint enforcing method of constraint handler for LP solutions */
364#define consEnfolpSamediff NULL
365
366/** constraint enforcing method of constraint handler for pseudo solutions */
367#define consEnfopsSamediff NULL
368
369/** feasibility check method of constraint handler for integral solutions */
370#define consCheckSamediff NULL
371
372/** domain propagation method of constraint handler */
373static
374SCIP_DECL_CONSPROP(consPropSamediff)
375{ /*lint --e{715}*/
376 SCIP_PROBDATA* probdata;
377 SCIP_CONSDATA* consdata;
378
379 SCIP_VAR** vars;
380 int nvars;
381 int c;
382
383 assert(scip != NULL);
384 assert(result != NULL);
385
387
388 SCIPdebugMsg(scip, "propagation constraints of constraint handler <"CONSHDLR_NAME">\n");
389
390 probdata = SCIPgetProbData(scip);
391 assert(probdata != NULL);
392
393 vars = SCIPprobdataGetVars(probdata);
394 nvars = SCIPprobdataGetNVars(probdata);
395
397
398 for( c = 0; c < nconss; ++c )
399 {
400 consdata = SCIPconsGetData(conss[c]);
401
402 /* check if all previously generated variables are valid for this constraint */
403 assert( consdataCheck(scip, probdata, consdata, TRUE) );
404
405#ifndef NDEBUG
406 {
407 /* check if there are no equal consdatas */
408 SCIP_CONSDATA* consdata2;
409 int i;
410
411 for( i = c+1; i < nconss; ++i )
412 {
413 consdata2 = SCIPconsGetData(conss[i]);
414 assert( !(consdata->itemid1 == consdata2->itemid1
415 && consdata->itemid2 == consdata2->itemid2
416 && consdata->type == consdata2->type) );
417 assert( !(consdata->itemid1 == consdata2->itemid2
418 && consdata->itemid2 == consdata2->itemid1
419 && consdata->type == consdata2->type) );
420 }
421 }
422#endif
423
424 if( !consdata->propagated )
425 {
426 SCIPdebugMsg(scip, "propagate constraint <%s> ", SCIPconsGetName(conss[c]));
427 SCIPdebug( consdataPrint(scip, consdata, NULL) );
428
430 consdata->npropagations++;
431
432 if( *result != SCIP_CUTOFF )
433 {
434 consdata->propagated = TRUE;
435 consdata->npropagatedvars = nvars;
436 }
437 else
438 break;
439 }
440
441 /* check if constraint is completely propagated */
442 assert( consdataCheck(scip, probdata, consdata, FALSE) );
443 }
444
445 return SCIP_OKAY;
446}
447
448/** variable rounding lock method of constraint handler */
449#define consLockSamediff NULL
450
451/** constraint activation notification method of constraint handler */
452static
453SCIP_DECL_CONSACTIVE(consActiveSamediff)
454{ /*lint --e{715}*/
455 SCIP_CONSDATA* consdata;
456 SCIP_PROBDATA* probdata;
457
458 assert(scip != NULL);
459 assert(cons != NULL);
460
462
463 probdata = SCIPgetProbData(scip);
464 assert(probdata != NULL);
465
466 consdata = SCIPconsGetData(cons);
467 assert(consdata != NULL);
468 assert(consdata->npropagatedvars <= SCIPprobdataGetNVars(probdata));
469
470 SCIPdebugMsg(scip, "activate constraint <%s> at node <%"SCIP_LONGINT_FORMAT"> in depth <%d>: ",
471 SCIPconsGetName(cons), SCIPnodeGetNumber(consdata->node), SCIPnodeGetDepth(consdata->node));
472 SCIPdebug( consdataPrint(scip, consdata, NULL) );
473
474 if( consdata->npropagatedvars != SCIPprobdataGetNVars(probdata) )
475 {
476 SCIPdebugMsg(scip, "-> mark constraint to be repropagated\n");
477 consdata->propagated = FALSE;
478 SCIP_CALL( SCIPrepropagateNode(scip, consdata->node) );
479 }
480
481 return SCIP_OKAY;
482}
483
484/** constraint deactivation notification method of constraint handler */
485static
486SCIP_DECL_CONSDEACTIVE(consDeactiveSamediff)
487{ /*lint --e{715}*/
488 SCIP_CONSDATA* consdata;
489 SCIP_PROBDATA* probdata;
490
491 assert(scip != NULL);
492 assert(cons != NULL);
493
495
496 consdata = SCIPconsGetData(cons);
497 assert(consdata != NULL);
498 assert(consdata->propagated || SCIPgetNChildren(scip) == 0);
499
500 probdata = SCIPgetProbData(scip);
501 assert(probdata != NULL);
502
503 SCIPdebugMsg(scip, "deactivate constraint <%s> at node <%"SCIP_LONGINT_FORMAT"> in depth <%d>: ",
504 SCIPconsGetName(cons), SCIPnodeGetNumber(consdata->node), SCIPnodeGetDepth(consdata->node));
505 SCIPdebug( consdataPrint(scip, consdata, NULL) );
506
507 /* set the number of propagated variables to current number of variables is SCIP */
508 consdata->npropagatedvars = SCIPprobdataGetNVars(probdata);
509
510 return SCIP_OKAY;
511}
512
513/** constraint display method of constraint handler */
514static
515SCIP_DECL_CONSPRINT(consPrintSamediff)
516{ /*lint --e{715}*/
517 SCIP_CONSDATA* consdata;
518
519 consdata = SCIPconsGetData(cons);
520 assert(consdata != NULL);
521
522 consdataPrint(scip, consdata, file);
523
524 return SCIP_OKAY;
525}
526
527/**@} */
528
529/**@name Interface methods
530 *
531 * @{
532 */
533
534/** creates the handler for samediff constraints and includes it in SCIP */
536 SCIP* scip /**< SCIP data structure */
537 )
538{
539 SCIP_CONSHDLRDATA* conshdlrdata = NULL;
540 SCIP_CONSHDLR* conshdlr = NULL;
541
542 /* include constraint handler */
546 conshdlrdata) );
547 assert(conshdlr != NULL);
548
549 SCIP_CALL( SCIPsetConshdlrDelete(scip, conshdlr, consDeleteSamediff) );
550 SCIP_CALL( SCIPsetConshdlrTrans(scip, conshdlr, consTransSamediff) );
553 SCIP_CALL( SCIPsetConshdlrActive(scip, conshdlr, consActiveSamediff) );
554 SCIP_CALL( SCIPsetConshdlrDeactive(scip, conshdlr, consDeactiveSamediff) );
555 SCIP_CALL( SCIPsetConshdlrPrint(scip, conshdlr, consPrintSamediff) );
556
557 return SCIP_OKAY;
558}
559
560/** creates and captures a samediff constraint */
562 SCIP* scip, /**< SCIP data structure */
563 SCIP_CONS** cons, /**< pointer to hold the created constraint */
564 const char* name, /**< name of constraint */
565 int itemid1, /**< item id one */
566 int itemid2, /**< item id two */
567 CONSTYPE type, /**< stores whether the items have to be in the SAME or DIFFER packing */
568 SCIP_NODE* node, /**< the node in the B&B-tree at which the cons is sticking */
569 SCIP_Bool local /**< is constraint only valid locally? */
570 )
571{
572 SCIP_CONSHDLR* conshdlr;
573 SCIP_CONSDATA* consdata;
574
575 /* find the samediff constraint handler */
577 if( conshdlr == NULL )
578 {
579 SCIPerrorMessage("samediff constraint handler not found\n");
580 return SCIP_PLUGINNOTFOUND;
581 }
582
583 /* create the constraint specific data */
584 SCIP_CALL( consdataCreate(scip, &consdata, itemid1, itemid2, type, node) );
585
586 /* create constraint */
587 SCIP_CALL( SCIPcreateCons(scip, cons, name, conshdlr, consdata, FALSE, FALSE, FALSE, FALSE, TRUE,
588 local, FALSE, FALSE, FALSE, TRUE) );
589
590 SCIPdebugMsg(scip, "created constraint: ");
591 SCIPdebug( consdataPrint(scip, consdata, NULL) );
592
593 return SCIP_OKAY;
594}
595
596/** returns item id one */
598 SCIP_CONS* cons /**< samediff constraint */
599 )
600{
601 SCIP_CONSDATA* consdata;
602
603 assert(cons != NULL);
604
605 consdata = SCIPconsGetData(cons);
606 assert(consdata != NULL);
607
608 return consdata->itemid1;
609}
610
611/** returns item id two */
613 SCIP_CONS* cons /**< samediff constraint */
614 )
615{
616 SCIP_CONSDATA* consdata;
617
618 assert(cons != NULL);
619
620 consdata = SCIPconsGetData(cons);
621 assert(consdata != NULL);
622
623 return consdata->itemid2;
624}
625
626/** return constraint type SAME or DIFFER */
628 SCIP_CONS* cons /**< samediff constraint */
629 )
630{
631 SCIP_CONSDATA* consdata;
632
633 assert(cons != NULL);
634
635 consdata = SCIPconsGetData(cons);
636 assert(consdata != NULL);
637
638 return consdata->type;
639}
640
641/**@} */
#define CONSHDLR_NEEDSCONS
Definition cons_and.c:96
#define CONSHDLR_CHECKPRIORITY
Definition cons_and.c:88
#define CONSHDLR_DESC
Definition cons_and.c:85
#define CONSHDLR_PROP_TIMING
Definition cons_and.c:99
#define CONSHDLR_PROPFREQ
Definition cons_and.c:90
#define CONSHDLR_EAGERFREQ
Definition cons_and.c:91
#define CONSHDLR_ENFOPRIORITY
Definition cons_and.c:87
#define CONSHDLR_NAME
Definition cons_and.c:84
#define CONSHDLR_DELAYPROP
Definition cons_and.c:95
#define consEnfopsSamediff
CONSTYPE SCIPgetTypeSamediff(SCIP_CONS *cons)
static void consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
#define consCheckSamediff
static SCIP_RETCODE checkVariable(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR *var, int *nfixedvars, SCIP_Bool *cutoff)
#define consLockSamediff
#define consEnfolpSamediff
int SCIPgetItemid2Samediff(SCIP_CONS *cons)
static SCIP_Bool consdataCheck(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_CONSDATA *consdata, SCIP_Bool beforeprop)
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
int SCIPgetItemid1Samediff(SCIP_CONS *cons)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node)
static SCIP_RETCODE consdataFixVariables(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_VAR **vars, int nvars, SCIP_RESULT *result)
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)
Constraint handler stores the local branching decision data.
enum ConsType CONSTYPE
@ SAME
@ DIFFER
#define NULL
Definition def.h:257
#define SCIP_Bool
Definition def.h:100
#define SCIP_STRINGEQ(name, reference, retcode)
Definition def.h:454
#define TRUE
Definition def.h:102
#define FALSE
Definition def.h:103
#define SCIP_LONGINT_FORMAT
Definition def.h:157
#define SCIP_CALL(x)
Definition def.h:364
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
Definition scip_prob.c:1139
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsg
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:670
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition scip_cons.c:281
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition scip_cons.c:181
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:785
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition cons.c:4320
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition scip_cons.c:940
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:578
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:693
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
Definition scip_cons.c:601
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
Definition cons.c:8423
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition cons.c:8652
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition cons.c:8562
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition cons.c:8592
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition cons.c:8582
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
Definition scip_cons.c:997
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition cons.c:8612
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
Definition cons.c:8632
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition cons.c:8393
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
Definition cons.c:8642
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition cons.c:8672
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition cons.c:8572
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition cons.c:8662
#define SCIPfreeBlockMemory(scip, ptr)
Definition scip_mem.h:108
#define SCIPallocBlockMemory(scip, ptr)
Definition scip_mem.h:89
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
Definition tree.c:8513
int SCIPnodeGetDepth(SCIP_NODE *node)
Definition tree.c:8523
SCIP_RETCODE SCIPrepropagateNode(SCIP *scip, SCIP_NODE *node)
Definition scip_tree.c:479
int SCIPgetNChildren(SCIP *scip)
Definition scip_tree.c:188
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition var.c:24300
SCIP_VARDATA * SCIPvarGetData(SCIP_VAR *var)
Definition var.c:23319
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition var.c:24266
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition scip_var.c:10318
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
Definition scip_var.c:12465
SCIP_Bool SCIPsortedvecFindInt(int *intarray, int val, int len, int *pos)
return SCIP_OKAY
int c
SCIP_Bool cutoff
assert(minobj< SCIPgetCutoffbound(scip))
int nvars
SCIP_VAR * var
static SCIP_VAR ** vars
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
int SCIPprobdataGetNVars(SCIP_PROBDATA *probdata)
SCIP_VAR ** SCIPprobdataGetVars(SCIP_PROBDATA *probdata)
Problem data for binpacking problem.
#define SCIPerrorMessage
Definition pub_message.h:64
#define SCIPdebug(x)
Definition pub_message.h:93
#define SCIP_DECL_CONSDELETE(x)
Definition type_cons.h:229
struct SCIP_Cons SCIP_CONS
Definition type_cons.h:63
#define SCIP_DECL_CONSPRINT(x)
Definition type_cons.h:769
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
Definition type_cons.h:64
#define SCIP_DECL_CONSPROP(x)
Definition type_cons.h:506
#define SCIP_DECL_CONSACTIVE(x)
Definition type_cons.h:691
#define SCIP_DECL_CONSTRANS(x)
Definition type_cons.h:239
#define SCIP_DECL_CONSDEACTIVE(x)
Definition type_cons.h:706
struct SCIP_Conshdlr SCIP_CONSHDLR
Definition type_cons.h:62
struct SCIP_ConsData SCIP_CONSDATA
Definition type_cons.h:65
struct SCIP_ProbData SCIP_PROBDATA
Definition type_prob.h:53
@ SCIP_CUTOFF
Definition type_result.h:48
@ SCIP_REDUCEDDOM
Definition type_result.h:51
@ SCIP_DIDNOTFIND
Definition type_result.h:44
enum SCIP_Result SCIP_RESULT
Definition type_result.h:61
@ SCIP_PLUGINNOTFOUND
@ SCIP_INVALIDCALL
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
Definition type_scip.h:39
@ SCIP_STAGE_TRANSFORMING
Definition type_set.h:46
struct SCIP_Node SCIP_NODE
Definition type_tree.h:63
struct SCIP_VarData SCIP_VARDATA
Definition type_var.h:167
struct SCIP_Var SCIP_VAR
Definition type_var.h:166
int * SCIPvardataGetConsids(SCIP_VARDATA *vardata)
void SCIPvardataPrint(SCIP *scip, SCIP_VARDATA *vardata, FILE *file)
int SCIPvardataGetNConsids(SCIP_VARDATA *vardata)
Variable data containing the ids of constraints in which the variable appears.