Sometimes, we developers would like to add constraints to the reformulation that have no (known) counterpart in the original problem. To facilitate this, GCG provides an interface to add such constraints. This page defines the structure of such constraints, which we call extended master constraints, and provides an example of how to add them to the reformulation.
Theoretical background
Extended master constraints are constraints that are added to the master problem of the Dantzig-Wolfe reformulation. Ordinarily, we require such constraints when no counterpart in the original problem exists. Let's assume that we have the following constraint to be added to the master:
\begin{align} \sum_{p \in P} f(p) \lambda_p + \sum_{r \in R} f(r) \lambda_r \leq h \quad \left[ \gamma \right] \end{align}
where (f) is a function used to determine the coefficient of each column in the constraint.
To ensure this constraint is valid and correct throughout the column generation process, the relevant pricing problems are now responsible for generating the correct column coefficient of the master constraint for each new column. In doing so, we can also consider the dual value of the constraint in the pricing problem, ensuring only columns with negative reduced cost are generated. For this we create a new variable (y), the coefficient variable in the pricing problem, which we will force to take the coefficient value of the new column in the master constraint. Expressing this constraint (y = f(x)) might require additional constraints and auxiliary variables. We call these variables inferred pricing variables, as they are inferred from the extended master constraint.
\begin{align} & \text{min} & & \left( c^\top - \pi^\top A \right) x - \gamma y - \pi_0 & \\ & \text{s.t.} & & D x &\geq d \\ & & & y &= f(x) \\ & & & x &\in X \\ & & & y &\in Y \end{align}
Interface
In GCG, an extended master constraint (GCG_EXTENDEDMASTERCONSDATA) is a wrapper around either a SCIP_CONS or a SCIP_ROW to be added to the master problem, in addition to one set of pricing modifications (GCG_PRICINGMODIFICATION) for each relevant pricing problem. A pricing problem consists of a coefficient variable (SCIP_VAR), as well as any additional constraints (SCIP_CONS) and auxiliary variables (SCIP_VAR), inferred pricing variables, required to express the constraint (y = f(x)). It is required that these variables have the type GCG_VARTYPE_INFERREDPRICING. We advise using the following interfaces:
- create inferred pricing variables with
GCGcreateInferredPricingVar() - create modifications with
GCGpricingmodificationCreate() - create an extended master constraint around a
SCIP_CONSwithGCGextendedmasterconsCreateFromCons() - create an extended master constraint around a
SCIP_ROWwithGCGextendedmasterconsCreateFromRow() - to create an extended master constraint for branching use
GCGbranchCreateExtendedmasterconsthat usesGCGextendedmasterconsCreateFromCons()
Usage
GCG needs to be made aware of the new extended master constraint. This can be easily achieved by implementing callbacks of the other interfaces, e.g. for branching, implement:
Furthermore, we implement a callback that calculates the coefficient of a column solution in the extended master constraint:
Don't forget to free the memory at some point: