Detailed Description
constraint handler for storing the branching decisions at each node of the tree
Definition in file cons_origbranch.c.
#include <assert.h>#include <string.h>#include "gcg/gcg.h"#include "gcg/branch_generic.h"#include "gcg/cons_masterbranch.h"#include "gcg/cons_origbranch.h"#include "scip/nodesel_bfs.h"#include "scip/nodesel_dfs.h"#include "scip/nodesel_estimate.h"#include "scip/nodesel_hybridestim.h"#include "scip/nodesel_restartdfs.h"#include "scip/branch_allfullstrong.h"#include "scip/branch_fullstrong.h"#include "scip/branch_inference.h"#include "scip/branch_mostinf.h"#include "scip/branch_leastinf.h"#include "scip/branch_pscost.h"#include "scip/branch_random.h"#include "scip/branch_relpscost.h"#include "scip/cons_linear.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_ConsData |
| struct | SCIP_ConshdlrData |
Macros | |
| #define | CONSHDLR_NAME "origbranch" |
| #define | CONSHDLR_DESC "store branching decision at nodes of the tree constraint handler" |
| #define | CONSHDLR_ENFOPRIORITY 0 |
| #define | CONSHDLR_CHECKPRIORITY 2000000 |
| #define | CONSHDLR_EAGERFREQ 100 |
| #define | CONSHDLR_NEEDSCONS TRUE |
Macro Definition Documentation
◆ CONSHDLR_NAME
| #define CONSHDLR_NAME "origbranch" |
Definition at line 63 of file cons_origbranch.c.
◆ CONSHDLR_DESC
| #define CONSHDLR_DESC "store branching decision at nodes of the tree constraint handler" |
Definition at line 64 of file cons_origbranch.c.
◆ CONSHDLR_ENFOPRIORITY
| #define CONSHDLR_ENFOPRIORITY 0 |
priority of the constraint handler for constraint enforcing
Definition at line 65 of file cons_origbranch.c.
◆ CONSHDLR_CHECKPRIORITY
| #define CONSHDLR_CHECKPRIORITY 2000000 |
priority of the constraint handler for checking feasibility
Definition at line 66 of file cons_origbranch.c.
◆ CONSHDLR_EAGERFREQ
| #define CONSHDLR_EAGERFREQ 100 |
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 67 of file cons_origbranch.c.
◆ CONSHDLR_NEEDSCONS
| #define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 69 of file cons_origbranch.c.
Function Documentation
◆ SCIP_DECL_CONSFREE()
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 106 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, SCIP_ConshdlrData::rootcons, SCIP_CALL(), SCIP_DECL_CONSFREE(), SCIPdebugMessage(), SCIPfreeMemory(), and SCIP_ConshdlrData::stack.
◆ SCIP_DECL_CONSINITSOL()
|
static |
solving process initialization method of constraint handler (called when branch and bound process is about to begin)
Definition at line 134 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, SCIP_ConshdlrData::gcg, GCGconsOrigbranchCheckConsistency(), SCIP_ConshdlrData::maxstacksize, SCIP_ConshdlrData::nstack, SCIP_ConshdlrData::rootcons, SCIP_CALL(), SCIP_DECL_CONSINITSOL(), and SCIP_ConshdlrData::stack.
◆ SCIP_DECL_CONSEXITSOL()
|
static |
solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
Definition at line 165 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, GCGconsOrigbranchGetBranchdata(), SCIP_ConshdlrData::maxstacksize, SCIP_ConshdlrData::nstack, SCIP_ConshdlrData::rootcons, SCIP_CALL(), SCIP_DECL_CONSEXITSOL(), SCIPdebugMessage(), and SCIP_ConshdlrData::stack.
◆ SCIP_DECL_CONSEXIT()
|
static |
exit method of constraint handler (called before problem is free transformed)
Definition at line 200 of file cons_origbranch.c.
References assert(), SCIP_ConshdlrData::rootcons, SCIP_CALL(), SCIP_DECL_CONSEXIT(), and SCIPdebugMessage().
◆ SCIP_DECL_CONSDELETE()
|
static |
frees specific constraint data
Definition at line 220 of file cons_origbranch.c.
References assert(), SCIP_ConsData::childconss, CONSHDLR_NAME, GCGconsMasterbranchGetOrigcons(), GCGconsMasterbranchSetBranchdata(), GCGconsMasterbranchSetOrigcons(), GCGorigGetGcg(), GCGrelaxBranchDataDelete(), i, SCIP_ConsData::nchildconss, SCIP_ConsData::probingtmpcons, SCIP_CALL(), and SCIPdebugMessage().
◆ SCIP_DECL_CONSACTIVE()
|
static |
constraint activation notification method of constraint handler
Definition at line 299 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, SCIP_ConshdlrData::maxstacksize, SCIP_ConsData::node, SCIP_ConshdlrData::nstack, SCIP_CALL(), SCIP_DECL_CONSACTIVE(), SCIPdebugMessage(), and SCIP_ConshdlrData::stack.
◆ SCIP_DECL_CONSDEACTIVE()
|
static |
constraint deactivation notification method of constraint handler
Definition at line 340 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, SCIP_ConshdlrData::nstack, SCIP_DECL_CONSDEACTIVE(), SCIPdebugMessage(), and SCIP_ConshdlrData::stack.
◆ SCIP_DECL_CONSENFOLP()
|
static |
◆ SCIP_DECL_CONSENFORELAX()
|
static |
lp solution enforcement method
Definition at line 377 of file cons_origbranch.c.
References result, and SCIP_DECL_CONSENFORELAX().
Referenced by SCIP_DECL_CONSENFORELAX().
◆ SCIP_DECL_CONSENFOPS()
|
static |
pseudo solution enforcement method
Definition at line 387 of file cons_origbranch.c.
References result.
◆ SCIP_DECL_CONSCHECK()
|
static |
◆ SCIP_DECL_CONSLOCK()
|
static |
variable lock method
Definition at line 405 of file cons_origbranch.c.
◆ GCGincludeConshdlrOrigbranch()
| SCIP_RETCODE GCGincludeConshdlrOrigbranch | ( | GCG * | gcg | ) |
creates the handler for origbranch constraints and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 416 of file cons_origbranch.c.
References assert(), CONSHDLR_CHECKPRIORITY, CONSHDLR_DESC, CONSHDLR_EAGERFREQ, CONSHDLR_ENFOPRIORITY, CONSHDLR_NAME, CONSHDLR_NEEDSCONS, SCIP_ConshdlrData::gcg, GCGgetOrigprob(), GCGincludeConshdlrOrigbranch(), SCIP_ConshdlrData::maxstacksize, SCIP_ConshdlrData::nstack, origprob, SCIP_ConshdlrData::rootcons, SCIP_CALL(), and SCIP_ConshdlrData::stack.
Referenced by GCGincludeConshdlrOrigbranch(), and GCGincludeGcgPlugins().
◆ GCGcreateConsOrigbranch()
| SCIP_RETCODE GCGcreateConsOrigbranch | ( | GCG * | gcg, |
| SCIP_CONS ** | cons, | ||
| const char * | name, | ||
| SCIP_NODE * | node, | ||
| SCIP_CONS * | parentcons, | ||
| GCG_BRANCHRULE * | branchrule, | ||
| GCG_BRANCHDATA * | branchdata ) |
creates and captures a origbranch constraint
- Parameters
-
gcg GCG data structure cons pointer to hold the created constraint name name of constraint node the node to which this origbranch constraint belongs parentcons origbranch constraint associated with the father node branchrule the branching rule that created the b&b node the constraint belongs to branchdata branching data storing information about the branching restrictions at the corresponding node
Definition at line 453 of file cons_origbranch.c.
References assert(), SCIP_ConsData::branchdata, SCIP_ConsData::branchrule, SCIP_ConsData::childconss, CONSHDLR_NAME, GCGcreateConsOrigbranch(), GCGgetOrigprob(), SCIP_ConsData::mastercons, SCIP_ConsData::maxchildconss, SCIP_ConsData::nchildconss, SCIP_ConsData::node, SCIP_ConsData::parentcons, SCIP_ConsData::probingtmpcons, SCIP_CALL(), and SCIPdebugMessage().
Referenced by createOrigbranchConstraint(), GCGconsOrigbranchAddRootCons(), GCGcreateConsOrigbranch(), and GCGrelaxNewProbingnodeOrig().
◆ GCGconsOrigbranchGetActiveCons()
returns the branch orig constraint of the current node, only needs the pointer to scip
- Parameters
-
gcg GCG data structure
Definition at line 532 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, GCGconsOrigbranchGetActiveCons(), GCGgetOrigprob(), SCIP_ConshdlrData::nstack, and SCIP_ConshdlrData::stack.
Referenced by createBranchNodesInOrigprob(), createOrigbranchConstraint(), GCGconsOrigbranchGetActiveCons(), GCGrelaxNewProbingnodeOrig(), initializeConsdata(), relaxExecGcgDantzigWolfe(), SCIP_DECL_CONSINITSOL(), SCIP_DECL_EVENTEXEC(), and SCIP_DECL_NODESELSELECT().
◆ GCGconsOrigbranchGetStack()
returns the stack and the number of elements on it
- Parameters
-
gcg GCG data structure stack return value: pointer to the stack nstackelements return value: pointer to int, for number of elements on the stack
Definition at line 554 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, GCGconsOrigbranchGetStack(), GCGgetOrigprob(), SCIP_ConshdlrData::nstack, and SCIP_ConshdlrData::stack.
Referenced by GCGconsOrigbranchGetStack(), and SCIP_DECL_BRANCHEXECPS().
◆ GCGconsOrigbranchSetBranchdata()
| void GCGconsOrigbranchSetBranchdata | ( | SCIP_CONS * | cons, |
| GCG_BRANCHDATA * | branchdata ) |
sets the branching data for a given origbranch constraint
- Parameters
-
cons origbranch constraint for which the branching data is requested branchdata branching data
Definition at line 578 of file cons_origbranch.c.
References assert(), SCIP_ConsData::branchdata, and GCGconsOrigbranchSetBranchdata().
Referenced by GCGconsOrigbranchSetBranchdata(), and SCIP_DECL_CONSDELETE().
◆ GCGconsOrigbranchGetBranchdata()
| GCG_BRANCHDATA * GCGconsOrigbranchGetBranchdata | ( | SCIP_CONS * | cons | ) |
returns the branching data for a given origbranch constraint
- Parameters
-
cons origbranch constraint for which the branching data is requested
Definition at line 592 of file cons_origbranch.c.
References assert(), SCIP_ConsData::branchdata, and GCGconsOrigbranchGetBranchdata().
Referenced by GCGconsOrigbranchGetBranchdata(), relaxExecGcgDantzigWolfe(), SCIP_DECL_BRANCHEXECPS(), and SCIP_DECL_CONSEXITSOL().
◆ GCGconsOrigbranchGetBranchrule()
| GCG_BRANCHRULE * GCGconsOrigbranchGetBranchrule | ( | SCIP_CONS * | cons | ) |
returns the branching rule for a given origbranch constraint
- Parameters
-
cons origbranch constraint for which the branchrule is requested
Definition at line 605 of file cons_origbranch.c.
References assert(), SCIP_ConsData::branchrule, and GCGconsOrigbranchGetBranchrule().
Referenced by GCGconsOrigbranchGetBranchrule(), relaxExecGcgDantzigWolfe(), and SCIP_DECL_BRANCHEXECPS().
◆ GCGconsOrigbranchGetNode()
returns the node in the B&B tree at which the given origbranch constraint is sticking
- Parameters
-
cons origbranch constraint for which the corresponding node is requested
Definition at line 619 of file cons_origbranch.c.
References assert(), GCGconsOrigbranchGetNode(), and SCIP_ConsData::node.
Referenced by createBranchNodesInOrigprob(), GCGconsOrigbranchGetNode(), initializeConsdata(), SCIP_DECL_EVENTEXEC(), and SCIP_DECL_NODESELSELECT().
◆ GCGconsOrigbranchGetParentcons()
returns the origbranch constraint of the B&B father of the node at which the given origbranch constraint is sticking
- Parameters
-
cons origbranch constraint for which the origbranch constraint of the father node is requested
Definition at line 635 of file cons_origbranch.c.
References assert(), GCGconsOrigbranchGetParentcons(), and SCIP_ConsData::parentcons.
Referenced by GCGconsMasterbranchCheckConsistency(), GCGconsOrigbranchGetParentcons(), initializeConsdata(), and SCIP_DECL_NODESELSELECT().
◆ GCGconsOrigbranchGetNChildconss()
| int GCGconsOrigbranchGetNChildconss | ( | SCIP_CONS * | cons | ) |
returns the number of origbranch constraints of the children of the node at which the given origbranch constraint is sticking
- Parameters
-
cons constraint
Definition at line 652 of file cons_origbranch.c.
References assert(), GCGconsOrigbranchGetNChildconss(), and SCIP_ConsData::nchildconss.
Referenced by GCGconsOrigbranchGetNChildconss(), and initializeConsdata().
◆ GCGconsOrigbranchGetChildcons()
returns an origbranch constraint of a child of the node at which the given origbranch constraint is sticking
- Parameters
-
cons constraint childnr number of child
Definition at line 667 of file cons_origbranch.c.
References assert(), SCIP_ConsData::childconss, GCGconsOrigbranchGetChildcons(), and SCIP_ConsData::nchildconss.
Referenced by GCGconsOrigbranchGetChildcons().
◆ GCGconsOrigbranchSetMastercons()
sets the masterbranch constraint of the node in the master program corresponding to the node at which the given origbranchbranch constraint is sticking
- Parameters
-
cons origbranch constraint for which the masterbranch constraint should be set mastercons masterbranch constraint corresponding to the given origbranch constraint
Definition at line 685 of file cons_origbranch.c.
References assert(), GCGconsOrigbranchSetMastercons(), and SCIP_ConsData::mastercons.
Referenced by createOrigbranchConstraint(), GCGconsOrigbranchSetMastercons(), initializeConsdata(), SCIP_DECL_CONSDELETE(), and SCIP_DECL_CONSINITSOL().
◆ GCGconsOrigbranchGetMastercons()
returns the masterbranch constraint of the node in the master program corresponding to the node at which the given origbranchbranch constraint is sticking
- Parameters
-
cons origbranch constraint for which the corresponding masterbranch constraint is requested
Definition at line 702 of file cons_origbranch.c.
References assert(), GCGconsOrigbranchGetMastercons(), and SCIP_ConsData::mastercons.
Referenced by GCGconsMasterbranchCheckConsistency(), GCGconsOrigbranchGetMastercons(), SCIP_DECL_CONSDELETE(), SCIP_DECL_EVENTEXEC(), and SCIP_DECL_NODESELSELECT().
◆ GCGconsOrigbranchAddRootCons()
| SCIP_RETCODE GCGconsOrigbranchAddRootCons | ( | GCG * | gcg | ) |
adds initial constraint to root node
- Parameters
-
gcg GCG data structure
Definition at line 717 of file cons_origbranch.c.
References assert(), CONSHDLR_NAME, GCGconsOrigbranchAddRootCons(), GCGconsOrigbranchCheckConsistency(), GCGcreateConsOrigbranch(), GCGgetOrigprob(), i, SCIP_ConshdlrData::rootcons, and SCIP_CALL().
Referenced by GCGconsOrigbranchAddRootCons(), and initializeMasterProblemSolve().
◆ GCGconsOrigbranchCheckConsistency()
| void GCGconsOrigbranchCheckConsistency | ( | GCG * | gcg | ) |
checks the consistency of the origbranch constraints in the problem
- Parameters
-
gcg GCG data structure
Definition at line 760 of file cons_origbranch.c.
References assert(), SCIP_ConsData::childconss, CONSHDLR_NAME, GCGconsMasterbranchGetOrigcons(), GCGconsOrigbranchCheckConsistency(), GCGgetOrigprob(), i, SCIP_ConsData::mastercons, SCIP_ConsData::nchildconss, SCIP_ConsData::node, SCIP_ConsData::parentcons, and SCIP_ConsData::probingtmpcons.
Referenced by GCGconsOrigbranchAddRootCons(), GCGconsOrigbranchCheckConsistency(), SCIP_DECL_CONSINITSOL(), and SCIP_DECL_NODESELSELECT().