Detailed Description
basis separator
Definition in file sepa_basis.c.
#include <assert.h>#include <stdio.h>#include <string.h>#include "scip/scip.h"#include "scip/scipdefplugins.h"#include "gcg/sepa_basis.h"#include "gcg/sepa_original.h"#include "gcg/gcg.h"#include "gcg/relax_gcg.h"#include "gcg/pricer_gcg.h"#include "gcg/pub_gcgvar.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_SepaData |
Macros | |
| #define | SEPA_NAME "basis" |
| #define | SEPA_DESC "separator calculates a basis of the orig problem to generate cuts, which cut off the master lp sol" |
| #define | SEPA_PRIORITY 100 |
| #define | SEPA_FREQ 0 |
| #define | SEPA_MAXBOUNDDIST 1.0 |
| #define | SEPA_USESSUBSCIP FALSE |
| #define | SEPA_DELAY TRUE |
| #define | STARTMAXCUTS 50 |
| #define | sepaCopyBasis NULL |
| #define | sepaExecsolBasis NULL |
Macro Definition Documentation
◆ SEPA_NAME
| #define SEPA_NAME "basis" |
Definition at line 58 of file sepa_basis.c.
Referenced by GCG_DECL_SEPAGETCOLCOEFFICIENT(), GCG_DECL_SEPAMASTERCUTDELETE(), GCGincludeSepaBasis(), GCGincludeSepaOriginal(), GCGsepaBasisAddPricingCut(), GCGsepaBasisGetMastercuts(), GCGsepaBasisGetNMastercuts(), GCGsepaBasisGetNOrigcuts(), GCGsepaBasisGetOrigcuts(), SCIPincludeSepaSubsetrow(), and SCIPsepaBasisAddPPObjConss().
◆ SEPA_DESC
| #define SEPA_DESC "separator calculates a basis of the orig problem to generate cuts, which cut off the master lp sol" |
Definition at line 59 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ SEPA_PRIORITY
| #define SEPA_PRIORITY 100 |
Definition at line 60 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ SEPA_FREQ
| #define SEPA_FREQ 0 |
Definition at line 61 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ SEPA_MAXBOUNDDIST
| #define SEPA_MAXBOUNDDIST 1.0 |
Definition at line 62 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ SEPA_USESSUBSCIP
| #define SEPA_USESSUBSCIP FALSE |
does the separator use a secondary SCIP instance?
Definition at line 63 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ SEPA_DELAY
| #define SEPA_DELAY TRUE |
should separation method be delayed, if other separators found cuts?
Definition at line 64 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis(), GCGincludeSepaOriginal(), and SCIPincludeSepaSubsetrow().
◆ STARTMAXCUTS
| #define STARTMAXCUTS 50 |
maximal cuts used at the beginning
Definition at line 66 of file sepa_basis.c.
◆ sepaCopyBasis
| #define sepaCopyBasis NULL |
copy method for separator plugins (called when SCIP copies plugins)
Definition at line 810 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis().
◆ sepaExecsolBasis
| #define sepaExecsolBasis NULL |
arbitrary primal solution separation method of separator
Definition at line 1601 of file sepa_basis.c.
Referenced by GCGincludeSepaBasis().
Function Documentation
◆ ensureSizeCuts()
|
static |
allocates enough memory to hold more cuts
- Parameters
-
scip SCIP data structure sepadata separator data data structure size new size of cut arrays
Definition at line 115 of file sepa_basis.c.
References assert(), ensureSizeCuts(), SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::norigcuts, SCIP_SepaData::origcuts, and SCIP_CALL().
Referenced by ensureSizeCuts(), ensureSizeCuts(), GCGsepaAddOriginalSepaCuts(), SCIP_DECL_SEPAEXECLP(), and SCIP_DECL_SEPAEXECLP().
◆ ensureSizeNewCuts()
|
static |
allocates enough memory to hold more new cuts
- Parameters
-
scip SCIP data structure sepadata separator data data structure size new size of cut arrays
Definition at line 144 of file sepa_basis.c.
References assert(), ensureSizeNewCuts(), SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, and SCIP_CALL().
Referenced by addPPObjConss(), ensureSizeNewCuts(), GCGsepaBasisAddPricingCut(), and SCIP_DECL_SEPAEXECLP().
◆ exponentiate()
returns the result of the exponentiation for given exponent and basis (basis^exponent) Initialize probing objective coefficient for each variable with original objective.
- Parameters
-
basis basis for exponentiation exponent exponent for exponentiation
Definition at line 169 of file sepa_basis.c.
References assert(), exponentiate(), i, and result.
Referenced by chgProbingObjUsingRows(), exponentiate(), and initProbingObjUsingVarBounds().
◆ initProbingObjWithOrigObj()
|
static |
Change probing objective coefficient for each variable by adding original objective to the probing objective.
- Parameters
-
origscip orig scip problem enableobj returns if objective row was added to the lp objfactor factor, the objective is multiplied with
Definition at line 190 of file sepa_basis.c.
References assert(), i, initProbingObjWithOrigObj(), objfactor, and SCIP_CALL().
Referenced by initConvObj(), and initProbingObjWithOrigObj().
◆ chgProbingObjAddingOrigObj()
|
static |
Initialize probing objective coefficient for each variable depending on the current origsol.
If variable is at upper bound set objective to -1, if variable is at lower bound set obj to 1, else set obj to 0. Additionally, add original objective to the probing objective if this is enabled.
- Parameters
-
origscip orig scip problem objfactor factor the additional part of the objective is multiplied with objdivisor factor the additional part of the objective is divided with
Definition at line 228 of file sepa_basis.c.
References assert(), chgProbingObjAddingOrigObj(), i, objfactor, and SCIP_CALL().
Referenced by chgProbingObjAddingOrigObj(), and initConvObj().
◆ initProbingObjUsingVarBounds()
|
static |
Change probing objective depending on the current origsol.
Loop over all constraints lhs <= sum a_i*x_i <= rhs. If lhs == sum a_i*x_i^* add a_i to objective of variable i and if rhs == sum a_i*x_i^* add -a_i to objective of variable i.
- Parameters
-
origscip orig scip problem sepadata separator specific data origsol orig solution enableobj returns if objective row was added to the lp objfactor factor the objective is multiplied with
Definition at line 266 of file sepa_basis.c.
References assert(), SCIP_SepaData::enableposslack, exponentiate(), i, initProbingObjUsingVarBounds(), objfactor, SCIP_SepaData::posslackexp, SCIP_CALL(), and solval.
Referenced by initConvObj(), and initProbingObjUsingVarBounds().
◆ chgProbingObjUsingRows()
|
static |
- Parameters
-
origscip orig scip problem sepadata separator data origsol orig solution objfactor factor the objective is multiplied with objdivisor factor the objective is divided with
Definition at line 364 of file sepa_basis.c.
References assert(), chgProbingObjUsingRows(), SCIP_SepaData::enableposslack, exponentiate(), i, j, nvars, obj, objfactor, SCIP_SepaData::objrow, SCIP_SepaData::posslackexp, SCIP_CALL(), SCIPfreeBufferArray(), and vars.
Referenced by chgProbingObjUsingRows(), and initConvObj().
◆ addPPObjConss()
|
static |
add cuts based on the last objective function of the pricing problems, which did not yield any new columns (stating that the reduced cost are non-negative)
- Parameters
-
gcg GCG data structure sepa separator basis ppnumber number of pricing problem dualsolconv dual solution corresponding to convexity constraint newcuts add cut to newcuts in sepadata? (otherwise add it just to the cutpool) probing add cut to probing LP?
Definition at line 711 of file sepa_basis.c.
References addPPObjConss(), assert(), ensureSizeNewCuts(), GCGgetNIdenticalBlocks(), GCGgetOrigprob(), GCGgetPricingprob(), GCGisPricingprobRelevant(), GCGpricingVarGetOrigvars(), GCGvarIsPricing(), j, SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, nvars, origprob, SCIP_CALL(), SCIPdebugMessage(), and var.
Referenced by addPPObjConss(), SCIP_DECL_SEPAEXECLP(), and SCIPsepaBasisAddPPObjConss().
◆ SCIP_DECL_SEPAFREE()
|
static |
destructor of separator to free user data (called when SCIP is exiting)
Definition at line 814 of file sepa_basis.c.
References assert(), and SCIP_DECL_SEPAFREE().
Referenced by SCIP_DECL_SEPAFREE(), SCIP_DECL_SEPAFREE(), and SCIP_DECL_SEPAFREE().
◆ SCIP_DECL_SEPAINIT()
|
static |
initialization method of separator (called after problem was transformed)
Definition at line 828 of file sepa_basis.c.
References assert(), SCIP_SepaData::enable, SCIP_SepaData::enableobj, SCIP_SepaData::gcg, GCGgetOrigprob(), i, SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, obj, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_CALL(), SCIP_DECL_SEPAINIT(), SCIPdebugMessage(), and STARTMAXCUTS.
Referenced by SCIP_DECL_SEPAINIT(), and SCIP_DECL_SEPAINIT().
◆ SCIP_DECL_SEPAEXIT()
|
static |
deinitialization method of separator (called before transformed problem is freed)
Definition at line 895 of file sepa_basis.c.
References assert(), SCIP_SepaData::enableobj, SCIP_SepaData::gcg, GCGgetOrigprob(), i, SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_CALL(), and SCIP_DECL_SEPAEXIT().
Referenced by SCIP_DECL_SEPAEXIT(), SCIP_DECL_SEPAEXIT(), and SCIP_DECL_SEPAEXIT().
◆ SCIP_DECL_SEPAINITSOL()
|
static |
solving process initialization method of separator (called when branch and bound process is about to begin)
Definition at line 934 of file sepa_basis.c.
References assert(), SCIP_SepaData::nmastercuts, and SCIP_DECL_SEPAINITSOL().
Referenced by SCIP_DECL_SEPAINITSOL().
◆ SCIP_DECL_SEPAEXITSOL()
|
static |
solving process deinitialization method of separator (called before branch and bound process data is freed)
Definition at line 949 of file sepa_basis.c.
References assert(), SCIP_SepaData::gcg, GCGgetOrigprob(), i, SCIP_SepaData::mastercuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::norigcuts, SCIP_CALL(), and SCIP_DECL_SEPAEXITSOL().
Referenced by SCIP_DECL_SEPAEXITSOL(), and SCIP_DECL_SEPAEXITSOL().
◆ initGenconv()
|
static |
Initialize generic convex combination coefficient
- Parameters
-
origscip original SCIP data structure sepadata separator data structure origsol current original solution nbasis rank of constraint matrix convex pointer to store convex combination coefficient
Definition at line 971 of file sepa_basis.c.
References initGenconv(), SCIP_SepaData::objconvex, SCIP_CALL(), and SCIPdebugMessage().
Referenced by initGenconv(), and SCIP_DECL_SEPAEXECLP().
◆ initConvObj()
|
static |
Initialize objective as convex combination of so-called face objective function and original objective function
- Parameters
-
origscip original SCIP data structure sepadata separator data structure origsol current original solution convex convex coefficient to initialize objective genericconv was convex coefficient calculated generically?
Definition at line 1002 of file sepa_basis.c.
References chgProbingObjAddingOrigObj(), chgProbingObjUsingRows(), SCIP_SepaData::enableobj, initConvObj(), initProbingObjUsingVarBounds(), initProbingObjWithOrigObj(), and SCIP_CALL().
Referenced by initConvObj(), and SCIP_DECL_SEPAEXECLP().
◆ SCIP_DECL_SEPAEXECLP()
|
static |
LP solution separation method of separator
Definition at line 1049 of file sepa_basis.c.
References addPPObjConss(), assert(), SCIP_SepaData::chgobj, SCIP_SepaData::chgobjallways, SCIP_SepaData::currentnodenr, cutoff, SCIP_SepaData::enable, SCIP_SepaData::enableobj, SCIP_SepaData::enableobjround, SCIP_SepaData::enableposslack, SCIP_SepaData::enableppobjconss, ensureSizeCuts(), ensureSizeNewCuts(), SCIP_SepaData::forcecuts, SCIP_SepaData::gcg, GCGgetNPricingprobs(), GCGgetNRelPricingprobs(), GCGgetOrigprob(), GCGrelaxGetCurrentOrigSol(), GCGrelaxIsOrigSolFeasible(), GCGrelaxUpdateCurrentSol(), GCGsepaAddOriginalSepaCuts(), GCGsepaGetNOriginalSepaCuts(), GCGsepaGetOriginalSepaOrigcuts(), GCGsepaOriginalSepaOrigcutExists(), GCGsetPricingObjs(), GCGtransformOrigvalsToMastervals(), GCGvarIsOriginal(), SCIP_SepaData::genobjconvex, i, initConvObj(), initGenconv(), j, lperror, lprows, SCIP_SepaData::mastercuts, mastervars, SCIP_SepaData::maxrounds, SCIP_SepaData::maxroundsroot, SCIP_SepaData::mincuts, SCIP_SepaData::newcuts, nfracs, nlprows, SCIP_SepaData::nmastercuts, nmastervars, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, obj, SCIP_SepaData::objconvex, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_SepaData::posslackexp, SCIP_SepaData::posslackexpgen, SCIP_SepaData::posslackexpgenfactor, result, SCIP_SepaData::round, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), and SCIP_SepaData::separationsetting.
◆ GCGincludeSepaBasis()
| SCIP_RETCODE GCGincludeSepaBasis | ( | GCG * | gcg | ) |
creates the basis separator and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 1608 of file sepa_basis.c.
References SCIP_SepaData::chgobj, SCIP_SepaData::chgobjallways, SCIP_SepaData::currentnodenr, SCIP_SepaData::enable, SCIP_SepaData::enableobj, SCIP_SepaData::enableobjround, SCIP_SepaData::enableposslack, SCIP_SepaData::enableppcuts, SCIP_SepaData::enableppobjcg, SCIP_SepaData::enableppobjconss, SCIP_SepaData::forcecuts, SCIP_SepaData::gcg, GCGgetMasterprob(), GCGgetOrigprob(), GCGincludeSepaBasis(), SCIP_SepaData::genobjconvex, SCIP_SepaData::mastercuts, masterprob, SCIP_SepaData::maxcuts, SCIP_SepaData::maxnewcuts, SCIP_SepaData::maxrounds, SCIP_SepaData::maxroundsroot, SCIP_SepaData::mincuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, SCIP_SepaData::objconvex, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, origprob, SCIP_SepaData::posslackexp, SCIP_SepaData::posslackexpgen, SCIP_SepaData::posslackexpgenfactor, SCIP_SepaData::round, SCIP_CALL(), SEPA_DELAY, SEPA_DESC, SEPA_FREQ, SEPA_MAXBOUNDDIST, SEPA_NAME, SEPA_PRIORITY, SEPA_USESSUBSCIP, sepaCopyBasis, sepaExecsolBasis, and SCIP_SepaData::separationsetting.
Referenced by GCGincludeMasterPlugins(), and GCGincludeSepaBasis().
◆ GCGsepaBasisGetOrigcuts()
returns the array of original cuts saved in the separator data
- Parameters
-
gcg GCG data structure
Definition at line 1702 of file sepa_basis.c.
References assert(), GCGgetMasterprob(), GCGsepaBasisGetOrigcuts(), SCIP_SepaData::origcuts, and SEPA_NAME.
Referenced by GCGsepaBasisGetOrigcuts().
◆ GCGsepaBasisGetNOrigcuts()
| int GCGsepaBasisGetNOrigcuts | ( | GCG * | gcg | ) |
returns the number of original cuts saved in the separator data
- Parameters
-
gcg GCG data structure
Definition at line 1721 of file sepa_basis.c.
References assert(), GCGgetMasterprob(), GCGsepaBasisGetNOrigcuts(), SCIP_SepaData::norigcuts, and SEPA_NAME.
Referenced by GCGsepaBasisGetNOrigcuts().
◆ GCGsepaBasisGetMastercuts()
returns the array of master cuts saved in the separator data
- Parameters
-
gcg GCG data structure
Definition at line 1740 of file sepa_basis.c.
References assert(), GCGgetMasterprob(), GCGsepaBasisGetMastercuts(), SCIP_SepaData::mastercuts, and SEPA_NAME.
Referenced by GCGsepaBasisGetMastercuts().
◆ GCGsepaBasisGetNMastercuts()
| int GCGsepaBasisGetNMastercuts | ( | GCG * | gcg | ) |
returns the number of master cuts saved in the separator data
- Parameters
-
gcg GCG data structure
Definition at line 1759 of file sepa_basis.c.
References assert(), GCGgetMasterprob(), GCGsepaBasisGetNMastercuts(), SCIP_SepaData::nmastercuts, and SEPA_NAME.
Referenced by GCGsepaBasisGetNMastercuts().
◆ GCGsepaBasisAddPricingCut()
| SCIP_RETCODE GCGsepaBasisAddPricingCut | ( | GCG * | gcg, |
| int | ppnumber, | ||
| SCIP_ROW * | cut ) |
transforms cut in pricing variables to cut in original variables and adds it to newcuts array
- Parameters
-
gcg GCG data structure ppnumber number of pricing problem cut cut to be added
Definition at line 1778 of file sepa_basis.c.
References assert(), SCIP_SepaData::enableppcuts, ensureSizeNewCuts(), SCIP_SepaData::gcg, GCGgetMasterprob(), GCGgetNIdenticalBlocks(), GCGgetOrigprob(), GCGgetPricingprob(), GCGpricingVarGetOrigvars(), GCGsepaBasisAddPricingCut(), GCGvarIsPricing(), i, j, masterprob, SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, nvars, origprob, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), SEPA_NAME, and var.
Referenced by GCGsepaBasisAddPricingCut(), and ObjPricerGcg::pricingLoop().
◆ SCIPsepaBasisAddPPObjConss()
| SCIP_RETCODE SCIPsepaBasisAddPPObjConss | ( | GCG * | gcg, |
| int | ppnumber, | ||
| SCIP_Real | dualsolconv, | ||
| SCIP_Bool | newcuts ) |
add cuts which are due to the latest objective function of the pricing problems (reduced cost non-negative)
- Parameters
-
gcg GCG data structure ppnumber number of pricing problem dualsolconv dual solution corresponding to convexity constraint newcuts add cut to newcuts in sepadata? (otherwise add it just to the cutpool)
Definition at line 1889 of file sepa_basis.c.
References addPPObjConss(), GCGgetMasterprob(), SCIP_CALL(), SCIPsepaBasisAddPPObjConss(), and SEPA_NAME.
Referenced by ObjPricerGcg::pricingLoop(), and SCIPsepaBasisAddPPObjConss().