Detailed Description
cplex solver for pricing problems
Definition in file solver_cplex.c.
#include <string.h>
#include "scip/scip.h"
#include "gcg.h"
#include "solver_cplex.h"
#include "pub_solver.h"
#include "pub_gcgcol.h"
#include "pricer_gcg.h"
#include "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 100 |
#define | SOLVER_HEURENABLED TRUE |
#define | SOLVER_EXACTENABLED TRUE |
#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 (SCIP *scip, 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 (SCIP *scip, 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 (SCIP *scip) |
Macro Definition Documentation
◆ CHECK_ZERO
#define CHECK_ZERO | ( | x | ) |
Definition at line 52 of file solver_cplex.c.
◆ CPX_LONG_MAX
#define CPX_LONG_MAX 9223372036800000000LL |
Definition at line 61 of file solver_cplex.c.
◆ SOLVER_NAME
#define SOLVER_NAME "cplex" |
Definition at line 64 of file solver_cplex.c.
◆ SOLVER_DESC
#define SOLVER_DESC "cplex solver for pricing problems" |
Definition at line 65 of file solver_cplex.c.
◆ SOLVER_PRIORITY
#define SOLVER_PRIORITY 100 |
Definition at line 66 of file solver_cplex.c.
◆ SOLVER_HEURENABLED
#define SOLVER_HEURENABLED TRUE |
indicates whether the heuristic solving method of the solver should be enabled
Definition at line 67 of file solver_cplex.c.
◆ SOLVER_EXACTENABLED
#define SOLVER_EXACTENABLED TRUE |
indicates whether the exact solving method of the solver should be enabled
Definition at line 68 of file solver_cplex.c.
◆ DEFAULT_CHECKSOLS
#define DEFAULT_CHECKSOLS TRUE |
should solutions of the pricing MIPs be checked for duplicity?
Definition at line 70 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 71 of file solver_cplex.c.
◆ DEFAULT_STARTNODELIMIT
#define DEFAULT_STARTNODELIMIT 1000LL |
start node limit for heuristic pricing
Definition at line 72 of file solver_cplex.c.
◆ DEFAULT_STARTGAPLIMIT
#define DEFAULT_STARTGAPLIMIT 0.2 |
start gap limit for heuristic pricing
Definition at line 73 of file solver_cplex.c.
◆ DEFAULT_STARTSOLLIMIT
#define DEFAULT_STARTSOLLIMIT 10LL |
start solution limit for heuristic pricing
Definition at line 74 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 75 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 76 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 77 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 78 of file solver_cplex.c.
◆ solverInitCplex
#define solverInitCplex NULL |
Definition at line 1065 of file solver_cplex.c.
◆ solverExitCplex
#define solverExitCplex NULL |
Definition at line 1066 of file solver_cplex.c.
Function Documentation
◆ buildProblem()
|
static |
creates a CPLEX environment and builds the pricing problem
- Parameters
-
scip SCIP data structure solverdata solver data structure pricingprob pricing problem probnr problem number
Definition at line 120 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), GCGconsGetVals(), GCGconsGetVars(), GCG_SolverData::lp, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingvars, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, GCG_SolverData::pricingvars, and GCG_SolverData::threads.
Referenced by GCG_DECL_SOLVERINITSOL().
◆ updateVars()
|
static |
updates bounds and objective coefficients of variables in the given pricing problem
- Parameters
-
scip SCIP data structure solverdata solver data structure pricingprob pricing problem probnr problem number varobjschanged have the objective coefficients changed? varbndschanged have the lower and upper bounds changed?
Definition at line 374 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCG_SolverData::lp, and GCG_SolverData::npricingvars.
Referenced by GCG_DECL_SOLVERUPDATE().
◆ updateBranchingConss()
|
static |
updates branching constraints in the given pricing problem
- Parameters
-
scip SCIP data structure solverdata solver data structure pricingprob pricing problem probnr problem number
Definition at line 480 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), GCGconsGetVals(), GCGconsGetVars(), GCG_SolverData::lp, GCG_SolverData::nbasicpricingconss, and GCG_SolverData::pricingconss.
Referenced by GCG_DECL_SOLVERUPDATE().
◆ solveCplex()
|
static |
solves the pricing problem with CPLEX
- Parameters
-
scip SCIP data structure (master problem) solverdata solver data structure pricingprob pricing problem probnr problem number dualsolconv dual solution value of the corresponding convexity constraint lowerbound pointer to store lower bound ncols pointer to store number of columns status pointer to store the pricing status
Definition at line 659 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::checksols, GCG_SolverData::cpxenv, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_SolverData::gaplimitfac, GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, GCGcreateGcgCol(), GCGcreateGcgColFromSol(), GCGpricerAddCol(), GCG_SolverData::lp, GCG_SolverData::nodelimitfac, GCG_SolverData::pricingvars, GCG_SolverData::sollimitfac, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, and GCG_SolverData::startsollimit.
Referenced by GCG_DECL_SOLVERSOLVE(), and GCG_DECL_SOLVERSOLVEHEUR().
◆ GCG_DECL_SOLVERFREE()
|
static |
destructor of pricing solver to free user data (called when SCIP is exiting)
Definition at line 928 of file solver_cplex.c.
References GCGsolverGetData(), and GCGsolverSetData().
◆ GCG_DECL_SOLVERINITSOL()
|
static |
solving process initialization method of pricing solver (called when branch and bound process is about to begin)
Definition at line 946 of file solver_cplex.c.
References buildProblem(), GCG_SolverData::cpxenv, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGgetNPricingprobs(), GCGgetPricingprob(), GCGisPricingprobRelevant(), GCGsolverGetData(), GCG_SolverData::lp, GCG_SolverData::masterprob, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingprobs, GCG_SolverData::npricingvars, GCG_SolverData::nupdates, GCG_SolverData::origprob, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, GCG_SolverData::pricingvars, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, and GCG_SolverData::startsollimit.
◆ GCG_DECL_SOLVEREXITSOL()
|
static |
solving process deinitialization method of pricing solver (called before branch and bound process data is freed)
Definition at line 996 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGgetNPricingprobs(), GCGisPricingprobRelevant(), GCGsolverGetData(), GCG_SolverData::lp, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingprobs, GCG_SolverData::npricingvars, GCG_SolverData::nupdates, GCG_SolverData::origprob, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, and GCG_SolverData::pricingvars.
◆ GCG_DECL_SOLVERUPDATE()
|
static |
update method for pricing solver, used to update solver specific pricing problem data
Definition at line 1070 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGsolverGetData(), GCG_SolverData::lp, GCG_SolverData::masterprob, GCG_SolverData::nupdates, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, updateBranchingConss(), and updateVars().
◆ GCG_DECL_SOLVERSOLVEHEUR()
|
static |
heuristic solving method of CPLEX solver
Definition at line 1114 of file solver_cplex.c.
References CHECK_ZERO, GCG_SolverData::cpxenv, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_PRICINGSTATUS_OPTIMAL, GCGsolverGetData(), GCG_SolverData::masterprob, and solveCplex().
◆ GCG_DECL_SOLVERSOLVE()
|
static |
solving method for pricing solver which solves the pricing problem to optimality
Definition at line 1142 of file solver_cplex.c.
References CHECK_ZERO, CPX_LONG_MAX, GCG_SolverData::cpxenv, GCG_PRICINGSTATUS_OPTIMAL, GCGsolverGetData(), GCG_SolverData::masterprob, and solveCplex().
◆ GCGincludeSolverCplex()
SCIP_RETCODE GCGincludeSolverCplex | ( | SCIP * | scip | ) |
creates the CPLEX pricing solver and includes it in GCG
- Parameters
-
scip SCIP data structure
Definition at line 1171 of file solver_cplex.c.
References GCG_SolverData::checksols, CPX_LONG_MAX, DEFAULT_CHECKSOLS, DEFAULT_GAPLIMITFAC, DEFAULT_NODELIMITFAC, DEFAULT_SOLLIMITFAC, DEFAULT_STARTGAPLIMIT, DEFAULT_STARTNODELIMIT, DEFAULT_STARTSOLLIMIT, DEFAULT_THREADS, GCG_SolverData::gaplimitfac, GCGmasterGetOrigprob(), GCGpricerIncludeSolver(), GCG_SolverData::masterprob, GCG_SolverData::nodelimitfac, GCG_SolverData::origprob, GCG_SolverData::sollimitfac, SOLVER_DESC, SOLVER_EXACTENABLED, SOLVER_HEURENABLED, SOLVER_NAME, SOLVER_PRIORITY, solverExitCplex, solverInitCplex, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, and GCG_SolverData::threads.
Referenced by GCGincludeMasterPlugins().