GCG 4.1.1 (dev)

Generic Column Generation

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

Detailed Description

gcg solver for pricing problem

Author
Erik Muehmer

Definition in file solver_gcg.cpp.

#include "scip/scip.h"
#include "gcg/gcg.h"
#include "gcg/objpricer_gcg.h"
#include "gcg/solver_gcg.h"
#include "gcg/gcgplugins.h"
#include "gcg/struct_solver.h"
#include "gcg/solver_mip.h"
#include "gcg/cons_decomp.h"
#include "gcg/cons_decomp.hpp"
#include "gcg/pub_solver.h"
#include "gcg/pricer_gcg.h"
#include "gcg/relax_gcg.h"
#include "gcg/cons_origbranch.h"
#include "gcg/class_partialdecomp.h"
#include "scip/scip_timing.h"
#include "gcg/struct_decomp.h"
#include "gcg/class_detprobdata.h"
#include "gcg/pub_gcg.hpp"

Go to the source code of this file.

Data Structures

struct  GCG_SolverData

Macros

#define SUBGCG_DEBUG_ITER   -1
#define SOLVER_NAME   "gcg"
#define SOLVER_DESC   "gcg solver for pricing problems"
#define SOLVER_PRIORITY   110
#define SOLVER_ENABLED   TRUE
#define SOLVER_HEU_ENABLED   TRUE
#define DEFAULT_MAX_RECURSION_DEPTH   0
#define DEFAULT_CHECKSOLS   TRUE
#define DEFAULT_STARTNODELIMIT   1000LL
#define DEFAULT_STARTSTALLNODELIMIT   100LL
#define DEFAULT_STARTGAPLIMIT   0.2
#define DEFAULT_STARTSOLLIMIT   10
#define DEFAULT_NODELIMITFAC   1.25
#define DEFAULT_STALLNODELIMITFAC   1.25
#define DEFAULT_GAPLIMITFAC   0.8
#define DEFAULT_SOLLIMITFAC   1.5
#define DEFAULT_SETTINGSFILE   "-"
#define DEFAULT_PRESOL_MAX_ROUNDS   0
#define DEFAULT_ENABLE_WARNINGS   FALSE
#define solverInitGcg   NULL
#define solverExitGcg   NULL

Functions

static SCIP_RETCODE solverGcgPrepareNestedSolver (GCG_SOLVERDATA *solverdata, GCG_SOLVER *nestedsolver)
static SCIP_RETCODE adjustSettings (GCG_SOLVERDATA *solverdata, SCIP *pricingprob, GCG *subgcg, SCIP *subgcgorig)
static SCIP_RETCODE buildProblem (GCG *gcg, GCG_SOLVERDATA *solverdata, SCIP *pricingprob, int probnr)
static SCIP_RETCODE updateVars (SCIP *scip, GCG_SOLVERDATA *solverdata, SCIP *pricingprob, int probnr, SCIP_Bool varobjschanged, SCIP_Bool varbndschanged)
static SCIP_RETCODE updateBranchingConss (SCIP *scip, GCG_SOLVERDATA *solverdata, SCIP *pricingprob, int probnr)
static SCIP_RETCODE solveProblem (GCG *gcg, SCIP *pricingprob, GCG *subgcg, int probnr, GCG_SOLVERDATA *solverdata, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status)
static GCG_DECL_SOLVERFREE (solverFreeGcg)
static SCIP_RETCODE freeBlockMemory (GCG *gcg, GCG_SOLVERDATA *solverdata)
static GCG_DECL_SOLVERINITSOL (solverInitsolGcg)
static GCG_DECL_SOLVEREXITSOL (solverExitsolGcg)
static GCG_DECL_SOLVERSOLVE (solverSolveGcg)
static GCG_DECL_SOLVERSOLVEHEUR (solverSolveHeurGcg)
static GCG_DECL_SOLVERUPDATE (solverUpdateGcg)
SCIP_RETCODE GCGincludeSolverGcg (GCG *gcg)

Macro Definition Documentation

◆ SUBGCG_DEBUG_ITER

#define SUBGCG_DEBUG_ITER   -1

Definition at line 41 of file solver_gcg.cpp.

Referenced by solveProblem().

◆ SOLVER_NAME

#define SOLVER_NAME   "gcg"

Definition at line 66 of file solver_gcg.cpp.

◆ SOLVER_DESC

#define SOLVER_DESC   "gcg solver for pricing problems"

Definition at line 67 of file solver_gcg.cpp.

◆ SOLVER_PRIORITY

#define SOLVER_PRIORITY   110

Definition at line 68 of file solver_gcg.cpp.

◆ SOLVER_ENABLED

#define SOLVER_ENABLED   TRUE

indicates whether the exact solving method of the solver should be enabled

Definition at line 70 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

◆ SOLVER_HEU_ENABLED

#define SOLVER_HEU_ENABLED   TRUE

indicates whether the heuristic solving method of the solver should be enabled

Definition at line 71 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

◆ DEFAULT_MAX_RECURSION_DEPTH

#define DEFAULT_MAX_RECURSION_DEPTH   0

Definition at line 73 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

◆ DEFAULT_CHECKSOLS

#define DEFAULT_CHECKSOLS   TRUE

should solutions be checked extensively

Definition at line 74 of file solver_gcg.cpp.

◆ DEFAULT_STARTNODELIMIT

#define DEFAULT_STARTNODELIMIT   1000LL

start node limit for heuristic pricing

Definition at line 75 of file solver_gcg.cpp.

◆ DEFAULT_STARTSTALLNODELIMIT

#define DEFAULT_STARTSTALLNODELIMIT   100LL

start stalling node limit for heuristic pricing

Definition at line 76 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg(), and GCGincludeSolverMip().

◆ DEFAULT_STARTGAPLIMIT

#define DEFAULT_STARTGAPLIMIT   0.2

start gap limit for heuristic pricing

Definition at line 77 of file solver_gcg.cpp.

◆ DEFAULT_STARTSOLLIMIT

#define DEFAULT_STARTSOLLIMIT   10

start solution limit for heuristic pricing

Definition at line 78 of file solver_gcg.cpp.

◆ DEFAULT_NODELIMITFAC

#define DEFAULT_NODELIMITFAC   1.25

factor by which to increase node limit for heuristic pricing

Definition at line 79 of file solver_gcg.cpp.

◆ DEFAULT_STALLNODELIMITFAC

#define DEFAULT_STALLNODELIMITFAC   1.25

factor by which to increase stalling node limit for heuristic pricing

Definition at line 80 of file solver_gcg.cpp.

◆ DEFAULT_GAPLIMITFAC

#define DEFAULT_GAPLIMITFAC   0.8

factor by which to decrease gap limit for heuristic pricing

Definition at line 81 of file solver_gcg.cpp.

◆ DEFAULT_SOLLIMITFAC

#define DEFAULT_SOLLIMITFAC   1.5

factor by which to increase solution limit for heuristic pricing

Definition at line 82 of file solver_gcg.cpp.

◆ DEFAULT_SETTINGSFILE

#define DEFAULT_SETTINGSFILE   "-"

settings file to be applied in pricing problems

Definition at line 83 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg(), and GCGincludeSolverMip().

◆ DEFAULT_PRESOL_MAX_ROUNDS

#define DEFAULT_PRESOL_MAX_ROUNDS   0

default maximal number of presolving rounds

Definition at line 84 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

◆ DEFAULT_ENABLE_WARNINGS

#define DEFAULT_ENABLE_WARNINGS   FALSE

should warnings (of pricing problems) be enabled by default

Definition at line 85 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg(), and GCGincludeSolverMip().

◆ solverInitGcg

#define solverInitGcg   NULL

initialization method of pricing solver (called after problem was transformed and solver is active)

Definition at line 929 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

◆ solverExitGcg

#define solverExitGcg   NULL

deinitialization method of pricing solver (called before transformed problem is freed and solver is active)

Definition at line 932 of file solver_gcg.cpp.

Referenced by GCGincludeSolverGcg().

Function Documentation

◆ solverGcgPrepareNestedSolver()

◆ adjustSettings()

SCIP_RETCODE adjustSettings ( GCG_SOLVERDATA * solverdata,
SCIP * pricingprob,
GCG * subgcg,
SCIP * subgcgorig )
static

adjusts settings of the gcg instance used to solve a given pricing problem

Parameters
solverdatasolver data structure
pricingprobpricing problem
subgcgsubgcg data structure
subgcgorigsubgcg origprob

Definition at line 173 of file solver_gcg.cpp.

References adjustSettings(), GCG_SolverData::presolmaxrounds, and SCIP_CALL().

Referenced by adjustSettings(), and buildProblem().

◆ buildProblem()

◆ updateVars()

SCIP_RETCODE updateVars ( SCIP * scip,
GCG_SOLVERDATA * solverdata,
SCIP * pricingprob,
int probnr,
SCIP_Bool varobjschanged,
SCIP_Bool varbndschanged )
static

updates bounds and objective coefficients of variables in the given pricing problem

Parameters
scipSCIP data structure
solverdatasolver data structure
pricingprobpricing problem
probnrproblem number
varobjschangedhave the objective coefficients changed?
varbndschangedhave the lower and upper bounds changed?

Definition at line 401 of file solver_gcg.cpp.

References assert(), GCGgetOrigprob(), i, nvars, GCG_SolverData::subgcgs, GCG_SolverData::translatesymmetry, updateVars(), var, GCG_SolverData::varmaps, and vars.

Referenced by GCG_DECL_SOLVERUPDATE(), and updateVars().

◆ updateBranchingConss()

SCIP_RETCODE updateBranchingConss ( SCIP * scip,
GCG_SOLVERDATA * solverdata,
SCIP * pricingprob,
int probnr )
static

updates branching constraints in the given pricing problem

Parameters
scipSCIP data structure
solverdatasolver data structure
pricingprobpricing problem
probnrproblem number

Definition at line 473 of file solver_gcg.cpp.

References c, GCGgetOrigprob(), GCG_SolverData::nbasicpricingconss, SCIP_CALL(), GCG_SolverData::subgcgs, updateBranchingConss(), and GCG_SolverData::varmaps.

Referenced by GCG_DECL_SOLVERUPDATE(), and updateBranchingConss().

◆ solveProblem()

SCIP_RETCODE solveProblem ( GCG * gcg,
SCIP * pricingprob,
GCG * subgcg,
int probnr,
GCG_SOLVERDATA * solverdata,
SCIP_Real * lowerbound,
GCG_PRICINGSTATUS * status )
static

◆ GCG_DECL_SOLVERFREE()

GCG_DECL_SOLVERFREE ( solverFreeGcg )
static

destructor of pricing solver to free user data (called when SCIP is exiting)

Definition at line 747 of file solver_gcg.cpp.

References assert(), GCG_DECL_SOLVERFREE, GCGgetDwMasterprob(), GCGsolverGetData(), GCGsolverSetData(), and SCIPfreeMemory().

◆ freeBlockMemory()

◆ GCG_DECL_SOLVERINITSOL()

◆ GCG_DECL_SOLVEREXITSOL()

GCG_DECL_SOLVEREXITSOL ( solverExitsolGcg )
static

solving process deinitialization method of pricing solver (called before branch and bound process data is freed)

Definition at line 897 of file solver_gcg.cpp.

References assert(), GCG_SolverData::count, GCG_SolverData::depth, freeBlockMemory(), GCG_DECL_SOLVEREXITSOL, GCGgetOrigprob(), GCGsolverGetData(), GCG_SolverData::origprob, and SCIP_CALL().

◆ GCG_DECL_SOLVERSOLVE()

GCG_DECL_SOLVERSOLVE ( solverSolveGcg )
static

◆ GCG_DECL_SOLVERSOLVEHEUR()

◆ GCG_DECL_SOLVERUPDATE()

◆ GCGincludeSolverGcg()

SCIP_RETCODE GCGincludeSolverGcg ( GCG * gcg)

creates the most infeasible LP braching rule and includes it in SCIP

creates the xyz solver for pricing problems and includes it in GCG

Parameters
gcgGCG data structure

Definition at line 1149 of file solver_gcg.cpp.

References GCG_SolverData::checksols, GCG_SolverData::count, DEFAULT_CHECKSOLS, DEFAULT_ENABLE_WARNINGS, DEFAULT_GAPLIMITFAC, DEFAULT_MAX_RECURSION_DEPTH, DEFAULT_NODELIMITFAC, DEFAULT_PRESOL_MAX_ROUNDS, DEFAULT_SETTINGSFILE, DEFAULT_SOLLIMITFAC, DEFAULT_STALLNODELIMITFAC, DEFAULT_STARTGAPLIMIT, DEFAULT_STARTNODELIMIT, DEFAULT_STARTSOLLIMIT, DEFAULT_STARTSTALLNODELIMIT, GCG_SolverData::depth, GCG_SolverData::enablewarnings, GCG_SolverData::gaplimitfac, GCGgetDwMasterprob(), GCGgetOrigprob(), GCGincludeSolverGcg(), GCGpricerIncludeSolver(), GCG_SolverData::masterprob, masterprob, GCG_SolverData::maxdepth, GCG_SolverData::nbasicpricingconss, GCG_SolverData::nodelimitfac, GCG_SolverData::npricingprobs, GCG_SolverData::nrelpricingprobs, GCG_SolverData::origprob, origprob, GCG_SolverData::presolmaxrounds, GCG_SolverData::relpricingprobidxs, SCIP_CALL(), GCG_SolverData::settingsfile, GCG_SolverData::sollimitfac, SOLVER_DESC, SOLVER_ENABLED, SOLVER_HEU_ENABLED, SOLVER_NAME, SOLVER_PRIORITY, solverExitGcg, solverInitGcg, GCG_SolverData::stallnodelimitfac, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, GCG_SolverData::startstallnodelimit, GCG_SolverData::subgcgs, GCG_SolverData::translatesymmetry, and GCG_SolverData::varmaps.

Referenced by GCGincludeMasterPlugins(), and GCGincludeSolverGcg().