Detailed Description
Constraint handler stores the local branching decision data.
This constraint handler is used to store the branching decision of the Ryan/Foster branching rule which is implemented in branch_ryanfoster.c.
Definition in file cons_samediff.c.
#include <assert.h>
#include <string.h>
#include "cons_samediff.h"
#include "probdata_binpacking.h"
#include "vardata_binpacking.h"
Go to the source code of this file.
Macros | |
Constraint handler properties | |
#define | CONSHDLR_NAME "samediff" |
#define | CONSHDLR_DESC "stores the local branching decisions" |
#define | CONSHDLR_ENFOPRIORITY 0 |
#define | CONSHDLR_CHECKPRIORITY 9999999 |
#define | CONSHDLR_PROPFREQ 1 |
#define | CONSHDLR_EAGERFREQ 1 |
#define | CONSHDLR_DELAYPROP FALSE |
#define | CONSHDLR_NEEDSCONS TRUE |
#define | CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
Callback methods | |
#define | consEnfolpSamediff NULL |
#define | consEnfopsSamediff NULL |
#define | consCheckSamediff NULL |
#define | consLockSamediff NULL |
static | SCIP_DECL_CONSDELETE (consDeleteSamediff) |
static | SCIP_DECL_CONSTRANS (consTransSamediff) |
static | SCIP_DECL_CONSPROP (consPropSamediff) |
static | SCIP_DECL_CONSACTIVE (consActiveSamediff) |
static | SCIP_DECL_CONSDEACTIVE (consDeactiveSamediff) |
static | SCIP_DECL_CONSPRINT (consPrintSamediff) |
Macro Definition Documentation
◆ CONSHDLR_NAME
#define CONSHDLR_NAME "samediff" |
Definition at line 40 of file cons_samediff.c.
Referenced by SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSDELETE(), SCIP_DECL_CONSPROP(), SCIP_DECL_CONSTRANS(), SCIPcreateConsSamediff(), and SCIPincludeConshdlrSamediff().
◆ CONSHDLR_DESC
#define CONSHDLR_DESC "stores the local branching decisions" |
Definition at line 41 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_ENFOPRIORITY
#define CONSHDLR_ENFOPRIORITY 0 |
priority of the constraint handler for constraint enforcing
Definition at line 42 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_CHECKPRIORITY
#define CONSHDLR_CHECKPRIORITY 9999999 |
priority of the constraint handler for checking feasibility
Definition at line 43 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_PROPFREQ
#define CONSHDLR_PROPFREQ 1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 44 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_EAGERFREQ
#define CONSHDLR_EAGERFREQ 1 |
frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only
Definition at line 45 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_DELAYPROP
#define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 48 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_NEEDSCONS
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 49 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ CONSHDLR_PROP_TIMING
#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
Definition at line 51 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ consEnfolpSamediff
#define consEnfolpSamediff NULL |
constraint enforcing method of constraint handler for LP solutions
Definition at line 357 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ consEnfopsSamediff
#define consEnfopsSamediff NULL |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 360 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ consCheckSamediff
#define consCheckSamediff NULL |
feasibility check method of constraint handler for integral solutions
Definition at line 363 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
◆ consLockSamediff
#define consLockSamediff NULL |
variable rounding lock method of constraint handler
Definition at line 441 of file cons_samediff.c.
Referenced by SCIPincludeConshdlrSamediff().
Function Documentation
◆ consdataCreate()
|
static |
create constraint data
- Parameters
-
scip SCIP data structure consdata pointer to store the constraint data itemid1 item id one itemid2 item id two type stores whether the items have to be in the SAME or DIFFER packing node the node in the B&B-tree at which the cons is sticking
Definition at line 80 of file cons_samediff.c.
References consdataPrint(), DIFFER, FALSE, NULL, SAME, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsSamediff().
◆ consdataPrint()
|
static |
display constraints
- Parameters
-
scip SCIP data structure consdata constraint data file file stream
Definition at line 110 of file cons_samediff.c.
References checkVariable(), NULL, SAME, SCIPgetProbData(), SCIPinfoMessage(), SCIPnodeGetNumber(), and SCIPprobdataGetIds().
Referenced by consdataCheck(), consdataCreate(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSPRINT(), SCIP_DECL_CONSPROP(), and SCIPcreateConsSamediff().
◆ checkVariable()
|
static |
fixes a variable to zero if the corresponding packings are not valid for this constraint/node (due to branching)
- Parameters
-
scip SCIP data structure consdata constraint data var variables to check nfixedvars pointer to store the number of fixed variables cutoff pointer to store if a cutoff was detected
Definition at line 132 of file cons_samediff.c.
References consdataFixVariables(), DIFFER, NULL, SAME, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMsg, SCIPfixVar(), SCIPsortedvecFindInt(), SCIPvardataGetConsids(), SCIPvardataGetNConsids(), SCIPvarGetData(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by consdataFixVariables(), and consdataPrint().
◆ consdataFixVariables()
|
static |
fixes variables to zero if the corresponding packings are not valid for this sonstraint/node (due to branching)
- Parameters
-
scip SCIP data structure consdata constraint data vars generated variables nvars number of generated variables result pointer to store the result of the fixing
Definition at line 195 of file cons_samediff.c.
References checkVariable(), consdataCheck(), FALSE, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_OKAY, SCIP_REDUCEDDOM, and SCIPdebugMsg.
Referenced by checkVariable(), and SCIP_DECL_CONSPROP().
◆ consdataCheck()
|
static |
check if all variables are valid for the given consdata
- Parameters
-
scip SCIP data structure probdata problem data consdata constraint data beforeprop is this check performed before propagation?
Definition at line 231 of file cons_samediff.c.
References consdataFree(), consdataPrint(), DIFFER, FALSE, NULL, SAME, SCIP_Bool, SCIPdebug, SCIPprintVar(), SCIPprobdataGetNVars(), SCIPprobdataGetVars(), SCIPsortedvecFindInt(), SCIPvardataGetConsids(), SCIPvardataGetNConsids(), SCIPvardataPrint(), SCIPvarGetData(), SCIPvarGetUbLocal(), and TRUE.
Referenced by consdataFixVariables(), and SCIP_DECL_CONSPROP().
◆ consdataFree()
|
static |
frees samediff constraint data
- Parameters
-
scip SCIP data structure consdata pointer to the constraint data
Definition at line 290 of file cons_samediff.c.
References NULL, SCIP_DECL_CONSDELETE(), SCIP_OKAY, and SCIPfreeBlockMemory.
Referenced by consdataCheck(), and SCIP_DECL_CONSDELETE().
◆ SCIP_DECL_CONSDELETE()
|
static |
frees specific constraint data
Definition at line 313 of file cons_samediff.c.
References consdataFree(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_DECL_CONSTRANS(), SCIP_OKAY, and SCIPconshdlrGetName().
Referenced by consdataFree().
◆ SCIP_DECL_CONSTRANS()
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 328 of file cons_samediff.c.
References consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_TRANSFORMING, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateCons(), and SCIPgetStage().
Referenced by SCIP_DECL_CONSDELETE().
◆ SCIP_DECL_CONSPROP()
|
static |
domain propagation method of constraint handler
Definition at line 367 of file cons_samediff.c.
References consdataCheck(), consdataFixVariables(), consdataPrint(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPdebug, SCIPdebugMsg, SCIPgetProbData(), SCIPprobdataGetNVars(), SCIPprobdataGetVars(), and TRUE.
◆ SCIP_DECL_CONSACTIVE()
|
static |
constraint activation notification method of constraint handler
Definition at line 445 of file cons_samediff.c.
References consdataPrint(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_DECL_CONSDEACTIVE(), SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPdebug, SCIPdebugMsg, SCIPgetProbData(), SCIPnodeGetDepth(), SCIPnodeGetNumber(), SCIPprobdataGetNVars(), and SCIPrepropagateNode().
◆ SCIP_DECL_CONSDEACTIVE()
|
static |
constraint deactivation notification method of constraint handler
Definition at line 477 of file cons_samediff.c.
References consdataPrint(), CONSHDLR_NAME, NULL, SCIP_DECL_CONSPRINT(), SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPdebug, SCIPdebugMsg, SCIPgetNChildren(), SCIPgetProbData(), SCIPnodeGetDepth(), SCIPnodeGetNumber(), and SCIPprobdataGetNVars().
Referenced by SCIP_DECL_CONSACTIVE().
◆ SCIP_DECL_CONSPRINT()
|
static |
constraint display method of constraint handler
Definition at line 505 of file cons_samediff.c.
References consdataPrint(), NULL, SCIP_OKAY, SCIPconsGetData(), and SCIPincludeConshdlrSamediff().
Referenced by SCIP_DECL_CONSDEACTIVE().
◆ SCIPincludeConshdlrSamediff()
SCIP_RETCODE SCIPincludeConshdlrSamediff | ( | SCIP * | scip | ) |
creates the handler for samediff constraints and includes it in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 525 of file cons_samediff.c.
References consCheckSamediff, consEnfolpSamediff, consEnfopsSamediff, CONSHDLR_CHECKPRIORITY, CONSHDLR_DELAYPROP, CONSHDLR_DESC, CONSHDLR_EAGERFREQ, CONSHDLR_ENFOPRIORITY, CONSHDLR_NAME, CONSHDLR_NEEDSCONS, CONSHDLR_PROP_TIMING, CONSHDLR_PROPFREQ, consLockSamediff, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsSamediff(), SCIPincludeConshdlrBasic(), SCIPsetConshdlrActive(), SCIPsetConshdlrDeactive(), SCIPsetConshdlrDelete(), SCIPsetConshdlrPrint(), SCIPsetConshdlrProp(), and SCIPsetConshdlrTrans().
Referenced by runShell(), and SCIP_DECL_CONSPRINT().
◆ SCIPcreateConsSamediff()
SCIP_RETCODE SCIPcreateConsSamediff | ( | SCIP * | scip, |
SCIP_CONS ** | cons, | ||
const char * | name, | ||
int | itemid1, | ||
int | itemid2, | ||
CONSTYPE | type, | ||
SCIP_NODE * | node, | ||
SCIP_Bool | local | ||
) |
creates and captures a samediff constraint
- Parameters
-
scip SCIP data structure cons pointer to hold the created constraint name name of constraint itemid1 item id one itemid2 item id two type stores whether the items have to be in the SAME or DIFFER packing node the node in the B&B-tree at which the cons is sticking local is constraint only valid locally?
Definition at line 551 of file cons_samediff.c.
References consdataCreate(), consdataPrint(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcreateCons(), SCIPdebug, SCIPdebugMsg, SCIPerrorMessage, SCIPfindConshdlr(), SCIPgetItemid1Samediff(), and TRUE.
Referenced by SCIP_DECL_BRANCHEXECLP(), and SCIPincludeConshdlrSamediff().
◆ SCIPgetItemid1Samediff()
returns item id one
- Parameters
-
scip SCIP data structure cons samediff constraint
Definition at line 587 of file cons_samediff.c.
References NULL, SCIPconsGetData(), and SCIPgetItemid2Samediff().
Referenced by addBranchingDecisionConss(), and SCIPcreateConsSamediff().
◆ SCIPgetItemid2Samediff()
returns item id two
- Parameters
-
scip SCIP data structure cons samediff constraint
Definition at line 603 of file cons_samediff.c.
References NULL, SCIPconsGetData(), and SCIPgetTypeSamediff().
Referenced by addBranchingDecisionConss(), and SCIPgetItemid1Samediff().
◆ SCIPgetTypeSamediff()
return constraint type SAME or DIFFER
- Parameters
-
scip SCIP data structure cons samediff constraint
Definition at line 619 of file cons_samediff.c.
References NULL, and SCIPconsGetData().
Referenced by addBranchingDecisionConss(), and SCIPgetItemid2Samediff().