Scippy

GCG

Branch-and-Price & Column Generation for Everyone

solver_cplex.c File Reference

Detailed Description

cplex solver for pricing problems

Author
Gerald Gamrath
Alexander Gross
Hanna Franzen
Christian Puchert

Definition in file solver_cplex.c.

#include <string.h>
#include "scip/scip.h"
#include "gcg/gcg.h"
#include "gcg/solver_cplex.h"
#include "gcg/pub_solver.h"
#include "gcg/pub_gcgcol.h"
#include "gcg/pricer_gcg.h"
#include "gcg/scip_misc.h"
#include "cplex.h"

Go to the source code of this file.

Data Structures

struct  GCG_SolverData
 

Macros

#define CHECK_ZERO(x)
 
#define CPX_LONG_MAX   9223372036800000000LL
 
#define SOLVER_NAME   "cplex"
 
#define SOLVER_DESC   "cplex solver for pricing problems"
 
#define SOLVER_PRIORITY   20
 
#define SOLVER_HEURENABLED   FALSE
 
#define SOLVER_EXACTENABLED   FALSE
 
#define DEFAULT_CHECKSOLS   TRUE
 
#define DEFAULT_THREADS   1
 
#define DEFAULT_STARTNODELIMIT   1000LL
 
#define DEFAULT_STARTGAPLIMIT   0.2
 
#define DEFAULT_STARTSOLLIMIT   10LL
 
#define DEFAULT_NODELIMITFAC   1.25
 
#define DEFAULT_STALLNODELIMITFAC   1.25
 
#define DEFAULT_GAPLIMITFAC   0.8
 
#define DEFAULT_SOLLIMITFAC   1.5
 
#define solverInitCplex   NULL
 
#define solverExitCplex   NULL
 

Functions

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 solveCplex (GCG *gcg, GCG_SOLVERDATA *solverdata, SCIP *pricingprob, int probnr, SCIP_Real dualsolconv, SCIP_Real *lowerbound, int *ncols, GCG_PRICINGSTATUS *status)
 
static GCG_DECL_SOLVERFREE (solverFreeCplex)
 
static GCG_DECL_SOLVERINITSOL (solverInitsolCplex)
 
static GCG_DECL_SOLVEREXITSOL (solverExitsolCplex)
 
static GCG_DECL_SOLVERUPDATE (solverUpdateCplex)
 
static GCG_DECL_SOLVERSOLVEHEUR (solverSolveHeurCplex)
 
static GCG_DECL_SOLVERSOLVE (solverSolveCplex)
 
SCIP_RETCODE GCGincludeSolverCplex (GCG *gcg)
 

Macro Definition Documentation

◆ CHECK_ZERO

#define CHECK_ZERO (   x)
Value:
{ int _restat_; \
if( (_restat_ = (x)) != 0 ) \
{ \
SCIPerrorMessage("Error in pricing solver: CPLEX returned %d\n", _restat_); \
retval = SCIP_INVALIDRESULT; \
goto TERMINATE; \
} \
}
SCIP_INVALIDRESULT

Definition at line 53 of file solver_cplex.c.

◆ CPX_LONG_MAX

#define CPX_LONG_MAX   9223372036800000000LL

Definition at line 62 of file solver_cplex.c.

◆ SOLVER_NAME

#define SOLVER_NAME   "cplex"

Definition at line 65 of file solver_cplex.c.

◆ SOLVER_DESC

#define SOLVER_DESC   "cplex solver for pricing problems"

Definition at line 66 of file solver_cplex.c.

◆ SOLVER_PRIORITY

#define SOLVER_PRIORITY   20

Definition at line 67 of file solver_cplex.c.

◆ SOLVER_HEURENABLED

#define SOLVER_HEURENABLED   FALSE

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

Definition at line 68 of file solver_cplex.c.

◆ SOLVER_EXACTENABLED

#define SOLVER_EXACTENABLED   FALSE

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

Definition at line 69 of file solver_cplex.c.

◆ DEFAULT_CHECKSOLS

#define DEFAULT_CHECKSOLS   TRUE

should solutions of the pricing MIPs be checked for duplicity?

Definition at line 71 of file solver_cplex.c.

◆ DEFAULT_THREADS

#define DEFAULT_THREADS   1

number of threads the CPLEX pricing solver is allowed to use (0: automatic)

Definition at line 72 of file solver_cplex.c.

◆ DEFAULT_STARTNODELIMIT

#define DEFAULT_STARTNODELIMIT   1000LL

start node limit for heuristic pricing

Definition at line 73 of file solver_cplex.c.

◆ DEFAULT_STARTGAPLIMIT

#define DEFAULT_STARTGAPLIMIT   0.2

start gap limit for heuristic pricing

Definition at line 74 of file solver_cplex.c.

◆ DEFAULT_STARTSOLLIMIT

#define DEFAULT_STARTSOLLIMIT   10LL

start solution limit for heuristic pricing

Definition at line 75 of file solver_cplex.c.

◆ DEFAULT_NODELIMITFAC

#define DEFAULT_NODELIMITFAC   1.25

factor by which to increase node limit for heuristic pricing (1.0: add start limit)

Definition at line 76 of file solver_cplex.c.

◆ DEFAULT_STALLNODELIMITFAC

#define DEFAULT_STALLNODELIMITFAC   1.25

factor by which to increase stalling node limit for heuristic pricing

Definition at line 77 of file solver_cplex.c.

◆ DEFAULT_GAPLIMITFAC

#define DEFAULT_GAPLIMITFAC   0.8

factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit)

Definition at line 78 of file solver_cplex.c.

◆ DEFAULT_SOLLIMITFAC

#define DEFAULT_SOLLIMITFAC   1.5

factor by which to increase solution limit for heuristic pricing (1.0: add start limit)

Definition at line 79 of file solver_cplex.c.

◆ solverInitCplex

#define solverInitCplex   NULL

Definition at line 1072 of file solver_cplex.c.

◆ solverExitCplex

#define solverExitCplex   NULL

Definition at line 1073 of file solver_cplex.c.

Function Documentation

◆ buildProblem()

◆ updateVars()

static 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 376 of file solver_cplex.c.

References CHECK_ZERO, GCG_SolverData::cpxenv, GCG_SolverData::lp, GCG_SolverData::npricingvars, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_TRANSFORMED, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetNOrigVars(), SCIPgetOrigVars(), SCIPgetStage(), SCIPvarGetIndex(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetTransVar(), and SCIPvarGetUbGlobal().

Referenced by GCG_DECL_SOLVERUPDATE().

◆ updateBranchingConss()

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

◆ solveCplex()

static SCIP_RETCODE solveCplex ( GCG *  gcg,
GCG_SOLVERDATA *  solverdata,
SCIP *  pricingprob,
int  probnr,
SCIP_Real  dualsolconv,
SCIP_Real *  lowerbound,
int *  ncols,
GCG_PRICINGSTATUS *  status 
)
static

◆ GCG_DECL_SOLVERFREE()

static GCG_DECL_SOLVERFREE ( solverFreeCplex  )
static

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

Definition at line 931 of file solver_cplex.c.

References GCGgetDwMasterprob(), GCGsolverGetData(), GCGsolverSetData(), NULL, SCIP_OKAY, and SCIPfreeMemory.

◆ GCG_DECL_SOLVERINITSOL()

◆ GCG_DECL_SOLVEREXITSOL()

◆ GCG_DECL_SOLVERUPDATE()

◆ GCG_DECL_SOLVERSOLVEHEUR()

static GCG_DECL_SOLVERSOLVEHEUR ( solverSolveHeurCplex  )
static

◆ GCG_DECL_SOLVERSOLVE()

static GCG_DECL_SOLVERSOLVE ( solverSolveCplex  )
static

solving method for pricing solver which solves the pricing problem to optimality

Definition at line 1149 of file solver_cplex.c.

References CHECK_ZERO, CPX_LONG_MAX, GCG_SolverData::cpxenv, GCG_PRICINGSTATUS_OPTIMAL, GCGsolverGetData(), NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and solveCplex().

◆ GCGincludeSolverCplex()