Scippy

SCIP

Solving Constraint Integer Programs

prop_rootredcost.c File Reference

Detailed Description

reduced cost strengthening using root node reduced costs and the cutoff bound

Author
Tobias Achterberg
Stefan Heinz

This propagator uses the root reduced cost to (globally) propagate against the cutoff bound. The propagator checks if the variables with non-zero root reduced cost can exceed the cutoff bound. If this is the case the corresponding bound can be tightened.

The propagate is performed during the search any time a new cutoff bound (primal solution) is found.

Definition in file prop_rootredcost.c.

#include <assert.h>
#include <string.h>
#include "scip/prop_rootredcost.h"

Go to the source code of this file.

Macros

Propagator properties
#define PROP_NAME   "rootredcost"
 
#define PROP_DESC   "reduced cost strengthening using root node reduced costs and the cutoff bound"
 
#define PROP_TIMING   SCIP_PROPTIMING_BEFORELP | SCIP_PROPTIMING_AFTERLPLOOP
 
#define PROP_PRIORITY   +10000000
 
#define PROP_FREQ   1
 
#define PROP_DELAY   FALSE
 

Functions

Local methods
static void propdataReset (SCIP *scip, SCIP_PROPDATA *propdata)
 
static SCIP_DECL_SORTPTRCOMP (varCompRedcost)
 
static SCIP_RETCODE propdataCreate (SCIP *scip, SCIP_PROPDATA **propdata)
 
static int countNonZeroRootRedcostVars (SCIP *scip, SCIP_VAR **vars, int nvars)
 
static SCIP_RETCODE propdataExit (SCIP *scip, SCIP_PROPDATA *propdata)
 
static SCIP_RETCODE propdataInit (SCIP *scip, SCIP_PROPDATA *propdata)
 
static SCIP_RETCODE propagateRootRedcostVar (SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffbound, SCIP_Bool *infeasible, SCIP_Bool *tightened)
 
static SCIP_RETCODE propagateBinaryBestRootRedcost (SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Real cutoffbound, int *nchgbds, SCIP_Bool *cutoff)
 
Callback methods of propagator
static SCIP_DECL_PROPCOPY (propCopyRootredcost)
 
static SCIP_DECL_PROPFREE (propFreeRootredcost)
 
static SCIP_DECL_PROPEXITSOL (propExitsolRootredcost)
 
static SCIP_DECL_PROPEXEC (propExecRootredcost)
 
Interface methods
SCIP_RETCODE SCIPincludePropRootredcost (SCIP *scip)
 

Macro Definition Documentation

#define PROP_NAME   "rootredcost"

Definition at line 45 of file prop_rootredcost.c.

Referenced by SCIP_DECL_PROPCOPY(), and SCIPincludePropRootredcost().

#define PROP_DESC   "reduced cost strengthening using root node reduced costs and the cutoff bound"

Definition at line 46 of file prop_rootredcost.c.

Referenced by SCIPincludePropRootredcost().

Definition at line 47 of file prop_rootredcost.c.

Referenced by SCIPincludePropRootredcost().

#define PROP_PRIORITY   +10000000

propagator priority

Definition at line 48 of file prop_rootredcost.c.

Referenced by SCIPincludePropRootredcost().

#define PROP_FREQ   1

propagator frequency

Definition at line 49 of file prop_rootredcost.c.

Referenced by SCIPincludePropRootredcost().

#define PROP_DELAY   FALSE

should propagation method be delayed, if other propagators found reductions?

Definition at line 50 of file prop_rootredcost.c.

Referenced by SCIPincludePropRootredcost().

Function Documentation

static void propdataReset ( SCIP scip,
SCIP_PROPDATA propdata 
)
static

reset structure memember of propagator data structure

Parameters
scipSCIP data structure
propdatapropagator data to reset

Definition at line 78 of file prop_rootredcost.c.

References FALSE, NULL, and SCIP_INVALID.

Referenced by propdataCreate(), and propdataExit().

static SCIP_DECL_SORTPTRCOMP ( varCompRedcost  )
static

compare variables with non-zero reduced cost w.r.t. (i) the cutoff bound which would lead to a fixing (ii) variable problem index;

Definition at line 96 of file prop_rootredcost.c.

References REALABS, SCIP_Real, SCIPvarCompare(), SCIPvarGetBestRootLPObjval(), SCIPvarGetBestRootRedcost(), and SCIPvarIsBinary().

static SCIP_RETCODE propdataCreate ( SCIP scip,
SCIP_PROPDATA **  propdata 
)
static

create propagator data structure

Parameters
scipSCIP data structure
propdatapointer to store the created propagator data

Definition at line 127 of file prop_rootredcost.c.

References propdataReset(), SCIP_CALL, SCIP_OKAY, and SCIPallocMemory.

Referenced by SCIPincludePropRootredcost().

static int countNonZeroRootRedcostVars ( SCIP scip,
SCIP_VAR **  vars,
int  nvars 
)
static

counts the number of variables with non-zero root reduced cost

Parameters
scipSCIP data structure
varsvariable array
nvarsnumber of variables

Definition at line 141 of file prop_rootredcost.c.

References NULL, SCIP_Real, SCIPisFeasZero(), and SCIPvarGetBestRootRedcost().

Referenced by propdataInit().

static SCIP_RETCODE propdataExit ( SCIP scip,
SCIP_PROPDATA propdata 
)
static

free propagator data

Parameters
scipSCIP data structure
propdatapropagator data

Definition at line 169 of file prop_rootredcost.c.

References propdataReset(), SCIP_CALL, SCIP_OKAY, SCIPfreeMemoryArrayNull, and SCIPreleaseVar().

Referenced by SCIP_DECL_PROPEXITSOL().

static SCIP_RETCODE propdataInit ( SCIP scip,
SCIP_PROPDATA propdata 
)
static
static SCIP_RETCODE propagateRootRedcostVar ( SCIP scip,
SCIP_VAR var,
SCIP_Real  cutoffbound,
SCIP_Bool infeasible,
SCIP_Bool tightened 
)
static

propagates the root reduced cost against the cutoff bound for the given variable

Parameters
scipSCIP data structure
varvariable to propagate
cutoffboundcutoff bound to use
infeasiblepointer to store whether the new domain is empty
tightenedpointer to store if the bound was tightened

Definition at line 292 of file prop_rootredcost.c.

References FALSE, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisFeasZero(), SCIPtightenVarLbGlobal(), SCIPtightenVarUbGlobal(), SCIPvarGetBestRootLPObjval(), SCIPvarGetBestRootRedcost(), SCIPvarGetBestRootSol(), SCIPvarGetLbGlobal(), and SCIPvarGetUbGlobal().

Referenced by propagateBinaryBestRootRedcost(), and SCIP_DECL_PROPEXEC().

static SCIP_RETCODE propagateBinaryBestRootRedcost ( SCIP scip,
SCIP_PROPDATA propdata,
SCIP_Real  cutoffbound,
int *  nchgbds,
SCIP_Bool cutoff 
)
static

propagate binary variables with non-zero root reduced cost

Parameters
scipSCIP data structure
propdatapropagator data structure
cutoffboundcutoff bound to use
nchgbdspointer to store the number of bound changes
cutoffpointer to store if a cutoff was detected

Definition at line 336 of file prop_rootredcost.c.

References NULL, propagateRootRedcostVar(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPvarGetBestRootLPObjval(), SCIPvarGetBestRootRedcost(), SCIPvarGetBestRootSol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), and SCIPvarGetUbGlobal().

Referenced by SCIP_DECL_PROPEXEC().

static SCIP_DECL_PROPCOPY ( propCopyRootredcost  )
static

copy method for propagator plugins (called when SCIP copies plugins)

Definition at line 483 of file prop_rootredcost.c.

References NULL, PROP_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludePropRootredcost(), and SCIPpropGetName().

static SCIP_DECL_PROPFREE ( propFreeRootredcost  )
static

destructor of propagator to free user data (called when SCIP is exiting)

Definition at line 497 of file prop_rootredcost.c.

References NULL, SCIP_OKAY, SCIPfreeMemory, SCIPpropGetData(), and SCIPpropSetData().

static SCIP_DECL_PROPEXITSOL ( propExitsolRootredcost  )
static

solving process deinitialization method of propagator (called before branch and bound process data is freed)

Definition at line 514 of file prop_rootredcost.c.

References NULL, propdataExit(), SCIP_CALL, SCIP_OKAY, and SCIPpropGetData().

SCIP_RETCODE SCIPincludePropRootredcost ( SCIP scip)

creates the root node reduced cost strengthening propagator and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 646 of file prop_rootredcost.c.

References NULL, PROP_DELAY, PROP_DESC, PROP_FREQ, PROP_NAME, PROP_PRIORITY, PROP_TIMING, propdataCreate(), SCIP_CALL, SCIP_OKAY, SCIPincludePropBasic(), SCIPsetPropCopy(), SCIPsetPropExitsol(), and SCIPsetPropFree().

Referenced by SCIP_DECL_PROPCOPY(), and SCIPincludeDefaultPlugins().