GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
score_strong.cpp File Reference

Detailed Description

strong score

Author
Jurgen Lentz

Definition in file score_strong.cpp.

#include <sstream>
#include <scip/scipdefplugins.h>
#include "gcg/class_partialdecomp.h"
#include "gcg/class_detprobdata.h"
#include "gcg/cons_decomp.h"
#include "gcg/cons_decomp.hpp"
#include "gcg/scip_misc.h"
#include "gcg/score.h"
#include "gcg/score_strong.h"

Go to the source code of this file.

Data Structures

struct  GCG_ScoreData

Macros

#define SCORE_NAME   "strong decomposition score"
#define SCORE_SHORTNAME   "strong"
#define SCORE_DESC   "strong decomposition score"
#define DEFAULT_STRONGTIMELIMIT   30.
#define DEFAULT_DUALVALRANDOMMETHOD   1
#define DEFAULT_COEFFACTORORIGVSRANDOM   0.5
#define DEFAULT_SCORECOEF_FASTBENEFICIAL   1.
#define DEFAULT_SCORECOEF_MEDIUMBENEFICIAL   0.75
#define DEFAULT_SCORECOEF_FASTNOTBENEFICIAL   0.3
#define DEFAULT_SCORECOEF_MEDIUMNOTBENEFICIAL   0.1
#define DEFAULT_RANDPARTIALDEC   23

Functions

static SCIP_RETCODE shuffleDualvalsRandom (GCG *gcg, GCG_SCORE *score, SCIP_Bool transformed)
 method that shuffles randomly and set dual variable values, used for strong detection score
static SCIP_Real getDualvalRandom (GCG *gcg, GCG_SCORE *score, int consindex, SCIP_Bool transformed)
 return the a random value of the dual variable of the corresponding ; if it is not calculated yet it will be calculated
static SCIP_RETCODE calculateDualvalsOptimalOrigLP (GCG *gcg, GCG_SCORE *score, SCIP_Bool transformed)
 method to calculate and set the optimal dual values from original lp, used for strong detection score
static SCIP_Real getDualvalOptimalLP (GCG *gcg, GCG_SCORE *score, int consindex, SCIP_Bool transformed)
 returns the value of the optimal lp relaxation dual value of the given constrainr rid correspondoning problem of the detprobdata; if it is not calculated yet it will be calculated
static SCIP_RETCODE setTestpricingProblemParameters (SCIP *scip, int clocktype, SCIP_Real infinity, SCIP_Real epsilon, SCIP_Real sumepsilon, SCIP_Real feastol, SCIP_Real lpfeastolfactor, SCIP_Real dualfeastol, SCIP_Bool enableppcuts, SCIP_Real timelimit)
 sets the pricing problem parameters
static SCIP_RETCODE createTestPricingprobConss (SCIP *scip, SCIP *subscip, gcg::PARTIALDECOMP *partialdec, int block, SCIP_HASHMAP *hashorig2pricingvar)
 creates the pricing problem constraints
static GCG_DECL_SCOREFREE (scoreFreeStrong)
static GCG_DECL_SCORECALC (scoreCalcStrong)
SCIP_RETCODE GCGincludeScoreStrongDecomp (GCG *gcg)

Macro Definition Documentation

◆ SCORE_NAME

#define SCORE_NAME   "strong decomposition score"

Definition at line 50 of file score_strong.cpp.

◆ SCORE_SHORTNAME

#define SCORE_SHORTNAME   "strong"

Definition at line 51 of file score_strong.cpp.

◆ SCORE_DESC

#define SCORE_DESC   "strong decomposition score"

Definition at line 52 of file score_strong.cpp.

◆ DEFAULT_STRONGTIMELIMIT

#define DEFAULT_STRONGTIMELIMIT   30.

timelimit for strong decompotition score calculation per partialdec

Definition at line 54 of file score_strong.cpp.

Referenced by GCGincludeScoreStrongDecomp().

◆ DEFAULT_DUALVALRANDOMMETHOD

#define DEFAULT_DUALVALRANDOMMETHOD   1

default value for method to dual initialization of dual values for strong decomposition: 1) naive, 2) expected equal, 3) expected overestimation

Definition at line 55 of file score_strong.cpp.

Referenced by GCGincludeScoreStrongDecomp().

◆ DEFAULT_COEFFACTORORIGVSRANDOM

#define DEFAULT_COEFFACTORORIGVSRANDOM   0.5

default value for convex coefficient for orig dual val (1-this coef is factor for random dual value)

Definition at line 56 of file score_strong.cpp.

Referenced by GCGincludeScoreStrongDecomp().

◆ DEFAULT_SCORECOEF_FASTBENEFICIAL

#define DEFAULT_SCORECOEF_FASTBENEFICIAL   1.

coefficient for fast & beneficial in strong decomposition score computation

Definition at line 58 of file score_strong.cpp.

Referenced by GCG_DECL_SCORECALC().

◆ DEFAULT_SCORECOEF_MEDIUMBENEFICIAL

#define DEFAULT_SCORECOEF_MEDIUMBENEFICIAL   0.75

coefficient for not fast but beneficial in strong decomposition score computation

Definition at line 59 of file score_strong.cpp.

Referenced by GCG_DECL_SCORECALC().

◆ DEFAULT_SCORECOEF_FASTNOTBENEFICIAL

#define DEFAULT_SCORECOEF_FASTNOTBENEFICIAL   0.3

coefficient for fast & not beneficial in strong decomposition score computation

Definition at line 60 of file score_strong.cpp.

Referenced by GCG_DECL_SCORECALC().

◆ DEFAULT_SCORECOEF_MEDIUMNOTBENEFICIAL

#define DEFAULT_SCORECOEF_MEDIUMNOTBENEFICIAL   0.1

coefficient for not & not beneficial in strong decomposition score computation

Definition at line 61 of file score_strong.cpp.

Referenced by GCG_DECL_SCORECALC().

◆ DEFAULT_RANDPARTIALDEC

#define DEFAULT_RANDPARTIALDEC   23

initial random partialdec

Definition at line 62 of file score_strong.cpp.

Referenced by shuffleDualvalsRandom().

Typedef Documentation

◆ GCG_RANDOM_DUAL_METHOD

Definition at line 85 of file score_strong.cpp.

Enumeration Type Documentation

◆ GCG_Random_dual_methods

Enumerator
GCG_RANDOM_DUAL_NAIVE 
GCG_RANDOM_DUAL_EXPECTED_EQUAL 
GCG_RANDOM_DUAL_EXPECTED_OVERESTIMATE 

Definition at line 79 of file score_strong.cpp.

Function Documentation

◆ shuffleDualvalsRandom()

SCIP_RETCODE shuffleDualvalsRandom ( GCG * gcg,
GCG_SCORE * score,
SCIP_Bool transformed )
static

method that shuffles randomly and set dual variable values, used for strong detection score

Returns
scip return code
Parameters
gcgGCG data structure
scorescore
transformedwhether the problem is tranformed yet

Definition at line 98 of file score_strong.cpp.

References c, DEFAULT_RANDPARTIALDEC, GCG_ScoreData::dualvalsrandom, GCG_RANDOM_DUAL_EXPECTED_EQUAL, GCG_RANDOM_DUAL_EXPECTED_OVERESTIMATE, GCG_RANDOM_DUAL_NAIVE, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), GCGconsGetVals(), GCGconshdlrDecompGetDetprobdataOrig(), GCGconshdlrDecompGetDetprobdataPresolved(), GCGgetOrigprob(), GCGscoreGetData(), gcg::DETPROBDATA::getCons(), gcg::DETPROBDATA::getVar(), SCIP_CALL(), and shuffleDualvalsRandom().

Referenced by getDualvalRandom(), and shuffleDualvalsRandom().

◆ getDualvalRandom()

SCIP_Real getDualvalRandom ( GCG * gcg,
GCG_SCORE * score,
int consindex,
SCIP_Bool transformed )
static

return the a random value of the dual variable of the corresponding ; if it is not calculated yet it will be calculated

Returns
the a random value of the dual variable of the corresponding
Parameters
gcgGCG data structure
scorescore
consindexconsindex index of constraint the value is asked for
transformedis the problem transformed yet

Definition at line 262 of file score_strong.cpp.

References GCG_ScoreData::dualvalsrandom, GCG_ScoreData::dualvalsrandomset, GCGscoreGetData(), getDualvalRandom(), and shuffleDualvalsRandom().

Referenced by GCG_DECL_SCORECALC(), and getDualvalRandom().

◆ calculateDualvalsOptimalOrigLP()

SCIP_RETCODE calculateDualvalsOptimalOrigLP ( GCG * gcg,
GCG_SCORE * score,
SCIP_Bool transformed )
static

method to calculate and set the optimal dual values from original lp, used for strong detection score

Returns
scip return code
Parameters
gcgGCG data structure
scorescore
transformedwhether the problem is transormed yet

Definition at line 283 of file score_strong.cpp.

References assert(), c, calculateDualvalsOptimalOrigLP(), GCG_ScoreData::dualvalsoptimaloriglp, GCGconsGetDualsol(), GCGconshdlrDecompGetDetprobdataOrig(), GCGconshdlrDecompGetDetprobdataPresolved(), GCGgetOrigprob(), GCGscoreGetData(), gcg::DETPROBDATA::getCons(), nvars, and var.

Referenced by calculateDualvalsOptimalOrigLP(), and getDualvalOptimalLP().

◆ getDualvalOptimalLP()

SCIP_Real getDualvalOptimalLP ( GCG * gcg,
GCG_SCORE * score,
int consindex,
SCIP_Bool transformed )
static

returns the value of the optimal lp relaxation dual value of the given constrainr rid correspondoning problem of the detprobdata; if it is not calculated yet it will be calculated

Returns
the value of the optimal lp relaxation dual value of the given constraint rid correspondoning problem of the detprobdata
Parameters
gcgGCG data structure
scorescore
consindexconsindex index of constraint the value is asked for
transformedis the problem transformed yet

Definition at line 399 of file score_strong.cpp.

References calculateDualvalsOptimalOrigLP(), GCG_ScoreData::dualvalsoptimaloriglp, GCG_ScoreData::dualvalsoptimaloriglpcalculated, GCGscoreGetData(), and getDualvalOptimalLP().

Referenced by GCG_DECL_SCORECALC(), and getDualvalOptimalLP().

◆ setTestpricingProblemParameters()

SCIP_RETCODE setTestpricingProblemParameters ( SCIP * scip,
int clocktype,
SCIP_Real infinity,
SCIP_Real epsilon,
SCIP_Real sumepsilon,
SCIP_Real feastol,
SCIP_Real lpfeastolfactor,
SCIP_Real dualfeastol,
SCIP_Bool enableppcuts,
SCIP_Real timelimit )
static

sets the pricing problem parameters

Returns
scip return code
Parameters
scipSCIP data structure of the pricing problem
clocktypeclocktype to use in the pricing problem
infinityvalues larger than this are considered infinity in the pricing problem
epsilonabsolute values smaller than this are considered zero in the pricing problem
sumepsilonabsolute values of sums smaller than this are considered zero in the pricing problem
feastolfeasibility tolerance for constraints in the pricing problem
lpfeastolfactorprimal feasibility tolerance factor of LP solver in the pricing problem
dualfeastolfeasibility tolerance for reduced costs in LP solution in the pricing problem
enableppcutsshould ppcuts be stored for sepa_basis
timelimitlimit of time

Definition at line 419 of file score_strong.cpp.

References assert(), GCG_DECTYPE_UNKNOWN, GCGsetPricingProblemParameters(), SCIP_CALL(), and setTestpricingProblemParameters().

Referenced by GCG_DECL_SCORECALC(), and setTestpricingProblemParameters().

◆ createTestPricingprobConss()

SCIP_RETCODE createTestPricingprobConss ( SCIP * scip,
SCIP * subscip,
gcg::PARTIALDECOMP * partialdec,
int block,
SCIP_HASHMAP * hashorig2pricingvar )
static

creates the pricing problem constraints

Returns
scip return code
Parameters
scipSCIP data structure
subscipthe relaxator data data structure
partialdecpartialdec corresponding to the decomposition to test
blockwhich pricing problem
hashorig2pricingvarhashmap mapping original to corresponding pricing variables

Definition at line 446 of file score_strong.cpp.

References assert(), c, createTestPricingprobConss(), GCGconsGetNVars(), GCGconsGetVars(), gcg::DETPROBDATA::getCons(), gcg::PARTIALDECOMP::getConssForBlock(), gcg::PARTIALDECOMP::getDetprobdata(), gcg::DETPROBDATA::getNConss(), gcg::PARTIALDECOMP::getNConssForBlock(), SCIP_CALL(), SCIPdebugMessage(), and success.

Referenced by createTestPricingprobConss(), and GCG_DECL_SCORECALC().

◆ GCG_DECL_SCOREFREE()

GCG_DECL_SCOREFREE ( scoreFreeStrong )
static

destructor of score to free user data (called when GCG is exiting)

Definition at line 526 of file score_strong.cpp.

References assert(), GCG_ScoreData::dualvalsoptimaloriglp, GCG_ScoreData::dualvalsrandom, GCG_DECL_SCOREFREE, GCGgetOrigprob(), GCGscoreGetData(), GCGscoreGetName(), SCIPfreeMemory(), and SCORE_NAME.

◆ GCG_DECL_SCORECALC()

◆ GCGincludeScoreStrongDecomp()