Detailed Description
GCG Benders' decomposition algorithm.
Definition in file benders_gcg.c.
#include <assert.h>#include <string.h>#include "gcg/benders_gcg.h"#include "gcg/gcg.h"#include "gcg/relax_gcg.h"#include "gcg/scip_misc.h"#include "gcg/pub_gcgvar.h"#include "scip/cons_linear.h"#include "scip/pub_var.h"#include "scip/pub_benders.h"#include "scip/bendersdefcuts.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_BendersData |
Macros | |
| #define | BENDERS_NAME "gcg" |
| #define | BENDERS_DESC "Benders' decomposition for the Generic Column Generation package" |
| #define | BENDERS_PRIORITY 1000 |
| #define | BENDERS_CUTLP TRUE |
| #define | BENDERS_CUTPSEUDO TRUE |
| #define | BENDERS_CUTRELAX TRUE |
| #define | BENDERS_SHAREAUXVARS FALSE |
| #define | LARGE_VALUE 10000 |
Macro Definition Documentation
◆ BENDERS_NAME
| #define BENDERS_NAME "gcg" |
Definition at line 52 of file benders_gcg.c.
Referenced by GCGbendersGetGcg(), GCGbendersGetRelaxSol(), and GCGincludeBendersGcg().
◆ BENDERS_DESC
| #define BENDERS_DESC "Benders' decomposition for the Generic Column Generation package" |
Definition at line 53 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ BENDERS_PRIORITY
| #define BENDERS_PRIORITY 1000 |
Definition at line 54 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ BENDERS_CUTLP
| #define BENDERS_CUTLP TRUE |
should Benders' cut be generated for LP solutions
Definition at line 55 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ BENDERS_CUTPSEUDO
| #define BENDERS_CUTPSEUDO TRUE |
should Benders' cut be generated for pseudo solutions
Definition at line 56 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ BENDERS_CUTRELAX
| #define BENDERS_CUTRELAX TRUE |
should Benders' cut be generated for relaxation solutions
Definition at line 57 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ BENDERS_SHAREAUXVARS
| #define BENDERS_SHAREAUXVARS FALSE |
should this Benders' share the highest priority Benders' aux vars
Definition at line 58 of file benders_gcg.c.
Referenced by GCGincludeBendersGcg().
◆ LARGE_VALUE
| #define LARGE_VALUE 10000 |
a large value that is used to create an artificial solution
Definition at line 60 of file benders_gcg.c.
Referenced by setOriginalProblemPricingValues().
Function Documentation
◆ varGetObj()
Definition at line 79 of file benders_gcg.c.
References assert(), GCGoriginalVarIsLinking(), GCGpricingVarGetOrigvars(), var, and varGetObj().
Referenced by setSubproblemObjs(), and varGetObj().
◆ setSubproblemObjs()
|
static |
- Parameters
-
benders the benders' decomposition constraint handler probnumber the subproblem number
Definition at line 96 of file benders_gcg.c.
References assert(), GCGoriginalVarIsLinking(), GCGpricingVarGetOrigvars(), GCGvarGetBlock(), i, SCIP_CALL(), SCIPdebugMessage(), setSubproblemObjs(), and varGetObj().
Referenced by SCIP_DECL_BENDERSCREATESUB(), and setSubproblemObjs().
◆ setOriginalProblemPricingValues()
|
static |
sets the pricing problem variable values for the original problem using the decomposed problem solution There is a mapping between the original problem and the variables from the pricing problems. This mapping is used to identify the variables of the original problem corresponding to the pricing problem variables.
An artificial solution can be constructed, which is indicated by the vals array provided as NULL. An artifical solution sets the original problem variables corresponding to pricing problems variables to their bounds. An artificial solution is created if branching candidates need to be found. Branching candidates only come from the master problem, so the variable values of the pricing problem variables does not affect the branching variable selection
- Parameters
-
origprob the SCIP instance of the original problem masterprob the Benders' master problem benders the Benders' decomposition structure origsol the solution for the original problem vars the variables from the decomposed problem vals the solution values of the given problem, can be NULL for an artificial solution nvars the number of variables success were all values set successfully?
Definition at line 139 of file benders_gcg.c.
References assert(), GCGpricingVarGetNOrigvars(), GCGpricingVarGetOrigvars(), GCGvarIsPricing(), i, LARGE_VALUE, masterprob, nvars, origprob, SCIP_CALL(), setOriginalProblemPricingValues(), success, and vars.
Referenced by createOriginalProblemSolution(), and setOriginalProblemPricingValues().
◆ setOriginalProblemMasterValues()
|
static |
sets the master problem values for the original problem using the decomposed problem solution
- Parameters
-
origprob the SCIP instance of the original problem masterprob the Benders' master problem benders the Benders' decomposition structure origsol the solution for the original problem vars the variables from the decomposed problem vals the solution values of the given problem, can be NULL nvars the number of variables
Definition at line 229 of file benders_gcg.c.
References assert(), GCGmasterVarGetNOrigvars(), GCGmasterVarGetOrigvals(), GCGmasterVarGetOrigvars(), GCGvarIsMaster(), i, masterprob, nvars, origprob, SCIP_CALL(), setOriginalProblemMasterValues(), and vars.
Referenced by createOriginalProblemSolution(), and setOriginalProblemMasterValues().
◆ createOriginalProblemSolution()
|
static |
creates an original problem solution from the master and subproblem solutions
- Parameters
-
masterprob the Benders' master problem benders the Benders' decomposition structure sol the solution passed to the Benders' decomposition subproblems. artificial should an artifical (possibly infeasible) solution be created to generate branching candidates
Definition at line 288 of file benders_gcg.c.
References assert(), createOriginalProblemSolution(), SCIP_BendersData::gcg, GCGgetOrigprob(), GCGrelaxGetProbingheur(), i, masterprob, nvars, origprob, SCIP_BendersData::relaxsol, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), setOriginalProblemMasterValues(), setOriginalProblemPricingValues(), sol, success, and vars.
Referenced by createOriginalProblemSolution(), and SCIP_DECL_BENDERSPOSTSOLVE().
◆ mergeSubproblemIntoMaster()
|
static |
merge a single subproblem into the master problem
- Parameters
-
masterprob the Benders' master problem benders the Benders' decomposition structure probnumber the index of the subproblem that will be merged
Definition at line 443 of file benders_gcg.c.
References assert(), SCIP_BendersData::gcg, GCGcopyPricingvarDataToMastervar(), i, masterprob, mergeSubproblemIntoMaster(), nvars, SCIP_CALL(), and vars.
Referenced by mergeSubproblemIntoMaster(), and mergeSubproblemsIntoMaster().
◆ mergeSubproblemsIntoMaster()
|
static |
performs a merge of subproblems into the master problem. The subproblems are merged into the master problem if the infeasibility can not be resolved through the addition of cuts. This could be because the appropriate cuts are not available in the Benders' decomposition framework, or that the subproblem has been infeasible for a set number of iterations.
- Parameters
-
masterprob the Benders' master problem benders the Benders' decomposition structure mergecands the subproblems that are merge candidates npriomergecands the priority merge candidates, these should be merged nmergecands the total number of merge candidates merged flag to indicate whether a subproblem has been merged into the master
Definition at line 493 of file benders_gcg.c.
References assert(), i, masterprob, mergeSubproblemIntoMaster(), mergeSubproblemsIntoMaster(), and SCIP_CALL().
Referenced by mergeSubproblemsIntoMaster(), and SCIP_DECL_BENDERSPOSTSOLVE().
◆ SCIP_DECL_BENDERSFREE()
|
static |
destructor of Benders' decomposition to free user data (called when SCIP is exiting)
Definition at line 540 of file benders_gcg.c.
References assert(), SCIP_DECL_BENDERSFREE(), and SCIPfreeMemory().
Referenced by SCIP_DECL_BENDERSFREE().
◆ SCIP_DECL_BENDERSINITPRE()
|
static |
presolving initialization method of constraint handler (called when presolving is about to begin)
Definition at line 559 of file benders_gcg.c.
References assert(), SCIP_BendersData::gcg, GCGaddDataAuxiliaryVar(), i, SCIP_CALL(), and SCIP_DECL_BENDERSINITPRE().
Referenced by SCIP_DECL_BENDERSINITPRE().
◆ SCIP_DECL_BENDERSEXITSOL()
|
static |
solving process deinitialization method of Benders' decomposition (called before branch and bound process data is freed)
Definition at line 589 of file benders_gcg.c.
References assert(), SCIP_BendersData::gcg, GCGgetOrigprob(), origprob, SCIP_BendersData::relaxsol, SCIP_CALL(), and SCIP_DECL_BENDERSEXITSOL().
Referenced by SCIP_DECL_BENDERSEXITSOL().
◆ SCIP_DECL_BENDERSGETVAR()
|
static |
mapping method between the master problem variables and the subproblem variables of Benders' decomposition
Definition at line 611 of file benders_gcg.c.
References assert(), GCGlinkingVarGetPricingVars(), GCGmasterVarGetOrigvars(), GCGoriginalVarGetMastervars(), GCGoriginalVarGetNMastervars(), GCGoriginalVarGetPricingVar(), GCGoriginalVarIsLinking(), GCGpricingVarGetOrigvars(), SCIP_DECL_BENDERSGETVAR(), and var.
Referenced by SCIP_DECL_BENDERSGETVAR().
◆ SCIP_DECL_BENDERSPOSTSOLVE()
|
static |
the post-execution method for Benders' decomposition
Definition at line 676 of file benders_gcg.c.
References assert(), createOriginalProblemSolution(), SCIP_BendersData::gcg, GCGrelaxUpdateCurrentSol(), mergeSubproblemsIntoMaster(), SCIP_CALL(), SCIP_DECL_BENDERSPOSTSOLVE(), SCIPdebugMessage(), and sol.
Referenced by SCIP_DECL_BENDERSPOSTSOLVE().
◆ SCIP_DECL_BENDERSCREATESUB()
|
static |
the method for creating the Benders' decomposition subproblem. This method is called during the initialization stage (after the master problem was transformed)
This method must create the SCIP instance for the subproblem and add the required variables and constraints. In addition, the settings required for the solving the problem must be set here. However, some settings will be overridden by the standard solving method included in the Benders' decomposition framework. If a special solving method is desired, the user can implement the bendersSolvesubDefault callback.
Definition at line 720 of file benders_gcg.c.
References assert(), SCIP_BendersData::gcg, GCGgetPricingprob(), SCIP_CALL(), SCIP_DECL_BENDERSCREATESUB(), and setSubproblemObjs().
Referenced by SCIP_DECL_BENDERSCREATESUB().
◆ GCGincludeBendersGcg()
| SCIP_RETCODE GCGincludeBendersGcg | ( | GCG * | gcg | ) |
creates the gcg Benders' decomposition and includes it in SCIP
creates the GCG Benders' decomposition and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 747 of file benders_gcg.c.
References assert(), BENDERS_CUTLP, BENDERS_CUTPSEUDO, BENDERS_CUTRELAX, BENDERS_DESC, BENDERS_NAME, BENDERS_PRIORITY, BENDERS_SHAREAUXVARS, SCIP_BendersData::gcg, GCGgetBendersMasterprob(), GCGincludeBendersGcg(), SCIP_BendersData::relaxsol, and SCIP_CALL().
Referenced by GCGincludeBendersGcg(), and GCGincludeRelaxGcg().