solver_mip.c
Go to the documentation of this file.
36 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
54 #define SOLVER_HEURENABLED TRUE /**< indicates whether the heuristic solving method of the solver should be enabled */
55 #define SOLVER_EXACTENABLED TRUE /**< indicates whether the exact solving method of the solver should be enabled */
59 #define DEFAULT_STARTSTALLNODELIMIT 100LL /**< start stalling node limit for heuristic pricing */
62 #define DEFAULT_NODELIMITFAC 1.0 /**< factor by which to increase node limit for heuristic pricing (1.0: add start limit) */
63 #define DEFAULT_STALLNODELIMITFAC 1.0 /**< factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit) */
64 #define DEFAULT_GAPLIMITFAC 0.8 /**< factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit) */
65 #define DEFAULT_SOLLIMITFAC 1.0 /**< factor by which to increase solution limit for heuristic pricing (1.0: add start limit) */
79 SCIP_Real nodelimitfac; /**< factor by which to increase node limit for heuristic pricing (1.0: add start limit) */
80 SCIP_Real stallnodelimitfac; /**< factor by which to increase stalling node limit for heuristic pricing (1.0: add start limit) */
81 SCIP_Real gaplimitfac; /**< factor by which to decrease gap limit for heuristic pricing (1.0: subtract start limit) */
82 SCIP_Real sollimitfac; /**< factor by which to increase solution limit for heuristic pricing (1.0: add start limit) */
137 SCIPdebugMessage("%s: %g (obj = %g)\n", SCIPvarGetName(probvars[i]), SCIPgetPrimalRayVal(pricingprob, probvars[i]), SCIPvarGetObj(probvars[i]));
144 SCIP_CALL( GCGcreateGcgCol(pricingprob, newcol, probnr, solvars, solvals, nsolvars, TRUE, SCIPinfinity(pricingprob)) );
171 /** checks whether the given solution is equal to one of the former solutions in the sols array */
205 if( (!SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && !SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx])) )
206 && !SCIPisEQ(pricingprob, SCIPgetSolOrigObj(pricingprob, sols[s]), SCIPgetSolOrigObj(pricingprob, sols[idx])) )
209 if( (SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && !SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx])) )
210 ||(!SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[s])) && SCIPisInfinity(pricingprob, -SCIPgetSolOrigObj(pricingprob, sols[idx]))) )
214 if( SCIPsolGetOrigin(sols[s]) != SCIP_SOLORIGIN_ORIGINAL && SCIPsolGetOrigin(sols[idx]) != SCIP_SOLORIGIN_ORIGINAL )
252 assert((SCIPgetStatus(pricingprob) >= SCIP_STATUS_USERINTERRUPT && SCIPgetStatus(pricingprob) <= SCIP_STATUS_BESTSOLLIMIT)
262 SCIPdebugMessage(" -> interrupted, %d solutions found\n", SCIPgetNSols(pricingprob)); /*lint -fallthrough*/
355 /* Check whether the pricing problem solution has infinite values; if not, transform it to a column */
358 SCIP_CALL( GCGcreateGcgColFromSol(pricingprob, &col, probnr, probsols[s], FALSE, SCIPinfinity(pricingprob)) );
376 SCIP_CALL( GCGcreateGcgColFromSol(pricingprob, &col, probnr, newsol, FALSE, SCIPinfinity(pricingprob)) );
415 SCIPwarningMessage(pricingprob, "Pricing problem %d terminated with retcode = %d, ignoring\n", probnr, retcode);
423 SCIPstatisticMessage("P p %d: %"SCIP_LONGINT_FORMAT" no\n", probnr, SCIPgetNNodes(pricingprob) - oldnnodes);
451 /* If the pricing problem is neither infeasible nor unbounded, try to extract feasible columns */
469 SCIPerrorMessage("Pricing problem %d has invalid status: %d\n", probnr, SCIPgetStatus(pricingprob));
500 /** initialization method of pricing solver (called after problem was transformed and solver is active) */
503 /** deinitialization method of pricing solver (called before transformed problem is freed and solver is active) */
506 /** solving process initialization method of pricing solver (called when branch and bound process is about to begin) */
538 /** solving process deinitialization method of pricing solver (called before branch and bound process data is freed) */
628 solverdata->curnodelimit[probnr] = (SCIP_Longint) (solverdata->curnodelimit[probnr] * solverdata->nodelimitfac);
635 solverdata->curstallnodelimit[probnr] = (SCIP_Longint) (solverdata->curstallnodelimit[probnr] * solverdata->stallnodelimitfac);
644 solverdata->curgaplimit[probnr] = MAX(solverdata->curgaplimit[probnr] - solverdata->startgaplimit, 0.0);
649 solverdata->cursollimit[probnr] = (int) (solverdata->cursollimit[probnr] * solverdata->sollimitfac);
659 SCIP_CALL( SCIPsetLongintParam(pricingprob, "limits/nodes", solverdata->curnodelimit[probnr]) );
660 SCIP_CALL( SCIPsetLongintParam(pricingprob, "limits/stallnodes", solverdata->curstallnodelimit[probnr]) );
665 SCIPdebugMessage("Solving pricing %d heuristically (pointer: %p)\n", probnr, (void*)pricingprob);
691 solverUpdateMip, solverSolveMip, solverSolveHeurMip, solverFreeMip, solverInitMip, solverExitMip,
700 &solverdata->startnodelimit, TRUE, DEFAULT_STARTNODELIMIT, -1LL, SCIP_LONGINT_MAX, NULL, NULL) );
704 &solverdata->startstallnodelimit, TRUE, DEFAULT_STARTSTALLNODELIMIT, -1LL, SCIP_LONGINT_MAX, NULL, NULL) );
716 &solverdata->nodelimitfac, TRUE, DEFAULT_NODELIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
720 &solverdata->stallnodelimitfac, TRUE, DEFAULT_STALLNODELIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
728 &solverdata->sollimitfac, TRUE, DEFAULT_SOLLIMITFAC, 1.0, SCIPinfinity(origprob), NULL, NULL) );
SCIP_RETCODE GCGcreateGcgCol(SCIP *pricingprob, GCG_COL **gcgcol, int probnr, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool isray, SCIP_Real redcost)
Definition: gcgcol.c:52
GCG interface methods.
Definition: struct_gcgcol.h:50
SCIP_EXPORT void GCGsolverSetData(GCG_SOLVER *solver, GCG_SOLVERDATA *solverdata)
Definition: solver.c:387
static SCIP_RETCODE resolvePricingWithoutPresolving(SCIP *pricingprob)
Definition: solver_mip.c:156
public methods for working with gcg columns
SCIP_RETCODE GCGcreateGcgColFromSol(SCIP *pricingprob, GCG_COL **gcgcol, int prob, SCIP_SOL *sol, SCIP_Bool isray, SCIP_Real redcost)
Definition: gcgcol.c:154
static GCG_DECL_SOLVERSOLVEHEUR(solverSolveHeurMip)
Definition: solver_mip.c:602
GCG variable pricer.
static SCIP_RETCODE createColumnFromRay(SCIP *pricingprob, int probnr, GCG_COL **newcol)
Definition: solver_mip.c:99
Definition: solver_cliquer.c:59
static SCIP_RETCODE solveProblem(SCIP *scip, SCIP *pricingprob, int probnr, GCG_SOLVERDATA *solverdata, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status)
Definition: solver_mip.c:386
static GCG_PRICINGSTATUS getPricingstatus(SCIP *pricingprob)
Definition: solver_mip.c:232
SCIP_EXPORT GCG_SOLVERDATA * GCGsolverGetData(GCG_SOLVER *solver)
Definition: solver.c:377
SCIP_RETCODE GCGpricerIncludeSolver(SCIP *scip, 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:4370
static SCIP_RETCODE getColumnsFromPricingprob(SCIP *scip, SCIP *pricingprob, int probnr, SCIP_Bool checksols)
Definition: solver_mip.c:316
static SCIP_RETCODE checkSolNew(SCIP *pricingprob, SCIP_SOL **sols, int idx, SCIP_Bool *isnew)
Definition: solver_mip.c:173
SCIP_RETCODE GCGpricerAddCol(SCIP *scip, GCG_COL *col)
Definition: pricer_gcg.cpp:4764
static SCIP_Bool solutionHasInfiniteValue(SCIP *pricingprob, SCIP_SOL *sol)
Definition: solver_mip.c:294
mip solver for pricing problems