Detailed Description
pricing solver solving the pricing problem as a sub-MIP, using SCIP
Definition in file solver_mip.c.
#include <assert.h>#include <string.h>#include "gcg/solver_mip.h"#include "scip/cons_linear.h"#include "scip/cons_knapsack.h"#include "gcg/gcg.h"#include "gcg/pricer_gcg.h"#include "gcg/pub_solver.h"#include "scip/scipdefplugins.h"#include "gcg/pub_gcgcol.h"Go to the source code of this file.
Data Structures | |
| struct | GCG_SolverData |
Macros | |
| #define | SOLVER_NAME "mip" |
| #define | SOLVER_DESC "pricing solver solving the pricing problem as a sub-MIP, using SCIP" |
| #define | SOLVER_PRIORITY 0 |
| #define | SOLVER_HEURENABLED TRUE |
| #define | SOLVER_EXACTENABLED TRUE |
| #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.0 |
| #define | DEFAULT_STALLNODELIMITFAC 1.0 |
| #define | DEFAULT_GAPLIMITFAC 0.8 |
| #define | DEFAULT_SOLLIMITFAC 1.0 |
| #define | DEFAULT_SETTINGSFILE "-" |
| #define | DEFAULT_ENABLE_WARNINGS FALSE |
| #define | solverInitMip NULL |
| #define | solverExitMip NULL |
| #define | solverUpdateMip NULL |
Macro Definition Documentation
◆ SOLVER_NAME
| #define SOLVER_NAME "mip" |
Definition at line 52 of file solver_mip.c.
◆ SOLVER_DESC
| #define SOLVER_DESC "pricing solver solving the pricing problem as a sub-MIP, using SCIP" |
Definition at line 53 of file solver_mip.c.
◆ SOLVER_PRIORITY
| #define SOLVER_PRIORITY 0 |
Definition at line 54 of file solver_mip.c.
◆ SOLVER_HEURENABLED
| #define SOLVER_HEURENABLED TRUE |
indicates whether the heuristic solving method of the solver should be enabled
Definition at line 55 of file solver_mip.c.
◆ SOLVER_EXACTENABLED
| #define SOLVER_EXACTENABLED TRUE |
indicates whether the exact solving method of the solver should be enabled
Definition at line 56 of file solver_mip.c.
◆ DEFAULT_CHECKSOLS
| #define DEFAULT_CHECKSOLS TRUE |
should solutions be checked extensively
Definition at line 58 of file solver_mip.c.
◆ DEFAULT_STARTNODELIMIT
| #define DEFAULT_STARTNODELIMIT 1000LL |
start node limit for heuristic pricing
Definition at line 59 of file solver_mip.c.
◆ DEFAULT_STARTSTALLNODELIMIT
| #define DEFAULT_STARTSTALLNODELIMIT 100LL |
start stalling node limit for heuristic pricing
Definition at line 60 of file solver_mip.c.
◆ DEFAULT_STARTGAPLIMIT
| #define DEFAULT_STARTGAPLIMIT 0.2 |
start gap limit for heuristic pricing
Definition at line 61 of file solver_mip.c.
◆ DEFAULT_STARTSOLLIMIT
| #define DEFAULT_STARTSOLLIMIT 10 |
start solution limit for heuristic pricing
Definition at line 62 of file solver_mip.c.
◆ DEFAULT_NODELIMITFAC
| #define DEFAULT_NODELIMITFAC 1.0 |
factor by which to increase node limit for heuristic pricing (1.0: add start limit)
Definition at line 63 of file solver_mip.c.
◆ DEFAULT_STALLNODELIMITFAC
| #define DEFAULT_STALLNODELIMITFAC 1.0 |
factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit)
Definition at line 64 of file solver_mip.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 65 of file solver_mip.c.
◆ DEFAULT_SOLLIMITFAC
| #define DEFAULT_SOLLIMITFAC 1.0 |
factor by which to increase solution limit for heuristic pricing (1.0: add start limit)
Definition at line 66 of file solver_mip.c.
◆ DEFAULT_SETTINGSFILE
| #define DEFAULT_SETTINGSFILE "-" |
settings file to be applied in pricing problems
Definition at line 67 of file solver_mip.c.
◆ DEFAULT_ENABLE_WARNINGS
| #define DEFAULT_ENABLE_WARNINGS FALSE |
should warnings (of pricing problems) be enabled by default
Definition at line 68 of file solver_mip.c.
◆ solverInitMip
| #define solverInitMip NULL |
initialization method of pricing solver (called after problem was transformed and solver is active)
Definition at line 339 of file solver_mip.c.
Referenced by GCGincludeSolverMip().
◆ solverExitMip
| #define solverExitMip NULL |
deinitialization method of pricing solver (called before transformed problem is freed and solver is active)
Definition at line 342 of file solver_mip.c.
Referenced by GCGincludeSolverMip().
◆ solverUpdateMip
| #define solverUpdateMip NULL |
Definition at line 405 of file solver_mip.c.
Referenced by GCGincludeSolverMip().
Function Documentation
◆ resolvePricingWithoutPresolving()
|
static |
solves the pricing problem again without presolving
- Parameters
-
pricingprob pricing problem to solve again
Definition at line 102 of file solver_mip.c.
References assert(), resolvePricingWithoutPresolving(), and SCIP_CALL().
Referenced by resolvePricingWithoutPresolving(), and solveProblem().
◆ checkSolNew()
|
static |
checks whether the given solution is equal to one of the former solutions in the sols array
- Parameters
-
pricingprob pricing problem SCIP data structure sols array of solutions idx index of the solution isnew pointer to store whether the solution is new
Definition at line 119 of file solver_mip.c.
References assert(), checkSolNew(), i, SCIP_CALL(), and SCIPfreeBufferArray().
Referenced by checkSolNew(), and getColumnsFromPricingprob().
◆ solutionHasInfiniteValue()
check whether a column contains an infinite solution value
- Parameters
-
pricingprob pricing problem SCIP data structure sol solution to be checked
Definition at line 178 of file solver_mip.c.
References i, nvars, sol, solutionHasInfiniteValue(), and vars.
Referenced by getColumnsFromPricingprob(), and solutionHasInfiniteValue().
◆ solveProblem()
|
static |
solves the given pricing problem as a sub-SCIP
- Parameters
-
gcg GCG data structure pricingprob pricing problem SCIP data structure probnr problem number solverdata solver data structure lowerbound pointer to store lower bound status pointer to store pricing problem status
Definition at line 200 of file solver_mip.c.
References assert(), GCG_SolverData::checksols, createColumnFromRay(), GCG_SolverData::enablewarnings, GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_NOTAPPLICABLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, GCGpricerAddCol(), getColumnsFromPricingprob(), getPricingstatus(), resolvePricingWithoutPresolving(), retcode, SCIP_CALL(), SCIPdebugMessage(), and solveProblem().
Referenced by GCG_DECL_SOLVERSOLVE(), GCG_DECL_SOLVERSOLVEHEUR(), and solveProblem().
◆ GCG_DECL_SOLVERFREE()
|
static |
destructor of pricing solver to free user data (called when SCIP is exiting)
Definition at line 319 of file solver_mip.c.
References assert(), GCG_DECL_SOLVERFREE, GCGgetDwMasterprob(), 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 346 of file solver_mip.c.
References assert(), GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_SolverData::curstallnodelimit, GCG_DECL_SOLVERINITSOL, GCGgetMasterprob(), GCGgetNPricingprobs(), GCGsolverGetData(), i, masterprob, SCIP_CALL(), GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, and GCG_SolverData::startstallnodelimit.
◆ GCG_DECL_SOLVEREXITSOL()
|
static |
solving process deinitialization method of pricing solver (called before branch and bound process data is freed)
Definition at line 381 of file solver_mip.c.
References assert(), GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_SolverData::curstallnodelimit, GCG_DECL_SOLVEREXITSOL, GCGgetMasterprob(), GCGgetNPricingprobs(), GCGsolverGetData(), and masterprob.
◆ GCG_DECL_SOLVERSOLVE()
|
static |
solving method for pricing solver which solves the pricing problem to optimality
Definition at line 409 of file solver_mip.c.
References assert(), GCG_DECL_SOLVERSOLVE, GCGsolverGetData(), SCIP_CALL(), SCIPdebugMessage(), GCG_SolverData::settingsfile, and solveProblem().
◆ GCG_DECL_SOLVERSOLVEHEUR()
|
static |
heuristic solving method of mip solver
Definition at line 446 of file solver_mip.c.
References assert(), GCG_SolverData::curgaplimit, GCG_SolverData::curnodelimit, GCG_SolverData::cursollimit, GCG_SolverData::curstallnodelimit, GCG_SolverData::gaplimitfac, GCG_DECL_SOLVERSOLVEHEUR, GCG_PRICINGSTATUS_UNKNOWN, GCGsolverGetData(), GCG_SolverData::nodelimitfac, SCIP_CALL(), SCIPdebugMessage(), GCG_SolverData::sollimitfac, solveProblem(), GCG_SolverData::stallnodelimitfac, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, and GCG_SolverData::startstallnodelimit.
◆ createColumnFromRay()
| SCIP_RETCODE createColumnFromRay | ( | GCG * | gcg, |
| SCIP * | pricingprob, | ||
| SCIP * | subproblem, | ||
| SCIP_HASHMAP * | varmap, | ||
| int | probnr, | ||
| GCG_COL ** | newcol ) |
extracts ray from a subproblem used to solve a pricing problem pricing problem (or directly from the pricing problem if no subproblem is specified)
- Parameters
-
gcg GCG data structure pricingprob pricing problem SCIP data structure subproblem SCIP data structure that contains the actual solution (if NULL pricingprob will be used) varmap mapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL) probnr problem number newcol column pointer to store new column
Definition at line 521 of file solver_mip.c.
References assert(), createColumnFromRay(), GCGcreateGcgCol(), i, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), and solval.
Referenced by createColumnFromRay(), solveProblem(), and solveProblem().
◆ getPricingstatus()
| GCG_PRICINGSTATUS getPricingstatus | ( | SCIP * | pricingprob | ) |
get the status of the pricing problem
- Parameters
-
pricingprob pricing problem SCIP data structure
Definition at line 592 of file solver_mip.c.
References assert(), GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_OPTIMAL, GCG_PRICINGSTATUS_SOLVERLIMIT, GCG_PRICINGSTATUS_UNBOUNDED, GCG_PRICINGSTATUS_UNKNOWN, getPricingstatus(), and SCIPdebugMessage().
Referenced by getPricingstatus(), solveProblem(), and solveProblem().
◆ getColumnsFromPricingprob()
| SCIP_RETCODE getColumnsFromPricingprob | ( | GCG * | gcg, |
| SCIP * | pricingprob, | ||
| SCIP * | subproblem, | ||
| SCIP_HASHMAP * | varmap, | ||
| int | probnr, | ||
| SCIP_Bool | checksols ) |
transforms feasible solutions of a subproblem used to solve a pricing problem pricing problem into columns (or directly of the pricing problem if no subproblem is specified)
- Parameters
-
gcg GCG data structure pricingprob pricing problem SCIP data structure subproblem SCIP data structure that contains the actual solution (if NULL pricingprob will be used) varmap mapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL) probnr problem number checksols should solutions be checked extensively
Definition at line 652 of file solver_mip.c.
References assert(), checkSolNew(), GCGcreateGcgColFromSol(), GCGpricerAddCol(), getColumnsFromPricingprob(), SCIP_CALL(), SCIPdebugMessage(), solutionHasInfiniteValue(), and success.
Referenced by getColumnsFromPricingprob(), solveProblem(), and solveProblem().
◆ GCGincludeSolverMip()
| SCIP_RETCODE GCGincludeSolverMip | ( | GCG * | gcg | ) |
creates the mip solver for pricing problems and includes it in GCG
- Parameters
-
gcg GCG data structure
Definition at line 730 of file solver_mip.c.
References GCG_SolverData::checksols, DEFAULT_CHECKSOLS, DEFAULT_ENABLE_WARNINGS, DEFAULT_GAPLIMITFAC, DEFAULT_NODELIMITFAC, DEFAULT_SETTINGSFILE, DEFAULT_SOLLIMITFAC, DEFAULT_STALLNODELIMITFAC, DEFAULT_STARTGAPLIMIT, DEFAULT_STARTNODELIMIT, DEFAULT_STARTSOLLIMIT, DEFAULT_STARTSTALLNODELIMIT, GCG_SolverData::enablewarnings, GCG_SolverData::gaplimitfac, GCGgetDwMasterprob(), GCGgetOrigprob(), GCGincludeSolverMip(), GCGpricerIncludeSolver(), masterprob, GCG_SolverData::nodelimitfac, origprob, SCIP_CALL(), GCG_SolverData::settingsfile, GCG_SolverData::sollimitfac, SOLVER_DESC, SOLVER_EXACTENABLED, SOLVER_HEURENABLED, SOLVER_NAME, SOLVER_PRIORITY, solverExitMip, solverInitMip, solverUpdateMip, GCG_SolverData::stallnodelimitfac, GCG_SolverData::startgaplimit, GCG_SolverData::startnodelimit, GCG_SolverData::startsollimit, and GCG_SolverData::startstallnodelimit.
Referenced by GCGincludeMasterPlugins(), and GCGincludeSolverMip().