Scippy

SCIP

Solving Constraint Integer Programs

pricer.c File Reference

Detailed Description

methods for variable pricers

Author
Tobias Achterberg
Timo Berthold

Definition in file pricer.c.

#include <assert.h>
#include <string.h>
#include "scip/def.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/paramset.h"
#include "scip/lp.h"
#include "scip/prob.h"
#include "scip/pricestore.h"
#include "scip/scip.h"
#include "scip/pricer.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/struct_pricer.h"

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPpricerComp)
 
 SCIP_DECL_SORTPTRCOMP (SCIPpricerCompName)
 
static SCIP_DECL_PARAMCHGD (paramChgdPricerPriority)
 
SCIP_RETCODE SCIPpricerCopyInclude (SCIP_PRICER *pricer, SCIP_SET *set, SCIP_Bool *valid)
 
SCIP_RETCODE SCIPpricerCreate (SCIP_PRICER **pricer, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERCOPY((*pricercopy)), SCIP_DECL_PRICERFREE((*pricerfree)), SCIP_DECL_PRICERINIT((*pricerinit)), SCIP_DECL_PRICEREXIT((*pricerexit)), SCIP_DECL_PRICERINITSOL((*pricerinitsol)), SCIP_DECL_PRICEREXITSOL((*pricerexitsol)), SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
 
SCIP_RETCODE SCIPpricerFree (SCIP_PRICER **pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerInit (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerExit (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerInitsol (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerExitsol (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerActivate (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerDeactivate (SCIP_PRICER *pricer, SCIP_SET *set)
 
SCIP_RETCODE SCIPpricerRedcost (SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
 
SCIP_RETCODE SCIPpricerFarkas (SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob)
 
SCIP_RETCODE SCIPpricerExec (SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
 
SCIP_PRICERDATASCIPpricerGetData (SCIP_PRICER *pricer)
 
void SCIPpricerSetData (SCIP_PRICER *pricer, SCIP_PRICERDATA *pricerdata)
 
void SCIPpricerSetCopy (SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
 
void SCIPpricerSetFree (SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
 
void SCIPpricerSetInit (SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
 
void SCIPpricerSetExit (SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
 
void SCIPpricerSetInitsol (SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
 
void SCIPpricerSetExitsol (SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
 
const char * SCIPpricerGetName (SCIP_PRICER *pricer)
 
const char * SCIPpricerGetDesc (SCIP_PRICER *pricer)
 
int SCIPpricerGetPriority (SCIP_PRICER *pricer)
 
void SCIPpricerSetPriority (SCIP_PRICER *pricer, SCIP_SET *set, int priority)
 
int SCIPpricerGetNCalls (SCIP_PRICER *pricer)
 
int SCIPpricerGetNVarsFound (SCIP_PRICER *pricer)
 
SCIP_Real SCIPpricerGetSetupTime (SCIP_PRICER *pricer)
 
SCIP_Real SCIPpricerGetTime (SCIP_PRICER *pricer)
 
SCIP_Bool SCIPpricerIsActive (SCIP_PRICER *pricer)
 
SCIP_Bool SCIPpricerIsDelayed (SCIP_PRICER *pricer)
 
SCIP_Bool SCIPpricerIsInitialized (SCIP_PRICER *pricer)
 

Function Documentation

SCIP_DECL_SORTPTRCOMP ( SCIPpricerComp  )

compares two pricers w. r. to their activity and their priority

Definition at line 44 of file pricer.c.

SCIP_DECL_SORTPTRCOMP ( SCIPpricerCompName  )

comparison method for sorting pricers w.r.t. to their name

Definition at line 53 of file pricer.c.

References SCIPpricerGetName().

static SCIP_DECL_PARAMCHGD ( paramChgdPricerPriority  )
static

method to call, when the priority of a pricer was changed

Definition at line 63 of file pricer.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPparamGetData(), SCIPparamGetInt(), and SCIPsetPricerPriority().

SCIP_RETCODE SCIPpricerCopyInclude ( SCIP_PRICER pricer,
SCIP_SET set,
SCIP_Bool valid 
)

copies the given pricer to a new scip

Parameters
pricerpricer
setSCIP_SET of SCIP to copy to
validwas the copying process valid?

Definition at line 77 of file pricer.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPpricerGetName().

Referenced by SCIPsetCopyPlugins().

SCIP_RETCODE SCIPpricerCreate ( SCIP_PRICER **  pricer,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
BMS_BLKMEM blkmem,
const char *  name,
const char *  desc,
int  priority,
SCIP_Bool  delay,
SCIP_DECL_PRICERCOPY((*pricercopy))  ,
SCIP_DECL_PRICERFREE((*pricerfree))  ,
SCIP_DECL_PRICERINIT((*pricerinit))  ,
SCIP_DECL_PRICEREXIT((*pricerexit))  ,
SCIP_DECL_PRICERINITSOL((*pricerinitsol))  ,
SCIP_DECL_PRICEREXITSOL((*pricerexitsol))  ,
SCIP_DECL_PRICERREDCOST((*pricerredcost))  ,
SCIP_DECL_PRICERFARKAS((*pricerfarkas))  ,
SCIP_PRICERDATA pricerdata 
)

creates a variable pricer To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().

Parameters
pricerpointer to variable pricer data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of variable pricer
descdescription of variable pricer
prioritypriority of the variable pricer
delayshould the pricer be delayed until no other pricers or already existing problem variables with negative reduced costs are found
pricerdatavariable pricer data

Definition at line 99 of file pricer.c.

References BMSallocMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPclockCreate(), SCIPsetAddIntParam(), and SCIPsnprintf().

Referenced by SCIPincludePricer(), and SCIPincludePricerBasic().

SCIP_RETCODE SCIPpricerFree ( SCIP_PRICER **  pricer,
SCIP_SET set 
)

calls destructor and frees memory of variable pricer

Parameters
pricerpointer to variable pricer data structure
setglobal SCIP settings

Definition at line 160 of file pricer.c.

References BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().

Referenced by SCIPsetFree().

SCIP_RETCODE SCIPpricerInit ( SCIP_PRICER pricer,
SCIP_SET set 
)
SCIP_RETCODE SCIPpricerExit ( SCIP_PRICER pricer,
SCIP_SET set 
)

calls exit method of variable pricer

Parameters
pricervariable pricer
setglobal SCIP settings

Definition at line 226 of file pricer.c.

References SCIP_Pricer::active, FALSE, SCIP_Pricer::initialized, SCIP_Pricer::name, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), SCIPerrorMessage, and SCIP_Pricer::setuptime.

Referenced by SCIPsetExitPlugins().

SCIP_RETCODE SCIPpricerInitsol ( SCIP_PRICER pricer,
SCIP_SET set 
)

informs variable pricer that the branch and bound process is being started

Parameters
pricervariable pricer
setglobal SCIP settings

Definition at line 257 of file pricer.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIP_Pricer::setuptime.

Referenced by SCIPsetInitsolPlugins().

SCIP_RETCODE SCIPpricerExitsol ( SCIP_PRICER pricer,
SCIP_SET set 
)

informs variable pricer that the branch and bound process data is being freed

Parameters
pricervariable pricer
setglobal SCIP settings

Definition at line 281 of file pricer.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIP_Pricer::setuptime.

Referenced by SCIPsetExitsolPlugins().

SCIP_RETCODE SCIPpricerActivate ( SCIP_PRICER pricer,
SCIP_SET set 
)

activates pricer such that it is called in LP solving loop

Parameters
pricervariable pricer
setglobal SCIP settings

Definition at line 305 of file pricer.c.

References SCIP_Pricer::active, FALSE, NULL, SCIP_OKAY, SCIP_STAGE_PROBLEM, and TRUE.

Referenced by SCIPactivatePricer().

SCIP_RETCODE SCIPpricerDeactivate ( SCIP_PRICER pricer,
SCIP_SET set 
)

deactivates pricer such that it is no longer called in LP solving loop

Parameters
pricervariable pricer
setglobal SCIP settings

Definition at line 325 of file pricer.c.

References SCIP_Pricer::active, FALSE, NULL, SCIP_OKAY, and SCIP_STAGE_PROBLEM.

Referenced by SCIPdeactivatePricer(), and SCIPfreeProb().

SCIP_RETCODE SCIPpricerRedcost ( SCIP_PRICER pricer,
SCIP_SET set,
SCIP_PROB prob,
SCIP_Real lowerbound,
SCIP_Bool stopearly,
SCIP_RESULT result 
)

calls reduced cost pricing method of variable pricer

Parameters
pricervariable pricer
setglobal SCIP settings
probtransformed problem
lowerboundlocal lower bound computed by the pricer
stopearlyshould pricing be stopped, although new variables were added?
resultresult of the pricing process

Definition at line 345 of file pricer.c.

References SCIP_Pricer::active, SCIP_Pricer::name, SCIP_Pricer::ncalls, NULL, SCIP_Prob::nvars, SCIP_Pricer::nvarsfound, SCIP_Pricer::pricerclock, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIPdebugMessage.

Referenced by SCIPpricerExec().

SCIP_RETCODE SCIPpricerFarkas ( SCIP_PRICER pricer,
SCIP_SET set,
SCIP_PROB prob 
)

calls Farkas pricing method of variable pricer

Parameters
pricervariable pricer
setglobal SCIP settings
probtransformed problem

Definition at line 385 of file pricer.c.

References SCIP_Pricer::active, SCIP_Pricer::name, SCIP_Pricer::ncalls, NULL, SCIP_Prob::nvars, SCIP_Pricer::nvarsfound, SCIP_Pricer::pricerclock, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIPdebugMessage.

Referenced by SCIPpricerExec().

SCIP_RETCODE SCIPpricerExec ( SCIP_PRICER pricer,
SCIP_SET set,
SCIP_PROB prob,
SCIP_LP lp,
SCIP_PRICESTORE pricestore,
SCIP_Real lowerbound,
SCIP_Bool stopearly,
SCIP_RESULT result 
)

depending on the LP's solution status, calls reduced cost or Farkas pricing method of variable pricer

Parameters
pricervariable pricer
setglobal SCIP settings
probtransformed problem
lpLP data
pricestorepricing storage
lowerboundlocal lower bound computed by the pricer
stopearlyshould pricing be stopped, although new variables were added?
resultresult of the pricing process

Definition at line 423 of file pricer.c.

References SCIP_Pricer::delay, FALSE, NULL, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_OKAY, SCIP_SUCCESS, SCIPlpGetSolstat(), SCIPpricerFarkas(), SCIPpricerRedcost(), SCIPpricestoreGetNVars(), and SCIPsetInfinity().

Referenced by SCIPpriceLoop().

void SCIPpricerSetData ( SCIP_PRICER pricer,
SCIP_PRICERDATA pricerdata 
)

sets user data of variable pricer; user has to free old data in advance!

Parameters
pricervariable pricer
pricerdatanew variable pricer user data

Definition at line 472 of file pricer.c.

References NULL, and SCIP_Pricer::pricerdata.

Referenced by SCIP_DECL_PRICERFREE().

void SCIPpricerSetCopy ( SCIP_PRICER pricer,
SCIP_DECL_PRICERCOPY((*pricercopy))   
)

sets copy callback of pricer

Parameters
pricervariable pricer

Definition at line 483 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerCopy().

void SCIPpricerSetFree ( SCIP_PRICER pricer,
SCIP_DECL_PRICERFREE((*pricerfree))   
)

sets destructor callback of pricer

Parameters
pricerpricer

Definition at line 494 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerFree().

void SCIPpricerSetInit ( SCIP_PRICER pricer,
SCIP_DECL_PRICERINIT((*pricerinit))   
)

sets initialization callback of pricer

Parameters
pricerpricer

Definition at line 505 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerInit().

void SCIPpricerSetExit ( SCIP_PRICER pricer,
SCIP_DECL_PRICEREXIT((*pricerexit))   
)

sets deinitialization callback of pricer

Parameters
pricerpricer

Definition at line 516 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerExit().

void SCIPpricerSetInitsol ( SCIP_PRICER pricer,
SCIP_DECL_PRICERINITSOL((*pricerinitsol))   
)

sets solving process initialization callback of pricer

Parameters
pricerpricer

Definition at line 527 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerInitsol().

void SCIPpricerSetExitsol ( SCIP_PRICER pricer,
SCIP_DECL_PRICEREXITSOL((*pricerexitsol))   
)

sets solving process deinitialization callback of pricer

Parameters
pricerpricer

Definition at line 538 of file pricer.c.

References NULL.

Referenced by SCIPsetPricerExitsol().

const char* SCIPpricerGetName ( SCIP_PRICER pricer)

gets name of variable pricer

Parameters
pricervariable pricer

Definition at line 549 of file pricer.c.

References SCIP_Pricer::name, and NULL.

Referenced by printPricerStatistics(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_SORTPTRCOMP(), SCIPincludeDialogDefaultFix(), SCIPincludeDialogDefaultSet(), SCIPpriceLoop(), SCIPpricerCopyInclude(), and SCIPsetFindPricer().

const char* SCIPpricerGetDesc ( SCIP_PRICER pricer)

gets description of variable pricer

Parameters
pricervariable pricer

Definition at line 559 of file pricer.c.

References SCIP_Pricer::desc, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPincludeDialogDefaultFix(), and SCIPincludeDialogDefaultSet().

int SCIPpricerGetPriority ( SCIP_PRICER pricer)

gets priority of variable pricer

Parameters
pricervariable pricer

Definition at line 569 of file pricer.c.

References NULL, and SCIP_Pricer::priority.

Referenced by SCIP_DECL_DIALOGEXEC().

void SCIPpricerSetPriority ( SCIP_PRICER pricer,
SCIP_SET set,
int  priority 
)

sets priority of variable pricer

Parameters
pricervariable pricer
setglobal SCIP settings
prioritynew priority of the variable pricer

Definition at line 579 of file pricer.c.

References FALSE, NULL, and SCIP_Pricer::priority.

Referenced by SCIPsetPricerPriority().

int SCIPpricerGetNCalls ( SCIP_PRICER pricer)

gets the number of times, the pricer was called and tried to find a variable with negative reduced costs

Parameters
pricervariable pricer

Definition at line 593 of file pricer.c.

References SCIP_Pricer::ncalls, and NULL.

Referenced by printPricerStatistics().

int SCIPpricerGetNVarsFound ( SCIP_PRICER pricer)

gets the number of variables with negative reduced costs found by this pricer

Parameters
pricervariable pricer

Definition at line 603 of file pricer.c.

References NULL, and SCIP_Pricer::nvarsfound.

Referenced by printPricerStatistics().

SCIP_Real SCIPpricerGetSetupTime ( SCIP_PRICER pricer)

gets time in seconds used in this pricer for setting up for next stages

Parameters
pricervariable pricer

Definition at line 613 of file pricer.c.

References NULL, SCIPclockGetTime(), and SCIP_Pricer::setuptime.

Referenced by printPricerStatistics().

SCIP_Real SCIPpricerGetTime ( SCIP_PRICER pricer)

gets time in seconds used in this pricer

Parameters
pricervariable pricer

Definition at line 623 of file pricer.c.

References NULL, SCIP_Pricer::pricerclock, and SCIPclockGetTime().

Referenced by printPricerStatistics().

SCIP_Bool SCIPpricerIsActive ( SCIP_PRICER pricer)

returns whether the given pricer is in use in the current problem

Parameters
pricervariable pricer

Definition at line 633 of file pricer.c.

References SCIP_Pricer::active, and NULL.

Referenced by SCIPsetCopyPlugins().

SCIP_Bool SCIPpricerIsDelayed ( SCIP_PRICER pricer)

returns whether the pricer should be delayed until no other pricer finds a new variable

Parameters
pricervariable pricer

Definition at line 643 of file pricer.c.

References SCIP_Pricer::delay, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_Bool SCIPpricerIsInitialized ( SCIP_PRICER pricer)

is variable pricer initialized?

Parameters
pricervariable pricer

Definition at line 653 of file pricer.c.

References SCIP_Pricer::initialized, and NULL.