Detailed Description
highs solver for pricing problems
Definition in file solver_highs.c.
#include <math.h>#include <string.h>#include <stdint.h>#include "scip/scip.h"#include "gcg/gcg.h"#include "gcg/solver_highs.h"#include "gcg/pub_solver.h"#include "gcg/pub_gcgcol.h"#include "gcg/pricer_gcg.h"#include "gcg/scip_misc.h"#include "interfaces/highs_c_api.h"Go to the source code of this file.
Data Structures | |
| struct | GCG_SolverData |
Macros | |
| #define | CHECK_ZERO(x) |
| #define | CHECK_SOLVER_RUN(x) |
| #define | SOLVER_NAME "highs" |
| #define | SOLVER_DESC "highs solver for pricing problems" |
| #define | SOLVER_PRIORITY 10 |
| #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 | solverInitHighs NULL |
| #define | solverExitHighs 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 | solveHighs (GCG *gcg, GCG_SOLVERDATA *solverdata, SCIP *pricingprob, int probnr, SCIP_Real dualsolconv, SCIP_Real *lowerbound, int *ncols, GCG_PRICINGSTATUS *status) |
| static | GCG_DECL_SOLVERFREE (solverFreeHighs) |
| static | GCG_DECL_SOLVERINITSOL (solverInitsolHighs) |
| static | GCG_DECL_SOLVEREXITSOL (solverExitsolHighs) |
| static | GCG_DECL_SOLVERUPDATE (solverUpdateHighs) |
| static | GCG_DECL_SOLVERSOLVEHEUR (solverSolveHeurHighs) |
| static | GCG_DECL_SOLVERSOLVE (solverSolveHighs) |
| SCIP_RETCODE | GCGincludeSolverHighs (GCG *gcg) |
Macro Definition Documentation
◆ CHECK_ZERO
| #define CHECK_ZERO | ( | x | ) |
Definition at line 52 of file solver_highs.c.
◆ CHECK_SOLVER_RUN
| #define CHECK_SOLVER_RUN | ( | x | ) |
Definition at line 61 of file solver_highs.c.
◆ SOLVER_NAME
| #define SOLVER_NAME "highs" |
Definition at line 70 of file solver_highs.c.
◆ SOLVER_DESC
| #define SOLVER_DESC "highs solver for pricing problems" |
Definition at line 71 of file solver_highs.c.
◆ SOLVER_PRIORITY
| #define SOLVER_PRIORITY 10 |
Definition at line 72 of file solver_highs.c.
◆ SOLVER_HEURENABLED
| #define SOLVER_HEURENABLED FALSE |
indicates whether the heuristic solving method of the solver should be enabled
Definition at line 73 of file solver_highs.c.
◆ SOLVER_EXACTENABLED
| #define SOLVER_EXACTENABLED FALSE |
indicates whether the exact solving method of the solver should be enabled
Definition at line 74 of file solver_highs.c.
◆ DEFAULT_CHECKSOLS
| #define DEFAULT_CHECKSOLS TRUE |
should solutions of the pricing MIPs be checked for duplicity?
Definition at line 76 of file solver_highs.c.
◆ DEFAULT_THREADS
| #define DEFAULT_THREADS 1 |
number of threads the HIGHS pricing solver is allowed to use (0: automatic)
Definition at line 77 of file solver_highs.c.
◆ DEFAULT_STARTNODELIMIT
| #define DEFAULT_STARTNODELIMIT 1000LL |
start node limit for heuristic pricing
Definition at line 78 of file solver_highs.c.
◆ DEFAULT_STARTGAPLIMIT
| #define DEFAULT_STARTGAPLIMIT 0.2 |
start gap limit for heuristic pricing
Definition at line 79 of file solver_highs.c.
◆ DEFAULT_STARTSOLLIMIT
| #define DEFAULT_STARTSOLLIMIT 10LL |
start solution limit for heuristic pricing
Definition at line 80 of file solver_highs.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 81 of file solver_highs.c.
◆ DEFAULT_STALLNODELIMITFAC
| #define DEFAULT_STALLNODELIMITFAC 1.25 |
factor by which to increase stalling node limit for heuristic pricing
Definition at line 82 of file solver_highs.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 83 of file solver_highs.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 84 of file solver_highs.c.
◆ solverInitHighs
| #define solverInitHighs NULL |
Definition at line 1067 of file solver_highs.c.
◆ solverExitHighs
| #define solverExitHighs NULL |
Definition at line 1068 of file solver_highs.c.
Function Documentation
◆ buildProblem()
|
static |
creates a HIGHS environment and builds the pricing problem
- Parameters
-
gcg GCG data structure solverdata solver data structure pricingprob pricing problem probnr problem number
Definition at line 127 of file solver_highs.c.
References CHECK_ZERO, FALSE, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), GCGconsGetVals(), GCGconsGetVars(), GCGgetMasterprob(), GCG_SolverData::highsptr, GCG_SolverData::ismip, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingvars, NULL, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, GCG_SolverData::pricingvars, GCG_SolverData::pricingvartypes, SCIP_CALL, SCIP_INVALIDDATA, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_INTEGER, SCIPallocBufferArray, SCIPallocMemoryArray, SCIPcaptureCons(), SCIPcaptureVar(), SCIPerrorMessage, SCIPfeastol(), SCIPfreeBufferArray, SCIPgetNOrigConss(), SCIPgetNOrigVars(), SCIPgetObjsense(), SCIPgetOrigConss(), SCIPgetOrigVars(), SCIPgetProbName(), SCIPinfoMessage(), SCIPisInfinity(), SCIPsnprintf(), SCIPvarGetIndex(), SCIPvarGetLbLocal(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbLocal(), GCG_SolverData::threads, and TRUE.
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 356 of file solver_highs.c.
References CHECK_ZERO, GCG_SolverData::highsptr, 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 |
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 458 of file solver_highs.c.
References CHECK_ZERO, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), GCGconsGetVals(), GCGconsGetVars(), GCG_SolverData::highsptr, GCG_SolverData::nbasicpricingconss, GCG_SolverData::pricingconss, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPfreeBufferArray, SCIPgetNOrigConss(), SCIPgetNOrigVars(), SCIPgetOrigConss(), SCIPisInfinity(), and SCIPvarGetIndex().
Referenced by GCG_DECL_SOLVERUPDATE().
◆ solveHighs()
|
static |
solves the pricing problem with HIGHS
- Parameters
-
gcg GCG data structure 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 614 of file solver_highs.c.
References CHECK_SOLVER_RUN, CHECK_ZERO, GCG_SolverData::checksols, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, FALSE, GCG_SolverData::gaplimitfac, GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, GCGcreateGcgCol(), GCGcreateGcgColFromSol(), GCGgetMasterprob(), GCGpricerAddCol(), GCG_SolverData::highsptr, GCG_SolverData::ismip, MAX, GCG_SolverData::nodelimitfac, NULL, GCG_SolverData::pricingvars, GCG_SolverData::pricingvartypes, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIPallocBufferArray, SCIPceil(), SCIPcheckSolOrig(), SCIPcreateOrigSol(), SCIPdebugMessage, SCIPfloor(), SCIPfreeBufferArray, SCIPfreeSol(), SCIPgetNOrigVars(), SCIPgetObjsense(), SCIPinfinity(), SCIPisFeasEQ(), SCIPisFeasLE(), SCIPisFeasZero(), SCIPisIntegral(), SCIPisNegative(), SCIPisPositive(), SCIPsetSolVals(), SCIPvarGetObj(), GCG_SolverData::sollimitfac, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, and TRUE.
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 924 of file solver_highs.c.
References GCGgetDwMasterprob(), GCGsolverGetData(), GCGsolverSetData(), NULL, SCIP_OKAY, and SCIPfreeMemory.
◆ GCG_DECL_SOLVERINITSOL()
|
static |
solving process initialization method of pricing solver (called when branch and bound process is about to begin)
Definition at line 942 of file solver_highs.c.
References BMSclearMemoryArray, buildProblem(), GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGgetMasterprob(), GCGgetNPricingprobs(), GCGgetPricingprob(), GCGisPricingprobRelevant(), GCGsolverGetData(), GCG_SolverData::highsptr, GCG_SolverData::ismip, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingprobs, GCG_SolverData::npricingvars, NULL, GCG_SolverData::nupdates, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, GCG_SolverData::pricingvars, GCG_SolverData::pricingvartypes, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, 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 997 of file solver_highs.c.
References GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGgetMasterprob(), GCGgetNPricingprobs(), GCGisPricingprobRelevant(), GCGsolverGetData(), GCG_SolverData::highsptr, GCG_SolverData::ismip, GCG_SolverData::nbasicpricingconss, GCG_SolverData::npricingprobs, GCG_SolverData::npricingvars, NULL, GCG_SolverData::nupdates, GCG_SolverData::pricingconss, GCG_SolverData::pricingprobs, GCG_SolverData::pricingvars, GCG_SolverData::pricingvartypes, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemoryArray, SCIPfreeMemoryArray, SCIPreleaseCons(), and SCIPreleaseVar().
◆ GCG_DECL_SOLVERUPDATE()
|
static |
update method for pricing solver, used to update solver specific pricing problem data
Definition at line 1072 of file solver_highs.c.
References CHECK_ZERO, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCGgetMasterprob(), GCGsolverGetData(), GCG_SolverData::highsptr, NULL, GCG_SolverData::nupdates, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdebugMessage, SCIPgetNNodes(), SCIPgetProbName(), SCIPinfoMessage(), SCIPsnprintf(), GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, updateBranchingConss(), and updateVars().
◆ GCG_DECL_SOLVERSOLVEHEUR()
|
static |
heuristic solving method of HIGHS solver
Definition at line 1115 of file solver_highs.c.
References CHECK_ZERO, GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_PRICINGSTATUS_OPTIMAL, GCGsolverGetData(), GCG_SolverData::highsptr, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and solveHighs().
◆ GCG_DECL_SOLVERSOLVE()
|
static |
solving method for pricing solver which solves the pricing problem to optimality
Definition at line 1146 of file solver_highs.c.
References CHECK_ZERO, GCG_PRICINGSTATUS_OPTIMAL, GCGsolverGetData(), GCG_SolverData::highsptr, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and solveHighs().
◆ GCGincludeSolverHighs()
| SCIP_RETCODE GCGincludeSolverHighs | ( | GCG * | gcg | ) |
creates the HIGHS pricing solver and includes it in GCG
- Parameters
-
gcg GCG data structure
Definition at line 1175 of file solver_highs.c.
References GCG_SolverData::checksols, DEFAULT_CHECKSOLS, DEFAULT_GAPLIMITFAC, DEFAULT_NODELIMITFAC, DEFAULT_SOLLIMITFAC, DEFAULT_STARTGAPLIMIT, DEFAULT_STARTNODELIMIT, DEFAULT_STARTSOLLIMIT, DEFAULT_THREADS, GCG_SolverData::gaplimitfac, GCGgetDwMasterprob(), GCGgetOrigprob(), GCGpricerIncludeSolver(), GCG_SolverData::nodelimitfac, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPaddLongintParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPincludeExternalCodeInformation(), SCIPinfinity(), SCIPsnprintf(), GCG_SolverData::sollimitfac, SOLVER_DESC, SOLVER_EXACTENABLED, SOLVER_HEURENABLED, SOLVER_NAME, SOLVER_PRIORITY, solverExitHighs, solverInitHighs, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, GCG_SolverData::threads, and TRUE.
Referenced by GCGincludeMasterPlugins().