Loading...
Searching...
No Matches
class_pricingcontroller.cpp
Go to the documentation of this file.
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
59#define DEFAULT_HEURPRICINGITERS 1 /**< maximum number of heuristic pricing iterations per pricing call and problem */
60#define DEFAULT_MAXHEURDEPTH -1 /**< maximum depth at which heuristic pricing should be performed (-1 for infinity) */
68#define DEFAULT_CHUNKSIZE INT_MAX /**< maximal number of pricing problems to be solved during one pricing loop */
69#define DEFAULT_EAGERFREQ 10 /**< frequency at which all pricingproblems should be solved (0 to disable) */
132 "order by which the pricing problems should be sorted ('i'ndices, 'd'ual solutions of convexity constraints, 'r'eliability from previous rounds, reliability from the 'l'ast nroundscol rounds)",
218 assert(SCIPnodeGetDepth(GCGconsMasterbranchGetNode(branchcons)) == 0 || branchrule != NULL || SCIPinProbing(scip_));
264 || (GCGpricingprobGetStatus(pricingprob) == GCG_PRICINGSTATUS_OPTIMAL && GCGpricingprobGetBranchconsIdx(pricingprob) == 0)
269/** check whether the next generic branching constraint of a pricing problem must be considered */
301 SCIP_CALL_EXC( GCGpricingprobCreate(gcg, &pricingprobs[npricingprobs], GCGgetPricingprob(gcg, i), i, nroundscol) );
307 SCIP_CALL_EXC( GCGpricingjobCreate(gcg, &pricingjobs[npricingjobs], pricingprobs[npricingprobs], solvers[j], npricingprobs / actchunksize) );
317 SCIP_CALL_EXC( GCGpqueueCreate(scip_, &pqueue, npricingjobs, comparePricingjobs, &locks->memorylock) );
364 tmpmaxniters += GCGpricerGetNSolvers(gcg) * ((SCIP_Longint) heurpricingiters + 1) * (GCGpricingprobGetNGenericBranchconss(pricingprobs[i]) + 1);
381/** setup the priority queue (done once per stabilization round): add all pricing jobs to be performed */
383 SCIP_Real* dualsolconv /**< dual solution values / Farkas coefficients of convexity constraints */
399 (heurpricingiters > 0 && (maxheurdepth == -1 || SCIPnodeGetDepth(SCIPgetCurrentNode(scip_)) <= maxheurdepth)),
400 sorting, nroundscol, dualsolconv[probnr], GCGpricerGetNPointsProb(gcg, probnr), GCGpricerGetNRaysProb(gcg, probnr)) );
502 * increase at least one of its limits, or solve it exactly if it was solved heuristically before
510 if( heuristic && status != GCG_PRICINGSTATUS_OPTIMAL && status != GCG_PRICINGSTATUS_NOTAPPLICABLE )
514 if( status != GCG_PRICINGSTATUS_SOLVERLIMIT || GCGpricingjobGetNHeurIters(pricingjob) >= heurpricingiters )
570 SCIP_Bool* optimal, /**< pointer to store whether all pricing problems were solved to optimality */
594 if( *bestredcostvalid && !stabilized && bestcols[probnr] != NULL && SCIPgetStatus(pricingprobs[i]->pricingscip) == SCIP_STATUS_OPTIMAL )
596 /* set dual bound due to numerical issues: the best col may not belong to the lowerbound of this optimal round
599 assert(SCIPisFeasEQ(pricingprobs[i]->pricingscip, GCGpricingprobGetLowerbound(pricingprobs[i]), lowerbound));
616 bestobjvals[probnr] = SCIPisInfinity(scip_, ABS(lowerbound)) ? lowerbound : nidentblocks * lowerbound;
683/** for a given problem index, get the corresponding pricing problem (or NULL, if it does not exist) */
int GCGbranchGenericBranchdataGetConsblocknr(GCG_BRANCHDATA *branchdata)
Definition branch_generic.c:3067
SCIP_CONS * GCGbranchGenericBranchdataGetMastercons(GCG_BRANCHDATA *branchdata)
Definition branch_generic.c:3076
SCIP_Bool GCGisBranchruleGeneric(GCG_BRANCHRULE *branchrule)
Definition branch_generic.c:3085
branching rule based on vanderbeck's generic branching scheme
Definition class_pricingtype.h:49
virtual SCIP_Real consGetDual(SCIP_CONS *cons) const =0
virtual int getMaxcolsround() const =0
pricing controller managing the pricing strategy
abstraction for SCIP pricing types
void updatePricingprob(GCG_PRICINGPROB *pricingprob, GCG_PRICINGSTATUS status, SCIP_Real lowerbound, int nimpcols)
Definition class_pricingcontroller.cpp:478
SCIP_Bool canPricingloopBeAborted(PricingType *pricingtype, int nfoundcols, int nsuccessfulprobs) const
Definition class_pricingcontroller.cpp:649
SCIP_Bool checkNextChunk()
Definition class_pricingcontroller.cpp:631
void evaluatePricingjob(GCG_PRICINGJOB *pricingjob, GCG_PRICINGSTATUS status)
Definition class_pricingcontroller.cpp:489
GCG_PRICINGPROB * getPricingprob(int probnr)
Definition class_pricingcontroller.cpp:684
void increaseEagerage()
Definition class_pricingcontroller.cpp:675
SCIP_RETCODE setPricingjobTimelimit(GCG_PRICINGJOB *pricingjob)
Definition class_pricingcontroller.cpp:459
SCIP_RETCODE addParameters()
Definition class_pricingcontroller.cpp:121
SCIP_RETCODE initPricing(PricingType *pricingtype)
Definition class_pricingcontroller.cpp:344
int getMaxNIters() const
Definition class_pricingcontroller.cpp:696
GCG_PRICINGJOB * getNextPricingjob()
Definition class_pricingcontroller.cpp:414
Pricingcontroller()
virtual ~Pricingcontroller()
Definition class_pricingcontroller.cpp:117
void collectResults(GCG_COL **bestcols, SCIP_Real *dualsolconv, SCIP_Bool stabilized, SCIP_Bool *infeasible, SCIP_Bool *optimal, SCIP_Real *bestobjvals, SCIP_Real *beststabobj, SCIP_Real *bestredcost, SCIP_Bool *bestredcostvalid)
Definition class_pricingcontroller.cpp:565
SCIP_RETCODE pricingprobNextBranchcons(GCG_PRICINGPROB *pricingprob)
Definition class_pricingcontroller.cpp:433
SCIP_RETCODE setupPriorityQueue(SCIP_Real *dualsolconv)
Definition class_pricingcontroller.cpp:382
GCG_BRANCHRULE * GCGconsMasterbranchGetBranchrule(SCIP_CONS *cons)
Definition cons_masterbranch.c:2933
SCIP_CONS * GCGconsMasterbranchGetParentcons(SCIP_CONS *cons)
Definition cons_masterbranch.c:2828
GCG_BRANCHDATA * GCGconsMasterbranchGetBranchdata(SCIP_CONS *cons)
Definition cons_masterbranch.c:2907
SCIP_CONS * GCGconsMasterbranchGetActiveCons(GCG *gcg)
Definition cons_masterbranch.c:3056
SCIP_NODE * GCGconsMasterbranchGetNode(SCIP_CONS *cons)
Definition cons_masterbranch.c:2813
constraint handler for storing the branching decisions at each node of the tree
#define SCIP_Longint
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define ABS(x)
#define MAX(x, y)
#define TRUE
#define FALSE
GCG interface methods.
int GCGpricerGetNPointsProb(GCG *gcg, int probnr)
Definition pricer_gcg.cpp:6061
GCG_EXPORT SCIP * GCGgetPricingprob(GCG *gcg, int pricingprobnr)
Definition relax_gcg.c:4075
GCG_EXPORT int GCGgetNIdenticalBlocks(GCG *gcg, int pricingprobnr)
Definition relax_gcg.c:4185
GCG_EXPORT SCIP_Bool GCGisPricingprobRelevant(GCG *gcg, int pricingprobnr)
Definition relax_gcg.c:4132
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
GCG_PRICINGPROB * GCGpricingjobGetPricingprob(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:135
SCIP * GCGpricingprobGetPricingscip(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:200
GCG_EXPORT SCIP_Bool GCGsolverIsHeurEnabled(GCG_SOLVER *solver)
Definition solver.c:451
GCG_EXPORT SCIP_Bool GCGsolverIsExactEnabled(GCG_SOLVER *solver)
Definition solver.c:461
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, 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 SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_RETCODE GCGpqueueInsert(GCG_PQUEUE *pqueue, void *elem)
Definition gcgpqueue.c:173
SCIP_RETCODE GCGpqueueCreate(SCIP *scip, GCG_PQUEUE **pqueue, int initsize, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), GCG_LOCK *memorylock)
Definition gcgpqueue.c:124
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
int SCIPnodeGetDepth(SCIP_NODE *node)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
static assert(heur !=NULL)
SCIP_CALL(SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL))
SCIPdebugMessage("feasibility pump finished [%d iterations done].\n", nloops)
#define NULL
Definition class_conspartition.cpp:44
SCIP_DECL_SORTPTRCOMP(Pricingcontroller::comparePricingjobs)
Definition class_pricingcontroller.cpp:151
GCG variable pricer.
void GCGpricingjobSetExact(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:256
SCIP_RETCODE GCGpricingjobSetup(GCG *gcg, GCG_PRICINGJOB *pricingjob, SCIP_Bool heuristic, int scoring, int nroundscol, SCIP_Real dualsolconv, int npointsprob, int nraysprob)
Definition pricingjob.c:91
GCG_SOLVER * GCGpricingjobGetSolver(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:142
SCIP_Real GCGpricingjobGetScore(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:240
void GCGpricingjobResetHeuristic(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:264
SCIP_Bool GCGpricingjobIsHeuristic(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:248
void GCGpricingjobNextSolver(GCG *gcg, GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:180
void GCGpricingjobFree(GCG *gcg, GCG_PRICINGJOB **pricingjob)
Definition pricingjob.c:75
int GCGpricingjobGetNHeurIters(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:285
SCIP_RETCODE GCGpricingjobCreate(GCG *gcg, GCG_PRICINGJOB **pricingjob, GCG_PRICINGPROB *pricingprob, GCG_SOLVER *solver, int chunk)
Definition pricingjob.c:52
SCIP_Real GCGpricingjobGetChunk(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:232
void GCGpricingjobIncreaseNHeurIters(GCG_PRICINGJOB *pricingjob)
Definition pricingjob.c:276
private methods for working with pricing jobs, to be used by the pricing controller only
void GCGpricingprobUpdate(GCG *gcg, GCG_PRICINGPROB *pricingprob, GCG_PRICINGSTATUS status, SCIP_Real lowerbound, int nimpcols)
Definition pricingprob.c:178
void GCGpricingprobNextBranchcons(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:264
int GCGpricingprobGetBranchconsIdx(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:240
void GCGpricingprobInitPricing(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:98
SCIP_Real GCGpricingprobGetLowerbound(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:283
int GCGpricingprobGetNImpCols(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:291
void GCGpricingprobReset(GCG *gcg, GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:164
void GCGpricingprobFree(GCG *gcg, GCG_PRICINGPROB **pricingprob)
Definition pricingprob.c:84
SCIP_RETCODE GCGpricingprobAddGenericBranchData(GCG *gcg, GCG_PRICINGPROB *pricingprob, SCIP_CONS *branchcons, SCIP_Real branchdual)
Definition pricingprob.c:125
GCG_PRICINGSTATUS GCGpricingprobGetStatus(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:275
int GCGpricingprobGetProbnr(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:208
int GCGpricingprobGetNGenericBranchconss(GCG_PRICINGPROB *pricingprob)
Definition pricingprob.c:232
SCIP_RETCODE GCGpricingprobCreate(GCG *gcg, GCG_PRICINGPROB **pricingprob, SCIP *pricingscip, int probnr, int nroundscol)
Definition pricingprob.c:52
void GCGpricingprobExitPricing(GCG_PRICINGPROB *pricingprob, int nroundscol)
Definition pricingprob.c:110
private methods for working with pricing problems, to be used by the pricing controller only
public methods for working with pricing jobs
public methods for working with pricing problems
various SCIP helper methods
data structures for storing OpenMP locks
struct SCIP_Cons SCIP_CONS
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
SCIP_STATUS_OPTIMAL