solver_mip.c
Go to the documentation of this file.
37/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
55#define SOLVER_HEURENABLED TRUE /**< indicates whether the heuristic solving method of the solver should be enabled */
56#define SOLVER_EXACTENABLED TRUE /**< indicates whether the exact solving method of the solver should be enabled */
63#define DEFAULT_NODELIMITFAC 1.0 /**< factor by which to increase node limit for heuristic pricing (1.0: add start limit) */
64#define DEFAULT_STALLNODELIMITFAC 1.0 /**< factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit) */
65#define DEFAULT_GAPLIMITFAC 0.8 /**< factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit) */
66#define DEFAULT_SOLLIMITFAC 1.0 /**< factor by which to increase solution limit for heuristic pricing (1.0: add start limit) */
68#define DEFAULT_ENABLE_WARNINGS FALSE /**< should warnings (of pricing problems) be enabled by default */
81 SCIP_Real nodelimitfac; /**< factor by which to increase node limit for heuristic pricing (1.0: add start limit) */
82 SCIP_Real stallnodelimitfac; /**< factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit) */
83 SCIP_Real gaplimitfac; /**< factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit) */
84 SCIP_Real sollimitfac; /**< factor by which to increase solution limit for heuristic pricing (1.0: add start limit) */
117/** checks whether the given solution is equal to one of the former solutions in the sols array */
151 if( (!SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && !SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx])) )
152 && !SCIPisEQ(pricingprob, SCIPgetSolOrigObj(pricingprob, sols[s]), SCIPgetSolOrigObj(pricingprob, sols[idx])) )
155 if( (SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && !SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx])) )
156 ||(!SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx]))) )
160 if( SCIPsolGetOrigin(sols[s]) != SCIP_SOLORIGIN_ORIGINAL && SCIPsolGetOrigin(sols[idx]) != SCIP_SOLORIGIN_ORIGINAL )
251 SCIPwarningMessage(pricingprob, "Pricing problem %d terminated with retcode = %d, ignoring\n", probnr, retcode);
259 SCIPstatisticMessage("P p %d: %"SCIP_LONGINT_FORMAT" no\n", probnr, SCIPgetNNodes(pricingprob) - oldnnodes);
287 /* If the pricing problem is neither infeasible nor unbounded, try to extract feasible columns */
297 SCIP_CALL( getColumnsFromPricingprob(gcg, pricingprob, NULL, NULL, probnr, solverdata->checksols) );
305 SCIPerrorMessage("Pricing problem %d has invalid status: %d\n", probnr, SCIPgetStatus(pricingprob));
338/** initialization method of pricing solver (called after problem was transformed and solver is active) */
341/** deinitialization method of pricing solver (called before transformed problem is freed and solver is active) */
344/** solving process initialization method of pricing solver (called when branch and bound process is about to begin) */
364 SCIP_CALL( SCIPallocBlockMemoryArray(masterprob, &solverdata->curstallnodelimit, npricingprobs) );
379/** solving process deinitialization method of pricing solver (called before branch and bound process data is freed) */
472 solverdata->curnodelimit[probnr] = (SCIP_Longint) (solverdata->curnodelimit[probnr] * solverdata->nodelimitfac);
479 solverdata->curstallnodelimit[probnr] = (SCIP_Longint) (solverdata->curstallnodelimit[probnr] * solverdata->stallnodelimitfac);
488 solverdata->curgaplimit[probnr] = MAX(solverdata->curgaplimit[probnr] - solverdata->startgaplimit, 0.0);
493 solverdata->cursollimit[probnr] = (int) (solverdata->cursollimit[probnr] * solverdata->sollimitfac);
503 SCIP_CALL( SCIPsetLongintParam(pricingprob, "limits/nodes", solverdata->curnodelimit[probnr]) );
504 SCIP_CALL( SCIPsetLongintParam(pricingprob, "limits/stallnodes", solverdata->curstallnodelimit[probnr]) );
509 SCIPdebugMessage("Solving pricing %d heuristically (pointer: %p)\n", probnr, (void*)pricingprob);
520/** extracts ray from a subproblem used to solve a pricing problem pricing problem (or directly from the pricing problem if no subproblem is specified) */
524 SCIP* subproblem, /**< SCIP data structure that contains the actual solution (if NULL pricingprob will be used) */
525 SCIP_HASHMAP* varmap, /**< mapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL) */
575 SCIPdebugMessage("%s: %g (obj = %g)\n", SCIPvarGetName(probvars[i]), solval, SCIPvarGetObj(probvars[i]));
582 SCIP_CALL( GCGcreateGcgCol(gcg, pricingprob, newcol, probnr, solvars, solvals, nsolvars, TRUE, SCIPinfinity(pricingprob)) );
612 assert((SCIPgetStatus(pricingprob) >= SCIP_STATUS_USERINTERRUPT && SCIPgetStatus(pricingprob) <= SCIP_STATUS_BESTSOLLIMIT)
622 SCIPdebugMessage(" -> interrupted, %d solutions found\n", SCIPgetNSols(pricingprob)); /*lint -fallthrough*/
655 SCIP* subproblem, /**< SCIP data structure that contains the actual solution (if NULL pricingprob will be used) */
656 SCIP_HASHMAP* varmap, /**< mapping of pricingprob vars to subproblem vars (can be NULL if subproblem is NULL) */
684 SCIPwarningMessage(solprob, "solution %d of pricing problem %d (%s) not feasible:\n", s, probnr, SCIPgetProbName(solprob));
700 /* Check whether the pricing problem solution has infinite values; if not, transform it to a column */
703 SCIP_CALL( GCGcreateGcgColFromSol(gcg, pricingprob, subproblem, varmap, &col, probnr, probsols[s], FALSE, SCIPinfinity(solprob)) );
721 SCIP_CALL( GCGcreateGcgColFromSol(gcg, pricingprob, subproblem, varmap, &col, probnr, newsol, FALSE, SCIPinfinity(solprob)) );
746 solverUpdateMip, solverSolveMip, solverSolveHeurMip, solverFreeMip, solverInitMip, solverExitMip,
755 &solverdata->startnodelimit, TRUE, DEFAULT_STARTNODELIMIT, -1LL, SCIP_LONGINT_MAX, NULL, NULL) );
759 &solverdata->startstallnodelimit, TRUE, DEFAULT_STARTSTALLNODELIMIT, -1LL, SCIP_LONGINT_MAX, NULL, NULL) );
771 &solverdata->nodelimitfac, TRUE, DEFAULT_NODELIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
775 &solverdata->stallnodelimitfac, TRUE, DEFAULT_STALLNODELIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
783 &solverdata->sollimitfac, TRUE, DEFAULT_SOLLIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
#define SCIP_Longint
#define SCIP_REAL_MAX
#define SCIP_Bool
#define SCIP_Real
#define MAX(x, y)
#define SCIP_LONGINT_FORMAT
#define SCIP_LONGINT_MAX
#define SCIP_CALL(x)
#define TRUE
#define FALSE
GCG interface methods.
SCIP_RETCODE GCGcreateGcgColFromSol(GCG *gcg, SCIP *pricingprob, SCIP *subproblem, SCIP_HASHMAP *varmap, GCG_COL **gcgcol, int prob, SCIP_SOL *sol, SCIP_Bool isray, SCIP_Real redcost)
Definition: gcgcol.c:267
SCIP_RETCODE GCGcreateGcgCol(GCG *gcg, SCIP *pricingprob, GCG_COL **gcgcol, int probnr, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool isray, SCIP_Real redcost)
Definition: gcgcol.c:53
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
const char * SCIPgetProbName(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
GCG_EXPORT GCG_SOLVERDATA * GCGsolverGetData(GCG_SOLVER *solver)
Definition: solver.c:400
GCG_EXPORT void GCGsolverSetData(GCG_SOLVER *solver, GCG_SOLVERDATA *solverdata)
Definition: solver.c:410
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
SCIP_RETCODE SCIPwriteParams(SCIP *scip, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
int SCIPgetNSols(SCIP *scip)
SCIP_RETCODE SCIPcreateFiniteSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol, SCIP_Bool *success)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
SCIP_RETCODE SCIPpresolve(SCIP *scip)
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_RETCODE SCIPfreeSolve(SCIP *scip, SCIP_Bool restart)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
#define NULL
SCIP_Bool SCIPmessagehdlrIsQuiet(SCIP_MESSAGEHDLR *messagehdlr)
Definition: class_conspartition.cpp:44
SCIP_RETCODE GCGpricerIncludeSolver(GCG *gcg, const char *name, const char *desc, int priority, SCIP_Bool heurenabled, SCIP_Bool exactenabled, GCG_DECL_SOLVERUPDATE((*solverupdate)), GCG_DECL_SOLVERSOLVE((*solversolve)), GCG_DECL_SOLVERSOLVEHEUR((*solversolveheur)), GCG_DECL_SOLVERFREE((*solverfree)), GCG_DECL_SOLVERINIT((*solverinit)), GCG_DECL_SOLVEREXIT((*solverexit)), GCG_DECL_SOLVERINITSOL((*solverinitsol)), GCG_DECL_SOLVEREXITSOL((*solverexitsol)), GCG_SOLVERDATA *solverdata)
Definition: pricer_gcg.cpp:5750
GCG variable pricer.
public methods for working with gcg columns
#define SCIPerrorMessage
#define SCIPstatisticMessage
#define SCIPdebugMessage
static SCIP_RETCODE checkSolNew(SCIP *pricingprob, SCIP_SOL **sols, int idx, SCIP_Bool *isnew)
Definition: solver_mip.c:119
static SCIP_Bool solutionHasInfiniteValue(SCIP *pricingprob, SCIP_SOL *sol)
Definition: solver_mip.c:178
static SCIP_RETCODE solveProblem(GCG *gcg, SCIP *pricingprob, int probnr, GCG_SOLVERDATA *solverdata, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status)
Definition: solver_mip.c:200
SCIP_RETCODE createColumnFromRay(GCG *gcg, SCIP *pricingprob, SCIP *subproblem, SCIP_HASHMAP *varmap, int probnr, GCG_COL **newcol)
Definition: solver_mip.c:521
SCIP_RETCODE getColumnsFromPricingprob(GCG *gcg, SCIP *pricingprob, SCIP *subproblem, SCIP_HASHMAP *varmap, int probnr, SCIP_Bool checksols)
Definition: solver_mip.c:652
static GCG_DECL_SOLVERSOLVEHEUR(solverSolveHeurMip)
Definition: solver_mip.c:446
static SCIP_RETCODE resolvePricingWithoutPresolving(SCIP *pricingprob)
Definition: solver_mip.c:102
mip solver for pricing problems
Definition: struct_gcgcol.h:52
Definition: solver_cliquer.c:91
Definition: struct_gcg.h:55
SCIP_VERBLEVEL_NONE
SCIP_VERBLEVEL_HIGH
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE
SCIP_STAGE_PROBLEM
SCIP_SOLORIGIN_ORIGINAL
SCIP_STATUS_OPTIMAL
SCIP_STATUS_TOTALNODELIMIT
SCIP_STATUS_BESTSOLLIMIT
SCIP_STATUS_SOLLIMIT
SCIP_STATUS_UNBOUNDED
SCIP_STATUS_UNKNOWN
SCIP_STATUS_GAPLIMIT
SCIP_STATUS_USERINTERRUPT
SCIP_STATUS_INFORUNBD
SCIP_STATUS_STALLNODELIMIT
SCIP_STATUS_TIMELIMIT
SCIP_STATUS_INFEASIBLE
SCIP_STATUS_NODELIMIT
SCIP_STATUS_MEMLIMIT