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.
◆ 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.
◆ SEPA_PRIORITY
| #define SEPA_PRIORITY 100 |
Definition at line 60 of file sepa_basis.c.
◆ SEPA_FREQ
| #define SEPA_FREQ 0 |
Definition at line 61 of file sepa_basis.c.
◆ SEPA_MAXBOUNDDIST
| #define SEPA_MAXBOUNDDIST 1.0 |
Definition at line 62 of file sepa_basis.c.
◆ SEPA_USESSUBSCIP
| #define SEPA_USESSUBSCIP FALSE |
does the separator use a secondary SCIP instance?
Definition at line 63 of file sepa_basis.c.
◆ 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.
◆ 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.
◆ sepaExecsolBasis
| #define sepaExecsolBasis NULL |
arbitrary primal solution separation method of separator
Definition at line 1601 of file sepa_basis.c.
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 SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::norigcuts, NULL, SCIP_SepaData::origcuts, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by 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 SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addPPObjConss(), 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 SCIP_Real.
Referenced by chgProbingObjUsingRows(), 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 SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarObjProbing(), SCIPgetNVars(), SCIPgetVars(), SCIPinProbing(), and SCIPvarGetObj().
Referenced by initConvObj().
◆ 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 SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarObjProbing(), SCIPgetNVars(), SCIPgetVarObjProbing(), SCIPgetVars(), SCIPinProbing(), and SCIPvarGetObj().
Referenced by 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 SCIP_SepaData::enableposslack, exponentiate(), MAX, MIN, SCIP_SepaData::posslackexp, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarObjProbing(), SCIPgetNVars(), SCIPgetSolVal(), SCIPgetVars(), SCIPinfinity(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFeasPositive(), SCIPisGT(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetObj(), and SCIPvarGetUbLocal().
Referenced by initConvObj().
◆ 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 SCIP_SepaData::enableposslack, exponentiate(), MAX, MIN, NULL, SCIP_SepaData::objrow, SCIP_SepaData::posslackexp, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPchgVarObjProbing(), SCIPcolGetVar(), SCIPfreeBufferArray, SCIPgetLPRows(), SCIPgetNLPRows(), SCIPgetNVars(), SCIPgetRowSolActivity(), SCIPgetVarObjProbing(), SCIPinfinity(), SCIPinProbing(), SCIPisCutEfficacious(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFeasPositive(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIProwGetCols(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetNorm(), SCIProwGetRhs(), and SCIProwGetVals().
Referenced by 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 ensureSizeNewCuts(), FALSE, GCGgetNIdenticalBlocks(), GCGgetOrigprob(), GCGgetPricingprob(), GCGisPricingprobRelevant(), GCGpricingVarGetOrigvars(), GCGvarIsPricing(), SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddPoolCut(), SCIPaddRowProbing(), SCIPaddVarToRow(), SCIPcaptureRow(), SCIPcreateEmptyRowUnspec(), SCIPdebugMessage, SCIPgetNOrigVars(), SCIPgetOrigVars(), SCIPinfinity(), SCIPisEQ(), SCIPreleaseRow(), SCIPsepaGetData(), SCIPsepaGetNCalls(), SCIPsnprintf(), SCIPvarGetObj(), and TRUE.
Referenced by 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 NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPsepaGetData().
◆ SCIP_DECL_SEPAINIT()
|
static |
initialization method of separator (called after problem was transformed)
Definition at line 828 of file sepa_basis.c.
References SCIP_SepaData::enable, SCIP_SepaData::enableobj, FALSE, SCIP_SepaData::gcg, GCGgetOrigprob(), SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, NULL, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddVarToRow(), SCIPallocBlockMemoryArray, SCIPcalcMemGrowSize(), SCIPcreateEmptyRowUnspec(), SCIPdebugMessage, SCIPgetNVars(), SCIPgetVars(), SCIPinfinity(), SCIPsepaGetData(), SCIPsnprintf(), SCIPvarGetObj(), STARTMAXCUTS, and TRUE.
◆ SCIP_DECL_SEPAEXIT()
|
static |
deinitialization method of separator (called before transformed problem is freed)
Definition at line 895 of file sepa_basis.c.
References SCIP_SepaData::enableobj, SCIP_SepaData::gcg, GCGgetOrigprob(), SCIP_SepaData::mastercuts, SCIP_SepaData::maxcuts, SCIP_SepaData::maxnewcuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, NULL, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemoryArrayNull, SCIPreleaseRow(), and SCIPsepaGetData().
◆ 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 SCIP_SepaData::nmastercuts, NULL, SCIP_OKAY, and SCIPsepaGetData().
◆ 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 SCIP_SepaData::gcg, GCGgetOrigprob(), SCIP_SepaData::mastercuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::norigcuts, NULL, SCIP_CALL, SCIP_OKAY, SCIPreleaseRow(), and SCIPsepaGetData().
◆ 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 SCIP_SepaData::objconvex, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPwarningMessage().
Referenced by 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, FALSE, initProbingObjUsingVarBounds(), initProbingObjWithOrigObj(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetObjNorm(), SCIPisEQ(), SCIPisGT(), SCIPisLT(), and TRUE.
Referenced by SCIP_DECL_SEPAEXECLP().
◆ SCIP_DECL_SEPAEXECLP()
|
static |
LP solution separation method of separator
Definition at line 1049 of file sepa_basis.c.
References addPPObjConss(), SCIP_SepaData::chgobj, SCIP_SepaData::chgobjallways, SCIP_SepaData::currentnodenr, SCIP_SepaData::enable, SCIP_SepaData::enableobj, SCIP_SepaData::enableobjround, SCIP_SepaData::enableposslack, SCIP_SepaData::enableppobjconss, ensureSizeCuts(), ensureSizeNewCuts(), FALSE, SCIP_SepaData::forcecuts, SCIP_SepaData::gcg, GCGgetNPricingprobs(), GCGgetNRelPricingprobs(), GCGgetOrigprob(), GCGrelaxGetCurrentOrigSol(), GCGrelaxIsOrigSolFeasible(), GCGrelaxUpdateCurrentSol(), GCGsepaAddOriginalSepaCuts(), GCGsepaGetNOriginalSepaCuts(), GCGsepaGetOriginalSepaOrigcuts(), GCGsepaOriginalSepaOrigcutExists(), GCGsetPricingObjs(), GCGtransformOrigvalsToMastervals(), GCGvarIsOriginal(), SCIP_SepaData::genobjconvex, initConvObj(), initGenconv(), SCIP_SepaData::mastercuts, SCIP_SepaData::maxrounds, SCIP_SepaData::maxroundsroot, SCIP_SepaData::mincuts, SCIP_SepaData::newcuts, SCIP_SepaData::nmastercuts, SCIP_SepaData::nnewcuts, SCIP_SepaData::norigcuts, NULL, SCIP_SepaData::objconvex, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_SepaData::posslackexp, SCIP_SepaData::posslackexpgen, SCIP_SepaData::posslackexpgenfactor, SCIP_SepaData::round, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_Longint, SCIP_LPSOLSTAT_NOTSOLVED, SCIP_LPSOLSTAT_OBJLIMIT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXSTRLEN, SCIP_NEWROUND, SCIP_OKAY, SCIP_PARAMSETTING_OFF, SCIP_Real, SCIP_REAL_MIN, SCIP_ROWORIGINTYPE_SEPA, SCIP_SEPARATED, SCIPaddPoolCut(), SCIPaddRow(), SCIPaddRowProbing(), SCIPaddVarsToRow(), SCIPallocBufferArray, SCIPapplyCutsProbing(), SCIPcaptureRow(), SCIPceil(), SCIPchgRowLhs(), SCIPchgRowRhs(), SCIPclearCuts(), SCIPcolGetVar(), SCIPconstructLP(), SCIPcreateEmptyRowSepa(), SCIPdebugMessage, SCIPendProbing(), SCIPfreeBufferArray, SCIPgetCurrentNode(), SCIPgetCuts(), SCIPgetDelayedGlobalCutpool(), SCIPgetGlobalCutpool(), SCIPgetIntParam(), SCIPgetLPBranchCands(), SCIPgetLPObjval(), SCIPgetLPRows(), SCIPgetLPSolstat(), SCIPgetNCuts(), SCIPgetNLPCols(), SCIPgetNLPRows(), SCIPgetNVars(), SCIPgetRootNode(), SCIPgetSolTransObj(), SCIPgetVars(), SCIPinfinity(), SCIPisCutEfficacious(), SCIPisInfinity(), SCIPisObjIntegral(), SCIPnewProbingNode(), SCIPnodeGetNumber(), SCIPrelDiff(), SCIPreleaseRow(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetOrigintype(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIPsepaGetData(), SCIPseparateSol(), SCIPseparateSolCutpool(), SCIPsetIntParam(), SCIPsetSeparating(), SCIPsnprintf(), SCIPsolveProbingLP(), SCIPstartProbing(), SCIPwarningMessage(), SCIP_SepaData::separationsetting, and TRUE.
◆ 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, FALSE, SCIP_SepaData::forcecuts, SCIP_SepaData::gcg, GCGgetMasterprob(), GCGgetOrigprob(), SCIP_SepaData::genobjconvex, SCIP_SepaData::mastercuts, 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, NULL, SCIP_SepaData::objconvex, SCIP_SepaData::objrow, SCIP_SepaData::origcuts, SCIP_SepaData::posslackexp, SCIP_SepaData::posslackexpgen, SCIP_SepaData::posslackexpgenfactor, SCIP_SepaData::round, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPaddRealParam(), SCIPallocBlockMemory, SCIPepsilon(), SCIPincludeSepa(), SCIPinfinity(), SEPA_DELAY, SEPA_DESC, SEPA_FREQ, SEPA_MAXBOUNDDIST, SEPA_NAME, SEPA_PRIORITY, SEPA_USESSUBSCIP, sepaCopyBasis, sepaExecsolBasis, SCIP_SepaData::separationsetting, and TRUE.
Referenced by GCGincludeMasterPlugins().
◆ 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 GCGgetMasterprob(), NULL, SCIP_SepaData::origcuts, SCIPfindSepa(), SCIPsepaGetData(), and SEPA_NAME.
◆ 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 GCGgetMasterprob(), SCIP_SepaData::norigcuts, NULL, SCIPfindSepa(), SCIPsepaGetData(), and SEPA_NAME.
◆ 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 GCGgetMasterprob(), SCIP_SepaData::mastercuts, NULL, SCIPfindSepa(), SCIPsepaGetData(), and SEPA_NAME.
◆ 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 GCGgetMasterprob(), SCIP_SepaData::nmastercuts, NULL, SCIPfindSepa(), SCIPsepaGetData(), and SEPA_NAME.
◆ 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 SCIP_SepaData::enableppcuts, ensureSizeNewCuts(), FALSE, SCIP_SepaData::gcg, GCGgetMasterprob(), GCGgetNIdenticalBlocks(), GCGgetOrigprob(), GCGgetPricingprob(), GCGpricingVarGetOrigvars(), GCGvarIsPricing(), SCIP_SepaData::newcuts, SCIP_SepaData::nnewcuts, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddVarToRow(), SCIPallocBufferArray, SCIPcaptureRow(), SCIPcolGetVar(), SCIPcreateEmptyRowUnspec(), SCIPdebugMessage, SCIPerrorMessage, SCIPfindSepa(), SCIPfreeBufferArray, SCIPinfinity(), SCIPisInfinity(), SCIPreleaseRow(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIPsepaGetData(), SCIPsepaGetNCalls(), SCIPsnprintf(), SEPA_NAME, and TRUE.
Referenced by 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(), FALSE, GCGgetMasterprob(), NULL, SCIP_CALL, SCIP_OKAY, SCIPerrorMessage, SCIPfindSepa(), and SEPA_NAME.
Referenced by ObjPricerGcg::pricingLoop().